OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-x86_64/] [current.h] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
#ifndef _X86_64_CURRENT_H
2
#define _X86_64_CURRENT_H
3
 
4
#if !defined(__ASSEMBLY__) 
5
struct task_struct;
6
 
7
#include <asm/pda.h>
8
 
9
static inline struct task_struct *get_current(void)
10
{
11
        struct task_struct *t = read_pda(pcurrent);
12
        return t;
13
}
14
 
15
 
16
static inline struct task_struct *stack_current(void)
17
{
18
        struct task_struct *current;
19
        __asm__("andq %%rsp,%0; ":"=r" (current)
20
                : "0" (~(unsigned long)(THREAD_SIZE-1)));
21
        return current;
22
}
23
 
24
 
25
#define current get_current()
26
 
27
#else
28
 
29
#ifndef ASM_OFFSET_H
30
#include <asm/offset.h> 
31
#endif
32
 
33
#define GET_CURRENT(reg) movq %gs:(pda_pcurrent),reg
34
 
35
#endif
36
 
37
#endif /* !(_X86_64_CURRENT_H) */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.