summaryrefslogtreecommitdiffhomepage
path: root/Kernel/HALKit/POWER/Processor.hpp
blob: ece50c4472ed5f729e4a3ec58adfee9c31cefae7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* -------------------------------------------

	Copyright SoftwareLabs

	Purpose: POWER processor header.

------------------------------------------- */

#pragma once

#include <NewKit/Defines.hpp>
#include <NewKit/Utils.hpp>

#define kHalPPCAlignment __attribute__((aligned(4)))

namespace NewOS::HAL
{
	typedef UIntPtr Reg;

	struct kHalPPCAlignment StackFrame
	{
		Reg R0;
		Reg R1;
		Reg R2;
		Reg R3;
		Reg R4;
		Reg R5;
		Reg R6;
		Reg R7;
		Reg R8;
		Reg PC;
		Reg SP;
	};

	typedef StackFrame* StackFramePtr;

	inline void rt_halt()
	{
		while (1)
		{
			asm volatile("mr 0, 0"); // no oop.
		}
	}

	inline void rt_cli()
	{
		asm volatile("mr 0, 0"); // no oop
	}
} // namespace NewOS::HAL

EXTERN_C void int_handle_math(NewOS::UIntPtr sp);
EXTERN_C void int_handle_pf(NewOS::UIntPtr sp);

/// @brief Flush system TLB.
EXTERN_C void hal_flush_tlb();