File: reloc.h

package info (click to toggle)
mol 0.9.61-6
  • links: PTS
  • area: contrib
  • in suites: woody
  • size: 6,140 kB
  • ctags: 8,491
  • sloc: ansic: 50,560; asm: 2,826; sh: 458; makefile: 373; perl: 165; lex: 135; yacc: 131
file content (82 lines) | stat: -rw-r--r-- 1,904 bytes parent folder | download
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
/* 
 *   Creation Date: <1999/09/25 17:25:30 samuel>
 *   Time-stamp: <2001/04/21 16:55:24 samuel>
 *   
 *	<reloc.h>
 *	
 *	Definitions used to move criticalal low-level parts
 *	of the code to continuous physical memory.
 *   
 *   Copyright (C) 1999, 2000, 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
 *   
 */

#ifndef _H_RELOC
#define _H_RELOC

/* Special 'action symbols' are used to dynamically modify the code. */

#define NO_ACTION			0
#define  ACTION_KVARS_TABLE		1
#define  ACTION_KVARS_TABLE_VIRT	2

#define FIRST_RELOC_ACTION		3
#define   ACTION_LI_PHYS		3	/* dest_reg, addr */
#define LAST_RELOC_ACTION		3

#define FIRST_HOOK_ACTION		5
#define   ACTION_RELOC_HOOK		6	/* trigger, size, vret_action#, vret_offs */
#define   ACTION_VRET			7
#define   ACTION_HOOK_FUNCTION		8
#define   ACTION_FRET			9
#define LAST_HOOK_ACTION		9

#define MAX_ACTION			15	/* used to loop the actions */

/* Function hooks */
#define FHOOK_FLUSH_HASH_PAGE	1


#ifdef ACTION_SYM_GREPPING
#define ACTION_SYMBOL( sym_name, action ) \
	ACTION_SYM_START,##sym_name,##action,ACTION_SYM_END
#define GLOBAL_SYMBOL( sym_name ) \
	GLOBAL_SYM_START,##sym_name,GLOBAL_SYM_END
#else
#define ACTION_SYMBOL( sym_name, dummy2 ) \
sym_name:
#define GLOBAL_SYMBOL( sym_name ) \
GLOBL(sym_name)
#endif


#ifndef __ASSEMBLY__

extern int reloc_phys_offs;
extern int reloc_virt_offs;

#define reloc_ptr( v )  ((ulong)(v) + (ulong)reloc_virt_offs)

enum {
	R_PPC_ADDR16_LO = 1,
	R_PPC_ADDR16_HA,
	R_PPC_ADDR16_HI,
	R_PPC_ADDR32,
	/* unsupported */
	R_PPC_REL24,
	R_PPC_REL14
};

typedef struct reloc_table {
	unsigned long 	inst_offs;
	int 		action;
	int		rtype;
	unsigned long	offs;
} reloc_table_t, reloc_table_entry_t;
#endif

#endif   /* _H_RELOC */