Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 435 → Rev 436

/shark/trunk/drivers/linuxc26/linuxcomp.c
1,13 → 1,64
 
#include <ll/i386/hw-instr.h>
#include <ll/i386/cons.h>
 
#include <linuxcomp.h>
 
#include <linux/time.h>
#include <linux/sched.h>
#include <linux/ioport.h>
#include <asm/io.h>
 
int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
 
struct resource ioport_resource = {
.name = "PCI IO",
.start = 0x0000,
.end = IO_SPACE_LIMIT,
.flags = IORESOURCE_IO,
};
 
struct resource iomem_resource = {
.name = "PCI mem",
.start = 0UL,
.end = ~0UL,
.flags = IORESOURCE_MEM,
};
 
void __release_region(struct resource *parent, unsigned long start, unsigned long n) { }
 
struct resource * __request_region(struct resource *parent, unsigned long start, unsigned long n, const char *name) {
return NULL;
}
 
void dump_stack(void) { }
 
void panic(const char * fmt, ...) {
 
cprintf((char *)(fmt));
 
}
 
extern void * malloc(size_t size);
 
void *__kmalloc(size_t size, int flags) {
 
return malloc(size);
 
}
 
extern void free(void *);
 
void kfree(const void *ptr) {
 
free((void *)(ptr));
 
return 0;
 
}
 
unsigned long pci_mem_start = 0x10000000;
 
signed long schedule_timeout(signed long timeout) {
 
SYS_FLAGS f;
20,9 → 71,26
 
nanosleep(&t,NULL);
 
cli();
ll_frestore(f);
 
return 0;
 
}
 
void __const_udelay(unsigned long usecs) {
 
SYS_FLAGS f;
struct timespec t;
f = ll_fsave();
sti();
t.tv_sec = 0;
t.tv_nsec = usecs * 1000;
nanosleep(&t,NULL);
ll_frestore(f);
}
 
/shark/trunk/drivers/linuxc26/include/linux/slab.h
76,24 → 76,6
 
static inline void *kmalloc(size_t size, int flags)
{
if (__builtin_constant_p(size)) {
int i = 0;
#define CACHE(x) \
if (size <= x) \
goto found; \
else \
i++;
#include "kmalloc_sizes.h"
#undef CACHE
{
extern void __you_cannot_kmalloc_that_much(void);
__you_cannot_kmalloc_that_much();
}
found:
return kmem_cache_alloc((flags & GFP_DMA) ?
malloc_sizes[i].cs_dmacachep :
malloc_sizes[i].cs_cachep, flags);
}
return __kmalloc(size, flags);
}