debug_uart fixup for arm64
Change-Id: I872e822c48d0b4675064991ba890ce6d74d15118 Reviewed-on: https://review.haiku-os.org/c/haiku/+/5186 Reviewed-by: <[email protected]> Reviewed-by: Adrien Destugues <[email protected]> Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
committed by
Fredrik Holmqvist
parent
2b5b228442
commit
4b1d94b435
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006-2021, Haiku, Inc. All rights reserved.
|
* Copyright 2006-2022, Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
void
|
void
|
||||||
DebugUART::Out8(int reg, uint8 value)
|
DebugUART::Out8(int reg, uint8 value)
|
||||||
{
|
{
|
||||||
#ifdef __ARM__
|
#if defined(__ARM__) || defined(__aarch64__)
|
||||||
// 32-bit aligned
|
// 32-bit aligned
|
||||||
*((uint8 *)Base() + reg * sizeof(uint32)) = value;
|
*((uint8 *)Base() + reg * sizeof(uint32)) = value;
|
||||||
#else
|
#else
|
||||||
@@ -22,7 +22,7 @@ DebugUART::Out8(int reg, uint8 value)
|
|||||||
uint8
|
uint8
|
||||||
DebugUART::In8(int reg)
|
DebugUART::In8(int reg)
|
||||||
{
|
{
|
||||||
#ifdef __ARM__
|
#if defined(__ARM__) || defined(__aarch64__)
|
||||||
// 32-bit aligned
|
// 32-bit aligned
|
||||||
return *((uint8 *)Base() + reg * sizeof(uint32));
|
return *((uint8 *)Base() + reg * sizeof(uint32));
|
||||||
#else
|
#else
|
||||||
@@ -37,7 +37,7 @@ DebugUART::Barrier()
|
|||||||
// Simple memory barriers
|
// Simple memory barriers
|
||||||
#if defined(__POWERPC__)
|
#if defined(__POWERPC__)
|
||||||
asm volatile("eieio; sync");
|
asm volatile("eieio; sync");
|
||||||
#elif defined(__ARM__)
|
#elif defined(__ARM__) || defined(__aarch64__)
|
||||||
asm volatile ("" : : : "memory");
|
asm volatile ("" : : : "memory");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user