From c175f2a63eb2510342ca7eb16c214318c8cb9354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sundstr=C3=B6m?= Date: Mon, 17 Aug 2009 20:01:11 +0000 Subject: [PATCH] Adding placeholder machine dependent kernel code for arch mipsel. Copied from src/system/kernel/arch/arm and gutted. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32480 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/arch/mipsel/Jamfile | 35 ++++ src/system/kernel/arch/mipsel/arch_asm.S | 41 +++++ .../kernel/arch/mipsel/arch_commpage.cpp | 25 +++ src/system/kernel/arch/mipsel/arch_cpu.cpp | 171 ++++++++++++++++++ src/system/kernel/arch/mipsel/arch_debug.cpp | 125 +++++++++++++ .../kernel/arch/mipsel/arch_debug_console.cpp | 90 +++++++++ src/system/kernel/arch/mipsel/arch_elf.cpp | 97 ++++++++++ src/system/kernel/arch/mipsel/arch_int.cpp | 90 +++++++++ .../kernel/arch/mipsel/arch_platform.cpp | 41 +++++ .../arch/mipsel/arch_real_time_clock.cpp | 50 +++++ src/system/kernel/arch/mipsel/arch_smp.c | 51 ++++++ .../kernel/arch/mipsel/arch_system_info.cpp | 47 +++++ src/system/kernel/arch/mipsel/arch_thread.c | 149 +++++++++++++++ src/system/kernel/arch/mipsel/arch_timer.cpp | 42 +++++ .../kernel/arch/mipsel/arch_user_debugger.cpp | 111 ++++++++++++ src/system/kernel/arch/mipsel/arch_vm.cpp | 96 ++++++++++ .../arch/mipsel/arch_vm_translation_map.cpp | 94 ++++++++++ 17 files changed, 1355 insertions(+) create mode 100644 src/system/kernel/arch/mipsel/Jamfile create mode 100644 src/system/kernel/arch/mipsel/arch_asm.S create mode 100644 src/system/kernel/arch/mipsel/arch_commpage.cpp create mode 100644 src/system/kernel/arch/mipsel/arch_cpu.cpp create mode 100644 src/system/kernel/arch/mipsel/arch_debug.cpp create mode 100644 src/system/kernel/arch/mipsel/arch_debug_console.cpp create mode 100644 src/system/kernel/arch/mipsel/arch_elf.cpp create mode 100644 src/system/kernel/arch/mipsel/arch_int.cpp create mode 100644 src/system/kernel/arch/mipsel/arch_platform.cpp create mode 100644 src/system/kernel/arch/mipsel/arch_real_time_clock.cpp create mode 100644 src/system/kernel/arch/mipsel/arch_smp.c create mode 100644 src/system/kernel/arch/mipsel/arch_system_info.cpp create mode 100644 src/system/kernel/arch/mipsel/arch_thread.c create mode 100644 src/system/kernel/arch/mipsel/arch_timer.cpp create mode 100644 src/system/kernel/arch/mipsel/arch_user_debugger.cpp create mode 100644 src/system/kernel/arch/mipsel/arch_vm.cpp create mode 100644 src/system/kernel/arch/mipsel/arch_vm_translation_map.cpp diff --git a/src/system/kernel/arch/mipsel/Jamfile b/src/system/kernel/arch/mipsel/Jamfile new file mode 100644 index 0000000000..9987e86466 --- /dev/null +++ b/src/system/kernel/arch/mipsel/Jamfile @@ -0,0 +1,35 @@ +SubDir HAIKU_TOP src system kernel arch mipsel ; + +SubDirHdrs $(SUBDIR) $(DOTDOT) generic ; +UsePrivateKernelHeaders ; + +SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) generic ] ; + + +KernelMergeObject kernel_arch_arm.o : + arch_asm.S +# arch_atomic.c + arch_commpage.cpp + arch_cpu.cpp +# arch_cpu_asm.S + arch_debug_console.cpp + arch_debug.cpp + arch_elf.cpp +# arch_exceptions.S + arch_int.cpp + arch_platform.cpp + arch_real_time_clock.cpp + arch_smp.c + arch_system_info.cpp + arch_thread.c + arch_timer.cpp + arch_user_debugger.cpp + arch_vm.cpp + arch_vm_translation_map.cpp + + generic_vm_physical_page_mapper.cpp + generic_vm_physical_page_ops.cpp + : + $(TARGET_KERNEL_PIC_CCFLAGS) -Wno-unused +; + diff --git a/src/system/kernel/arch/mipsel/arch_asm.S b/src/system/kernel/arch/mipsel/arch_asm.S new file mode 100644 index 0000000000..165b31cbae --- /dev/null +++ b/src/system/kernel/arch/mipsel/arch_asm.S @@ -0,0 +1,41 @@ +/* + * Copyright 2009 Jonas Sundström, jonas@kirilla.com + * Copyright 2009 Wischert, johanneswi@gmail.com + * All rights reserved. Distributed under the terms of the MIT License. + * + * Copyright 2003, Travis Geiselbrecht. All rights reserved. + * Distributed under the terms of the NewOS License. + */ + +#include + +#include + +.text + + +/* void arch_int_enable_interrupts(void) */ +FUNCTION(arch_int_enable_interrupts): + nop +FUNCTION_END(arch_int_enable_interrupts) + + +/* int arch_int_disable_interrupts(void) + */ +FUNCTION(arch_int_disable_interrupts): + nop +FUNCTION_END(arch_int_disable_interrupts) + + +/* void arch_int_restore_interrupts(int oldState) + */ +FUNCTION(arch_int_restore_interrupts): + nop +FUNCTION_END(arch_int_restore_interrupts) + + +/* bool arch_int_are_interrupts_enabled(void) */ +FUNCTION(arch_int_are_interrupts_enabled): + nop +FUNCTION_END(arch_int_are_interrupts_enabled) + diff --git a/src/system/kernel/arch/mipsel/arch_commpage.cpp b/src/system/kernel/arch/mipsel/arch_commpage.cpp new file mode 100644 index 0000000000..cc9e25b831 --- /dev/null +++ b/src/system/kernel/arch/mipsel/arch_commpage.cpp @@ -0,0 +1,25 @@ +/* + * Copyright 2009 Jonas Sundström, jonas@kirilla.com + * Copyright 2009 Johannes Wischert, johanneswi@gmail.com + * Distributed under the terms of the MIT License. + */ + + +#include + + +status_t +arch_commpage_init(void) +{ +#warning IMPLEMENT arch_commpage_init + return B_ERROR; +} + + +status_t +arch_commpage_init_post_cpus(void) +{ +#warning IMPLEMENT arch_commpage_init_post_cpus + return B_ERROR; +} + diff --git a/src/system/kernel/arch/mipsel/arch_cpu.cpp b/src/system/kernel/arch/mipsel/arch_cpu.cpp new file mode 100644 index 0000000000..8aa32167b5 --- /dev/null +++ b/src/system/kernel/arch/mipsel/arch_cpu.cpp @@ -0,0 +1,171 @@ +/* + * Copyright 2009 Jonas Sundström, jonas@kirilla.com + * Copyright 2007 François Revol, revol@free.fr + * Copyright 2003-2005 Axel Dörfler, axeld@pinc-software.de + * Distributed under the terms of the MIT License. + * + * Copyright 2001, Travis Geiselbrecht. All rights reserved. + * Distributed under the terms of the NewOS License. + */ + + +#include + +//#include +#include +#include +#include +#include +#include + + +int arch_cpu_type; +int arch_fpu_type; +int arch_mmu_type; +int arch_platform; + +status_t +arch_cpu_preboot_init_percpu(kernel_args* args, int curr_cpu) +{ +#warning IMPLEMENT arch_cpu_preboot_init_percpu + + // The current thread must be NULL for all CPUs till we have threads. + // Some boot code relies on this. + arch_thread_set_current_thread(NULL); + + return B_ERROR; +} + + +status_t +arch_cpu_init_percpu(kernel_args* args, int curr_cpu) +{ +#warning IMPLEMENT arch_cpu_init_percpu + //detect_cpu(curr_cpu); + + // we only support one anyway... + return 0; +} + + +status_t +arch_cpu_init(kernel_args* args) +{ +#warning IMPLEMENT arch_cpu_init + arch_cpu_type = args->arch_args.cpu_type; + arch_fpu_type = args->arch_args.fpu_type; + arch_mmu_type = args->arch_args.mmu_type; + arch_platform = args->arch_args.platform; + arch_platform = args->arch_args.machine; + + return B_ERROR; +} + + +status_t +arch_cpu_init_post_vm(kernel_args* args) +{ +#warning IMPLEMENT arch_cpu_init_post_vm + return B_ERROR; +} + + +status_t +arch_cpu_init_post_modules(kernel_args* args) +{ +#warning IMPLEMENT arch_cpu_init_post_modules + return B_ERROR; +} + + +void +arch_cpu_sync_icache(void* address, size_t len) +{ +#warning IMPLEMENT arch_cpu_sync_icache +} + + +void +arch_cpu_memory_read_barrier(void) +{ +#warning IMPLEMENT arch_cpu_memory_read_barrier + asm volatile ("nop;" : : : "memory"); +} + + +void +arch_cpu_memory_write_barrier(void) +{ +#warning IMPLEMENT arch_cpu_memory_write_barrier + asm volatile ("nop;" : : : "memory"); +} + + +void +arch_cpu_invalidate_TLB_range(addr_t start, addr_t end) +{ +#warning IMPLEMENT arch_cpu_invalidate_TLB_range +} + + +void +arch_cpu_invalidate_TLB_list(addr_t pages[], int num_pages) +{ +#warning IMPLEMENT arch_cpu_invalidate_TLB_list +} + + +void +arch_cpu_global_TLB_invalidate(void) +{ +#warning IMPLEMENT arch_cpu_global_TLB_invalidate +} + + +void +arch_cpu_user_TLB_invalidate(void) +{ +#warning IMPLEMENT arch_cpu_user_TLB_invalidate +} + + +status_t +arch_cpu_user_memcpy(void* to, const void* from, size_t size, + addr_t* faultHandler) +{ +#warning IMPLEMENT arch_cpu_user_memcpy + return B_BAD_ADDRESS; +} + + +ssize_t +arch_cpu_user_strlcpy(char* to, const char* from, size_t size, + addr_t* faultHandler) +{ +#warning IMPLEMENT arch_cpu_user_strlcpy + return B_BAD_ADDRESS; +} + + +status_t +arch_cpu_user_memset(void* s, char c, size_t count, addr_t* faultHandler) +{ +#warning IMPLEMENT arch_cpu_user_memset + return B_BAD_ADDRESS; +} + + +status_t +arch_cpu_shutdown(bool reboot) +{ +#warning IMPLEMENT arch_cpu_shutdown + return B_ERROR; +} + + +void +arch_cpu_idle(void) +{ +#warning IMPLEMENT arch_cpu_idle +} + diff --git a/src/system/kernel/arch/mipsel/arch_debug.cpp b/src/system/kernel/arch/mipsel/arch_debug.cpp new file mode 100644 index 0000000000..7694aed4d4 --- /dev/null +++ b/src/system/kernel/arch/mipsel/arch_debug.cpp @@ -0,0 +1,125 @@ +/* + * Copyright 2003-2009, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Axel Dörfler + * Ingo Weinhold + * François Revol + * Jonas Sundström + */ + + +#include + +#include +#include +#include +#include +#include +#include + + +struct stack_frame { + struct stack_frame *previous; + addr_t return_address; +}; + + +#define NUM_PREVIOUS_LOCATIONS 32 + + +extern struct iframe_stack gBootFrameStack; + + +// #pragma mark - + + +void +arch_debug_save_registers(int* regs) +{ +#warning IMPLEMENT arch_debug_save_registers +} + + +bool +arch_debug_contains_call(struct thread* thread, const char* symbol, + addr_t start, addr_t end) +{ +#warning IMPLEMENT arch_debug_contains_call + return false; +} + + +void* +arch_debug_get_caller(void) +{ +#warning IMPLEMENT arch_debug_get_caller + return NULL; +} + + +int32 +arch_debug_get_stack_trace(addr_t* returnAddresses, int32 maxCount, + int32 skipIframes, int32 skipFrames, bool userOnly) +{ +#warning IMPLEMENT arch_debug_get_stack_trace + return 0; +} + + +void* +arch_debug_get_interrupt_pc(bool* _isSyscall) +{ +#warning IMPLEMENT arch_debug_get_interrupt_pc + return NULL; +} + + +bool +arch_is_debug_variable_defined(const char* variableName) +{ +#warning IMPLEMENT arch_is_debug_variable_defined + return false; +} + + +status_t +arch_set_debug_variable(const char* variableName, uint64 value) +{ +#warning IMPLEMENT arch_set_debug_variable + return B_ENTRY_NOT_FOUND; +} + + +status_t +arch_get_debug_variable(const char* variableName, uint64* value) +{ +#warning IMPLEMENT arch_get_debug_variable + return B_ENTRY_NOT_FOUND; +} + + +status_t +arch_debug_init(kernel_args* args) +{ +#warning IMPLEMENT arch_debug_init + return B_ERROR; +} + + +void +arch_debug_call_with_fault_handler(cpu_ent* cpu, jmp_buf jumpBuffer, + void (*function)(void*), void* parameter) +{ +#warning IMPLEMENT arch_debug_call_with_fault_handler + longjmp(jumpBuffer, 1); +} + + +void +arch_debug_unset_current_thread(void) +{ +#warning IMPLEMENT arch_debug_unset_current_thread +} + diff --git a/src/system/kernel/arch/mipsel/arch_debug_console.cpp b/src/system/kernel/arch/mipsel/arch_debug_console.cpp new file mode 100644 index 0000000000..0330941bc8 --- /dev/null +++ b/src/system/kernel/arch/mipsel/arch_debug_console.cpp @@ -0,0 +1,90 @@ +/* + * Copyright 2009 Jonas Sundström, jonas@kirilla.com + * Copyright 2007 François Revol, revol@free.fr + * Copyright 2003-2006 Axel Dörfler, axeld@pinc-software.de + * Distributed under the terms of the MIT License. + * + * Copyright 2001, Travis Geiselbrecht. All rights reserved. + * Distributed under the terms of the NewOS License. + */ + + +//#include +#include +#include +#include +#include +#include +#include + + +void +arch_debug_remove_interrupt_handler(uint32 line) +{ +#warning IMPLEMENT arch_debug_remove_interrupt_handler +} + + +void +arch_debug_install_interrupt_handlers(void) +{ +#warning IMPLEMENT arch_debug_install_interrupt_handlers +} + + +char +arch_debug_blue_screen_getchar(void) +{ +#warning IMPLEMENT arch_debug_blue_screen_getchar + return 0; +} + + +char +arch_debug_serial_getchar(void) +{ +#warning IMPLEMENT arch_debug_serial_getchar + return 0; +} + + +void +arch_debug_serial_putchar(const char c) +{ +#warning IMPLEMENT arch_debug_serial_putchar + return 0; +} + + +void +arch_debug_serial_puts(const char* s) +{ + while (*s != '\0') { + arch_debug_serial_putchar(*s); + s++; + } +} + + +void +arch_debug_serial_early_boot_message(const char* string) +{ +#warning IMPLEMENT arch_debug_serial_early_boot_message +} + + +status_t +arch_debug_console_init(kernel_args* args) +{ +#warning IMPLEMENT arch_debug_console_init + return 0; +} + + +status_t +arch_debug_console_init_settings(kernel_args* args) +{ +#warning IMPLEMENT arch_debug_console_init_settings + return B_ERROR; +} + diff --git a/src/system/kernel/arch/mipsel/arch_elf.cpp b/src/system/kernel/arch/mipsel/arch_elf.cpp new file mode 100644 index 0000000000..6339b99c0d --- /dev/null +++ b/src/system/kernel/arch/mipsel/arch_elf.cpp @@ -0,0 +1,97 @@ +/* + * Copyright 2009 Jonas Sundström, jonas@kirilla.com + * Copyright 2009 Johannes Wischert, johanneswi@gmail.com + * Copyright 2005 Ingo Weinhold bonefish@cs.tu-berlin.de + * All rights reserved. Distributed under the terms of the MIT License. + * + * Copyright 2002, Travis Geiselbrecht. All rights reserved. + * Distributed under the terms of the NewOS License. + */ + +#ifdef _BOOT_MODE +#include +#endif + +#include + +#include +#include + + +#define CHATTY 0 + +#ifdef _BOOT_MODE +status_t +boot_arch_elf_relocate_rel(struct preloaded_image *image, + struct Elf32_Rel *rel, int rel_len) +#else +int +arch_elf_relocate_rel(struct elf_image_info *image, + struct elf_image_info *resolve_image, struct Elf32_Rel *rel, int rel_len) +#endif +{ +#warning IMPLEMENT arch_elf_relocate_rel + return B_ERROR; +} + + +static inline void +write_32(addr_t P, Elf32_Word value) +{ + *(Elf32_Word*)P = value; +} + + +static inline void +write_16(addr_t P, Elf32_Word value) +{ + // bits 16:29 + *(Elf32_Half*)P = (Elf32_Half)value; +} + + +static inline bool +write_16_check(addr_t P, Elf32_Word value) +{ + // bits 15:0 + if ((value & 0xffff0000) && (~value & 0xffff8000)) + return false; + *(Elf32_Half*)P = (Elf32_Half)value; + return true; +} + + +static inline bool +write_8(addr_t P, Elf32_Word value) +{ + // bits 7:0 + *(uint8 *)P = (uint8)value; + return true; +} + + +static inline bool +write_8_check(addr_t P, Elf32_Word value) +{ + // bits 7:0 + if ((value & 0xffffff00) && (~value & 0xffffff80)) + return false; + *(uint8 *)P = (uint8)value; + return true; +} + + +#ifdef _BOOT_MODE +status_t +boot_arch_elf_relocate_rela(struct preloaded_image *image, + struct Elf32_Rela *rel, int rel_len) +#else +int +arch_elf_relocate_rela(struct elf_image_info *image, + struct elf_image_info *resolve_image, struct Elf32_Rela *rel, int rel_len) +#endif +{ +#warning IMPLEMENT arch_elf_relocate_rela + return B_ERROR; +} + diff --git a/src/system/kernel/arch/mipsel/arch_int.cpp b/src/system/kernel/arch/mipsel/arch_int.cpp new file mode 100644 index 0000000000..a26f046030 --- /dev/null +++ b/src/system/kernel/arch/mipsel/arch_int.cpp @@ -0,0 +1,90 @@ +/* + * Copyright 2003-2009, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Axel Dörfler + * Ingo Weinhold + * François Revol + * Jonas Sundström + * + * Copyright 2001, Travis Geiselbrecht. All rights reserved. + * Distributed under the terms of the NewOS License. + */ + +#include + +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// defined in arch_exceptions.S +extern int __irqvec_start; +extern int __irqvec_end; + +// current fault handler +addr_t gFaultHandler; + +// An iframe stack used in the early boot process when we don't have +// threads yet. +struct iframe_stack gBootFrameStack; + + +void +arch_int_enable_io_interrupt(int irq) +{ +#warning IMPLEMENT arch_int_enable_io_interrupt +} + + +void +arch_int_disable_io_interrupt(int irq) +{ +#warning IMPLEMENT arch_int_disable_io_interrupt +} + + +static void +print_iframe(struct iframe* frame) +{ +#warning IMPLEMENT print_iframe +} + + +status_t +arch_int_init(kernel_args* args) +{ +#warning IMPLEMENT arch_int_init + return B_ERROR; +} + + +status_t +arch_int_init_post_vm(kernel_args* args) +{ +#warning IMPLEMENT arch_int_init_post_vm + return B_ERROR; +} + + +status_t +arch_int_init_post_device_manager(struct kernel_args* args) +{ +#warning IMPLEMENT arch_int_init_post_device_manager + panic("arch_int_init_post_device_manager()"); + return B_ENTRY_NOT_FOUND; +} + diff --git a/src/system/kernel/arch/mipsel/arch_platform.cpp b/src/system/kernel/arch/mipsel/arch_platform.cpp new file mode 100644 index 0000000000..1939f18caf --- /dev/null +++ b/src/system/kernel/arch/mipsel/arch_platform.cpp @@ -0,0 +1,41 @@ +/* + * Copyright 2009 Jonas Sundström, jonas@kirilla.com + * Copyright 2007 François Revol, revol@free.fr + * Copyright 2006 Ingo Weinhold, bonefish@cs.tu-berlin.de + * All rights reserved. Distributed under the terms of the MIT License. + */ + +//#include + +#include + +#include +#include +#include +#include +#include + + +status_t +arch_platform_init(struct kernel_args* kernelArgs) +{ +#warning IMPLEMENT arch_platform_init + return B_ERROR; +} + + +status_t +arch_platform_init_post_vm(struct kernel_args* kernelArgs) +{ +#warning IMPLEMENT arch_platform_init_post_vm + return B_ERROR; +} + + +status_t +arch_platform_init_post_thread(struct kernel_args* kernelArgs) +{ +#warning IMPLEMENT arch_platform_init_post_thread + return B_ERROR; +} + diff --git a/src/system/kernel/arch/mipsel/arch_real_time_clock.cpp b/src/system/kernel/arch/mipsel/arch_real_time_clock.cpp new file mode 100644 index 0000000000..2e77329faa --- /dev/null +++ b/src/system/kernel/arch/mipsel/arch_real_time_clock.cpp @@ -0,0 +1,50 @@ +/* + * Copyright 2009 Jonas Sundström, jonas@kirilla.com + * Copyright 2007 François Revol, revol@free.fr. + * Copyright 2006 Ingo Weinhold bonefish@cs.tu-berlin.de. All rights reserved. + * Copyright 2005-2007 Axel Dörfler, axeld@pinc-software.de + * Copyright 2003 Jeff Ward, jeff@r2d2.stcloudstate.edu. All rights reserved. + * + * Distributed under the terms of the MIT License. + */ + +#include + + +status_t +arch_rtc_init(kernel_args* args, struct real_time_data* data) +{ +#warning IMPLEMENT arch_rtc_init + return B_ERROR; +} + + +uint32 +arch_rtc_get_hw_time(void) +{ +#warning IMPLEMENT arch_rtc_get_hw_time + return 0; +} + + +void +arch_rtc_set_hw_time(uint32 seconds) +{ +#warning IMPLEMENT arch_rtc_set_hw_time +} + + +void +arch_rtc_set_system_time_offset(struct real_time_data* data, bigtime_t offset) +{ +#warning IMPLEMENT arch_rtc_set_system_time_offset +} + + +bigtime_t +arch_rtc_get_system_time_offset(struct real_time_data* data) +{ +#warning IMPLEMENT arch_rtc_get_system_time_offset + return 0; +} + diff --git a/src/system/kernel/arch/mipsel/arch_smp.c b/src/system/kernel/arch/mipsel/arch_smp.c new file mode 100644 index 0000000000..3d7dd0dc11 --- /dev/null +++ b/src/system/kernel/arch/mipsel/arch_smp.c @@ -0,0 +1,51 @@ +/* + * Copyright 2007-2009, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * François Revol + * Jonas Sundström + * + * Copyright 2004, Axel Dörfler, axeld@pinc-software.de + * Distributed under the terms of the OpenBeOS License. + */ + + +#include + +#include +#include +#include + + +status_t +arch_smp_init(kernel_args* args) +{ +#warning IMPLEMENT arch_smp_init + return B_ERROR; +} + + +status_t +arch_smp_per_cpu_init(kernel_args* args, int32 cpu) +{ +#warning IMPLEMENT arch_smp_per_cpu_init + return B_ERROR; +} + + +void +arch_smp_send_ici(int32 target_cpu) +{ +#warning IMPLEMENT arch_smp_send_ici + panic("called arch_smp_send_ici!\n"); +} + + +void +arch_smp_send_broadcast_ici() +{ +#warning IMPLEMENT arch_smp_send_broadcast_ici + panic("called arch_smp_send_broadcast_ici\n"); +} + diff --git a/src/system/kernel/arch/mipsel/arch_system_info.cpp b/src/system/kernel/arch/mipsel/arch_system_info.cpp new file mode 100644 index 0000000000..00af8b92d6 --- /dev/null +++ b/src/system/kernel/arch/mipsel/arch_system_info.cpp @@ -0,0 +1,47 @@ +/* + * Copyright 2007-2009, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * François Revol + * Jonas Sundström + * + * Copyright 2006, Ingo Weinhold . + * All rights reserved. Distributed under the terms of the MIT License. + */ + +#include + +#include +#include +#include + + +static uint64 sCPUClockFrequency; +static uint64 sBusClockFrequency; +static enum cpu_types sCPUType; +static uint16 sCPURevision; + +status_t +arch_get_system_info(system_info *info, size_t size) +{ + info->cpu_type = sCPUType; + info->cpu_revision = sCPURevision; + + info->cpu_clock_speed = sCPUClockFrequency; + info->bus_clock_speed = sBusClockFrequency; + + return B_OK; +} + + +status_t +arch_system_info_init(struct kernel_args *args) +{ + sCPUClockFrequency = args->arch_args.cpu_frequency; + sBusClockFrequency = args->arch_args.bus_frequency; + sCPUType = args->arch_args.cpu_type; + sCPURevision = args->arch_args.cpu_revision; + + return B_OK; +} diff --git a/src/system/kernel/arch/mipsel/arch_thread.c b/src/system/kernel/arch/mipsel/arch_thread.c new file mode 100644 index 0000000000..7860576c7e --- /dev/null +++ b/src/system/kernel/arch/mipsel/arch_thread.c @@ -0,0 +1,149 @@ +/* + * Copyright 2003-2009 Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Axel Dörfler + * Ingo Weinhold + * François Revol + * Jonas Sundström + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +static struct arch_thread sInitialState; + + +status_t +arch_thread_init(struct kernel_args *args) +{ +#warning IMPLEMENT arch_thread_init + return B_ERROR; +} + + +status_t +arch_team_init_team_struct(struct team *team, bool kernel) +{ +#warning IMPLEMENT arch_team_init_team_struct + return B_ERROR; +} + + +status_t +arch_thread_init_thread_struct(struct thread *thread) +{ +#warning IMPLEMENT arch_thread_init_thread_struct + return B_ERROR; +} + + +status_t +arch_thread_init_kthread_stack(struct thread *t, int (*start_func)(void), + void (*entry_func)(void), void (*exit_func)(void)) +{ +#warning IMPLEMENT arch_thread_init_kthread_stack + return B_ERROR; +} + + +status_t +arch_thread_init_tls(struct thread *thread) +{ +#warning IMPLEMENT arch_thread_init_tls + return B_ERROR; +} + + +void +arch_thread_switch_kstack_and_call(struct thread *t, addr_t newKstack, + void (*func)(void *), void *arg) +{ +#warning IMPLEMENT arch_thread_switch_kstack_and_call +} + + +void +arch_thread_context_switch(struct thread *from, struct thread *to) +{ +#warning IMPLEMENT arch_thread_context_switch +} + + +void +arch_thread_dump_info(void *info) +{ +#warning IMPLEMENT arch_thread_dump_info +} + + +status_t +arch_thread_enter_userspace(struct thread *thread, addr_t entry, void *arg1, + void *arg2) +{ +#warning IMPLEMENT arch_thread_enter_userspace + panic("arch_thread_enter_uspace(): not yet implemented\n"); + return B_ERROR; +} + + +bool +arch_on_signal_stack(struct thread *thread) +{ +#warning IMPLEMENT arch_on_signal_stack + return false; +} + + +status_t +arch_setup_signal_frame(struct thread *thread, struct sigaction *sa, int sig, + int sigMask) +{ +#warning IMPLEMENT arch_setup_signal_frame + return B_ERROR; +} + + +int64 +arch_restore_signal_frame(void) +{ +#warning IMPLEMENT arch_restore_signal_frame + return 0; +} + + +void +arch_check_syscall_restart(struct thread *thread) +{ +#warning IMPLEMENT arch_check_syscall_restart +} + + +void +arch_store_fork_frame(struct arch_fork_arg *arg) +{ +#warning IMPLEMENT arch_store_fork_frame +} + + +void +arch_restore_fork_frame(struct arch_fork_arg *arg) +{ +#warning IMPLEMENT arch_restore_fork_frame +} + diff --git a/src/system/kernel/arch/mipsel/arch_timer.cpp b/src/system/kernel/arch/mipsel/arch_timer.cpp new file mode 100644 index 0000000000..8dec8ce766 --- /dev/null +++ b/src/system/kernel/arch/mipsel/arch_timer.cpp @@ -0,0 +1,42 @@ +/* + * Copyright 2007-2009 Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * François Revol + * Jonas Sundström + * + * Copyright 2001, Travis Geiselbrecht. All rights reserved. + * Distributed under the terms of the NewOS License. + */ + + +#include +#include +#include + +#include +#include + + +void +arch_timer_set_hardware_timer(bigtime_t timeout) +{ +#warning IMPLEMENT arch_timer_set_hardware_timer +} + + +void +arch_timer_clear_hardware_timer() +{ +#warning IMPLEMENT arch_timer_clear_hardware_timer +} + + +int +arch_init_timer(kernel_args* args) +{ +#warning IMPLEMENT arch_init_timer + return 0; +} + diff --git a/src/system/kernel/arch/mipsel/arch_user_debugger.cpp b/src/system/kernel/arch/mipsel/arch_user_debugger.cpp new file mode 100644 index 0000000000..9b75be6bfc --- /dev/null +++ b/src/system/kernel/arch/mipsel/arch_user_debugger.cpp @@ -0,0 +1,111 @@ +/* + * Copyright 2009 Jonas Sundström, jonas@kirilla.com + * Copyright 2007 François Revol, revol@free.fr + * Copyright 2005 Axel Dörfler, axeld@pinc-softare.de + * Distributed under the terms of the MIT License. + */ + + +#include +#include +#include +#include + + +void +arch_clear_team_debug_info(struct arch_team_debug_info* info) +{ +#warning IMPLEMENT arch_clear_team_debug_info +} + + +void +arch_destroy_team_debug_info(struct arch_team_debug_info* info) +{ + arch_clear_team_debug_info(info); +} + + +void +arch_clear_thread_debug_info(struct arch_thread_debug_info* info) +{ +#warning IMPLEMENT arch_clear_thread_debug_info +} + + +void +arch_destroy_thread_debug_info(struct arch_thread_debug_info* info) +{ + arch_clear_thread_debug_info(info); +} + + +void +arch_update_thread_single_step() +{ +#warning IMPLEMENT arch_update_thread_single_step +} + + +void +arch_set_debug_cpu_state(const debug_cpu_state* cpuState) +{ +#warning IMPLEMENT arch_set_debug_cpu_state +} + + +void +arch_get_debug_cpu_state(debug_cpu_state* cpuState) +{ +#warning IMPLEMENT arch_get_debug_cpu_state +} + + +status_t +arch_get_thread_debug_cpu_state(struct thread* thread, + debug_cpu_state* cpuState) +{ +#warning IMPLEMENT arch_get_thread_debug_cpu_state + return B_ERROR; +} + + +status_t +arch_set_breakpoint(void* address) +{ +#warning IMPLEMENT arch_set_breakpoint + return B_ERROR; +} + + +status_t +arch_clear_breakpoint(void* address) +{ +#warning IMPLEMENT arch_clear_breakpoint + return B_ERROR; +} + + +status_t +arch_set_watchpoint(void* address, uint32 type, int32 length) +{ +#warning IMPLEMENT arch_set_watchpoint + return B_ERROR; +} + + +status_t +arch_clear_watchpoint(void* address) +{ +#warning IMPLEMENT arch_clear_watchpoint + return B_ERROR; +} + + +bool +arch_has_breakpoints(struct arch_team_debug_info* info) +{ +#warning IMPLEMENT arch_has_breakpoints + return false; +} + diff --git a/src/system/kernel/arch/mipsel/arch_vm.cpp b/src/system/kernel/arch/mipsel/arch_vm.cpp new file mode 100644 index 0000000000..f02debd64d --- /dev/null +++ b/src/system/kernel/arch/mipsel/arch_vm.cpp @@ -0,0 +1,96 @@ +/* + * Copyright 2009 Jonas Sundström, jonas@kirilla.com + * Copyright 2007 François Revol, revol@free.fr + * Copyright 2003-2005 Axel Dörfler, axeld@pinc-software.de + * Distributed under the terms of the MIT License. + * + * Copyright 2001, Travis Geiselbrecht. All rights reserved. + * Distributed under the terms of the NewOS License. + */ + +#include + +#include +#include + +#include +#include +#include + + +//#define TRACE_ARCH_VM +#ifdef TRACE_ARCH_VM +# define TRACE(x) dprintf x +#else +# define TRACE(x) ; +#endif + +status_t +arch_vm_init(kernel_args* args) +{ +#warning IMPLEMENT arch_vm_init + return B_ERROR; +} + + +status_t +arch_vm_init2(kernel_args* args) +{ +#warning IMPLEMENT arch_vm_init2 + return B_ERROR; +} + + +status_t +arch_vm_init_post_area(kernel_args* args) +{ +#warning IMPLEMENT arch_vm_init_post_area + return B_ERROR; +} + + +status_t +arch_vm_init_end(kernel_args* args) +{ +#warning IMPLEMENT arch_vm_init_end + return B_ERROR; +} + + +status_t +arch_vm_init_post_modules(kernel_args* args) +{ +#warning IMPLEMENT arch_vm_init_post_modules + return B_ERROR; +} + + +void +arch_vm_aspace_swap(struct vm_address_space* from, struct vm_address_space* to) +{ +#warning IMPLEMENT arch_vm_aspace_swap +} + + +bool +arch_vm_supports_protection(uint32 protection) +{ +#warning IMPLEMENT arch_vm_supports_protection + return true; +} + + +void +arch_vm_unset_memory_type(vm_area* area) +{ +#warning IMPLEMENT arch_vm_unset_memory_type +} + + +status_t +arch_vm_set_memory_type(vm_area* area, addr_t physicalBase, uint32 type) +{ +#warning IMPLEMENT arch_vm_set_memory_type + return B_ERROR; +} + diff --git a/src/system/kernel/arch/mipsel/arch_vm_translation_map.cpp b/src/system/kernel/arch/mipsel/arch_vm_translation_map.cpp new file mode 100644 index 0000000000..cd179ef887 --- /dev/null +++ b/src/system/kernel/arch/mipsel/arch_vm_translation_map.cpp @@ -0,0 +1,94 @@ +/* + * Copyright 2009 Jonas Sundström, jonas@kirilla.com + * Copyright 2007 François Revol, revol@free.fr + * Copyright 2003-2007 Axel Dörfler, axeld@pinc-software.de + * Distributed under the terms of the MIT License. + * + * Copyright 2001, Travis Geiselbrecht. All rights reserved. + * Distributed under the terms of the NewOS License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "generic_vm_physical_page_mapper.h" + + +// #pragma mark - +// VM API + + +status_t +arch_vm_translation_map_init_map(vm_translation_map* map, bool kernel) +{ +#warning IMPLEMENT arch_vm_translation_map_init_map + return NULL; +} + + +status_t +arch_vm_translation_map_init_kernel_map_post_sem(vm_translation_map* map) +{ +#warning IMPLEMENT arch_vm_translation_map_init_kernel_map_post_sem + return NULL; +} + + +status_t +arch_vm_translation_map_init(kernel_args* args) +{ +#warning IMPLEMENT arch_vm_translation_map_init + return NULL; +} + + +status_t +arch_vm_translation_map_init_post_area(kernel_args* args) +{ +#warning IMPLEMENT arch_vm_translation_map_init_post_area + return NULL; +} + + +status_t +arch_vm_translation_map_init_post_sem(kernel_args* args) +{ +#warning IMPLEMENT arch_vm_translation_map_init_post_sem + return NULL; +} + + +status_t +arch_vm_translation_map_early_map(kernel_args* ka, addr_t virtualAddress, + addr_t physicalAddress, uint8 attributes, + addr_t (*get_free_page)(kernel_args* )) +{ +#warning IMPLEMENT arch_vm_translation_map_early_map + return NULL; +} + + +status_t +arch_vm_translation_map_early_query(addr_t va, addr_t* out_physical) +{ +#warning IMPLEMENT arch_vm_translation_map_early_query + return NULL; +} + + +bool +arch_vm_translation_map_is_kernel_page_accessible(addr_t virtualAddress, + uint32 protection) +{ +#warning IMPLEMENT arch_vm_translation_map_is_kernel_page_accessible + return TRUE; +} +