394
// UEFI Compatibility Support Module (CSM) entry point
397
// Backup register state
404
// Backup stack location and convert to a "flat pointer"
406
movw %ax, BREGS_code+2(%esp) // Store %ss in bregs->code.seg
410
// Change to BUILD_STACK_ADDR stack
413
movl $BUILD_STACK_ADDR, %esp
415
// Jump to 32bit mode and call handle_csm(bregs)
416
movl $_cfunc32flat_handle_csm, %edx
419
DECLFUNC __csm_return
426
// Switch back to original stack
427
1: movzwl BREGS_code+2(%eax), %edx
434
// Restore register state and return.
436
addw $4, %sp // pop dummy
388
441
/****************************************************************
389
442
* Interrupt entry points
483
// Main entry point for interrupts handled on extra stack
484
DECLFUNC irqentry_arg_extrastack
485
irqentry_arg_extrastack:
488
pushw %ds // Set %ds:%eax to space on ExtraStack
490
movl $_zonelow_seg, %eax
493
subl $BREGS_size+8, %eax
494
popl BREGS_eax(%eax) // Backup registers
496
movl %edi, BREGS_edi(%eax)
497
movl %esi, BREGS_esi(%eax)
498
movl %ebp, BREGS_ebp(%eax)
499
movl %ebx, BREGS_ebx(%eax)
500
movl %edx, BREGS_edx(%eax)
501
movl %ecx, BREGS_ecx(%eax)
503
movw %es, BREGS_es(%eax)
504
movl %esp, BREGS_size+0(%eax)
506
movw %ss, BREGS_size+4(%eax)
508
movl %edx, BREGS_code(%eax)
510
movw %dx, BREGS_flags(%eax)
512
movw %ds, %dx // Setup %ss/%esp and call function
517
movl %esp, %eax // Restore registers and return
518
movw BREGS_size+4(%eax), %ss
519
movl BREGS_size+0(%eax), %esp
522
pushw BREGS_flags(%eax)
523
pushl BREGS_code(%eax)
524
movl BREGS_edi(%eax), %edi
525
movl BREGS_esi(%eax), %esi
526
movl BREGS_ebp(%eax), %ebp
527
movl BREGS_ebx(%eax), %ebx
528
movl BREGS_edx(%eax), %edx
529
movl BREGS_ecx(%eax), %ecx
530
movw BREGS_es(%eax), %es
532
pushl BREGS_eax(%eax)
430
537
// Main entry point for interrupts with args
431
538
DECLFUNC irqentryarg