Rev 3161 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3161 | Rev 3169 | ||
|---|---|---|---|
| Line 26... | Line 26... | ||
| 26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | # |
27 | # |
| 28 | 28 | ||
| 29 | .globl program_run |
29 | .globl program_run |
| 30 | 30 | ||
| 31 | ## void program_run(uintptr_t entry_point); |
31 | ## void program_run(void *entry_point, void *pcb); |
| 32 | # |
32 | # |
| 33 | # Jump to a program entry point |
33 | # Jump to a program entry point |
| 34 | program_run: |
34 | program_run: |
| - | 35 | # Use standard ia32 prologue not to confuse anybody |
|
| 35 | push %ebp |
36 | push %ebp |
| 36 | movl %esp, %ebp |
37 | movl %esp, %ebp |
| - | 38 | ||
| - | 39 | # %eax := entry_point |
|
| 37 | movl 0x8(%ebp), %eax |
40 | movl 0x8(%ebp), %eax |
| - | 41 | ||
| - | 42 | # %ebx := pcb |
|
| - | 43 | # pcb is passed to the entry point int %ebx |
|
| - | 44 | mov 0xc(%ebp), %ebx |
|
| - | 45 | ||
| - | 46 | # Save a tiny bit of stack space |
|
| 38 | pop %ebp |
47 | pop %ebp |
| 39 | 48 | ||
| 40 | jmp %eax |
49 | jmp %eax |