OFFSET(BREGS_edi, bregs, edi);
OFFSET(BREGS_flags, bregs, flags);
OFFSET(BREGS_code, bregs, code);
- DEFINE(BREGS_size, sizeof(struct bregs));
}
* Macros for save and restore of 'struct bregs' registers
****************************************************************/
+#define PUSHBREGS_size 32
+
// Save registers (matches struct bregs) to stack
.macro PUSHBREGS
pushl %eax
movw %cx, %ds
shll $4, %ecx
movl $_cfunc32flat_handle_pmm, %eax // Setup: call32(handle_pmm, args, -1)
- leal BREGS_size-6+12(%esp, %ecx), %edx // %edx points to start of args
+ leal PUSHBREGS_size+12(%esp, %ecx), %edx // %edx points to start of args
movl $-1, %ecx
calll call32
movw %ax, BREGS_eax(%esp) // Modify %ax:%dx to return %eax
PUSHBREGS
movw %ss, %cx // Move %ss to %ds
movw %cx, %ds
- leal BREGS_size-6+12(%esp), %eax // %eax points to start of u16 args
+ leal PUSHBREGS_size+12(%esp), %eax // %eax points to start of u16 args
calll handle_pnp
movw %ax, BREGS_eax(%esp) // Modify %eax to return %ax
POPBREGS
movl $_zonelow_seg, %eax
movl %eax, %ds
movl StackPos, %eax
- subl $BREGS_size+8, %eax
+ subl $PUSHBREGS_size+8, %eax
SAVEBREGS_POP_DSEAX
popl %ecx
- movl %esp, BREGS_size(%eax)
- movw %ss, BREGS_size+4(%eax)
+ movl %esp, PUSHBREGS_size(%eax)
+ movw %ss, PUSHBREGS_size+4(%eax)
movw %ds, %dx // Setup %ss/%esp and call function
movw %dx, %ss
calll *%ecx
movl %esp, %eax // Restore registers and return
- movw BREGS_size+4(%eax), %ss
- movl BREGS_size(%eax), %esp
+ movw PUSHBREGS_size+4(%eax), %ss
+ movl PUSHBREGS_size(%eax), %esp
RESTOREBREGS_DSEAX
iretw
movl $_zonelow_seg, %eax
movl %eax, %ds
movl StackPos, %eax
- subl $BREGS_size+8, %eax
+ subl $PUSHBREGS_size+16, %eax
SAVEBREGS_POP_DSEAX // Save registers on extra stack
popl %ecx
- movl %esp, BREGS_size+0(%eax)
- movw %ss, BREGS_size+4(%eax)
+ movl %esp, PUSHBREGS_size+8(%eax)
+ movw %ss, PUSHBREGS_size+12(%eax)
popl BREGS_code(%eax)
popw BREGS_flags(%eax)
calll *%ecx
movl %esp, %eax // Restore registers and return
- movw BREGS_size+4(%eax), %ss
- movl BREGS_size+0(%eax), %esp
+ movw PUSHBREGS_size+12(%eax), %ss
+ movl PUSHBREGS_size+8(%eax), %esp
popl %edx
popw %dx
pushw BREGS_flags(%eax)
pushw %ds // Set %ds:%eax to space on ExtraStack
pushl %eax
movw %cs:ExtraStackSeg, %ds
- movl $(CONFIG_VGA_EXTRA_STACK_SIZE-BREGS_size-8), %eax
+ movl $(CONFIG_VGA_EXTRA_STACK_SIZE-PUSHBREGS_size-16), %eax
SAVEBREGS_POP_DSEAX // Save registers on extra stack
- movl %esp, BREGS_size+0(%eax)
- movw %ss, BREGS_size+4(%eax)
+ movl %esp, PUSHBREGS_size+8(%eax)
+ movw %ss, PUSHBREGS_size+12(%eax)
popl BREGS_code(%eax)
popw BREGS_flags(%eax)
VGA_CALLL handle_10
movl %esp, %eax // Restore registers and return
- movw BREGS_size+4(%eax), %ss
- movl BREGS_size+0(%eax), %esp
+ movw PUSHBREGS_size+12(%eax), %ss
+ movl PUSHBREGS_size+8(%eax), %esp
popl %edx
popw %dx
pushw BREGS_flags(%eax)
pushw %ds // Set %ds:%eax to space on ExtraStack
pushl %eax
movw %cs:ExtraStackSeg, %ds
- movl $(CONFIG_VGA_EXTRA_STACK_SIZE-BREGS_size-8), %eax
+ movl $(CONFIG_VGA_EXTRA_STACK_SIZE-PUSHBREGS_size-8), %eax
SAVEBREGS_POP_DSEAX
- movl %esp, BREGS_size(%eax)
- movw %ss, BREGS_size+4(%eax)
+ movl %esp, PUSHBREGS_size(%eax)
+ movw %ss, PUSHBREGS_size+4(%eax)
movw %ds, %dx // Setup %ss/%esp and call function
movw %dx, %ss
calll handle_timer_hook
movl %esp, %eax // Restore registers and return
- movw BREGS_size+4(%eax), %ss
- movl BREGS_size(%eax), %esp
+ movw PUSHBREGS_size+4(%eax), %ss
+ movl PUSHBREGS_size(%eax), %esp
RESTOREBREGS_DSEAX
ljmpw *%cs:Timer_Hook_Resume