Rev 432 | Rev 437 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
432 | giacomo | 1 | |
2 | #include <ll/i386/hw-instr.h> |
||
436 | giacomo | 3 | #include <ll/i386/cons.h> |
432 | giacomo | 4 | |
5 | #include <linuxcomp.h> |
||
6 | |||
7 | #include <linux/time.h> |
||
8 | #include <linux/sched.h> |
||
436 | giacomo | 9 | #include <linux/ioport.h> |
10 | #include <asm/io.h> |
||
432 | giacomo | 11 | |
12 | int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); |
||
13 | |||
436 | giacomo | 14 | struct resource ioport_resource = { |
15 | .name = "PCI IO", |
||
16 | .start = 0x0000, |
||
17 | .end = IO_SPACE_LIMIT, |
||
18 | .flags = IORESOURCE_IO, |
||
19 | }; |
||
20 | |||
21 | struct resource iomem_resource = { |
||
22 | .name = "PCI mem", |
||
23 | .start = 0UL, |
||
24 | .end = ~0UL, |
||
25 | .flags = IORESOURCE_MEM, |
||
26 | }; |
||
27 | |||
28 | void __release_region(struct resource *parent, unsigned long start, unsigned long n) { } |
||
29 | |||
30 | struct resource * __request_region(struct resource *parent, unsigned long start, unsigned long n, const char *name) { |
||
31 | return NULL; |
||
32 | } |
||
33 | |||
34 | void dump_stack(void) { } |
||
35 | |||
36 | void panic(const char * fmt, ...) { |
||
37 | |||
38 | cprintf((char *)(fmt)); |
||
39 | |||
40 | } |
||
41 | |||
42 | extern void * malloc(size_t size); |
||
43 | |||
44 | void *__kmalloc(size_t size, int flags) { |
||
45 | |||
46 | return malloc(size); |
||
47 | |||
48 | } |
||
49 | |||
50 | extern void free(void *); |
||
51 | |||
52 | void kfree(const void *ptr) { |
||
53 | |||
54 | free((void *)(ptr)); |
||
55 | |||
56 | return 0; |
||
57 | |||
58 | } |
||
59 | |||
60 | unsigned long pci_mem_start = 0x10000000; |
||
61 | |||
432 | giacomo | 62 | signed long schedule_timeout(signed long timeout) { |
63 | |||
64 | SYS_FLAGS f; |
||
65 | struct timespec t; |
||
66 | |||
67 | f = ll_fsave(); |
||
68 | sti(); |
||
69 | |||
70 | jiffies_to_timespec(timeout, &t); |
||
71 | |||
72 | nanosleep(&t,NULL); |
||
73 | |||
74 | ll_frestore(f); |
||
75 | |||
76 | return 0; |
||
77 | |||
78 | } |
||
436 | giacomo | 79 | |
80 | void __const_udelay(unsigned long usecs) { |
||
81 | |||
82 | SYS_FLAGS f; |
||
83 | struct timespec t; |
||
84 | |||
85 | f = ll_fsave(); |
||
86 | sti(); |
||
87 | |||
88 | t.tv_sec = 0; |
||
89 | t.tv_nsec = usecs * 1000; |
||
90 | |||
91 | nanosleep(&t,NULL); |
||
92 | |||
93 | ll_frestore(f); |
||
94 | |||
95 | } |
||
96 |