xref: /haiku/headers/private/kernel/arch/cpu.h (revision fef6144999c2fa611f59ee6ffe6dd7999501385c)
1 /*
2  * Copyright 2002-2004, 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 #include <boot/kernel_args.h>
14 
15 
16 #define PAGE_ALIGN(x) (((x) + (B_PAGE_SIZE - 1)) & ~(B_PAGE_SIZE - 1))
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 status_t arch_cpu_preboot_init(kernel_args *args);
23 status_t arch_cpu_init(kernel_args *args);
24 status_t arch_cpu_init_post_vm(kernel_args *args);
25 status_t arch_cpu_shutdown(bool reboot);
26 
27 void arch_cpu_invalidate_TLB_range(addr_t start, addr_t end);
28 void arch_cpu_invalidate_TLB_list(addr_t pages[], int num_pages);
29 void arch_cpu_global_TLB_invalidate(void);
30 
31 status_t arch_cpu_user_memcpy(void *to, const void *from, size_t size, addr_t *faultHandler);
32 ssize_t arch_cpu_user_strlcpy(char *to, const char *from, size_t size, addr_t *faultHandler);
33 status_t arch_cpu_user_memset(void *s, char c, size_t count, addr_t *faultHandler);
34 
35 void arch_cpu_idle(void);
36 void arch_cpu_sync_icache(void *address, size_t length);
37 
38 #ifdef __cplusplus
39 }
40 #endif
41 
42 #include <arch_cpu.h>
43 
44 #endif /* _KERNEL_ARCH_CPU_H */
45