Rev 6346 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6346 | Rev 6536 | ||
---|---|---|---|
Line 235... | Line 235... | ||
235 | { |
235 | { |
236 | uint32_t old_event_mask; |
236 | uint32_t old_event_mask; |
237 | __asm__ __volatile__( |
237 | __asm__ __volatile__( |
238 | "int $0x40" |
238 | "int $0x40" |
239 | :"=a"(old_event_mask) |
239 | :"=a"(old_event_mask) |
240 | :"a"(40)); |
240 | :"a"(40),"b"(event_mask)); |
Line 241... | Line 241... | ||
241 | 241 | ||
242 | return old_event_mask; |
242 | return old_event_mask; |
Line 243... | Line 243... | ||
243 | }; |
243 | }; |
Line 271... | Line 271... | ||
271 | :"=a"(val) |
271 | :"=a"(val) |
272 | :"a"(23), "b"(time)); |
272 | :"a"(23), "b"(time)); |
273 | return val; |
273 | return val; |
274 | }; |
274 | }; |
Line 275... | Line 275... | ||
275 | 275 | ||
276 | static inline uint32_t check_os_event() |
276 | static inline uint32_t check_os_event(void) |
277 | { |
277 | { |
278 | uint32_t val; |
278 | uint32_t val; |
279 | __asm__ __volatile__( |
279 | __asm__ __volatile__( |
280 | "int $0x40" |
280 | "int $0x40" |
281 | :"=a"(val) |
281 | :"=a"(val) |
282 | :"a"(11)); |
282 | :"a"(11)); |
283 | return val; |
283 | return val; |
Line 284... | Line 284... | ||
284 | }; |
284 | }; |
285 | 285 | ||
286 | static inline uint32_t get_os_event() |
286 | static inline uint32_t get_os_event(void) |
287 | { |
287 | { |
288 | uint32_t val; |
288 | uint32_t val; |
289 | __asm__ __volatile__( |
289 | __asm__ __volatile__( |
Line 326... | Line 326... | ||
326 | :"a"(2)); |
326 | :"a"(2)); |
327 | return val; |
327 | return val; |
328 | } |
328 | } |
Line 329... | Line 329... | ||
329 | 329 | ||
330 | static inline |
330 | static inline |
331 | uint32_t get_os_button() |
331 | uint32_t get_os_button(void) |
332 | { |
332 | { |
333 | uint32_t val; |
333 | uint32_t val; |
334 | __asm__ __volatile__( |
334 | __asm__ __volatile__( |
335 | "int $0x40" |
335 | "int $0x40" |
Line 451... | Line 451... | ||
451 | 451 | ||
452 | return uf; |
452 | return uf; |
453 | }; |
453 | }; |
Line 454... | Line 454... | ||
454 | static inline ufile_t LoadFile(const char *path) __attribute__ ((alias ("load_file"))); |
454 | static inline ufile_t LoadFile(const char *path) __attribute__ ((alias ("load_file"))); |
455 | 455 | ||
456 | static inline int GetScreenSize() |
456 | static inline int GetScreenSize(void) |
Line 457... | Line 457... | ||
457 | { |
457 | { |
458 | int retval; |
458 | int retval; |
Line 512... | Line 512... | ||
512 | __asm__ __volatile__( |
512 | __asm__ __volatile__( |
513 | "int $0x40" |
513 | "int $0x40" |
514 | ::"a"(73),"b"(0),"c"(&bc.dstx)); |
514 | ::"a"(73),"b"(0),"c"(&bc.dstx)); |
515 | }; |
515 | }; |
Line -... | Line 516... | ||
- | 516 | ||
- | 517 | #define TLS_KEY_PID 0 |
|
- | 518 | #define TLS_KEY_TID 4 |
|
- | 519 | #define TLS_KEY_LOW_STACK 8 |
|
- | 520 | #define TLS_KEY_HIGH_STACK 12 |
|
- | 521 | #define TLS_KEY_LIBC 16 |
|
- | 522 | ||
- | 523 | unsigned int tls_alloc(void); |
|
- | 524 | int tls_free(unsigned int key); |
|
- | 525 | ||
- | 526 | static inline int tls_set(unsigned int key, void *val) |
|
- | 527 | { |
|
- | 528 | int ret = -1; |
|
- | 529 | if(key < 4096) |
|
- | 530 | { |
|
- | 531 | __asm__ __volatile__( |
|
- | 532 | "movl %0, %%fs:(%1)" |
|
- | 533 | ::"r"(val),"r"(key)); |
|
- | 534 | ret = 0; |
|
- | 535 | } |
|
- | 536 | return ret; |
|
- | 537 | }; |
|
- | 538 | ||
- | 539 | static inline void *tls_get(unsigned int key) |
|
- | 540 | { |
|
- | 541 | void *val = (void*)-1; |
|
- | 542 | if(key < 4096) |
|
- | 543 | { |
|
- | 544 | __asm__ __volatile__( |
|
- | 545 | "movl %%fs:(%1), %0" |
|
- | 546 | :"=r"(val) |
|
- | 547 | :"r"(key)); |
|
- | 548 | }; |
|
- | 549 | return val; |
|
- | 550 | } |
|
- | 551 | ||
516 | 552 | ||
Line 517... | Line 553... | ||
517 | int create_thread(int (*proc)(void *param), void *param, int stack_size); |
553 | int create_thread(int (*proc)(void *param), void *param, int stack_size); |
Line 518... | Line 554... | ||
518 | 554 |