~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Linux/include/asm-arm/processor.h

Version: ~ [ 2.4.0 ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  *  linux/include/asm-arm/processor.h
  3  *
  4  *  Copyright (C) 1995 Russell King
  5  *
  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  */
 10 
 11 #ifndef __ASM_ARM_PROCESSOR_H
 12 #define __ASM_ARM_PROCESSOR_H
 13 
 14 /*
 15  * Default implementation of macro that returns current
 16  * instruction pointer ("program counter").
 17  */
 18 #define current_text_addr() ({ __label__ _l; _l: &&_l;})
 19 
 20 #define FP_SIZE 35
 21 
 22 struct fp_hard_struct {
 23         unsigned int save[FP_SIZE];             /* as yet undefined */
 24 };
 25 
 26 struct fp_soft_struct {
 27         unsigned int save[FP_SIZE];             /* undefined information */
 28 };
 29 
 30 union fp_state {
 31         struct fp_hard_struct   hard;
 32         struct fp_soft_struct   soft;
 33 };
 34 
 35 typedef unsigned long mm_segment_t;             /* domain register      */
 36 
 37 #ifdef __KERNEL__
 38 
 39 #define EISA_bus 0
 40 #define MCA_bus 0
 41 
 42 #include <asm/atomic.h>
 43 #include <asm/ptrace.h>
 44 #include <asm/arch/memory.h>
 45 #include <asm/proc/processor.h>
 46 
 47 struct debug_info {
 48         int                             nsaved;
 49         struct {
 50                 unsigned long           address;
 51                 unsigned long           insn;
 52         } bp[2];
 53 };
 54 
 55 struct thread_struct {
 56         atomic_t                        refcount;
 57                                                         /* fault info     */
 58         unsigned long                   address;
 59         unsigned long                   trap_no;
 60         unsigned long                   error_code;
 61                                                         /* floating point */
 62         union fp_state                  fpstate;
 63                                                         /* debugging      */
 64         struct debug_info               debug;
 65                                                         /* context info   */
 66         struct context_save_struct      *save;
 67         EXTRA_THREAD_STRUCT
 68 };
 69 
 70 #define INIT_MMAP {                                     \
 71         vm_mm:          &init_mm,                       \
 72         vm_page_prot:   PAGE_SHARED,                    \
 73         vm_flags:       VM_READ | VM_WRITE | VM_EXEC,   \
 74         vm_avl_height:  1,                              \
 75 }
 76 
 77 #define INIT_THREAD  {                                  \
 78         refcount:       ATOMIC_INIT(1),                 \
 79         EXTRA_THREAD_STRUCT_INIT                        \
 80 }
 81 
 82 /*
 83  * Return saved PC of a blocked thread.
 84  */
 85 extern __inline__ unsigned long thread_saved_pc(struct thread_struct *t)
 86 {
 87         return t->save ? pc_pointer(t->save->pc) : 0;
 88 }
 89 
 90 extern __inline__ unsigned long get_css_fp(struct thread_struct *t)
 91 {
 92         return t->save ? t->save->fp : 0;
 93 }
 94 
 95 asmlinkage void ret_from_sys_call(void) __asm__("ret_from_sys_call");
 96 
 97 extern __inline__ void init_thread_css(struct context_save_struct *save)
 98 {
 99         *save = INIT_CSS;
100         save->pc |= (unsigned long)ret_from_sys_call;
101 }
102 
103 /* Forward declaration, a strange C thing */
104 struct task_struct;
105 
106 /* Free all resources held by a thread. */
107 extern void release_thread(struct task_struct *);
108 
109 /* Copy and release all segment info associated with a VM */
110 #define copy_segments(tsk, mm)          do { } while (0)
111 #define release_segments(mm)            do { } while (0)
112 
113 unsigned long get_wchan(struct task_struct *p);
114 
115 #define THREAD_SIZE     (8192)
116 
117 extern struct task_struct *alloc_task_struct(void);
118 extern void __free_task_struct(struct task_struct *);
119 #define get_task_struct(p)      atomic_inc(&(p)->thread.refcount)
120 #define free_task_struct(p)                                     \
121  do {                                                           \
122         if (atomic_dec_and_test(&(p)->thread.refcount))         \
123                 __free_task_struct((p));                        \
124  } while (0)
125 
126 #define init_task       (init_task_union.task)
127 #define init_stack      (init_task_union.stack)
128 
129 /*
130  * Create a new kernel thread
131  */
132 extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
133 
134 #endif
135 
136 #endif /* __ASM_ARM_PROCESSOR_H */
137 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.