2 ** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the MIT License.
12 page_table_entry::PrimaryHash(uint32 virtualSegmentID
, uint32 virtualAddress
)
14 return (virtualSegmentID
& 0x7ffff) ^ ((virtualAddress
>> 12) & 0xffff);
19 page_table_entry::SecondaryHash(uint32 virtualSegmentID
, uint32 virtualAddress
)
21 return ~PrimaryHash(virtualSegmentID
, virtualAddress
);
26 page_table_entry::SecondaryHash(uint32 primaryHash
)
33 ppc_get_page_table(page_table_entry_group
**_pageTable
, size_t *_size
)
35 uint32 sdr1
= get_sdr1();
37 *_pageTable
= (page_table_entry_group
*)(sdr1
& 0xffff0000);
38 *_size
= ((sdr1
& 0x1ff) + 1) << 16;
43 ppc_set_page_table(page_table_entry_group
*pageTable
, size_t size
)
45 set_sdr1(((uint32
)pageTable
& 0xffff0000) | (((size
-1) >> 16) & 0x1ff));