Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
882 | serge | 1 | |
2 | |||
3 | unsigned handle; |
||
4 | unsigned io_code; |
||
5 | void *input; |
||
6 | int inp_size; |
||
7 | void *output; |
||
8 | int out_size; |
||
9 | }ioctl_t; |
||
10 | |||
11 | |||
12 | |||
13 | |||
14 | #define ERR_NOMEM -2 |
||
15 | |||
16 | |||
17 | |||
18 | |||
19 | |||
20 | |||
21 | |||
22 | static int __attribute__ ((always_inline)) |
||
23 | |||
24 | { |
||
25 | return i < 0 ? -i : i; |
||
26 | }; |
||
27 | |||
28 | |||
29 | |||
30 | |||
31 | u32_t retval; |
||
32 | asm("int $0x40" |
||
33 | :"=a"(retval) |
||
34 | :"a"(68),"b"(16),"c"(name)); |
||
35 | |||
36 | return retval; |
||
37 | |||
38 | |||
39 | extern inline u32_t load_service(char *name) |
||
40 | |||
41 | u32_t retval; |
||
42 | asm("int $0x40" |
||
43 | :"=a"(retval) |
||
44 | :"a"(68),"b"(21),"c"(name)); |
||
45 | |||
46 | return retval; |
||
47 | |||
48 | |||
49 | extern inline int call_service(ioctl_t *io) |
||
50 | |||
51 | int retval; |
||
52 | |||
53 | asm("int $0x40" |
||
54 | |||
55 | :"a"(68),"b"(17),"c"(io) |
||
56 | :"memory"); |
||
57 | |||
58 | return retval; |
||
59 | |||
60 | |||
61 | extern inline void* UserAlloc(size_t size) |
||
62 | |||
63 | void *retval; |
||
64 | |||
65 | asm("int $0x40" |
||
66 | |||
67 | :"a"(68),"b"(12),"c"(size) |
||
68 | :"memory"); |
||
69 | return retval; |
||
70 | } |
||
71 | |||
72 | extern inline void UserFree(void *mem) |
||
73 | |||
74 | __asm__ __volatile__( |
||
75 | "int $0x40" |
||
76 | ::"a"(68),"b"(13),"c"(mem) |
||
77 | :"memory"); |
||
78 | } |
||
79 | |||
80 | extern inline int GetScreenSize() |
||
81 | |||
82 | int retval; |
||
83 | |||
84 | __asm__ __volatile__( |
||
85 | |||
86 | :"=a"(retval) |
||
87 | :"a"(61), "b"(1)); |
||
88 | return retval; |
||
89 | } |
||
90 | |||
91 | extern inline int GetScreenBpp() |
||
92 | |||
93 | int retval; |
||
94 | |||
95 | __asm__ __volatile__( |
||
96 | |||
97 | :"=a"(retval) |
||
98 | :"a"(61), "b"(2)); |
||
99 | return retval; |
||
100 | } |
||
101 | |||
102 | extern inline int GetScreenPitch() |
||
103 | |||
104 | int retval; |
||
105 | |||
106 | __asm__ __volatile__( |
||
107 | |||
108 | :"=a"(retval) |
||
109 | :"a"(61), "b"(3)); |
||
110 | return retval; |
||
111 | } |
||
112 | |||
113 | extern inline int test_mmx() |
||
114 | |||
115 | int retval; |
||
116 | |||
117 | __asm__ __volatile__( |
||
118 | |||
119 | "testl $23, %%edx\n\t" |
||
120 | "setnzb %%al\n\t" |
||
121 | "movzx %%al, %%eax" |
||
122 | :"=a"(retval) |
||
123 | :"a"(0) |
||
124 | :"ebx","ecx","edx"); |
||
125 | |||
126 | return retval; |
||
127 | |||
128 |