~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/ipxe/src/arch/x86/prefix/undiloader.S

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

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