From 05dd25307ca67cbfa0207bbba2e6c79fa97d125b Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Tue, 10 Jul 2007 11:24:09 +0200 Subject: [S390] sclp: introduce some new interfaces. Introduce some new interfaces so that random subsystems don't have to mess around with sclp internal structures. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- include/asm-s390/sclp.h | 46 ++++++++++++++++------------------------------ 1 file changed, 16 insertions(+), 30 deletions(-) (limited to 'include/asm-s390') diff --git a/include/asm-s390/sclp.h b/include/asm-s390/sclp.h index 21ed6477321..ddfaa8db47b 100644 --- a/include/asm-s390/sclp.h +++ b/include/asm-s390/sclp.h @@ -11,29 +11,6 @@ #include #include -struct sccb_header { - u16 length; - u8 function_code; - u8 control_mask[3]; - u16 response_code; -} __attribute__((packed)); - -#define LOADPARM_LEN 8 - -struct sclp_readinfo_sccb { - struct sccb_header header; /* 0-7 */ - u16 rnmax; /* 8-9 */ - u8 rnsize; /* 10 */ - u8 _reserved0[24 - 11]; /* 11-23 */ - u8 loadparm[LOADPARM_LEN]; /* 24-31 */ - u8 _reserved1[91 - 32]; /* 32-90 */ - u8 flags; /* 91 */ - u8 _reserved2[100 - 92]; /* 92-99 */ - u32 rnsize2; /* 100-103 */ - u64 rnmax2; /* 104-111 */ - u8 _reserved3[4096 - 112]; /* 112-4095 */ -} __attribute__((packed, aligned(4096))); - #define SCLP_CHP_INFO_MASK_SIZE 32 struct sclp_chp_info { @@ -42,12 +19,21 @@ struct sclp_chp_info { u8 configured[SCLP_CHP_INFO_MASK_SIZE]; }; -extern struct sclp_readinfo_sccb s390_readinfo_sccb; -extern void sclp_readinfo_early(void); -extern int sclp_sdias_blk_count(void); -extern int sclp_sdias_copy(void *dest, int blk_num, int nr_blks); -extern int sclp_chp_configure(struct chp_id chpid); -extern int sclp_chp_deconfigure(struct chp_id chpid); -extern int sclp_chp_read_info(struct sclp_chp_info *info); +#define LOADPARM_LEN 8 + +struct sclp_ipl_info { + int is_valid; + int has_dump; + char loadparm[LOADPARM_LEN]; +}; + +void sclp_readinfo_early(void); +unsigned long long sclp_memory_detect(void); +int sclp_sdias_blk_count(void); +int sclp_sdias_copy(void *dest, int blk_num, int nr_blks); +int sclp_chp_configure(struct chp_id chpid); +int sclp_chp_deconfigure(struct chp_id chpid); +int sclp_chp_read_info(struct sclp_chp_info *info); +void sclp_get_ipl_info(struct sclp_ipl_info *info); #endif /* _ASM_S390_SCLP_H */ -- cgit v1.2.3 From 83119ad4a1ceacd99f380086c2855ae2c4268afc Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Tue, 10 Jul 2007 11:24:10 +0200 Subject: [S390] sclp: Test facility list before executing a service call. Check if a command is available before executing. Saves some superfluous service calls that won't succeed anyway. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- include/asm-s390/sclp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/asm-s390') diff --git a/include/asm-s390/sclp.h b/include/asm-s390/sclp.h index ddfaa8db47b..cb9faf1ea5c 100644 --- a/include/asm-s390/sclp.h +++ b/include/asm-s390/sclp.h @@ -28,6 +28,7 @@ struct sclp_ipl_info { }; void sclp_readinfo_early(void); +void sclp_facilities_detect(void); unsigned long long sclp_memory_detect(void); int sclp_sdias_blk_count(void); int sclp_sdias_copy(void *dest, int blk_num, int nr_blks); -- cgit v1.2.3 From 8a88367088a6b9964d99694b30d80720f019bea2 Mon Sep 17 00:00:00 2001 From: Martin Schwidefsky Date: Tue, 10 Jul 2007 11:24:14 +0200 Subject: [S390] Bogomips calculation for 64 bit. The bogomips calculation triggered via reading from /proc/cpuinfo can return incorrect values if the qrnnd assembly is called with a pointer in %r2 with any of the upper 32 bits set. Fix this by using 64 bit division / remainder operation provided by gcc instead of calling the assembly. Signed-off-by: Martin Schwidefsky --- include/asm-s390/sfp-machine.h | 6 +++--- include/asm-s390/sfp-util.h | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'include/asm-s390') diff --git a/include/asm-s390/sfp-machine.h b/include/asm-s390/sfp-machine.h index 8ca8c77b2d0..4e16aede4b0 100644 --- a/include/asm-s390/sfp-machine.h +++ b/include/asm-s390/sfp-machine.h @@ -27,9 +27,9 @@ #define _FP_W_TYPE_SIZE 32 -#define _FP_W_TYPE unsigned long -#define _FP_WS_TYPE signed long -#define _FP_I_TYPE long +#define _FP_W_TYPE unsigned int +#define _FP_WS_TYPE signed int +#define _FP_I_TYPE int #define _FP_MUL_MEAT_S(R,X,Y) \ _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm) diff --git a/include/asm-s390/sfp-util.h b/include/asm-s390/sfp-util.h index 8cabcd23d97..0addc6466d9 100644 --- a/include/asm-s390/sfp-util.h +++ b/include/asm-s390/sfp-util.h @@ -51,6 +51,16 @@ wl = __wl; \ }) +#ifdef __s390x__ +#define udiv_qrnnd(q, r, n1, n0, d) \ + do { unsigned long __n; \ + unsigned int __r, __d; \ + __n = ((unsigned long)(n1) << 32) + n0; \ + __d = (d); \ + (q) = __n / __d; \ + (r) = __n % __d; \ + } while (0) +#else #define udiv_qrnnd(q, r, n1, n0, d) \ do { unsigned int __r; \ (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \ @@ -58,6 +68,7 @@ } while (0) extern unsigned long __udiv_qrnnd (unsigned int *, unsigned int, unsigned int , unsigned int); +#endif #define UDIV_NEEDS_NORMALIZATION 0 -- cgit v1.2.3 From 048d5ce6828b9071e241254c7dba13d67bfef2c3 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Tue, 10 Jul 2007 11:24:16 +0200 Subject: [S390] Remove volatile from atomic_t Follow i386/x86_64 and remove 'volatile' from atomic_t. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- include/asm-s390/atomic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/asm-s390') diff --git a/include/asm-s390/atomic.h b/include/asm-s390/atomic.h index c17bdbf2206..ea486952f77 100644 --- a/include/asm-s390/atomic.h +++ b/include/asm-s390/atomic.h @@ -24,7 +24,7 @@ */ typedef struct { - volatile int counter; + int counter; } __attribute__ ((aligned (4))) atomic_t; #define ATOMIC_INIT(i) { (i) } @@ -141,7 +141,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) #ifdef __s390x__ typedef struct { - volatile long long counter; + long long counter; } __attribute__ ((aligned (8))) atomic64_t; #define ATOMIC64_INIT(i) { (i) } -- cgit v1.2.3 From 736f563373804e75f9f3b4abb9e480451bfef8d3 Mon Sep 17 00:00:00 2001 From: Cornelia Huck Date: Tue, 10 Jul 2007 11:24:20 +0200 Subject: [S390] cio: Remove prototype for non-existing function cmf_reset(). Signed-off-by: Cornelia Huck Signed-off-by: Martin Schwidefsky --- include/asm-s390/cmb.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/asm-s390') diff --git a/include/asm-s390/cmb.h b/include/asm-s390/cmb.h index 241756f80df..021e7c3223e 100644 --- a/include/asm-s390/cmb.h +++ b/include/asm-s390/cmb.h @@ -88,7 +88,6 @@ extern u64 cmf_read(struct ccw_device *cdev, int index); * any **/ extern int cmf_readall(struct ccw_device *cdev, struct cmbdata*data); -extern void cmf_reset(struct ccw_device *cdev); #endif /* __KERNEL__ */ #endif /* S390_CMB_H */ -- cgit v1.2.3 From dce554708cdb02a1053ca3a68997b9facbfde5ce Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Tue, 10 Jul 2007 11:24:21 +0200 Subject: [S390] s390: rename CPU_IDLE to S390_CPU_IDLE sched-cfs-v2.6.22-git-v18.patch introduces CPU_IDLE in sched.h. This conflict with the already existing define in include/asm-s390/processor.h Just rename the s390 defines, since they will go away as soon as we support CONFIG_NO_HZ instead of our own CONFIG_NO_IDLE_HZ. Signed-off-by: Heiko Carstens Signed-off-by: Andrew Morton Signed-off-by: Ingo Molnar Signed-off-by: Martin Schwidefsky --- include/asm-s390/processor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/asm-s390') diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h index 5cb480af65d..3b972d4c6b2 100644 --- a/include/asm-s390/processor.h +++ b/include/asm-s390/processor.h @@ -357,8 +357,8 @@ extern void (*s390_base_ext_handler_fn)(void); /* * CPU idle notifier chain. */ -#define CPU_IDLE 0 -#define CPU_NOT_IDLE 1 +#define S390_CPU_IDLE 0 +#define S390_CPU_NOT_IDLE 1 struct notifier_block; int register_idle_notifier(struct notifier_block *nb); -- cgit v1.2.3