support vsyscall_getcpu() vsyscall. refs #385
This version simply calls getcpu() system call, so that it's not fast.
This commit is contained in:
@@ -58,3 +58,17 @@ long vsyscall_time(void *tp)
|
|||||||
|
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern int vsyscall_getcpu(unsigned *cpup, unsigned *nodep, void *tcachep)
|
||||||
|
__attribute__ ((section (".vsyscall.getcpu")));
|
||||||
|
|
||||||
|
int vsyscall_getcpu(unsigned *cpup, unsigned *nodep, void *tcachep)
|
||||||
|
{
|
||||||
|
int error;
|
||||||
|
|
||||||
|
asm ("syscall" : "=a" (error)
|
||||||
|
: "a" (__NR_getcpu), "D" (cpup), "S" (nodep), "d" (tcachep)
|
||||||
|
: "%rcx", "%r11", "memory");
|
||||||
|
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ SECTIONS
|
|||||||
. = vsyscall_page + 0x400;
|
. = vsyscall_page + 0x400;
|
||||||
*(.vsyscall.time)
|
*(.vsyscall.time)
|
||||||
|
|
||||||
|
. = vsyscall_page + 0x800;
|
||||||
|
*(.vsyscall.getcpu)
|
||||||
|
|
||||||
. = ALIGN(4096);
|
. = ALIGN(4096);
|
||||||
} : data = 0xf4
|
} : data = 0xf4
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ SECTIONS
|
|||||||
. = vsyscall_page + 0x400;
|
. = vsyscall_page + 0x400;
|
||||||
*(.vsyscall.time)
|
*(.vsyscall.time)
|
||||||
|
|
||||||
|
. = vsyscall_page + 0x800;
|
||||||
|
*(.vsyscall.getcpu)
|
||||||
|
|
||||||
. = ALIGN(4096);
|
. = ALIGN(4096);
|
||||||
} : data = 0xf4
|
} : data = 0xf4
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ SECTIONS
|
|||||||
. = vsyscall_page + 0x400;
|
. = vsyscall_page + 0x400;
|
||||||
*(.vsyscall.time)
|
*(.vsyscall.time)
|
||||||
|
|
||||||
|
. = vsyscall_page + 0x800;
|
||||||
|
*(.vsyscall.getcpu)
|
||||||
|
|
||||||
. = ALIGN(4096);
|
. = ALIGN(4096);
|
||||||
} : data = 0xf4
|
} : data = 0xf4
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ SECTIONS
|
|||||||
. = vsyscall_page + 0x400;
|
. = vsyscall_page + 0x400;
|
||||||
*(.vsyscall.time)
|
*(.vsyscall.time)
|
||||||
|
|
||||||
|
. = vsyscall_page + 0x800;
|
||||||
|
*(.vsyscall.getcpu)
|
||||||
|
|
||||||
. = ALIGN(4096);
|
. = ALIGN(4096);
|
||||||
} : data = 0xf4
|
} : data = 0xf4
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user