Skip to content

Commit

Permalink
[build] Provide real-mode call wrappers only for i386
Browse files Browse the repository at this point in the history
We currently attempt to provide real-mode call wrappers for any
architecture that is not x86_64.  Invert this logic to provide
real-mode call wrappers only for the i386 architecture.

Signed-off-by: Michael Brown <[email protected]>
  • Loading branch information
mcb30 committed Nov 27, 2023
1 parent 0a05ca0 commit aa41490
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/wimboot.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,22 +130,19 @@ static inline void bochsbp ( void ) {
/* Mark parameter as unused */
#define __unused __attribute__ (( unused ))

#if __x86_64__
#ifdef __i386__
extern void call_real ( struct bootapp_callback_params *params );
extern void call_interrupt ( struct bootapp_callback_params *params );
extern void __attribute__ (( noreturn )) reboot ( void );
#else
static inline void call_real ( struct bootapp_callback_params *params ) {
/* Not available in 64-bit mode */
( void ) params;
}
static inline void call_interrupt ( struct bootapp_callback_params *params ) {
/* Not available in 64-bit mode */
( void ) params;
}
static inline void reboot ( void ) {
/* Not available in 64-bit mode */
}
#else
extern void call_real ( struct bootapp_callback_params *params );
extern void call_interrupt ( struct bootapp_callback_params *params );
extern void __attribute__ (( noreturn )) reboot ( void );
#endif

extern void __attribute__ (( noreturn, format ( printf, 1, 2 ) ))
Expand Down

0 comments on commit aa41490

Please sign in to comment.