xref: /haiku/src/add-ons/kernel/bus_managers/isa/arch/arm64/isa_controller.c (revision 13581b3d2a71545960b98fefebc5225b5bf29072)
1 /*
2  * Copyright 2007 Haiku, Inc.
3  * Distributed under the terms of the MIT License.
4  *
5  * arch-specific config manager
6  *
7  * Authors (in chronological order):
8  *              François Revol (revol@free.fr)
9  */
10 
11 
12 #include <KernelExport.h>
13 #include "ISA.h"
14 #include "arch_cpu.h"
15 #include "isa_arch.h"
16 
17 //#define TRACE_ISA
18 #ifdef TRACE_ISA
19 #       define TRACE(x) dprintf x
20 #else
21 #       define TRACE(x) ;
22 #endif
23 
24 
25 uint8
26 arch_isa_read_io_8(int mapped_io_addr)
27 {
28 	uint8 value = in8(mapped_io_addr);
29 
30 	TRACE(("isa_read8(%x->%x)\n", mapped_io_addr, value));
31 
32 	return value;
33 }
34 
35 
36 void
37 arch_isa_write_io_8(int mapped_io_addr, uint8 value)
38 {
39 	TRACE(("isa_write8(%x->%x)\n", value, mapped_io_addr));
40 
41 	out8(value, mapped_io_addr);
42 }
43 
44 
45 uint16
46 arch_isa_read_io_16(int mapped_io_addr)
47 {
48 	return in16(mapped_io_addr);
49 }
50 
51 
52 void
53 arch_isa_write_io_16(int mapped_io_addr, uint16 value)
54 {
55 	out16(value, mapped_io_addr);
56 }
57 
58 
59 uint32
60 arch_isa_read_io_32(int mapped_io_addr)
61 {
62 	return in32(mapped_io_addr);
63 }
64 
65 
66 void
67 arch_isa_write_io_32(int mapped_io_addr, uint32 value)
68 {
69 	out32(value, mapped_io_addr);
70 }
71 
72 
73 phys_addr_t
74 arch_isa_ram_address(phys_addr_t physical_address_in_system_memory)
75 {
76 	// this is what the BeOS kernel does
77 	return physical_address_in_system_memory;
78 }
79 
80 
81 status_t
82 arch_isa_init(void)
83 {
84 	return B_OK;
85 }
86