Annotation of /tags/mkinitrd-6_3_5/isolinux/stack.inc
Parent Directory | Revision Log
Revision 1223 -
(hide annotations)
(download)
Sat Jan 29 14:06:54 2011 UTC (13 years, 8 months ago) by niro
File size: 1236 byte(s)
Sat Jan 29 14:06:54 2011 UTC (13 years, 8 months ago) by niro
File size: 1236 byte(s)
tagged 'mkinitrd-6_3_5'
1 | niro | 1133 | ; ----------------------------------------------------------------------- |
2 | ; | ||
3 | ; Copyright 2005-2008 H. Peter Anvin - All Rights Reserved | ||
4 | ; | ||
5 | ; This program is free software; you can redistribute it and/or modify | ||
6 | ; it under the terms of the GNU General Public License as published by | ||
7 | ; the Free Software Foundation, Inc., 53 Temple Place Ste 330, | ||
8 | ; Boston MA 02111-1307, USA; either version 2 of the License, or | ||
9 | ; (at your option) any later version; incorporated herein by reference. | ||
10 | ; | ||
11 | ; ----------------------------------------------------------------------- | ||
12 | |||
13 | ; | ||
14 | ; stack.inc | ||
15 | ; | ||
16 | ; How to reset the stack pointer | ||
17 | ; | ||
18 | |||
19 | %ifndef _STACK_INC | ||
20 | %define _STACK_INC | ||
21 | |||
22 | ; | ||
23 | ; This macro resets the stack pointer (including SS), and sets | ||
24 | ; DS == ES == 0, interrupts on, DF = 0. | ||
25 | ; | ||
26 | ; It takes a 16-bit register that can be safely clobbered as parameter. | ||
27 | ; | ||
28 | %macro RESET_STACK_AND_SEGS 1 | ||
29 | xor %1,%1 | ||
30 | mov ds,%1 | ||
31 | mov es,%1 | ||
32 | %if IS_SYSLINUX || IS_EXTLINUX | ||
33 | mov ss,%1 ; Just in case... | ||
34 | mov sp,StackBuf-2*5 ; Reset stack | ||
35 | %elif IS_PXELINUX | ||
36 | lss esp,[BaseStack] | ||
37 | %elif IS_ISOLINUX | ||
38 | mov ss,%1 | ||
39 | mov sp,StackBuf-2*2 | ||
40 | %else | ||
41 | NEED TO KNOW HOW TO RESET STACK | ||
42 | %endif | ||
43 | sti | ||
44 | cld | ||
45 | %endmacro | ||
46 | |||
47 | %endif ; _STACK_INC |