[a690c003] | 1 | /* |
---|
[1c554014] | 2 | * lnklib.S |
---|
[a690c003] | 3 | */ |
---|
| 4 | |
---|
| 5 | #include <rtems/mips/iregdef.h> |
---|
| 6 | #include <rtems/mips/idtcpu.h> |
---|
| 7 | |
---|
| 8 | #define FRAME(name,frm_reg,offset,ret_reg) \ |
---|
| 9 | .globl name; \ |
---|
| 10 | .ent name; \ |
---|
| 11 | name:; \ |
---|
| 12 | .frame frm_reg,offset,ret_reg |
---|
| 13 | |
---|
| 14 | #define ENDFRAME(name) \ |
---|
| 15 | .end name |
---|
| 16 | |
---|
| 17 | #define PROM_LINK(name,entry) \ |
---|
| 18 | .globl name; \ |
---|
| 19 | .ent name; \ |
---|
| 20 | name: la $2,+entry; \ |
---|
| 21 | j $2; \ |
---|
| 22 | .end name |
---|
| 23 | |
---|
| 24 | #define PROM_ENTRY(x) (0xbfc00000+((x)*8)) |
---|
| 25 | |
---|
| 26 | #define PROM_RESET PROM_ENTRY(0) |
---|
| 27 | #define PROM_NOT_IMP PROM_ENTRY(1) |
---|
| 28 | #define PROM_RESTART PROM_ENTRY(2) |
---|
| 29 | #define PROM_REINIT PROM_ENTRY(3) |
---|
| 30 | #define PROM_GETCHAR PROM_ENTRY(11) |
---|
| 31 | #define PROM_PUTCHAR PROM_ENTRY(12) |
---|
| 32 | #define PROM_SHOWCHAR PROM_ENTRY(13) |
---|
| 33 | #define PROM_PRINTF PROM_ENTRY(16) |
---|
| 34 | #define PROM_RETURN PROM_ENTRY(17) |
---|
| 35 | |
---|
| 36 | #define PROM_RGETS PROM_ENTRY(25) |
---|
| 37 | #define PROM_FLUSHCACHE PROM_ENTRY(28) |
---|
| 38 | #define PROM_CLEARCACHE PROM_ENTRY(29) |
---|
| 39 | #define PROM_SETJMP PROM_ENTRY(30) |
---|
| 40 | #define PROM_LONGJMP PROM_ENTRY(31) |
---|
| 41 | |
---|
| 42 | .text |
---|
| 43 | |
---|
| 44 | PROM_LINK(idtsim_putchar, PROM_PUTCHAR) |
---|
| 45 | PROM_LINK(idtsim_getchar, PROM_GETCHAR) |
---|
| 46 | PROM_LINK(idtsim_showchar, PROM_SHOWCHAR) |
---|
| 47 | PROM_LINK(idtsim__exit, PROM_RETURN) |
---|
| 48 | PROM_LINK(idtsim_reinit, PROM_REINIT) |
---|
| 49 | PROM_LINK(idtsim_restart, PROM_RESTART) |
---|
| 50 | PROM_LINK(idtsim_reset, PROM_RESET) |
---|
| 51 | PROM_LINK(idtsim_promexit, PROM_RETURN) |
---|
| 52 | PROM_LINK(idtsim_setjmp, PROM_SETJMP) |
---|
| 53 | PROM_LINK(idtsim_longjmp, PROM_LONGJMP) |
---|
| 54 | |
---|
| 55 | FRAME(idtsim_init_sbrk,sp,0,ra) |
---|
| 56 | j ra |
---|
| 57 | ENDFRAME(idtsim_init_sbrk) |
---|
| 58 | |
---|
| 59 | FRAME(idtsim_init_file,sp,0,ra) |
---|
| 60 | j ra |
---|
| 61 | ENDFRAME(idtsim_init_file) |
---|
| 62 | |
---|