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
  * the prefix requested.
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
 	/* Determine exit path requested by prefix */
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
 	/* Call to main() */
22
 	/* Call to main() */
23
-	regs->eax = main();
23
+	ix86->regs.eax = main();
24
 
24
 
25
 	if ( exit_path ) {
25
 	if ( exit_path ) {
26
 		/* Prefix requested that we use a particular function
26
 		/* Prefix requested that we use a particular function
27
 		 * as the exit path, so we call this function, which
27
 		 * as the exit path, so we call this function, which
28
 		 * must not return.
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
 #ifndef HOOKS_H
1
 #ifndef HOOKS_H
2
 #define HOOKS_H
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
 #endif /* HOOKS_H */
6
 #endif /* HOOKS_H */

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

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
 /* Segment:offset structure.  Note that the order within the structure
15
 /* Segment:offset structure.  Note that the order within the structure
21
  * is offset:segment.
16
  * is offset:segment.
22
  */
17
  */

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

1
 #include "bochs.h"
1
 #include "bochs.h"
2
 #include "realmode.h"
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
 	bochsbp();
15
 	bochsbp();
12
 	/* Placeholder */
16
 	/* Placeholder */
13
 }
17
 }

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

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

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

11
  * that would cause linker symbol pollution.
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
 	 * PCI BIOS passes busdevfn in %ax
16
 	 * PCI BIOS passes busdevfn in %ax
17
 	 *
17
 	 *
23
 	
23
 	
24
 	/* Select PCI bus and specified busdevfn as first boot device */
24
 	/* Select PCI bus and specified busdevfn as first boot device */
25
 	memset ( &u, 0, sizeof ( u ) );
25
 	memset ( &u, 0, sizeof ( u ) );
26
-	u.pci_loc.busdevfn = regs->ax;
26
+	u.pci_loc.busdevfn = ix86->regs.ax;
27
 	select_device ( &dev, &pci_driver, &u.bus_loc );
27
 	select_device ( &dev, &pci_driver, &u.bus_loc );
28
 }
28
 }

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

135
  *
135
  *
136
  * Call a specific C function in the internal code.  The prototype of
136
  * Call a specific C function in the internal code.  The prototype of
137
  * the C function must be
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
  * at entry to kir_call.
140
  * at entry to kir_call.
141
  *
141
  *
142
  * All registers will be preserved across kir_call(), unless the C
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
  * will also be preserved.
144
  * will also be preserved.
145
  *
145
  *
146
  * Parameters:
146
  * Parameters:
151
  *	lcall	$UNDI_CS, $kir_call
151
  *	lcall	$UNDI_CS, $kir_call
152
  *	addw	$2, %sp
152
  *	addw	$2, %sp
153
  * to call in to the C function
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
 	pushl	%cs:ext_ds_and_es
190
 	pushl	%cs:ext_ds_and_es
191
 	pushl	%cs:ext_cs_and_ss
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
 	pushl	%esp
194
 	pushl	%esp
195
 	data32 call *%cs:save_function
195
 	data32 call *%cs:save_function
196
 	popl	%eax /* discard */
196
 	popl	%eax /* discard */

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

106
 /* Size of various C data structures */
106
 /* Size of various C data structures */
107
 #define SIZEOF_I386_SEG_REGS	12
107
 #define SIZEOF_I386_SEG_REGS	12
108
 #define SIZEOF_I386_REGS	32
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
 #define SIZEOF_I386_FLAGS	4
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
 #define SIZEOF_SEGOFF_T		4
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
 	.text
115
 	.text
116
 	.arch i386
116
 	.arch i386
461
  *
461
  *
462
  * Call a specific C function in the protected-mode code.  The
462
  * Call a specific C function in the protected-mode code.  The
463
  * prototype of the C function must be
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
  * at entry to prot_call.  
466
  * at entry to prot_call.  
467
  *
467
  *
468
  * All registers will be preserved across prot_call(), unless the C
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
  * will also be preserved.  Gate A20 will be enabled.
470
  * will also be preserved.  Gate A20 will be enabled.
471
  *
471
  *
472
  * The protected-mode code may install librm to a new location.  If it
472
  * The protected-mode code may install librm to a new location.  If it
495
  *	lcall	$LIBRM_SEGMENT, $prot_call
495
  *	lcall	$LIBRM_SEGMENT, $prot_call
496
  *	addw	$4, %sp
496
  *	addw	$4, %sp
497
  * to call in to the C function
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
 #define PC_OFFSET_FUNCTION ( PC_OFFSET_RETADDR + 4 )
504
 #define PC_OFFSET_FUNCTION ( PC_OFFSET_RETADDR + 4 )
505
 	
505
 	
506
 	.code16
506
 	.code16
534
 	call	real_to_prot
534
 	call	real_to_prot
535
 	.code32
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
 	subl	%ecx, %esp
539
 	subl	%ecx, %esp
540
 	movl	%esp, %edi
540
 	movl	%esp, %edi
541
 	pushl	%esi
541
 	pushl	%esi
542
 	cld
542
 	cld
543
 	rep movsb
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
 	/* Switch to virtual addresses. */
546
 	/* Switch to virtual addresses. */
547
 	call	1f
547
 	call	1f
555
 	popl	%eax	/* discard */
555
 	popl	%eax	/* discard */
556
 	popal
556
 	popal
557
 
557
 
558
-	/* Push &rm_regs on the stack, and call function */
558
+	/* Push &ix86 on the stack, and call function */
559
 	pushl	%esp
559
 	pushl	%esp
560
 	call	*%ebx
560
 	call	*%ebx
561
 	popl	%eax /* discard */
561
 	popl	%eax /* discard */
564
 	lcall	$VIRTUAL_CS, $_virt_to_phys
564
 	lcall	$VIRTUAL_CS, $_virt_to_phys
565
 	popl	%eax /* discard */
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
 	 * from PM stack.  (%edi still contains physical address of
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
 	 * %edi).
570
 	 * %edi).
571
 	 */
571
 	 */
572
 	movl	%esp, %esi
572
 	movl	%esp, %esi
573
-	movl	$SIZEOF_REAL_MODE_REGS, %ecx
573
+	movl	$SIZEOF_I386_ALL_REGS, %ecx
574
 	cld
574
 	cld
575
 	rep movsb
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
 	/* Obtain physical base address of installed copy of librm in
578
 	/* Obtain physical base address of installed copy of librm in
579
 	 * %ebx.  (It's possible that this *isn't* the physical base
579
 	 * %ebx.  (It's possible that this *isn't* the physical base

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

139
  * pointer to this new librm's entry point via es:di.
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
 	/* Hand off to initialise() */
143
 	/* Hand off to initialise() */
144
 	initialise ();
144
 	initialise ();
145
 
145
 
147
 	 * already set up by setup16, so all we need to do is point
147
 	 * already set up by setup16, so all we need to do is point
148
 	 * es:0000 to the start of the new librm.
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