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); |
|
} |
|