X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Farch%2Fx86_64%2Flib.c;h=977cffd1ee283d36c687ab951c53d17f824ace95;hb=641a3c5a09b61973431c5772333f65eeb76e76c0;hp=cbcf769fc6c84bee1262a517800515d1aaca16af;hpb=50e4e842d87975295f0b4cc9989cca9372a439e8;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/arch/x86_64/lib.c b/KernelLand/Kernel/arch/x86_64/lib.c index cbcf769f..977cffd1 100644 --- a/KernelLand/Kernel/arch/x86_64/lib.c +++ b/KernelLand/Kernel/arch/x86_64/lib.c @@ -20,6 +20,7 @@ extern void *Proc_GetCurThread(void); // === PROTOTYPEs === int putDebugChar(char ch); +void Debug_SerialIRQHandler(int irq, void *unused); // === CODE === /** @@ -145,6 +146,18 @@ void SHORTREL(struct sShortSpinlock *Lock) #endif } +void __AtomicTestSetLoop(Uint *Ptr, Uint Value) +{ + __ASM__( + "1:\n\t" + "xor %%eax, %%eax;\n\t" + "lock cmpxchg %0, (%1);\n\t" // if( Ptr==0 ) { ZF=1; Ptr=Value } else { ZF=0; _=Ptr } + "jnz 1b;\n\t" + :: "r"(Value), "r"(Ptr) + : "eax" // EAX clobbered + ); +} + // === DEBUG IO === #if USE_GDB_STUB void initGdbSerial(void)