processor.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:3k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  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. #ifndef __ASM_ARM_PROCESSOR_H
  11. #define __ASM_ARM_PROCESSOR_H
  12. /*
  13.  * Default implementation of macro that returns current
  14.  * instruction pointer ("program counter").
  15.  */
  16. #define current_text_addr() ({ __label__ _l; _l: &&_l;})
  17. #define FP_SIZE 35
  18. struct fp_hard_struct {
  19. unsigned int save[FP_SIZE]; /* as yet undefined */
  20. };
  21. struct fp_soft_struct {
  22. unsigned int save[FP_SIZE]; /* undefined information */
  23. };
  24. union fp_state {
  25. struct fp_hard_struct hard;
  26. struct fp_soft_struct soft;
  27. };
  28. typedef unsigned long mm_segment_t; /* domain register */
  29. #ifdef __KERNEL__
  30. #define EISA_bus 0
  31. #define MCA_bus 0
  32. #define MCA_bus__is_a_macro
  33. #include <asm/atomic.h>
  34. #include <asm/ptrace.h>
  35. #include <asm/arch/memory.h>
  36. #include <asm/proc/processor.h>
  37. struct debug_info {
  38. int nsaved;
  39. struct {
  40. unsigned long address;
  41. unsigned long insn;
  42. } bp[2];
  43. };
  44. struct thread_struct {
  45. atomic_t refcount;
  46. /* fault info   */
  47. unsigned long address;
  48. unsigned long trap_no;
  49. unsigned long error_code;
  50. /* floating point */
  51. union fp_state fpstate;
  52. /* debugging   */
  53. struct debug_info debug;
  54. /* context info   */
  55. struct context_save_struct *save;
  56. EXTRA_THREAD_STRUCT
  57. };
  58. #define INIT_THREAD  {
  59. refcount: ATOMIC_INIT(1),
  60. EXTRA_THREAD_STRUCT_INIT
  61. }
  62. /*
  63.  * Return saved PC of a blocked thread.
  64.  */
  65. static inline unsigned long thread_saved_pc(struct thread_struct *t)
  66. {
  67. return t->save ? pc_pointer(t->save->pc) : 0;
  68. }
  69. static inline unsigned long get_css_fp(struct thread_struct *t)
  70. {
  71. return t->save ? t->save->fp : 0;
  72. }
  73. /* Forward declaration, a strange C thing */
  74. struct task_struct;
  75. /* Free all resources held by a thread. */
  76. extern void release_thread(struct task_struct *);
  77. /* Copy and release all segment info associated with a VM */
  78. #define copy_segments(tsk, mm) do { } while (0)
  79. #define release_segments(mm) do { } while (0)
  80. unsigned long get_wchan(struct task_struct *p);
  81. #define THREAD_SIZE (8192)
  82. extern struct task_struct *alloc_task_struct(void);
  83. extern void __free_task_struct(struct task_struct *);
  84. #define get_task_struct(p) atomic_inc(&(p)->thread.refcount)
  85. #define free_task_struct(p)
  86.  do {
  87. if (atomic_dec_and_test(&(p)->thread.refcount))
  88. __free_task_struct((p));
  89.  } while (0)
  90. #define init_task (init_task_union.task)
  91. #define init_stack (init_task_union.stack)
  92. #define cpu_relax() do { } while (0)
  93. /*
  94.  * Create a new kernel thread
  95.  */
  96. extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
  97. #endif
  98. #endif /* __ASM_ARM_PROCESSOR_H */