File: proto64.c

package info (click to toggle)
ffcall 1.8-4.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 4,752 kB
  • ctags: 3,102
  • sloc: asm: 19,563; ansic: 11,737; sh: 5,402; makefile: 885
file content (35 lines) | stat: -rw-r--r-- 798 bytes parent folder | download | duplicates (2)
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
/* Sample prototype for a trampoline. */

/*
 * Copyright 1995-1999, 2001 Bruno Haible, <haible@clisp.cons.org>
 *
 * This is free software distributed under the GNU General Public Licence
 * described in the file COPYING. Contact the author if you don't have this
 * or can't live with it. There is ABSOLUTELY NO WARRANTY, explicit or implied,
 * on this software.
 */

#define function  (int (*) ()) 0xbabebec0dea0ffabL
#define data      (void*)      0x7355471143622155L

#ifdef __mips64__
register void* env __asm__("$2");
#endif
#ifdef __sparc64__
register void* env __asm__("%g5");
#endif
#ifdef __alpha__
register void* env __asm__("$1");
#endif
#ifdef __ia64__
register void* env __asm__("r15");
#endif

int tramp ()
{ env = data;
  return (*function)();
}

int jump ()
{ goto *function; }