From aaaceca81b791a6500289835e59934dba7e8791c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 11 Oct 2003 19:00:59 +0000 Subject: [PATCH] Added more CPU functions, fixed the get_sr() function. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4990 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/arch/ppc/arch_cpu_asm.S | 28 +++++++++++++++++++++++++ src/kernel/core/arch/ppc/arch_mmu.cpp | 7 +++++++ 2 files changed, 35 insertions(+) diff --git a/src/kernel/core/arch/ppc/arch_cpu_asm.S b/src/kernel/core/arch/ppc/arch_cpu_asm.S index 1bbc21d0ed..dd19c4acba 100644 --- a/src/kernel/core/arch/ppc/arch_cpu_asm.S +++ b/src/kernel/core/arch/ppc/arch_cpu_asm.S @@ -20,6 +20,34 @@ FUNCTION(set_sdr1): mtsdr1 %r3 blr +/* uint32 get_sr(void *virtualAddress); + * r3 + */ +FUNCTION(get_sr): + mfsrin %r3, %r3 + blr + +/* void set_sr(void *virtualAddress, uint32 value); + * r3 r4 + */ +FUNCTION(set_sr): + mtsrin %r4, %r3 + blr + +/* uint32 get_msr(void); + */ +FUNCTION(get_msr): + mfmsr %r3 + blr + +/* uint32 set_msr(uint32 value); + * r3 + */ +FUNCTION(set_msr): + mtmsr %r3 + blr + + #define get_ibat(num) \ mfibatu %r4, num; \ stw %r4, 0(%r3); \ diff --git a/src/kernel/core/arch/ppc/arch_mmu.cpp b/src/kernel/core/arch/ppc/arch_mmu.cpp index ecadbbc712..9ebac3704b 100644 --- a/src/kernel/core/arch/ppc/arch_mmu.cpp +++ b/src/kernel/core/arch/ppc/arch_mmu.cpp @@ -22,6 +22,13 @@ page_table_entry::SecondaryHash(uint32 virtualSegmentID, uint32 virtualAddress) } +uint32 +page_table_entry::SecondaryHash(uint32 primaryHash) +{ + return ~primaryHash; +} + + void ppc_get_page_table(void **_pageTable, size_t *_size) {