PKUOS - Pintos
Pintos source browser for PKU Operating System course
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
11void
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}
void test_main(void)
Expand the stack by 32 bytes all at once using the PUSHA instruction.
Definition: pt-grow-pusha.c:12