2 * linux/include/asm-arm/processor.h
4 * Copyright (C) 1995-2002 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 struct fp_hard_struct {
23 unsigned int save[FP_SIZE]; /* as yet undefined */
26 struct fp_soft_struct {
27 unsigned int save[FP_SIZE]; /* undefined information */
31 struct fp_hard_struct hard;
32 struct fp_soft_struct soft;
35 typedef unsigned long mm_segment_t; /* domain register */
41 #define MCA_bus__is_a_macro
43 #include <asm/atomic.h>
44 #include <asm/ptrace.h>
46 #include <asm/arch/memory.h>
47 #endif /* XXX###XXX */
48 #include <asm/proc-armv/processor.h>
49 #include <asm/types.h>
58 union debug_insn insn;
63 struct debug_entry bp[2];
66 struct thread_struct {
69 unsigned long address;
70 unsigned long trap_no;
71 unsigned long error_code;
73 union fp_state fpstate;
75 struct debug_info debug;
77 struct context_save_struct *save;
81 #define INIT_THREAD { \
82 refcount: ATOMIC_INIT(1), \
83 EXTRA_THREAD_STRUCT_INIT \
87 * Return saved PC of a blocked thread.
89 static inline unsigned long thread_saved_pc(struct thread_struct *t)
91 return t->save ? pc_pointer(t->save->pc) : 0;
94 static inline unsigned long thread_saved_fp(struct thread_struct *t)
96 return t->save ? t->save->fp : 0;
99 /* Forward declaration, a strange C thing */
102 /* Free all resources held by a thread. */
103 extern void release_thread(struct task_struct *);
105 /* Copy and release all segment info associated with a VM */
106 #define copy_segments(tsk, mm) do { } while (0)
107 #define release_segments(mm) do { } while (0)
109 unsigned long get_wchan(struct task_struct *p);
111 #define THREAD_SIZE (8192)
113 extern struct task_struct *alloc_task_struct(void);
114 extern void __free_task_struct(struct task_struct *);
115 #define get_task_struct(p) atomic_inc(&(p)->thread.refcount)
116 #define free_task_struct(p) \
118 if (atomic_dec_and_test(&(p)->thread.refcount)) \
119 __free_task_struct((p)); \
122 #define init_task (init_task_union.task)
123 #define init_stack (init_task_union.stack)
125 #define cpu_relax() barrier()
128 * Create a new kernel thread
130 extern int arch_kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
134 #endif /* __ASM_ARM_PROCESSOR_H */