// Set the magic number in ax and the boot drive in dl.
br.dl = bootdrv;
br.ax = 0xaa55;
- call16(&br);
+ farcall16(&br);
}
// Boot from a disk (either floppy or harddrive)
struct bregs br;
memset(&br, 0, sizeof(br));
br.code = SEGOFF(SEG_BIOS, (u32)reset_vector);
- call16big(&br);
+ farcall16big(&br);
}
// Determine next boot method and attempt a boot using it.
br.di = get_pnp_offset();
br.code = SEGOFF(seg, offset);
start_preempt();
- call16big(&br);
+ farcall16big(&br);
finish_preempt();
debug_serial_setup();
memset(&br, 0, sizeof(br));
dprintf(1, "Jump to resume vector (%x)\n", s3_resume_vector);
br.code = FLATPTR_TO_SEGOFF((void*)s3_resume_vector);
- call16big(&br);
+ farcall16big(&br);
}
// Attempt to invoke a hard-reboot.
movl %ecx, %eax
jmpl *%edx
-// Call a 16bit function from 16bit mode with a specified cpu register state
+// Far call a 16bit function from 16bit mode with a specified cpu register state
// %eax = address of struct bregs
// Clobbers: %e[bcd]x, %e[ds]i, flags
- DECLFUNC __call16
-__call16:
+ DECLFUNC __farcall16
+__farcall16:
// Save %eax, %ebp
pushl %ebp
pushl %eax
retl
-// Call a 16bit function from 32bit mode.
+// Far call a 16bit function from 32bit mode.
// %eax = address of struct bregs
// Clobbers: %e[bcd]x, %e[ds]i, flags, segment registers, idt/gdt
- DECLFUNC __call16_from32
- .global __call16big_from32
+ DECLFUNC __farcall16_from32
+ .global __farcall16big_from32
.code32
-__call16_from32:
+__farcall16_from32:
movl $1f, %edx
jmp transition16
-__call16big_from32:
+__farcall16big_from32:
movl $1f, %edx
jmp transition16big
// Make call.
.code16gcc
-1: calll __call16
+1: calll __farcall16
// Return via transition32
movl $(2f + BUILD_BIOS_ADDR), %edx
jmp transition32
br.flags = F_IF;
br.code.seg = SEG_BIOS;
br.code.offset = (u32)&trampoline_checkirqs;
- call16big(&br);
+ farcall16big(&br);
}
// 16bit trampoline for waiting for an irq from 32bit mode.
br.flags = 0;
br.code.seg = SEG_BIOS;
br.code.offset = (u32)&trampoline_waitirq;
- call16big(&br);
+ farcall16big(&br);
}
// Call a function with a specified register state. Note that on
// return, the interrupt enable/disable flag may be altered.
inline void
-call16(struct bregs *callregs)
+farcall16(struct bregs *callregs)
{
if (!MODESEGMENT && getesp() > BUILD_STACK_ADDR)
panic("call16 with invalid stack\n");
asm volatile(
#if MODE16 == 1
- "calll __call16\n"
+ "calll __farcall16\n"
"cli\n"
"cld"
#else
- "calll __call16_from32"
+ "calll __farcall16_from32"
#endif
: "+a" (callregs), "+m" (*callregs)
:
}
inline void
-call16big(struct bregs *callregs)
+farcall16big(struct bregs *callregs)
{
ASSERT32FLAT();
if (getesp() > BUILD_STACK_ADDR)
panic("call16 with invalid stack\n");
asm volatile(
- "calll __call16big_from32"
+ "calll __farcall16big_from32"
: "+a" (callregs), "+m" (*callregs)
:
: "ebx", "ecx", "edx", "esi", "edi", "cc", "memory");
else
callregs->code.seg = SEG_BIOS;
callregs->code.offset = offset;
- call16(callregs);
+ farcall16(callregs);
}
// util.c
void cpuid(u32 index, u32 *eax, u32 *ebx, u32 *ecx, u32 *edx);
struct bregs;
-inline void call16(struct bregs *callregs);
-inline void call16big(struct bregs *callregs);
+inline void farcall16(struct bregs *callregs);
+inline void farcall16big(struct bregs *callregs);
inline void __call16_int(struct bregs *callregs, u16 offset);
#define call16_int(nr, callregs) do { \
extern void irq_trampoline_ ##nr (); \