registry.h
2.12 KB
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
/*
* Copyright (C) 1996-1998 by the Board of Trustees
* of Leland Stanford Junior University.
*
* This file is part of the SimOS distribution.
* See LICENSE file for terms of the license.
*
*/
/*****************************************************************
* registry.h
*
* Registry for backdoor areas and functions.
* Created by: Steve Herrod
* Revised by: Dan Teodosiu, 07/96
*
****************************************************************/
#ifndef _REGISTRY_H
#define _REGISTRY_H
#include "arch_specifics.h"
#define REGISTRY_BASE_ADDR K1BASE
void RegistryInit(void);
/* Function registry */
void RegistryAddSimFunction(void *ptr, void *func);
void *RegistryGetSimFunction(VA addr);
/* Range registry */
int RegistryAddRange(VA start,VA size, uint flag, void *data, char *name);
void RegistryComplete(void);
bool RegistryIsInRange(VA addr, void **data, uint *flag);
VA RegistryReverseMap(void *data);
void RegistryDumpEntries(void);
/* Flags used when specifying how to treat particular ranges of memory */
#define REG_DATA 0x1
#define REG_FUNC 0x2
/* Flags passed to backdoor functions */
#define BDOOR_LOAD 0x0
#define BDOOR_STORE 0x1
#define BDOOR_IS_LOAD(x) (((x) & 1) == BDOOR_LOAD)
#define BDOOR_IS_STORE(x) (((x) & 1) == BDOOR_STORE)
/* assigning these guys their actual size in bytes so that
BDDOR_SIZE returns something more useful */
#define BDOOR_BYTE 0x1
#define BDOOR_HALF 0x2
#define BDOOR_WORD 0x4
#define BDOOR_DOUBLE 0x8
#define BDOOR_SIZE_SHIFT 1
#define BDOOR_SIZE(x) ((x) >> BDOOR_SIZE_SHIFT)
#define BDOOR_LOAD_BYTE ((BDOOR_BYTE<<BDOOR_SIZE_SHIFT) | BDOOR_LOAD)
#define BDOOR_LOAD_HALF ((BDOOR_HALF<<BDOOR_SIZE_SHIFT) | BDOOR_LOAD)
#define BDOOR_LOAD_WORD ((BDOOR_WORD<<BDOOR_SIZE_SHIFT) | BDOOR_LOAD)
#define BDOOR_LOAD_DOUBLE ((BDOOR_DOUBLE<<BDOOR_SIZE_SHIFT) | BDOOR_LOAD)
#define BDOOR_STORE_BYTE ((BDOOR_BYTE<<BDOOR_SIZE_SHIFT) | BDOOR_STORE)
#define BDOOR_STORE_HALF ((BDOOR_HALF<<BDOOR_SIZE_SHIFT) | BDOOR_STORE)
#define BDOOR_STORE_WORD ((BDOOR_WORD<<BDOOR_SIZE_SHIFT) | BDOOR_STORE)
#define BDOOR_STORE_DOUBLE ((BDOOR_DOUBLE<<BDOOR_SIZE_SHIFT) | BDOOR_STORE)
#endif