Browse Source

[pxeprefix] Merge common code between !PXE and PXENV+

The parsing of the !PXE and PXENV+ structures share a fair bit of
code; merge the common code to save a few bytes.

Signed-off-by: Michael Brown <mcb30@etherboot.org>
tags/v0.9.8
H. Peter Anvin 15 years ago
parent
commit
f3d09b5c79
1 changed files with 12 additions and 14 deletions
  1. 12
    14
      src/arch/i386/prefix/pxeprefix.S

+ 12
- 14
src/arch/i386/prefix/pxeprefix.S View File

105
 
105
 
106
 	/* Record entry point and UNDI segments */
106
 	/* Record entry point and UNDI segments */
107
 	pushl	%es:0x0a(%bx)		/* Entry point */
107
 	pushl	%es:0x0a(%bx)		/* Entry point */
108
-	popl	entry_segoff
109
 	pushw	%es:0x24(%bx)		/* UNDI code segment */
108
 	pushw	%es:0x24(%bx)		/* UNDI code segment */
110
 	pushw	%es:0x26(%bx)		/* UNDI code size */
109
 	pushw	%es:0x26(%bx)		/* UNDI code size */
111
-	popl	undi_code_segoff
112
 	pushw	%es:0x20(%bx)		/* UNDI data segment */
110
 	pushw	%es:0x20(%bx)		/* UNDI data segment */
113
 	pushw	%es:0x22(%bx)		/* UNDI data size */
111
 	pushw	%es:0x22(%bx)		/* UNDI data size */
114
-	popl	undi_data_segoff
115
 
112
 
116
 	/* Print "PXENV+ at <address>" */
113
 	/* Print "PXENV+ at <address>" */
117
 	movw	$10f, %si
114
 	movw	$10f, %si
118
-	call	print_message
119
-	call	print_segoff
120
-	movb	$( ',' ), %al
121
-	call	print_character
122
 	jmp	check_have_stack
115
 	jmp	check_have_stack
123
 	.section ".prefix.data", "aw", @progbits
116
 	.section ".prefix.data", "aw", @progbits
124
 10:	.asciz	" PXENV+ at "
117
 10:	.asciz	" PXENV+ at "
129
 	movw	%es, ppxe_segment
122
 	movw	%es, ppxe_segment
130
 	
123
 	
131
 	pushl	%es:0x10(%bx)		/* Entry point */
124
 	pushl	%es:0x10(%bx)		/* Entry point */
132
-	popl	entry_segoff
133
 	pushw	%es:0x30(%bx)		/* UNDI code segment */
125
 	pushw	%es:0x30(%bx)		/* UNDI code segment */
134
 	pushw	%es:0x36(%bx)		/* UNDI code size */
126
 	pushw	%es:0x36(%bx)		/* UNDI code size */
135
-	popl	undi_code_segoff
136
 	pushw	%es:0x28(%bx)		/* UNDI data segment */
127
 	pushw	%es:0x28(%bx)		/* UNDI data segment */
137
 	pushw	%es:0x2e(%bx)		/* UNDI data size */
128
 	pushw	%es:0x2e(%bx)		/* UNDI data size */
138
-	popl	undi_data_segoff
129
+
139
 	/* Print "!PXE at <address>" */
130
 	/* Print "!PXE at <address>" */
140
 	movw	$10f, %si
131
 	movw	$10f, %si
141
-	call	print_message
142
-	call	print_segoff
143
-	movb	$( ',' ), %al
144
-	call	print_character
145
 	jmp	check_have_stack
132
 	jmp	check_have_stack
146
 	.section ".prefix.data", "aw", @progbits
133
 	.section ".prefix.data", "aw", @progbits
147
 10:	.asciz	" !PXE at "
134
 10:	.asciz	" !PXE at "
201
  *****************************************************************************
188
  *****************************************************************************
202
  */
189
  */
203
 check_have_stack:
190
 check_have_stack:
191
+	/* Save common values pushed onto the stack */
192
+	popl	undi_data_segoff
193
+	popl	undi_code_segoff
194
+	popl	entry_segoff
195
+
196
+	/* Print have !PXE/PXENV+ message; structure pointer in %es:%bx */
197
+	call	print_message
198
+	call	print_segoff
199
+	movb	$( ',' ), %al
200
+	call	print_character
201
+
204
 	/* Check for entry point */
202
 	/* Check for entry point */
205
 	movl	entry_segoff, %eax
203
 	movl	entry_segoff, %eax
206
 	testl	%eax, %eax
204
 	testl	%eax, %eax

Loading…
Cancel
Save