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