Changeset c8f70eb in mainline
- Timestamp:
- 2011-08-20T17:04:52Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ac08cd9
- Parents:
- 81bc309
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/dist/src/c/demos/tetris/build
r81bc309 rc8f70eb 1 cc - I/inc/c -E -o scores.i scores.c2 cc - I/inc/c -E -o screen.i screen.c3 cc - I/inc/c -E -o shapes.i shapes.c4 cc - I/inc/c -E -o tetris.i tetris.c1 cc -D__PCC__ -I/inc/c -E -o scores.i scores.c 2 cc -D__PCC__ -I/inc/c -E -o screen.i screen.c 3 cc -D__PCC__ -I/inc/c -E -o shapes.i shapes.c 4 cc -D__PCC__ -I/inc/c -E -o tetris.i tetris.c 5 5 6 6 cc -S -o scores.s scores.i -
uspace/lib/c/arch/amd64/include/atomic.h
r81bc309 rc8f70eb 44 44 static inline void atomic_inc(atomic_t *val) 45 45 { 46 #ifdef __PCC__ 46 47 asm volatile ( 47 48 "lock incq %0\n" 48 49 : "+m" (val->count) 49 50 ); 51 #else 52 asm volatile ( 53 "lock incq %[count]\n" 54 : [count] "+m" (val->count) 55 ); 56 #endif 50 57 } 51 58 52 59 static inline void atomic_dec(atomic_t *val) 53 60 { 61 #ifdef __PCC__ 54 62 asm volatile ( 55 63 "lock decq %0\n" 56 64 : "+m" (val->count) 57 65 ); 66 #else 67 asm volatile ( 68 "lock decq %[count]\n" 69 : [count] "+m" (val->count) 70 ); 71 #endif 58 72 } 59 73 … … 62 76 atomic_count_t r = 1; 63 77 78 #ifdef __PCC__ 64 79 asm volatile ( 65 80 "lock xaddq %1, %0\n" … … 67 82 "+r" (r) 68 83 ); 84 #else 85 asm volatile ( 86 "lock xaddq %[r], %[count]\n" 87 : [count] "+m" (val->count), 88 [r] "+r" (r) 89 ); 90 #endif 69 91 70 92 return r; … … 75 97 atomic_count_t r = -1; 76 98 99 #ifdef __PCC__ 77 100 asm volatile ( 78 101 "lock xaddq %1, %0\n" … … 80 103 "+r" (r) 81 104 ); 105 #else 106 asm volatile ( 107 "lock xaddq %[r], %[count]\n" 108 : [count] "+m" (val->count), 109 [r] "+r" (r) 110 ); 111 #endif 82 112 83 113 return r; -
uspace/lib/c/arch/ia32/include/atomic.h
r81bc309 rc8f70eb 42 42 static inline void atomic_inc(atomic_t *val) 43 43 { 44 #ifdef __PCC__ 44 45 asm volatile ( 45 46 "lock incl %0\n" 46 47 : "+m" (val->count) 47 48 ); 49 #else 50 asm volatile ( 51 "lock incl %[count]\n" 52 : [count] "+m" (val->count) 53 ); 54 #endif 48 55 } 49 56 50 57 static inline void atomic_dec(atomic_t *val) 51 58 { 59 #ifdef __PCC__ 52 60 asm volatile ( 53 61 "lock decl %0\n" 54 62 : "+m" (val->count) 55 63 ); 64 #else 65 asm volatile ( 66 "lock decl %[count]\n" 67 : [count] "+m" (val->count) 68 ); 69 #endif 56 70 } 57 71 … … 60 74 atomic_count_t r = 1; 61 75 76 #ifdef __PCC__ 62 77 asm volatile ( 63 78 "lock xaddl %1, %0\n" … … 65 80 "+r" (r) 66 81 ); 82 #else 83 asm volatile ( 84 "lock xaddl %[r], %[count]\n" 85 : [count] "+m" (val->count), 86 [r] "+r" (r) 87 ); 88 #endif 67 89 68 90 return r; … … 73 95 atomic_count_t r = -1; 74 96 97 #ifdef __PCC__ 75 98 asm volatile ( 76 99 "lock xaddl %1, %0\n" … … 78 101 "+r" (r) 79 102 ); 103 #else 104 asm volatile ( 105 "lock xaddl %[r], %[count]\n" 106 : [count] "+m" (val->count), 107 [r] "+r" (r) 108 ); 109 #endif 80 110 81 111 return r; -
uspace/lib/c/arch/ia32/include/ddi.h
r81bc309 rc8f70eb 44 44 uint8_t val; 45 45 asm volatile ( 46 "inb %w 1, %b0\n"47 : "=a" (val)48 : "d" (port)46 "inb %w[port], %b[val]\n" 47 : [val] "=a" (val) 48 : [port] "d" (port) 49 49 ); 50 50 return val; … … 59 59 uint16_t val; 60 60 asm volatile ( 61 "inw %w 1, %w0\n"62 : "=a" (val)63 : "d" (port)61 "inw %w[port], %w[val]\n" 62 : [val] "=a" (val) 63 : [port] "d" (port) 64 64 ); 65 65 return val; … … 74 74 uint32_t val; 75 75 asm volatile ( 76 "inl %w 1, %0\n"77 : "=a" (val)78 : "d" (port)76 "inl %w[port], %[val]\n" 77 : [val] "=a" (val) 78 : [port] "d" (port) 79 79 ); 80 80 return val; … … 88 88 if (port < (ioport8_t *) IO_SPACE_BOUNDARY) { 89 89 asm volatile ( 90 "outb %b 0, %w1\n"91 :: "a" (val),"d" (port)90 "outb %b[val], %w[port]\n" 91 :: [val] "a" (val), [port] "d" (port) 92 92 ); 93 93 } else { … … 100 100 if (port < (ioport16_t *) IO_SPACE_BOUNDARY) { 101 101 asm volatile ( 102 "outw %w 0, %w1\n"103 :: "a" (val),"d" (port)102 "outw %w[val], %w[port]\n" 103 :: [val] "a" (val), [port] "d" (port) 104 104 ); 105 105 } else { … … 112 112 if (port < (ioport32_t *) IO_SPACE_BOUNDARY) { 113 113 asm volatile ( 114 "outl % 0, %w1\n"115 :: "a" (val),"d" (port)114 "outl %[val], %w[port]\n" 115 :: [val] "a" (val), [port] "d" (port) 116 116 ); 117 117 } else {
Note:
See TracChangeset
for help on using the changeset viewer.