Blame view

include/asm-powerpc/paca.h 3.6 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
  /*
8882a4da1   David Gibson   [PATCH] powerpc: ...
2
   * include/asm-powerpc/paca.h
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
3
   *
8882a4da1   David Gibson   [PATCH] powerpc: ...
4
5
   * This control block defines the PACA which defines the processor
   * specific data for each logical processor on the system.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
6
7
8
9
10
11
12
13
   * There are some pointers defined that are utilized by PLIC.
   *
   * C 2001 PPC 64 Team, IBM Corp
   *
   * This program is free software; you can redistribute it and/or
   * modify it under the terms of the GNU General Public License
   * as published by the Free Software Foundation; either version
   * 2 of the License, or (at your option) any later version.
8882a4da1   David Gibson   [PATCH] powerpc: ...
14
15
16
   */
  #ifndef _ASM_POWERPC_PACA_H
  #define _ASM_POWERPC_PACA_H
88ced0314   Arnd Bergmann   [PATCH] powerpc: ...
17
  #ifdef __KERNEL__
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
18

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
19
20
  #include	<asm/types.h>
  #include	<asm/lppaca.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
21
22
23
24
  #include	<asm/mmu.h>
  
  register struct paca_struct *local_paca asm("r13");
  #define get_paca()	local_paca
3356bb9f7   David Gibson   [PATCH] powerpc: ...
25
  #define get_lppaca()	(get_paca()->lppaca_ptr)
2f6093c84   Michael Neuling   [POWERPC] Impleme...
26
  #define get_slb_shadow()	(get_paca()->slb_shadow_ptr)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
27
28
  
  struct task_struct;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
29
30
31
32
33
34
  
  /*
   * Defines the layout of the paca.
   *
   * This structure is not directly accessed by firmware or the service
   * processor except for the first two pointers that point to the
1888e7b51   David Gibson   [PATCH] powerpc: ...
35
36
37
   * lppaca area and the ItLpRegSave area for this CPU.  The lppaca
   * object is currently contained within the PACA but it doesn't need
   * to be.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
38
39
40
41
42
43
44
45
46
47
48
49
50
51
   */
  struct paca_struct {
  	/*
  	 * Because hw_cpu_id, unlike other paca fields, is accessed
  	 * routinely from other CPUs (from the IRQ code), we stick to
  	 * read-only (after boot) fields in the first cacheline to
  	 * avoid cacheline bouncing.
  	 */
  
  	/*
  	 * MAGIC: These first two pointers can't be moved - they're
  	 * accessed by the firmware
  	 */
  	struct lppaca *lppaca_ptr;	/* Pointer to LpPaca for PLIC */
1888e7b51   David Gibson   [PATCH] powerpc: ...
52
53
54
  #ifdef CONFIG_PPC_ISERIES
  	void *reg_save_ptr; /* Pointer to LpRegSave for PLIC */
  #endif /* CONFIG_PPC_ISERIES */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
55
56
  
  	/*
2ef9481e6   Jon Mason   [PATCH] powerpc: ...
57
  	 * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c 
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
58
59
60
61
62
63
  	 * load lock_token and paca_index with a single lwz
  	 * instruction.  They must travel together and be properly
  	 * aligned.
  	 */
  	u16 lock_token;			/* Constant 0x8000, used in locks */
  	u16 paca_index;			/* Logical processor number */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
64
65
66
67
  	u64 kernel_toc;			/* Kernel TOC address */
  	u64 stab_real;			/* Absolute address of segment table */
  	u64 stab_addr;			/* Virtual address of segment table */
  	void *emergency_sp;		/* pointer to emergency stack */
7a0268fa1   Anton Blanchard   [PATCH] powerpc/6...
68
  	u64 data_offset;		/* per cpu data offset */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
69
70
71
  	s16 hw_cpu_id;			/* Physical processor number */
  	u8 cpu_start;			/* At startup, processor spins until */
  					/* this becomes non-zero. */
e91948fd8   Stephen Rothwell   [POWERPC] Minor p...
72
  	struct slb_shadow *slb_shadow_ptr;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
73
74
75
76
  
  	/*
  	 * Now, starting in cacheline 2, the exception save areas
  	 */
3c726f8de   Benjamin Herrenschmidt   [PATCH] ppc64: su...
77
78
79
80
81
  	/* used for most interrupts/exceptions */
  	u64 exgen[10] __attribute__((aligned(0x80)));
  	u64 exmc[10];		/* used for machine checks */
  	u64 exslb[10];		/* used for SLB/segment table misses
   				 * on the linear mapping */
3c726f8de   Benjamin Herrenschmidt   [PATCH] ppc64: su...
82

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
83
  	mm_context_t context;
bf72aeba2   Paul Mackerras   powerpc: Use 64k ...
84
  	u16 vmalloc_sllp;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
85
  	u16 slb_cache_ptr;
d0f13e3c2   Benjamin Herrenschmidt   [POWERPC] Introdu...
86
  	u16 slb_cache[SLB_CACHE_ENTRIES];
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
87
88
89
90
91
92
93
  
  	/*
  	 * then miscellaneous read-write fields
  	 */
  	struct task_struct *__current;	/* Pointer to current */
  	u64 kstack;			/* Saved Kernel stack addr */
  	u64 stab_rr;			/* stab/slb round-robin counter */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
94
95
  	u64 saved_r1;			/* r1 save for RTAS calls */
  	u64 saved_msr;			/* MSR saved here by enter_rtas */
687304014   Olof Johansson   [POWERPC] Save tr...
96
  	u16 trap_save;			/* Used when bad stack is encountered */
d04c56f73   Paul Mackerras   [POWERPC] Lazy in...
97
98
  	u8 soft_enabled;		/* irq soft-enable flag */
  	u8 hard_enabled;		/* set if irqs are enabled in MSR */
f007cacff   Paul Mackerras   [POWERPC] Fix MMI...
99
  	u8 io_sync;			/* writel() needs spin_unlock sync */
c6622f63d   Paul Mackerras   powerpc: Implemen...
100
101
102
103
104
  
  	/* Stuff for accurate time accounting */
  	u64 user_time;			/* accumulated usermode TB ticks */
  	u64 system_time;		/* accumulated system TB ticks */
  	u64 startpurr;			/* PURR/TB value snapshot */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
105
106
107
  };
  
  extern struct paca_struct paca[];
4df20460a   Anton Blanchard   [PATCH] powerpc: ...
108
  void setup_boot_paca(void);
88ced0314   Arnd Bergmann   [PATCH] powerpc: ...
109
  #endif /* __KERNEL__ */
8882a4da1   David Gibson   [PATCH] powerpc: ...
110
  #endif /* _ASM_POWERPC_PACA_H */