kernel/arm: adjust function names for getting/setting SCTLR

Change-Id: I28d6101c772a5065beec5af20f6d2a0c1855ae6c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6421
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: David Karoly <karolyd577@gmail.com>
This commit is contained in:
David Karoly 2023-05-07 16:58:28 +02:00
parent 18f35e4ebd
commit 19537d01d1
3 changed files with 12 additions and 12 deletions

View File

@ -60,8 +60,8 @@ extern addr_t arm_get_ifar(void);
extern addr_t arm_get_fp(void);
extern int mmu_read_c1(void);
extern int mmu_write_c1(int val);
extern int arm_get_sctlr(void);
extern int arm_set_sctlr(int val);
void arch_cpu_invalidate_TLB_page(addr_t page);

View File

@ -1,5 +1,5 @@
/*
* Copyright 2022, Haiku Inc. All rights reserved.
* Copyright 2022-2023, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Copyright 2009, Wischert, johanneswi@gmail.com.
@ -20,18 +20,18 @@
.text
/* int mmu_read_c1(void); */
FUNCTION(mmu_read_c1):
/* int arm_get_sctlr(void); */
FUNCTION(arm_get_sctlr):
mrc p15, 0, r0, c1, c0, 0
bx lr
FUNCTION_END(mmu_read_c1)
FUNCTION_END(arm_get_sctlr)
/* void mmu_write_c1(int val); */
FUNCTION(mmu_write_c1):
/* void arm_set_sctlr(int val); */
FUNCTION(arm_set_sctlr):
mcr p15, 0, r0, c1, c0, 0
bx lr
FUNCTION_END(mmu_write_c1)
FUNCTION_END(arm_set_sctlr)
/* NOTE: the I bit in cpsr (bit 7) is *set* to disable... */

View File

@ -153,12 +153,12 @@ arch_int_init_post_vm(kernel_args *args)
arm_vector_init();
// see if high vectors are enabled
if ((mmu_read_c1() & (1 << 13)) != 0)
if ((arm_get_sctlr() & (1 << 13)) != 0)
dprintf("High vectors already enabled\n");
else {
mmu_write_c1(mmu_read_c1() | (1 << 13));
arm_set_sctlr(arm_get_sctlr() | (1 << 13));
if ((mmu_read_c1() & (1 << 13)) == 0)
if ((arm_get_sctlr() & (1 << 13)) == 0)
dprintf("Unable to enable high vectors!\n");
else
dprintf("Enabled high vectors\n");