iPXE
bochs.h
Go to the documentation of this file.
00001 #ifndef BOCHS_H
00002 #define BOCHS_H
00003 
00004 /** @file
00005  *
00006  * bochs breakpoints
00007  *
00008  * This file defines @c bochsbp, the magic breakpoint instruction that
00009  * is incredibly useful when debugging under bochs.  This file should
00010  * never be included in production code.
00011  *
00012  * Use the pseudo-instruction @c bochsbp in assembly code, or the
00013  * bochsbp() function in C code.
00014  *
00015  */
00016 
00017 #ifdef ASSEMBLY
00018 
00019 /* Breakpoint for when debugging under bochs */
00020 #define bochsbp xchgw %bx, %bx
00021 #define BOCHSBP bochsbp
00022 
00023 #else /* ASSEMBLY */
00024 
00025 /** Breakpoint for when debugging under bochs */
00026 static inline void bochsbp ( void ) {
00027         __asm__ __volatile__ ( "xchgw %bx, %bx" );
00028 }
00029 
00030 #endif /* ASSEMBLY */
00031 
00032 #warning "bochs.h should not be included into production code"
00033 
00034 #endif /* BOCHS_H */