1/* 2 * Copyright 2002-2005, Axel Dörfler, axeld@pinc-software.de. 3 * Distributed under the terms of the MIT License. 4 * 5 * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. 6 * Distributed under the terms of the NewOS License. 7 */ 8#ifndef _KERNEL_ARCH_CPU_H 9#define _KERNEL_ARCH_CPU_H 10 11 12#include <OS.h> 13 14 15#define PAGE_ALIGN(x) (((x) + (B_PAGE_SIZE - 1)) & ~(B_PAGE_SIZE - 1)) 16 17 18struct kernel_args; 19 20 21#ifdef __cplusplus 22extern "C" { 23#endif 24 25status_t arch_cpu_preboot_init_percpu(struct kernel_args *args, int curr_cpu); 26status_t arch_cpu_init(struct kernel_args *args); 27status_t arch_cpu_init_percpu(struct kernel_args *args, int curr_cpu); 28status_t arch_cpu_init_post_vm(struct kernel_args *args); 29status_t arch_cpu_init_post_modules(struct kernel_args *args); 30status_t arch_cpu_shutdown(bool reboot); 31 32void arch_cpu_invalidate_TLB_range(addr_t start, addr_t end); 33void arch_cpu_invalidate_TLB_list(addr_t pages[], int num_pages); 34void arch_cpu_user_TLB_invalidate(void); 35void arch_cpu_global_TLB_invalidate(void); 36 37void arch_cpu_sync_icache(void *address, size_t length); 38 39 40#ifdef __cplusplus 41} 42#endif 43 44#include <arch_cpu.h> 45 46#define CACHE_LINE_ALIGN __attribute__((aligned(CACHE_LINE_SIZE))) 47 48#endif /* _KERNEL_ARCH_CPU_H */ 49