]>
git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blob - include/asm-arm/processor.h
2 * linux/include/asm-arm/processor.h
4 * Copyright (C) 1995-1999 Russell King
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
11 #ifndef __ASM_ARM_PROCESSOR_H
12 #define __ASM_ARM_PROCESSOR_H
15 * Default implementation of macro that returns current
16 * instruction pointer ("program counter").
18 #define current_text_addr() ({ __label__ _l; _l: &&_l;})
22 #include <asm/ptrace.h>
23 #include <asm/procinfo.h>
24 #include <asm/types.h>
26 #define KERNEL_STACK_SIZE PAGE_SIZE
35 union debug_insn insn
;
40 struct debug_entry bp
[2];
43 struct thread_struct
{
45 unsigned long address
;
46 unsigned long trap_no
;
47 unsigned long error_code
;
49 struct debug_info debug
;
52 #define INIT_THREAD { }
54 #define start_thread(regs,pc,sp) \
56 unsigned long *stack = (unsigned long *)sp; \
58 memzero(regs->uregs, sizeof(regs->uregs)); \
59 if (current->personality & ADDR_LIMIT_32BIT) \
60 regs->ARM_cpsr = USR_MODE; \
62 regs->ARM_cpsr = USR26_MODE; \
63 if (elf_hwcap & HWCAP_THUMB && pc & 1) \
64 regs->ARM_cpsr |= PSR_T_BIT; \
65 regs->ARM_pc = pc & ~1; /* pc */ \
66 regs->ARM_sp = sp; /* sp */ \
67 regs->ARM_r2 = stack[2]; /* r2 (envp) */ \
68 regs->ARM_r1 = stack[1]; /* r1 (argv) */ \
69 regs->ARM_r0 = stack[0]; /* r0 (argc) */ \
72 /* Forward declaration, a strange C thing */
75 /* Free all resources held by a thread. */
76 extern void release_thread(struct task_struct
*);
78 /* Prepare to copy thread state - unlazy all lazy status */
79 #define prepare_to_copy(tsk) do { } while (0)
81 unsigned long get_wchan(struct task_struct
*p
);
83 #define cpu_relax() barrier()
86 * Create a new kernel thread
88 extern int kernel_thread(int (*fn
)(void *), void *arg
, unsigned long flags
);
90 #define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1019])
91 #define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1017])
94 * Prefetching support - only ARMv5.
96 #if __LINUX_ARM_ARCH__ >= 5
98 #define ARCH_HAS_PREFETCH
99 #define prefetch(ptr) \
101 __asm__ __volatile__( \
104 : "o" (*(char *)(ptr)) \
108 #define ARCH_HAS_PREFETCHW
109 #define prefetchw(ptr) prefetch(ptr)
111 #define ARCH_HAS_SPINLOCK_PREFETCH
112 #define spin_lock_prefetch(x) do { } while (0)
118 #endif /* __ASM_ARM_PROCESSOR_H */