Browse Source

Update to cope with changes in registers.h

tags/v0.9.3
Michael Brown 19 years ago
parent
commit
d3dec7c331

+ 5
- 5
src/arch/i386/core/hooks.c View File

@@ -13,20 +13,20 @@
13 13
  * the prefix requested.
14 14
  *
15 15
  */
16
-void arch_main ( struct i386_all_regs *regs ) {
17
-	void (*exit_path) ( struct i386_all_regs *regs );
16
+void arch_main ( struct i386_all_regs *ix86 ) {
17
+	void (*exit_path) ( struct i386_all_regs *ix86 );
18 18
 
19 19
 	/* Determine exit path requested by prefix */
20
-	exit_path = ( typeof ( exit_path ) ) regs->eax;
20
+	exit_path = ( typeof ( exit_path ) ) ix86->regs.eax;
21 21
 
22 22
 	/* Call to main() */
23
-	regs->eax = main();
23
+	ix86->regs.eax = main();
24 24
 
25 25
 	if ( exit_path ) {
26 26
 		/* Prefix requested that we use a particular function
27 27
 		 * as the exit path, so we call this function, which
28 28
 		 * must not return.
29 29
 		 */
30
-		exit_path ( regs );
30
+		exit_path ( ix86 );
31 31
 	}
32 32
 }

+ 1
- 1
src/arch/i386/include/hooks.h View File

@@ -1,6 +1,6 @@
1 1
 #ifndef HOOKS_H
2 2
 #define HOOKS_H
3 3
 
4
-extern void arch_main ( struct i386_all_regs *regs );
4
+extern void arch_main ( struct i386_all_regs *ix86 );
5 5
 
6 6
 #endif /* HOOKS_H */

+ 0
- 5
src/arch/i386/include/realmode.h View File

@@ -12,11 +12,6 @@
12 12
  *
13 13
  */
14 14
 
15
-/* All i386 registers, as passed in by prot_call or kir_call */
16
-struct real_mode_regs {
17
-	struct i386_all_regs;
18
-} PACKED;
19
-
20 15
 /* Segment:offset structure.  Note that the order within the structure
21 16
  * is offset:segment.
22 17
  */

+ 9
- 5
src/arch/i386/prefix/int19exit.c View File

@@ -1,13 +1,17 @@
1 1
 #include "bochs.h"
2 2
 #include "realmode.h"
3 3
 
4
-/*
5
- * The "exit via INT 19" exit path.  INT 19 is the old (pre-BBS) "boot
6
- * system" interrupt.
4
+/**
5
+ * The "exit via INT 19" exit path.
6
+ *
7
+ * INT 19 is the old (pre-BBS) "boot system" interrupt.  It is
8
+ * conventionally used now to return from a failed boot from floppy
9
+ * disk.
10
+ *
11
+ * @bug Not yet implemented
7 12
  *
8 13
  */
9
-
10
-void exit_via_int19 ( struct real_mode_regs *rm_regs ) {
14
+void exit_via_int19 ( struct i386_all_regs *ix86 ) {
11 15
 	bochsbp();
12 16
 	/* Placeholder */
13 17
 }

+ 3
- 3
src/arch/i386/prefix/select_isapnp.c View File

@@ -11,7 +11,7 @@
11 11
  * would cause linker symbol pollution.
12 12
  *
13 13
  */
14
-void i386_select_isapnp_device ( struct i386_all_regs *regs ) {
14
+void i386_select_isapnp_device ( struct i386_all_regs *ix86 ) {
15 15
 	/*
16 16
 	 * PnP BIOS passes card select number in %bx and read port
17 17
 	 * address in %dx.
@@ -23,10 +23,10 @@ void i386_select_isapnp_device ( struct i386_all_regs *regs ) {
23 23
 	} u;
24 24
 
25 25
 	/* Set ISAPnP read port */
26
-	isapnp_read_port = regs->dx;
26
+	isapnp_read_port = ix86->regs.dx;
27 27
 	
28 28
 	/* Select ISAPnP bus and specified CSN as first boot device */
29 29
 	memset ( &u, 0, sizeof ( u ) );
30
-	u.isapnp_loc.csn = regs->bx;
30
+	u.isapnp_loc.csn = ix86->regs.bx;
31 31
 	select_device ( &dev, &isapnp_driver, &u.bus_loc );
32 32
 }

+ 2
- 2
src/arch/i386/prefix/select_pci.c View File

@@ -11,7 +11,7 @@
11 11
  * that would cause linker symbol pollution.
12 12
  *
13 13
  */
14
-void i386_select_pci_device ( struct i386_all_regs *regs ) {
14
+void i386_select_pci_device ( struct i386_all_regs *ix86 ) {
15 15
 	/*
16 16
 	 * PCI BIOS passes busdevfn in %ax
17 17
 	 *
@@ -23,6 +23,6 @@ void i386_select_pci_device ( struct i386_all_regs *regs ) {
23 23
 	
24 24
 	/* Select PCI bus and specified busdevfn as first boot device */
25 25
 	memset ( &u, 0, sizeof ( u ) );
26
-	u.pci_loc.busdevfn = regs->ax;
26
+	u.pci_loc.busdevfn = ix86->regs.ax;
27 27
 	select_device ( &dev, &pci_driver, &u.bus_loc );
28 28
 }

+ 5
- 5
src/arch/i386/transitions/libkir.S View File

@@ -135,12 +135,12 @@ kir_to_ext:
135 135
  *
136 136
  * Call a specific C function in the internal code.  The prototype of
137 137
  * the C function must be
138
- *   void function ( struct real_mode_regs *rm_regs ); 
139
- * rm_regs will point to a struct containing the real-mode registers
138
+ *   void function ( struct i386_all_resg *ix86 ); 
139
+ * ix86 will point to a struct containing the real-mode registers
140 140
  * at entry to kir_call.
141 141
  *
142 142
  * All registers will be preserved across kir_call(), unless the C
143
- * function explicitly overwrites values in rm_regs.  Interrupt status
143
+ * function explicitly overwrites values in ix86.  Interrupt status
144 144
  * will also be preserved.
145 145
  *
146 146
  * Parameters:
@@ -151,7 +151,7 @@ kir_to_ext:
151 151
  *	lcall	$UNDI_CS, $kir_call
152 152
  *	addw	$2, %sp
153 153
  * to call in to the C function
154
- *      void pxe_api_call ( struct real_mode_regs *rm_regs );
154
+ *      void pxe_api_call ( struct i386_all_regs *ix86 );
155 155
  ****************************************************************************
156 156
  */
157 157
 
@@ -190,7 +190,7 @@ kir_call:
190 190
 	pushl	%cs:ext_ds_and_es
191 191
 	pushl	%cs:ext_cs_and_ss
192 192
 
193
-	/* Push &rm_regs on stack and call function */
193
+	/* Push &ix86 on stack and call function */
194 194
 	pushl	%esp
195 195
 	data32 call *%cs:save_function
196 196
 	popl	%eax /* discard */

+ 17
- 17
src/arch/i386/transitions/librm.S View File

@@ -106,11 +106,11 @@
106 106
 /* Size of various C data structures */
107 107
 #define SIZEOF_I386_SEG_REGS	12
108 108
 #define SIZEOF_I386_REGS	32
109
-#define SIZEOF_I386_ALL_REGS	( SIZEOF_I386_SEG_REGS + SIZEOF_I386_REGS )
109
+#define SIZEOF_REAL_MODE_REGS	( SIZEOF_I386_SEG_REGS + SIZEOF_I386_REGS )
110 110
 #define SIZEOF_I386_FLAGS	4
111
-#define SIZEOF_REAL_MODE_REGS   ( SIZEOF_I386_ALL_REGS + SIZEOF_I386_FLAGS )
111
+#define SIZEOF_I386_ALL_REGS	( SIZEOF_REAL_MODE_REGS + SIZEOF_I386_FLAGS )
112 112
 #define SIZEOF_SEGOFF_T		4
113
-#define SIZEOF_REAL_CALL_PARAMS ( SIZEOF_I386_ALL_REGS + 2 * SIZEOF_SEGOFF_T )
113
+#define SIZEOF_REAL_CALL_PARAMS ( SIZEOF_REAL_MODE_REGS + 2 * SIZEOF_SEGOFF_T )
114 114
 	
115 115
 	.text
116 116
 	.arch i386
@@ -461,12 +461,12 @@ p2r_ljmp:
461 461
  *
462 462
  * Call a specific C function in the protected-mode code.  The
463 463
  * prototype of the C function must be
464
- *   void function ( struct real_mode_regs *rm_regs ); 
465
- * rm_regs will point to a struct containing the real-mode registers
464
+ *   void function ( struct i386_all_regs *ix86 ); 
465
+ * ix86 will point to a struct containing the real-mode registers
466 466
  * at entry to prot_call.  
467 467
  *
468 468
  * All registers will be preserved across prot_call(), unless the C
469
- * function explicitly overwrites values in rm_regs.  Interrupt status
469
+ * function explicitly overwrites values in ix86.  Interrupt status
470 470
  * will also be preserved.  Gate A20 will be enabled.
471 471
  *
472 472
  * The protected-mode code may install librm to a new location.  If it
@@ -495,12 +495,12 @@ p2r_ljmp:
495 495
  *	lcall	$LIBRM_SEGMENT, $prot_call
496 496
  *	addw	$4, %sp
497 497
  * to call in to the C function
498
- *      void pxe_api_call ( struct real_mode_regs *rm_regs );
498
+ *      void pxe_api_call ( struct i386_all_regs *ix86 );
499 499
  ****************************************************************************
500 500
  */
501 501
 
502
-#define PC_OFFSET_RM_REGS ( 0 )
503
-#define PC_OFFSET_RETADDR ( PC_OFFSET_RM_REGS + SIZEOF_REAL_MODE_REGS )
502
+#define PC_OFFSET_IX86 ( 0 )
503
+#define PC_OFFSET_RETADDR ( PC_OFFSET_IX86 + SIZEOF_I386_ALL_REGS )
504 504
 #define PC_OFFSET_FUNCTION ( PC_OFFSET_RETADDR + 4 )
505 505
 	
506 506
 	.code16
@@ -534,14 +534,14 @@ EXPORT(prot_call):
534 534
 	call	real_to_prot
535 535
 	.code32
536 536
 
537
-	/* Copy rm_regs from RM stack to PM stack */
538
-	movl	$SIZEOF_REAL_MODE_REGS, %ecx
537
+	/* Copy ix86 from RM stack to PM stack */
538
+	movl	$SIZEOF_I386_ALL_REGS, %ecx
539 539
 	subl	%ecx, %esp
540 540
 	movl	%esp, %edi
541 541
 	pushl	%esi
542 542
 	cld
543 543
 	rep movsb
544
-	popl	%edi		/* %edi = phys addr of RM copy of rm_regs */
544
+	popl	%edi		/* %edi = phys addr of RM copy of ix86 */
545 545
 	
546 546
 	/* Switch to virtual addresses. */
547 547
 	call	1f
@@ -555,7 +555,7 @@ EXPORT(prot_call):
555 555
 	popl	%eax	/* discard */
556 556
 	popal
557 557
 
558
-	/* Push &rm_regs on the stack, and call function */
558
+	/* Push &ix86 on the stack, and call function */
559 559
 	pushl	%esp
560 560
 	call	*%ebx
561 561
 	popl	%eax /* discard */
@@ -564,16 +564,16 @@ EXPORT(prot_call):
564 564
 	lcall	$VIRTUAL_CS, $_virt_to_phys
565 565
 	popl	%eax /* discard */
566 566
 
567
-	/* Copy rm_regs from PM stack to RM stack, and remove rm_regs
567
+	/* Copy ix86 from PM stack to RM stack, and remove ix86
568 568
 	 * from PM stack.  (%edi still contains physical address of
569
-	 * rm_regs on RM stack from earlier, since C code preserves
569
+	 * ix86 on RM stack from earlier, since C code preserves
570 570
 	 * %edi).
571 571
 	 */
572 572
 	movl	%esp, %esi
573
-	movl	$SIZEOF_REAL_MODE_REGS, %ecx
573
+	movl	$SIZEOF_I386_ALL_REGS, %ecx
574 574
 	cld
575 575
 	rep movsb
576
-	movl	%esi, %esp	/* remove rm_regs from PM stack */
576
+	movl	%esi, %esp	/* remove ix86 from PM stack */
577 577
 
578 578
 	/* Obtain physical base address of installed copy of librm in
579 579
 	 * %ebx.  (It's possible that this *isn't* the physical base

+ 2
- 2
src/arch/i386/transitions/librm_mgmt.c View File

@@ -139,7 +139,7 @@ POST_RELOC_FN ( POST_RELOC_LIBRM, librm_post_reloc );
139 139
  * pointer to this new librm's entry point via es:di.
140 140
  *
141 141
  */
142
-void initialise_via_librm ( struct i386_all_regs *regs ) {
142
+void initialise_via_librm ( struct i386_all_regs *ix86 ) {
143 143
 	/* Hand off to initialise() */
144 144
 	initialise ();
145 145
 
@@ -147,7 +147,7 @@ void initialise_via_librm ( struct i386_all_regs *regs ) {
147 147
 	 * already set up by setup16, so all we need to do is point
148 148
 	 * es:0000 to the start of the new librm.
149 149
 	 */
150
-	regs->es = librm_base >> 4;
150
+	ix86->segs.es = librm_base >> 4;
151 151
 }
152 152
 
153 153
 /*

Loading…
Cancel
Save