Some header cleanups.

Renamed dbg_save_registers() to arch_...() since it's arch dependent.
Removed unnecessary dependencies to stage2.h.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3138 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2003-05-03 14:12:16 +00:00
parent ec639282c8
commit c17f45d123
13 changed files with 66 additions and 57 deletions

View File

@ -8,7 +8,7 @@
#include <kernel.h>
#include <ktypes.h>
#include <stage2.h>
#include <boot/stage2.h>
#define PAGE_ALIGN(x) (((x) + (PAGE_SIZE-1)) & ~(PAGE_SIZE-1))

View File

@ -2,15 +2,14 @@
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _NEWOS_KERNEL_ARCH_DBG_CONSOLE
#define _NEWOS_KERNEL_ARCH_DBG_CONSOLE
#ifndef KERNEL_DBG_CONSOLE_H
#define KERNEL_DBG_CONSOLE_H
#include <stage2.h>
struct kernel_args;
char arch_dbg_con_read(void);
char arch_dbg_con_putch(char c);
void arch_dbg_con_puts(const char *s);
int arch_dbg_con_init(kernel_args *ka);
#endif
int arch_dbg_con_init(struct kernel_args *ka);
#endif /* KERNEL_DBG_CONSOLE_H */

View File

@ -6,5 +6,6 @@
#define _KERNEL_ARCH_DEBUG_H
int arch_dbg_init(kernel_args *ka);
void arch_dbg_save_registers(int *);
#endif /* _KERNEL_ARCH_DEBUG_H */

View File

@ -14,6 +14,6 @@ extern int arch_elf_relocate_rel(struct elf_image_info *image, const char *sym_p
extern int arch_elf_relocate_rela(struct elf_image_info *image, const char *sym_prepend,
struct elf_image_info *resolve_image, struct Elf32_Rela *rel, int rel_len);
//#include <arch_elf.h>
#include <arch_elf.h>
#endif /* _KERNEL_ARCH_ELF_H */

View File

@ -2,13 +2,12 @@
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _NEWOS_KERNEL_ARCH_FAULTS
#define _NEWOS_KERNEL_ARCH_FAULTS
#ifndef KERNEL_ARCH_FAULTS_H
#define KERNEL_ARCH_FAULTS_H
#include <stage2.h>
struct kernel_args;
int faults_init(kernel_args *ka);
int arch_faults_init(kernel_args *ka);
#endif
#endif /* KERNEL_ARCH_FAULTS_H */

View File

@ -2,11 +2,10 @@
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _NEWOS_KERNEL_ARCH_INT_H
#define _NEWOS_KERNEL_ARCH_INT_H
#ifndef KERNEL_ARCH_INT_H
#define KERNEL_ARCH_INT_H
#include <ktypes.h>
#include <stage2.h>
#include <boot/stage2.h>
int arch_int_init(kernel_args *ka);
int arch_int_init2(kernel_args *ka);
@ -18,5 +17,4 @@ void arch_int_enable_io_interrupt(int irq);
void arch_int_disable_io_interrupt(int irq);
bool arch_int_is_interrupts_enabled(void);
#endif
#endif /* KERNEL_ARCH_INT_H */

View File

@ -2,18 +2,20 @@
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _NEWOS_KERNEL_ARCH_SMP_H
#define _NEWOS_KERNEL_ARCH_SMP_H
#ifndef KERNEL_ARCH_SMP_H
#define KERNEL_ARCH_SMP_H
#include <kernel.h>
#include <stage2.h>
struct kernel_args;
// must match MAX_BOOT_CPUS in stage2.h
#define SMP_MAX_CPUS MAX_BOOT_CPUS
int arch_smp_init(kernel_args *ka);
int arch_smp_init(struct kernel_args *ka);
void arch_smp_send_ici(int target_cpu);
void arch_smp_send_broadcast_ici(void);
#endif
#endif /* KERNEL_ARCH_SMP_H */

View File

@ -37,7 +37,6 @@
*/
#include <sys/types.h>
#include <sys/cdefs.h>
#include <sys/stat.h>
#ifdef __STDC__
#include <machine/stdarg.h>

View File

@ -2,8 +2,8 @@
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _KERNEL_ARCH_THREAD_H
#define _KERNEL_ARCH_THREAD_H
#ifndef KERNEL_ARCH_THREAD_H
#define KERNEL_ARCH_THREAD_H
#include <thread.h>
@ -16,8 +16,13 @@ void arch_thread_dump_info(void *info);
void arch_thread_enter_uspace(struct thread *t, addr entry, void *args1, void *args2);
void arch_thread_switch_kstack_and_call(struct thread *t, addr new_kstack, void (*func)(void *), void *arg);
//struct thread *arch_thread_get_current_thread(void);
//void arch_thread_set_current_thread(struct thread *t);
// ToDo: doing this this way is an ugly hack - please fix me!
// (those functions are "static inline" for x86 - since
// "extern inline" doesn't work for "gcc -g"...)
#ifndef ARCH_x86
struct thread *arch_thread_get_current_thread(void);
void arch_thread_set_current_thread(struct thread *t);
#endif
void arch_setup_signal_frame(struct thread *t, struct sigaction *sa, int sig, int sig_mask);
int64 arch_restore_signal_frame(void);
@ -26,4 +31,4 @@ void arch_check_syscall_restart(struct thread *t);
// for any inline overrides
#include <arch_thread.h>
#endif /* _KERNEL_ARCH_THREAD_H */
#endif /* KERNEL_ARCH_THREAD_H */

View File

@ -2,8 +2,8 @@
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _NEWOS_KERNEL_ARCH_THREAD_STRUCT_H
#define _NEWOS_KERNEL_ARCH_THREAD_STRUCT_H
#ifndef KERNEL_ARCH_THREAD_STRUCT_H
#define KERNEL_ARCH_THREAD_STRUCT_H
#ifdef ARCH_x86
#include <arch/x86/thread_struct.h>
@ -27,5 +27,4 @@
#include <arch/m68k/thread_struct.h>
#endif
#endif
#endif /* KERNEL_ARCH_THREAD_STRUCT_H */

View File

@ -2,14 +2,16 @@
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _NEWOS_KERNEL_ARCH_TIMER_H
#define _NEWOS_KERNEL_ARCH_TIMER_H
#ifndef KERNEL_ARCH_TIMER_H
#define KERNEL_ARCH_TIMER_H
#include <SupportDefs.h>
struct kernel_args;
#include <stage2.h>
void arch_timer_set_hardware_timer(bigtime_t timeout);
void arch_timer_clear_hardware_timer(void);
int arch_init_timer(kernel_args *ka);
#endif
int arch_init_timer(struct kernel_args *ka);
#endif /* KERNEL_ARCH_TIMER_H */

View File

@ -2,16 +2,17 @@
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _NEWOS_KERNEL_ARCH_VM_H
#define _NEWOS_KERNEL_ARCH_VM_H
#ifndef KERNEL_ARCH_VM_H
#define KERNEL_ARCH_VM_H
#include <stage2.h>
#include <vm.h>
int arch_vm_init(kernel_args *ka);
int arch_vm_init2(kernel_args *ka);
int arch_vm_init_endvm(kernel_args *ka);
struct kernel_args;
int arch_vm_init(struct kernel_args *ka);
int arch_vm_init2(struct kernel_args *ka);
int arch_vm_init_endvm(struct kernel_args *ka);
void arch_vm_aspace_swap(vm_address_space *aspace);
#endif
#endif /* KERNEL_ARCH_VM_H */

View File

@ -2,13 +2,16 @@
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _NEWOS_KERNEL_ARCH_VM_TRANSLATION_MAP_H
#define _NEWOS_KERNEL_ARCH_VM_TRANSLATION_MAP_H
#ifndef KERNEL_ARCH_VM_TRANSLATION_MAP_H
#define KERNEL_ARCH_VM_TRANSLATION_MAP_H
#include <kernel.h>
#include <stage2.h>
#include <lock.h>
struct kernel_args;
typedef struct vm_translation_map_struct {
struct vm_translation_map_struct *next;
struct vm_translation_map_ops_struct *ops;
@ -34,15 +37,16 @@ typedef struct vm_translation_map_ops_struct {
} vm_translation_map_ops;
int vm_translation_map_create(vm_translation_map *new_map, bool kernel);
int vm_translation_map_module_init(kernel_args *ka);
int vm_translation_map_module_init2(kernel_args *ka);
void vm_translation_map_module_init_post_sem(kernel_args *ka);
int vm_translation_map_module_init(struct kernel_args *ka);
int vm_translation_map_module_init2(struct kernel_args *ka);
void vm_translation_map_module_init_post_sem(struct kernel_args *ka);
// quick function to map a page in regardless of map context. Used in VM initialization,
// before most vm data structures exist
int vm_translation_map_quick_map(kernel_args *ka, addr va, addr pa, unsigned int attributes, addr (*get_free_page)(kernel_args *));
int vm_translation_map_quick_map(struct kernel_args *ka, addr va, addr pa,
unsigned int attributes, addr (*get_free_page)(kernel_args *));
// quick function to return the physical pgdir of a mapping, needed for a context switch
addr vm_translation_map_get_pgdir(vm_translation_map *map);
#endif
#endif /* KERNEL_VM_TRANSLATION_MAP_H */