You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.0 KiB
38 lines
1.0 KiB
20 years ago
|
#ifndef __ARCH_S390_PERCPU__
|
||
|
#define __ARCH_S390_PERCPU__
|
||
|
|
||
|
#include <linux/compiler.h>
|
||
|
#include <asm/lowcore.h>
|
||
|
|
||
|
/*
|
||
|
* s390 uses its own implementation for per cpu data, the offset of
|
||
|
* the cpu local data area is cached in the cpu's lowcore memory.
|
||
|
* For 64 bit module code s390 forces the use of a GOT slot for the
|
||
|
* address of the per cpu variable. This is needed because the module
|
||
|
* may be more than 4G above the per cpu area.
|
||
|
*/
|
||
|
#if defined(__s390x__) && defined(MODULE)
|
||
|
|
||
17 years ago
|
#define SHIFT_PERCPU_PTR(ptr,offset) (({ \
|
||
18 years ago
|
extern int simple_identifier_##var(void); \
|
||
19 years ago
|
unsigned long *__ptr; \
|
||
17 years ago
|
asm ( "larl %0, %1@GOTENT" \
|
||
|
: "=a" (__ptr) : "X" (ptr) ); \
|
||
|
(typeof(ptr))((*__ptr) + (offset)); }))
|
||
20 years ago
|
|
||
|
#else
|
||
|
|
||
17 years ago
|
#define SHIFT_PERCPU_PTR(ptr, offset) (({ \
|
||
18 years ago
|
extern int simple_identifier_##var(void); \
|
||
19 years ago
|
unsigned long __ptr; \
|
||
17 years ago
|
asm ( "" : "=a" (__ptr) : "0" (ptr) ); \
|
||
|
(typeof(ptr)) (__ptr + (offset)); }))
|
||
20 years ago
|
|
||
|
#endif
|
||
|
|
||
17 years ago
|
#define __my_cpu_offset S390_lowcore.percpu_offset
|
||
20 years ago
|
|
||
17 years ago
|
#include <asm-generic/percpu.h>
|
||
20 years ago
|
|
||
|
#endif /* __ARCH_S390_PERCPU__ */
|