Inline Assembly: Difference between revisions
[unchecked revision] | [unchecked revision] |
Content deleted Content added
Line 183:
<source lang="c">
// Works for both 32 and 64 bit
#define cmpxchg( ptr, _old, _new, fail_label ) { \
volatile u32 *__ptr = (volatile u32 *)(ptr); \
: "
: "
:
}
</source>
Line 199 ⟶ 197:
This new macro could then be used as follows:
<source lang="c">
typedef unsigned int u32;
volatile struct Item* next;
};
void addItem( struct Item *i ) {
volatile struct Item *oldHead;
again:
i->next = oldHead;
cmpxchg( &
}
|