Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | pj | 1 | /* Project: OSLib |
2 | * Description: The OS Construction Kit |
||
3 | * Date: 1.6.2000 |
||
4 | * Idea by: Luca Abeni & Gerardo Lamastra |
||
5 | * |
||
6 | * OSLib is an SO project aimed at developing a common, easy-to-use |
||
7 | * low-level infrastructure for developing OS kernels and Embedded |
||
8 | * Applications; it partially derives from the HARTIK project but it |
||
9 | * currently is independently developed. |
||
10 | * |
||
11 | * OSLib is distributed under GPL License, and some of its code has |
||
12 | * been derived from the Linux kernel source; also some important |
||
13 | * ideas come from studying the DJGPP go32 extender. |
||
14 | * |
||
15 | * We acknowledge the Linux Community, Free Software Foundation, |
||
16 | * D.J. Delorie and all the other developers who believe in the |
||
17 | * freedom of software and ideas. |
||
18 | * |
||
19 | * For legalese, check out the included GPL license. |
||
20 | */ |
||
21 | |||
22 | /* Provides the _exit function for escaping from PM!!! */ |
||
23 | |||
24 | #include <ll/i386/linkage.h> |
||
25 | #include <ll/i386/defs.h> |
||
26 | #include <ll/i386/sel.h> |
||
27 | #include <ll/i386/defs.h> |
||
28 | |||
29 | .data |
||
30 | |||
31 | ASMFILE(X0-Sys) |
||
32 | |||
33 | .text |
||
34 | |||
35 | .globl SYMBOL_NAME(_x_callBIOS) |
||
36 | |||
37 | #ifdef __NO_INLINE_PORT__ |
||
38 | .globl SYMBOL_NAME(outp) |
||
39 | .globl SYMBOL_NAME(inp) |
||
40 | .globl SYMBOL_NAME(outpw) |
||
41 | .globl SYMBOL_NAME(inpw) |
||
42 | .globl SYMBOL_NAME(outpd) |
||
43 | .globl SYMBOL_NAME(inpd) |
||
44 | #endif |
||
45 | |||
46 | /* Invoke 16 bit BIOS function from PM application */ |
||
47 | |||
48 | /* void _x_callBIOS(void) */ |
||
49 | |||
50 | SYMBOL_NAME_LABEL(_x_callBIOS) |
||
51 | .byte 0x09a /* Direct gate call */ |
||
52 | .long 0 |
||
53 | .word X_CALLBIOS_GATE |
||
54 | ret |
||
55 | |||
56 | #ifdef __NO_INLINE_PORT__ |
||
57 | /* void outp(int port,char value) */ |
||
58 | |||
59 | SYMBOL_NAME_LABEL(outp) |
||
60 | movl 4(%esp),%edx |
||
61 | movl 8(%esp),%eax |
||
62 | outb %al,%dx |
||
63 | ret |
||
64 | |||
65 | /* char inp(int port) */ |
||
66 | |||
67 | SYMBOL_NAME_LABEL(inp) |
||
68 | movl 4(%esp),%edx |
||
69 | inb %dx,%al |
||
70 | movzb %al,%eax |
||
71 | ret |
||
72 | |||
73 | /* void outpw(int port,unsigned short value) */ |
||
74 | |||
75 | SYMBOL_NAME_LABEL(outpw) |
||
76 | movl 4(%esp),%edx |
||
77 | movl 8(%esp),%eax |
||
78 | outw %ax,%dx |
||
79 | ret |
||
80 | |||
81 | /* unsigned short inpw(int port) */ |
||
82 | |||
83 | SYMBOL_NAME_LABEL(inpw) |
||
84 | movl 4(%esp),%edx |
||
85 | inw %dx,%ax |
||
86 | movzwl %ax,%eax |
||
87 | ret |
||
88 | /* void outpd(int port,unsigned long value) */ |
||
89 | |||
90 | SYMBOL_NAME_LABEL(outpd) |
||
91 | movl 4(%esp),%edx |
||
92 | movl 8(%esp),%eax |
||
93 | outl %eax,%dx |
||
94 | ret |
||
95 | |||
96 | /* unsigned long inpd(int port) */ |
||
97 | |||
98 | SYMBOL_NAME_LABEL(inpd) |
||
99 | movl 4(%esp),%edx |
||
100 | inl %dx,%eax |
||
101 | ret |
||
102 | #endif /* __NO_INLINE_PORTS__ */ |