add SDHC support in mmc driver
[u-boot-openmoko/mini2440.git] / include / asm-arm / processor.h
blob445d4495be17a96db05417fa08b08f08741ff6b9
1 /*
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.
9 */
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;})
20 #define FP_SIZE 35
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 */
30 union fp_state {
31 struct fp_hard_struct hard;
32 struct fp_soft_struct soft;
35 typedef unsigned long mm_segment_t; /* domain register */
37 #ifdef __KERNEL__
39 #define EISA_bus 0
40 #define MCA_bus 0
41 #define MCA_bus__is_a_macro
43 #include <asm/atomic.h>
44 #include <asm/ptrace.h>
45 #if 0 /* XXX###XXX */
46 #include <asm/arch/memory.h>
47 #endif /* XXX###XXX */
48 #include <asm/proc/processor.h>
49 #include <asm/types.h>
51 union debug_insn {
52 u32 arm;
53 u16 thumb;
56 struct debug_entry {
57 u32 address;
58 union debug_insn insn;
61 struct debug_info {
62 int nsaved;
63 struct debug_entry bp[2];
66 struct thread_struct {
67 atomic_t refcount;
68 /* fault info */
69 unsigned long address;
70 unsigned long trap_no;
71 unsigned long error_code;
72 /* floating point */
73 union fp_state fpstate;
74 /* debugging */
75 struct debug_info debug;
76 /* context info */
77 struct context_save_struct *save;
78 EXTRA_THREAD_STRUCT
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 */
100 struct task_struct;
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) \
117 do { \
118 if (atomic_dec_and_test(&(p)->thread.refcount)) \
119 __free_task_struct((p)); \
120 } while (0)
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);
132 #endif
134 #endif /* __ASM_ARM_PROCESSOR_H */