1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
/*
* Creation Date: <2001/06/16 21:30:18 samuel>
* Time-stamp: <2001/06/21 13:37:53 samuel>
*
* <init.S>
*
* Asm glue for ELF images run inside MOL
*
* Copyright (C) 2001 Samuel Rydh (samuel@ibrium.se)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
*
*/
#include "mol_config.h"
#include "asmdefs.h"
#include "processor.h"
#include "os_interface.h"
.section .bss
.balign 32
.space 1024*256 // 256 K stack
stack: .space 64
/************************************************************************/
/* Exception Vectors */
/************************************************************************/
.text
.org 0x100
1: nop
b 1b
.org 0x200
1: nop
b 1b
.org 0x300
1: nop
b 1b
.org 0x400
1: nop
b 1b
.org 0x500
1: nop
b 1b
.org 0x600
1: nop
b 1b
.org 0x700
1: nop
b 1b
.org 0x800
mtsprg0 r3
mfsrr1 r3
ori r3,r3,0x2000
mtsrr1 r3
mfsprg0 r3
rfi
.org 0x900
1: nop
b 1b
/************************************************************************/
/* Entrypoint, Asm globals */
/************************************************************************/
.org 0x1400
GLOBL(_start):
LOADI r1,stack
bl entry
li r3,OSI_EXIT
b osi_call
GLOBL(osi_call):
mr r5,r3
mr r6,r4
mr r7,r5
mr r8,r6
mr r9,r7
LOADI r3,OSI_SC_MAGIC_R3
LOADI r4,OSI_SC_MAGIC_R4
sc
blr
|