1 | /* $Id: misc.c 142 2000-04-23 14:55:46Z ktk $ */
|
---|
2 |
|
---|
3 | //******************************************************************************
|
---|
4 | // OS/2 implementation of misc. Linux kernel services
|
---|
5 | //
|
---|
6 | // Copyright 2000 Sander van Leeuwen (sandervl@xs4all.nl)
|
---|
7 | //
|
---|
8 | // Parts based on Linux kernel code (set/clear_bit)
|
---|
9 | //
|
---|
10 | // This program is free software; you can redistribute it and/or
|
---|
11 | // modify it under the terms of the GNU General Public License as
|
---|
12 | // published by the Free Software Foundation; either version 2 of
|
---|
13 | // the License, or (at your option) any later version.
|
---|
14 | //
|
---|
15 | // This program is distributed in the hope that it will be useful,
|
---|
16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
18 | // GNU General Public License for more details.
|
---|
19 | //
|
---|
20 | // You should have received a copy of the GNU General Public
|
---|
21 | // License along with this program; if not, write to the Free
|
---|
22 | // Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
|
---|
23 | // USA.
|
---|
24 | //
|
---|
25 | //******************************************************************************
|
---|
26 | #include "hwaccess.h"
|
---|
27 | #include <linux/init.h>
|
---|
28 | #include <linux/poll.h>
|
---|
29 | #include <asm/uaccess.h>
|
---|
30 | #include <asm/hardirq.h>
|
---|
31 | #include <linux\ioport.h>
|
---|
32 | #include <linux\utsname.h>
|
---|
33 |
|
---|
34 | struct new_utsname system_utsname = {0};
|
---|
35 | struct resource ioport_resource = {0};
|
---|
36 | mem_map_t *mem_map = 0;
|
---|
37 |
|
---|
38 | void set_bit(int nr, volatile void * addr)
|
---|
39 | {
|
---|
40 | volatile unsigned long *pAddr = (volatile unsigned long *)addr;
|
---|
41 |
|
---|
42 | *pAddr = (*pAddr) | (1 << nr);
|
---|
43 | }
|
---|
44 |
|
---|
45 | void clear_bit(int nr, volatile void * addr)
|
---|
46 | {
|
---|
47 | volatile unsigned long *pAddr = (volatile unsigned long *)addr;
|
---|
48 |
|
---|
49 | *pAddr = (*pAddr) & ~(1 << nr);
|
---|
50 | }
|
---|
51 |
|
---|
52 | int sprintf (char *buffer, const char *format, ...)
|
---|
53 | {
|
---|
54 | return 0;
|
---|
55 | }
|
---|
56 |
|
---|
57 | int printk(const char * fmt, ...)
|
---|
58 | {
|
---|
59 | return 0;
|
---|
60 | }
|
---|
61 |
|
---|
62 | void schedule(void)
|
---|
63 | {
|
---|
64 |
|
---|
65 | }
|
---|
66 |
|
---|
67 | void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p)
|
---|
68 | {
|
---|
69 |
|
---|
70 | }
|
---|
71 |
|
---|
72 |
|
---|
73 | int __check_region(struct resource *a, unsigned long b, unsigned long c)
|
---|
74 | {
|
---|
75 | return 0;
|
---|
76 | }
|
---|
77 |
|
---|
78 | void __release_region(struct resource *a, unsigned long b, unsigned long c)
|
---|
79 | {
|
---|
80 |
|
---|
81 | }
|
---|
82 |
|
---|
83 | struct resource * __request_region(struct resource *a, unsigned long start, unsigned long n, const char *name)
|
---|
84 | {
|
---|
85 | return a;
|
---|
86 | }
|
---|
87 |
|
---|
88 | void iodelay32(unsigned long);
|
---|
89 | #pragma aux iodelay32 parm nomemory [eax] modify nomemory exact [eax ecx];
|
---|
90 |
|
---|
91 | void __udelay(unsigned long usecs)
|
---|
92 | {
|
---|
93 | iodelay32(usecs*2);
|
---|
94 | }
|
---|
95 |
|
---|
96 |
|
---|