comparison dyncallback/dyncall_thunk_mips.c @ 97:d0787f3b81fb

- internal linkage for some helper functions - corrected and added some comments for clarification
author cslag
date Sat, 04 Jun 2016 19:35:58 +0200
parents 3e629dc19168
children 1ce60358fbad
comparison
equal deleted inserted replaced
96:95f67e67feb0 97:d0787f3b81fb
23 23
24 */ 24 */
25 25
26 #include "dyncall_thunk.h" 26 #include "dyncall_thunk.h"
27 27
28 unsigned short hi16(x) { return ( (unsigned short) (((unsigned int)x)>>16UL) ); } 28 static unsigned short hi16(x) { return ( (unsigned short) (((unsigned int)x)>>16UL) ); }
29 unsigned short lo16(x) { return ( (unsigned short) ((unsigned int)x) ); } 29 static unsigned short lo16(x) { return ( (unsigned short) ((unsigned int)x) ); }
30 30
31 void dcbInitThunk(DCThunk* p, void (*entry)()) 31 void dcbInitThunk(DCThunk* p, void (*entry)())
32 { 32 {
33 /* 33 /*
34 34
41 mips thunk code: 41 mips thunk code:
42 lui $t4, %hi(p) 42 lui $t4, %hi(p)
43 lui $t9, %hi(entry) 43 lui $t9, %hi(entry)
44 ori $t9, $t9, %lo(entry) 44 ori $t9, $t9, %lo(entry)
45 jr $t9 45 jr $t9
46 ori $t4, $t4, %lo(p) 46 ori $t4, $t4, %lo(p) ; branch delay slot
47 47
48 thunk.o: file format elf32-tradbigmips 48 thunk.o: file format elf32-tradbigmips
49 49
50 50
51 Disassembly of section .text: 51 Disassembly of section .text: