1 struct _subtable_data {
6 struct _subtable_data subtable[64];
8 struct _addrspace_data {
9 struct _table_data read;
10 struct _table_data write;
12 void reallocate_subtable(struct _table_data *tabledata, unsigned char subentry);
13 void release_subtable(struct _table_data *tabledata, unsigned char subentry);
14 void install_mem_handler(struct _addrspace_data *space, int iswrite,
15 int databits, int ismatchmask, unsigned int start,
16 unsigned int end, unsigned int mask,
17 unsigned int mirror, void **handler, int isfixed,
18 const char *handler_name)
20 unsigned int lmirrorbits;
21 unsigned int hmirrorbits;
22 unsigned int lmirrorcount;
23 unsigned int hmirrorcount;
24 struct _table_data *tabledata = iswrite ? &space->write : &space->read;
25 unsigned char prev_entry = 0;
29 for (i = (32 - 18); hmirrorcount < (1 << hmirrorbits); hmirrorcount++) {
30 unsigned int hmirrorbase = 0;
31 if (cur_index == ((end + hmirrorbase) >> (32 - 18))) {
33 && prev_entry == tabledata->table[cur_index]) {
34 if (tabledata->table[cur_index] >= (256 - 64))
35 release_subtable(tabledata,
38 if (tabledata->table[prev_index] >= (256 - 64))
39 reallocate_subtable(tabledata,
43 prev_entry = tabledata->table[cur_index];
45 for (lmirrorcount = 0;
46 lmirrorcount < (1 << lmirrorbits); lmirrorcount++) {
50 void reallocate_subtable(struct _table_data *tabledata, unsigned char subentry)
52 unsigned char subindex = subentry - (256 - 64);
53 if (tabledata->subtable[subindex].usecount <= 0)
56 void release_subtable(struct _table_data *tabledata, unsigned char subentry)
58 unsigned char subindex = subentry - (256 - 64);
59 if (tabledata->subtable[subindex].usecount <= 0)