ARM: add ISA support code

This commit is contained in:
Ithamar R. Adema
2012-11-22 00:00:16 +01:00
parent 39b546702c
commit e25f9cbb24
3 changed files with 121 additions and 0 deletions
@@ -0,0 +1,12 @@
SubDir HAIKU_TOP src add-ons kernel bus_managers isa arch arm ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) $(DOTDOT) ] ;
UsePrivateHeaders kernel [ FDirName kernel arch arm ] ;
UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_BOOT_PLATFORM) ] ;
KernelStaticLibrary isa_arch_bus_manager :
isa_dma.c
isa_controller.c
;
@@ -0,0 +1,84 @@
/*
* Copyright 2007 Haiku, Inc.
* Distributed under the terms of the MIT License.
*
* arch-specific config manager
*
* Authors (in chronological order):
* François Revol ([email protected])
*/
#include <KernelExport.h>
#include "ISA.h"
#include "arch_cpu.h"
#include "isa_arch.h"
//#define TRACE_ISA
#ifdef TRACE_ISA
# define TRACE(x) dprintf x
#else
# define TRACE(x) ;
#endif
uint8
arch_isa_read_io_8(int mapped_io_addr)
{
uint8 value = in8(mapped_io_addr);
TRACE(("isa_read8(%x->%x)\n", mapped_io_addr, value));
return value;
}
void
arch_isa_write_io_8(int mapped_io_addr, uint8 value)
{
TRACE(("isa_write8(%x->%x)\n", value, mapped_io_addr));
out8(value, mapped_io_addr);
}
uint16
arch_isa_read_io_16(int mapped_io_addr)
{
return in16(mapped_io_addr);
}
void
arch_isa_write_io_16(int mapped_io_addr, uint16 value)
{
out16(value, mapped_io_addr);
}
uint32
arch_isa_read_io_32(int mapped_io_addr)
{
return in32(mapped_io_addr);
}
void
arch_isa_write_io_32(int mapped_io_addr, uint32 value)
{
out32(value, mapped_io_addr);
}
void *
arch_isa_ram_address(const void *physical_address_in_system_memory)
{
// this is what the BeOS kernel does
return (void *)physical_address_in_system_memory;
}
status_t
arch_isa_init(void)
{
return B_OK;
}
@@ -0,0 +1,25 @@
/*
* Copyright 2007 Haiku, Inc.
* Distributed under the terms of the MIT License.
*
* arch-specific config manager
*
* Authors (in chronological order):
* François Revol ([email protected])
*/
#include <KernelExport.h>
#include "ISA.h"
#include "arch_cpu.h"
#include "isa_arch.h"
status_t
arch_start_isa_dma(long channel, void *buf, long transfer_count,
uchar mode, uchar e_mode)
{
// ToDo: implement this?!
return B_NOT_ALLOWED;
}