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