Skip to contentSkip to conversation

Type checking for write_pda()

PATCH Jeremy Fitzhardinge 2 participants 2 messages Sep 1, 2006

lore
Share & tools
lore
#0 lore raw

I just added type checking for assignments the PDA in the i386 PDA code. Here's the x86-64 equivalent. (Obviously this doesn't contain the latest x86-64 PDA change.)

include/asm-x86_64/pda.h Thu Aug 31 18:34:49 2006 -0700 renamed from include/asm-x86_64/pda.h Thu Aug 31 18:30:26 2006 -0700 +0 -0
diff -r 77945c3646ac include/asm-x86_64/pda.h
@@ -47,6 +47,7 @@ extern void __bad_pda_field(void);
 
#define pda_to_op(op,field,val) do { \
       typedef typeof_field(struct x8664_pda, field) T__; \
+       if (0) { T__ tmp__; tmp__ = (val); }                            \
       switch (sizeof_field(struct x8664_pda, field)) {                \

case 2: \
asm volatile(op "w %0,%%gs:%P1"::"ri" ((T__)val),"i"(pda_offset(field)):"memory"); break; \

#1 lore raw
Quoted 3 lines · Jeremy Fitzhardinge

I just added type checking for assignments the PDA in the i386 PDA code. Here's the x86-64 equivalent. (Obviously this doesn't contain the latest x86-64 PDA change.)

Added thanks

-Andi