Fix Arm big-endian host bug.
[qemu] / pc-bios / bios.diff
1 Index: rombios.c
2 ===================================================================
3 RCS file: /cvsroot/bochs/bochs/bios/rombios.c,v
4 retrieving revision 1.130
5 diff -u -w -r1.130 rombios.c
6 --- rombios.c   13 Feb 2005 08:47:30 -0000      1.130
7 +++ rombios.c   9 Feb 2006 21:49:38 -0000
8 @@ -8570,7 +8570,10 @@
9  use32 386
10  #define APM_PROT32
11  #include "apmbios.S"
12 +
13  use16 386
14 +#define APM_PROT16
15 +#include "apmbios.S"
16  
17  #define APM_REAL
18  #include "apmbios.S"
19 @@ -8611,6 +8614,7 @@
20    mov al, #0x80
21  bios32_end:
22    popf
23 +  and dword ptr[esp+4],0xfffffffc ;; reset CS.RPL for kqemu
24    retf
25  
26  .align 16
27 @@ -8721,17 +8725,17 @@
28  pci_pro_fail:
29    pop edi
30    pop esi
31 -  sti
32    popf
33    stc
34 +  and dword ptr[esp+4],0xfffffffc ;; reset CS.RPL for kqemu
35    retf
36  pci_pro_ok:
37    xor ah, ah
38    pop edi
39    pop esi
40 -  sti
41    popf
42    clc
43 +  and dword ptr[esp+4],0xfffffffc ;; reset CS.RPL for kqemu
44    retf
45  
46  pci_pro_select_reg:
47 Index: apmbios.S
48 ===================================================================
49 RCS file: /cvsroot/bochs/bochs/bios/apmbios.S,v
50 retrieving revision 1.1
51 diff -u -w -r1.1 apmbios.S
52 --- apmbios.S   20 Jun 2004 18:27:09 -0000      1.1
53 +++ apmbios.S   9 Feb 2006 21:49:38 -0000
54 @@ -1,6 +1,9 @@
55  //  APM BIOS support for the Bochs BIOS
56  //  Copyright (C) 2004 Fabrice Bellard
57  //
58 +//  16-bit interface activation
59 +//  Copyright (C) 2005 Struan Bartlett
60 +//
61  //  This library is free software; you can redistribute it and/or
62  //  modify it under the terms of the GNU Lesser General Public
63  //  License as published by the Free Software Foundation; either
64 @@ -111,13 +114,28 @@
65    mov bl, #0x4d // 'M'
66    // bit 0 : 16 bit interface supported
67    // bit 1 : 32 bit interface supported
68 -  mov cx, #0x2 
69 +  mov cx, #0x3
70    jmp APMSYM(ok)
71    
72  ;-----------------
73  ; APM real mode interface connect
74  APMSYM(01):
75    cmp al, #0x01
76 +  jne APMSYM(02)
77 +  jmp APMSYM(ok)
78 +
79 +;-----------------
80 +; APM 16 bit protected mode interface connect
81 +APMSYM(02):
82 +  cmp al, #0x02
83 +  jne APMSYM(03)
84 +
85 +  mov bx, #_apm16_entry
86 +  
87 +  mov ax, #0xf000 // 16 bit code segment base
88 +  mov si, #0xfff0 // 16 bit code segment size
89 +  mov cx, #0xf000 // data segment address
90 +  mov di, #0xfff0 // data segment length
91    jne APMSYM(03)
92    jmp APMSYM(ok)
93