PKUOS - Pintos
Pintos source browser for PKU Operating System course
src
tests
vm
pt-grow-pusha.c
Go to the documentation of this file.
1
/** Expand the stack by 32 bytes all at once using the PUSHA
2
instruction.
3
This must succeed. */
4
5
#include <
string.h
>
6
#include "
tests/arc4.h
"
7
#include "
tests/cksum.h
"
8
#include "
tests/lib.h
"
9
#include "
tests/main.h
"
10
11
void
12
test_main
(
void
)
13
{
14
asm
volatile
15
(
"movl %%esp, %%eax;"
/**< Save a copy of the stack pointer. */
16
"andl $0xfffff000, %%esp;"
/**< Move stack pointer to bottom of page. */
17
"pushal;"
/**< Push 32 bytes on stack at once. */
18
"movl %%eax, %%esp"
/**< Restore copied stack pointer. */
19
: : :
"eax"
);
/**< Tell GCC we destroyed eax. */
20
}
arc4.h
cksum.h
lib.h
main.h
test_main
void test_main(void)
Expand the stack by 32 bytes all at once using the PUSHA instruction.
Definition:
pt-grow-pusha.c:12
string.h
Generated on Thu Nov 4 2021 19:31:01 for PKUOS - Pintos by
1.9.2