These changes are the raw update to qemu-2.6.
[kvmfornfv.git] / qemu / roms / ipxe / src / arch / i386 / prefix / nbiprefix.S
1 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
2
3         .text
4         .arch i386
5         .code16
6         .section ".prefix", "ax", @progbits
7         .org 0
8
9 nbi_header:
10         
11 /*****************************************************************************
12  * NBI file header
13  *****************************************************************************
14  */
15 file_header:
16         .long   0x1b031336      /* Signature */
17         .byte   0x04            /* 16 bytes header, no vendor info */
18         .byte   0
19         .byte   0
20         .byte   0               /* No flags */
21         .word   0x0000, 0x07c0  /* Load header to 0x07c0:0x0000 */
22         .word   _nbi_start, 0x07c0      /* Start execution at 0x07c0:entry */
23         .size   file_header, . - file_header
24
25 /*****************************************************************************
26  * NBI segment header
27  *****************************************************************************
28  */
29 segment_header:
30         .byte   0x04            /* 16 bytes header, no vendor info */
31         .byte   0
32         .byte   0
33         .byte   0x04            /* Last segment */
34         .long   0x00007e00
35 imglen: .long   -512
36 memlen: .long   -512
37         .size   segment_header, . - segment_header
38
39         .section ".zinfo.fixup", "a", @progbits /* Compressor fixups */
40         .ascii  "ADDL"
41         .long   imglen
42         .long   1
43         .long   0
44         .ascii  "ADDL"
45         .long   memlen
46         .long   1
47         .long   0
48         .previous
49
50 /*****************************************************************************
51  * NBI entry point
52  *****************************************************************************
53  */
54         .globl  _nbi_start
55 _nbi_start:
56         /* Install iPXE */
57         call    install
58
59         /* Set up real-mode stack */
60         movw    %bx, %ss
61         movw    $_estack16, %sp
62
63         /* Jump to .text16 segment */
64         pushw   %ax
65         pushw   $1f
66         lret
67         .section ".text16", "awx", @progbits
68 1:
69         pushl   $main
70         pushw   %cs
71         call    prot_call
72         popl    %ecx /* discard */
73
74         /* Uninstall iPXE */
75         call    uninstall
76
77         /* Reboot system */
78         int $0x19
79
80         .previous
81         .size   _nbi_start, . - _nbi_start
82
83 nbi_header_end:
84         .org 512