Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / ipxe / src / arch / i386 / prefix / undiloader.S
1 FILE_LICENCE ( GPL2_OR_LATER )
2
3         .text
4         .code16
5         .arch i386
6         .section ".prefix", "ax", @progbits
7
8 /* UNDI loader
9  *
10  * Called by an external program to load our PXE stack.
11  */
12         .globl  undiloader
13 undiloader:
14         /* Save registers */
15         pushl   %esi
16         pushl   %edi
17         pushl   %ebp
18         pushw   %ds
19         pushw   %es
20         pushw   %bx
21         /* ROM segment address to %ds */
22         pushw   %cs
23         popw    %ds
24         /* UNDI loader parameter structure address into %es:%di */
25         movw    %sp, %bx
26         movw    %ss:22(%bx), %di
27         movw    %ss:24(%bx), %es
28         /* Install to specified real-mode addresses */
29         pushw   %di
30         movw    %es:12(%di), %bx
31         movw    %es:14(%di), %ax
32         movl    image_source, %esi
33         movl    decompress_to, %edi
34         orl     $0xffffffff, %ebp       /* Allow arbitrary relocation */
35         call    install_prealloc
36         popw    %di
37         /* Call UNDI loader C code */
38         pushl   $pxe_loader_call
39         pushw   %cs
40         pushw   $1f
41         pushw   %ax
42         pushw   $prot_call
43         lret
44 1:      popw    %bx     /* discard */
45         popw    %bx     /* discard */
46         /* Restore registers and return */
47         popw    %bx
48         popw    %es
49         popw    %ds
50         popl    %ebp
51         popl    %edi
52         popl    %esi
53         lret
54         .size undiloader, . - undiloader