debuggers.hg

view extras/mini-os/include/ia64/arch_sched.h @ 16768:e51bf624433a

minios: Optimize IA64's get_current()

Let gcc access r13 itself, leading to better code

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jan 17 14:39:21 2008 +0000 (2008-01-17)
parents ac18d251df63
children
line source
1 /*
2 * Copyright (c) 2006 Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
3 * All rights reserved.
4 *
5 * The file contains ia64 specific scheduler declarations.
6 *
7 ****************************************************************************
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to
10 * deal in the Software without restriction, including without limitation the
11 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 * sell copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 * DEALINGS IN THE SOFTWARE.
25 */
27 #ifndef __ARCH_SCHED_H__
28 #define __ARCH_SCHED_H__
30 #include "os.h"
32 struct thread; /* Only declaration */
34 struct thread_regs
35 {
36 unsigned long unat_b; /* NaT before spilling */
37 unsigned long sp;
38 unsigned long rp;
39 unsigned long pr;
40 unsigned long bsp;
41 unsigned long pfs;
42 unsigned long rnat;
43 unsigned long lc;
45 unsigned long unat_a; /* NaT after spilling. */
46 unsigned long r4;
47 unsigned long r5;
48 unsigned long r6;
49 unsigned long r7;
51 unsigned long b1;
52 unsigned long b2;
53 unsigned long b3;
54 unsigned long b4;
55 unsigned long b5;
57 ia64_fpreg_t f2;
58 ia64_fpreg_t f3;
59 ia64_fpreg_t f4;
60 ia64_fpreg_t f5;
61 ia64_fpreg_t f16;
62 ia64_fpreg_t f17;
63 ia64_fpreg_t f18;
64 ia64_fpreg_t f19;
65 ia64_fpreg_t f20;
66 ia64_fpreg_t f21;
67 ia64_fpreg_t f22;
68 ia64_fpreg_t f23;
69 ia64_fpreg_t f24;
70 ia64_fpreg_t f25;
71 ia64_fpreg_t f26;
72 ia64_fpreg_t f27;
73 ia64_fpreg_t f28;
74 ia64_fpreg_t f29;
75 ia64_fpreg_t f30;
76 ia64_fpreg_t f31;
77 };
79 typedef struct thread_regs thread_regs_t;
81 void arch_switch_threads(struct thread* prev, struct thread* next);
83 static inline struct thread* get_current(void)
84 {
85 register struct thread *current asm("r13");
86 return current;
87 }
90 #endif /* __ARCH_SCHED_H__ */