diff options
Diffstat (limited to 'include/asm-s390')
-rw-r--r-- | include/asm-s390/bitops.h | 43 | ||||
-rw-r--r-- | include/asm-s390/cio.h | 2 | ||||
-rw-r--r-- | include/asm-s390/cmb.h | 4 | ||||
-rw-r--r-- | include/asm-s390/dasd.h | 8 | ||||
-rw-r--r-- | include/asm-s390/debug.h | 1 | ||||
-rw-r--r-- | include/asm-s390/hardirq.h | 1 | ||||
-rw-r--r-- | include/asm-s390/idals.h | 1 | ||||
-rw-r--r-- | include/asm-s390/io.h | 5 | ||||
-rw-r--r-- | include/asm-s390/irq.h | 4 | ||||
-rw-r--r-- | include/asm-s390/local.h | 1 | ||||
-rw-r--r-- | include/asm-s390/lowcore.h | 1 | ||||
-rw-r--r-- | include/asm-s390/page.h | 6 | ||||
-rw-r--r-- | include/asm-s390/percpu.h | 2 | ||||
-rw-r--r-- | include/asm-s390/pgalloc.h | 1 | ||||
-rw-r--r-- | include/asm-s390/posix_types.h | 44 | ||||
-rw-r--r-- | include/asm-s390/ptrace.h | 6 | ||||
-rw-r--r-- | include/asm-s390/sfp-machine.h | 1 | ||||
-rw-r--r-- | include/asm-s390/smp.h | 1 | ||||
-rw-r--r-- | include/asm-s390/system.h | 1 | ||||
-rw-r--r-- | include/asm-s390/thread_info.h | 1 | ||||
-rw-r--r-- | include/asm-s390/tlbflush.h | 1 | ||||
-rw-r--r-- | include/asm-s390/types.h | 1 | ||||
-rw-r--r-- | include/asm-s390/unistd.h | 10 | ||||
-rw-r--r-- | include/asm-s390/vtoc.h | 38 | ||||
-rw-r--r-- | include/asm-s390/z90crypt.h | 212 |
25 files changed, 287 insertions, 109 deletions
diff --git a/include/asm-s390/bitops.h b/include/asm-s390/bitops.h index ca092ffb7a9..0ddcdba79e4 100644 --- a/include/asm-s390/bitops.h +++ b/include/asm-s390/bitops.h @@ -12,7 +12,9 @@ * Copyright (C) 1992, Linus Torvalds * */ -#include <linux/config.h> + +#ifdef __KERNEL__ + #include <linux/compiler.h> /* @@ -51,19 +53,6 @@ * with operation of the form "set_bit(bitnr, flags)". */ -/* set ALIGN_CS to 1 if the SMP safe bit operations should - * align the address to 4 byte boundary. It seems to work - * without the alignment. - */ -#ifdef __KERNEL__ -#define ALIGN_CS 0 -#else -#define ALIGN_CS 1 -#ifndef CONFIG_SMP -#error "bitops won't work without CONFIG_SMP" -#endif -#endif - /* bitmap tables from arch/S390/kernel/bitmap.S */ extern const char _oi_bitmap[]; extern const char _ni_bitmap[]; @@ -122,10 +111,6 @@ static inline void set_bit_cs(unsigned long nr, volatile unsigned long *ptr) unsigned long addr, old, new, mask; addr = (unsigned long) ptr; -#if ALIGN_CS == 1 - nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */ - addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */ -#endif /* calculate address for CS */ addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; /* make OR mask */ @@ -142,10 +127,6 @@ static inline void clear_bit_cs(unsigned long nr, volatile unsigned long *ptr) unsigned long addr, old, new, mask; addr = (unsigned long) ptr; -#if ALIGN_CS == 1 - nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */ - addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */ -#endif /* calculate address for CS */ addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; /* make AND mask */ @@ -162,10 +143,6 @@ static inline void change_bit_cs(unsigned long nr, volatile unsigned long *ptr) unsigned long addr, old, new, mask; addr = (unsigned long) ptr; -#if ALIGN_CS == 1 - nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */ - addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */ -#endif /* calculate address for CS */ addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; /* make XOR mask */ @@ -183,10 +160,6 @@ test_and_set_bit_cs(unsigned long nr, volatile unsigned long *ptr) unsigned long addr, old, new, mask; addr = (unsigned long) ptr; -#if ALIGN_CS == 1 - nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */ - addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */ -#endif /* calculate address for CS */ addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; /* make OR/test mask */ @@ -206,10 +179,6 @@ test_and_clear_bit_cs(unsigned long nr, volatile unsigned long *ptr) unsigned long addr, old, new, mask; addr = (unsigned long) ptr; -#if ALIGN_CS == 1 - nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */ - addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */ -#endif /* calculate address for CS */ addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; /* make AND/test mask */ @@ -229,10 +198,6 @@ test_and_change_bit_cs(unsigned long nr, volatile unsigned long *ptr) unsigned long addr, old, new, mask; addr = (unsigned long) ptr; -#if ALIGN_CS == 1 - nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */ - addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */ -#endif /* calculate address for CS */ addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; /* make XOR/test mask */ @@ -835,8 +800,6 @@ static inline int sched_find_first_bit(unsigned long *b) #include <asm-generic/bitops/hweight.h> -#ifdef __KERNEL__ - /* * ATTENTION: intel byte ordering convention for ext2 and minix !! * bit 0 is the LSB of addr; bit 31 is the MSB of addr; diff --git a/include/asm-s390/cio.h b/include/asm-s390/cio.h index 089cf567c31..2b161930635 100644 --- a/include/asm-s390/cio.h +++ b/include/asm-s390/cio.h @@ -276,6 +276,8 @@ extern void wait_cons_dev(void); extern void clear_all_subchannels(void); +extern void css_schedule_reprobe(void); + #endif #endif diff --git a/include/asm-s390/cmb.h b/include/asm-s390/cmb.h index dae1dd4fb93..241756f80df 100644 --- a/include/asm-s390/cmb.h +++ b/include/asm-s390/cmb.h @@ -44,10 +44,6 @@ struct cmbdata { #define BIODASDCMFENABLE _IO(DASD_IOCTL_LETTER,32) /* enable channel measurement */ #define BIODASDCMFDISABLE _IO(DASD_IOCTL_LETTER,33) -/* reset channel measurement block */ -#define BIODASDRESETCMB _IO(DASD_IOCTL_LETTER,34) -/* read channel measurement data */ -#define BIODASDREADCMB _IOWR(DASD_IOCTL_LETTER,32,u64) /* read channel measurement data */ #define BIODASDREADALLCMB _IOWR(DASD_IOCTL_LETTER,33,struct cmbdata) diff --git a/include/asm-s390/dasd.h b/include/asm-s390/dasd.h index 1630c26e8f4..c042f957808 100644 --- a/include/asm-s390/dasd.h +++ b/include/asm-s390/dasd.h @@ -68,10 +68,12 @@ typedef struct dasd_information2_t { * 0x00: default features * 0x01: readonly (ro) * 0x02: use diag discipline (diag) + * 0x04: set the device initially online (internal use only) */ -#define DASD_FEATURE_DEFAULT 0 -#define DASD_FEATURE_READONLY 1 -#define DASD_FEATURE_USEDIAG 2 +#define DASD_FEATURE_DEFAULT 0x00 +#define DASD_FEATURE_READONLY 0x01 +#define DASD_FEATURE_USEDIAG 0x02 +#define DASD_FEATURE_INITIAL_ONLINE 0x04 #define DASD_PARTN_BITS 2 diff --git a/include/asm-s390/debug.h b/include/asm-s390/debug.h index 23450ed4b57..7f1ef99fd1e 100644 --- a/include/asm-s390/debug.h +++ b/include/asm-s390/debug.h @@ -9,7 +9,6 @@ #ifndef DEBUG_H #define DEBUG_H -#include <linux/config.h> #include <linux/fs.h> #include <linux/string.h> diff --git a/include/asm-s390/hardirq.h b/include/asm-s390/hardirq.h index 6792c559a12..e84b7ef54aa 100644 --- a/include/asm-s390/hardirq.h +++ b/include/asm-s390/hardirq.h @@ -12,7 +12,6 @@ #ifndef __ASM_HARDIRQ_H #define __ASM_HARDIRQ_H -#include <linux/config.h> #include <linux/threads.h> #include <linux/sched.h> #include <linux/cache.h> diff --git a/include/asm-s390/idals.h b/include/asm-s390/idals.h index 8038858b86b..e82c10efe65 100644 --- a/include/asm-s390/idals.h +++ b/include/asm-s390/idals.h @@ -13,7 +13,6 @@ #ifndef _S390_IDALS_H #define _S390_IDALS_H -#include <linux/config.h> #include <linux/errno.h> #include <linux/err.h> #include <linux/types.h> diff --git a/include/asm-s390/io.h b/include/asm-s390/io.h index b05825dd16d..d4614b35f42 100644 --- a/include/asm-s390/io.h +++ b/include/asm-s390/io.h @@ -86,20 +86,25 @@ extern void iounmap(void *addr); #define readb(addr) (*(volatile unsigned char *) __io_virt(addr)) #define readw(addr) (*(volatile unsigned short *) __io_virt(addr)) #define readl(addr) (*(volatile unsigned int *) __io_virt(addr)) +#define readq(addr) (*(volatile unsigned long long *) __io_virt(addr)) #define readb_relaxed(addr) readb(addr) #define readw_relaxed(addr) readw(addr) #define readl_relaxed(addr) readl(addr) +#define readq_relaxed(addr) readq(addr) #define __raw_readb readb #define __raw_readw readw #define __raw_readl readl +#define __raw_readq readq #define writeb(b,addr) (*(volatile unsigned char *) __io_virt(addr) = (b)) #define writew(b,addr) (*(volatile unsigned short *) __io_virt(addr) = (b)) #define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b)) +#define writeq(b,addr) (*(volatile unsigned long long *) __io_virt(addr) = (b)) #define __raw_writeb writeb #define __raw_writew writew #define __raw_writel writel +#define __raw_writeq writeq #define memset_io(a,b,c) memset(__io_virt(a),(b),(c)) #define memcpy_fromio(a,b,c) memcpy((a),__io_virt(b),(c)) diff --git a/include/asm-s390/irq.h b/include/asm-s390/irq.h index 916a1aa0b07..bd1a721f7aa 100644 --- a/include/asm-s390/irq.h +++ b/include/asm-s390/irq.h @@ -21,10 +21,6 @@ enum interruption_class { #define touch_nmi_watchdog() do { } while(0) -struct irqaction; -struct pt_regs; -int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); - #endif /* __KERNEL__ */ #endif diff --git a/include/asm-s390/local.h b/include/asm-s390/local.h index cf8189009c3..86745a1b29b 100644 --- a/include/asm-s390/local.h +++ b/include/asm-s390/local.h @@ -1,7 +1,6 @@ #ifndef _ASM_LOCAL_H #define _ASM_LOCAL_H -#include <linux/config.h> #include <linux/percpu.h> #include <asm/atomic.h> diff --git a/include/asm-s390/lowcore.h b/include/asm-s390/lowcore.h index bea72790428..596c8b17210 100644 --- a/include/asm-s390/lowcore.h +++ b/include/asm-s390/lowcore.h @@ -124,7 +124,6 @@ #ifndef __ASSEMBLY__ -#include <linux/config.h> #include <asm/processor.h> #include <linux/types.h> #include <asm/sigp.h> diff --git a/include/asm-s390/page.h b/include/asm-s390/page.h index 3b1138ac7e7..b2628dc5c49 100644 --- a/include/asm-s390/page.h +++ b/include/asm-s390/page.h @@ -9,7 +9,6 @@ #ifndef _S390_PAGE_H #define _S390_PAGE_H -#include <asm/setup.h> #include <asm/types.h> /* PAGE_SHIFT determines the page size */ @@ -20,6 +19,7 @@ #define PAGE_DEFAULT_KEY (PAGE_DEFAULT_ACC << 4) #ifdef __KERNEL__ +#include <asm/setup.h> #ifndef __ASSEMBLY__ #ifndef __s390x__ @@ -189,9 +189,9 @@ page_get_storage_key(unsigned long addr) #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) -#endif /* __KERNEL__ */ - #include <asm-generic/memory_model.h> #include <asm-generic/page.h> +#endif /* __KERNEL__ */ + #endif /* _S390_PAGE_H */ diff --git a/include/asm-s390/percpu.h b/include/asm-s390/percpu.h index 436d216601e..d9a8cca9b65 100644 --- a/include/asm-s390/percpu.h +++ b/include/asm-s390/percpu.h @@ -40,6 +40,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS]; __typeof__(type) per_cpu__##name #define __get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) +#define __raw_get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) #define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu]) /* A macro to avoid #include hell... */ @@ -57,6 +58,7 @@ do { \ __typeof__(type) per_cpu__##name #define __get_cpu_var(var) __reloc_hide(var,0) +#define __raw_get_cpu_var(var) __reloc_hide(var,0) #define per_cpu(var,cpu) __reloc_hide(var,0) #endif /* SMP */ diff --git a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h index e28aaf28e4a..3002fda89d3 100644 --- a/include/asm-s390/pgalloc.h +++ b/include/asm-s390/pgalloc.h @@ -13,7 +13,6 @@ #ifndef _S390_PGALLOC_H #define _S390_PGALLOC_H -#include <linux/config.h> #include <linux/threads.h> #include <linux/gfp.h> #include <linux/mm.h> diff --git a/include/asm-s390/posix_types.h b/include/asm-s390/posix_types.h index 61788de3c0c..b94c98856e1 100644 --- a/include/asm-s390/posix_types.h +++ b/include/asm-s390/posix_types.h @@ -76,24 +76,36 @@ typedef struct { } __kernel_fsid_t; -#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) - -#ifndef _S390_BITOPS_H -#include <asm/bitops.h> -#endif - -#undef __FD_SET -#define __FD_SET(fd,fdsetp) set_bit((fd),(fdsetp)->fds_bits) - -#undef __FD_CLR -#define __FD_CLR(fd,fdsetp) clear_bit((fd),(fdsetp)->fds_bits) - -#undef __FD_ISSET -#define __FD_ISSET(fd,fdsetp) test_bit((fd),(fdsetp)->fds_bits) +#ifdef __KERNEL__ + +#undef __FD_SET +static inline void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp) +{ + unsigned long _tmp = fd / __NFDBITS; + unsigned long _rem = fd % __NFDBITS; + fdsetp->fds_bits[_tmp] |= (1UL<<_rem); +} + +#undef __FD_CLR +static inline void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp) +{ + unsigned long _tmp = fd / __NFDBITS; + unsigned long _rem = fd % __NFDBITS; + fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem); +} + +#undef __FD_ISSET +static inline int __FD_ISSET(unsigned long fd, const __kernel_fd_set *fdsetp) +{ + unsigned long _tmp = fd / __NFDBITS; + unsigned long _rem = fd % __NFDBITS; + return (fdsetp->fds_bits[_tmp] & (1UL<<_rem)) != 0; +} #undef __FD_ZERO -#define __FD_ZERO(fdsetp) (memset ((fdsetp), 0, sizeof(*(fd_set *)(fdsetp)))) +#define __FD_ZERO(fdsetp) \ + ((void) memset ((__ptr_t) (fdsetp), 0, sizeof (__kernel_fd_set))) -#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)*/ +#endif /* __KERNEL__ */ #endif diff --git a/include/asm-s390/ptrace.h b/include/asm-s390/ptrace.h index a949cc077cc..4d75d77b0f9 100644 --- a/include/asm-s390/ptrace.h +++ b/include/asm-s390/ptrace.h @@ -181,11 +181,8 @@ #define PTRACE_OLDSETOPTIONS 21 #ifndef __ASSEMBLY__ -#include <linux/config.h> #include <linux/stddef.h> #include <linux/types.h> -#include <asm/setup.h> -#include <asm/page.h> typedef union { @@ -301,6 +298,9 @@ typedef struct } s390_regs; #ifdef __KERNEL__ +#include <asm/setup.h> +#include <asm/page.h> + /* * The pt_regs struct defines the way the registers are stored on * the stack during a system call. diff --git a/include/asm-s390/sfp-machine.h b/include/asm-s390/sfp-machine.h index 3c79b5384f4..de69dfa46fb 100644 --- a/include/asm-s390/sfp-machine.h +++ b/include/asm-s390/sfp-machine.h @@ -25,7 +25,6 @@ #ifndef _SFP_MACHINE_H #define _SFP_MACHINE_H -#include <linux/config.h> #define _FP_W_TYPE_SIZE 32 #define _FP_W_TYPE unsigned long diff --git a/include/asm-s390/smp.h b/include/asm-s390/smp.h index 444dae5912e..657646054c5 100644 --- a/include/asm-s390/smp.h +++ b/include/asm-s390/smp.h @@ -10,7 +10,6 @@ #ifndef __ASM_SMP_H #define __ASM_SMP_H -#include <linux/config.h> #include <linux/threads.h> #include <linux/cpumask.h> #include <linux/bitops.h> diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h index 6a89dbb03c1..71a0732cd51 100644 --- a/include/asm-s390/system.h +++ b/include/asm-s390/system.h @@ -11,7 +11,6 @@ #ifndef __ASM_SYSTEM_H #define __ASM_SYSTEM_H -#include <linux/config.h> #include <linux/kernel.h> #include <asm/types.h> #include <asm/ptrace.h> diff --git a/include/asm-s390/thread_info.h b/include/asm-s390/thread_info.h index 8e0c7ed73d0..0a518915bf9 100644 --- a/include/asm-s390/thread_info.h +++ b/include/asm-s390/thread_info.h @@ -63,6 +63,7 @@ struct thread_info { .exec_domain = &default_exec_domain, \ .flags = 0, \ .cpu = 0, \ + .preempt_count = 1, \ .restart_block = { \ .fn = do_no_restart_syscall, \ }, \ diff --git a/include/asm-s390/tlbflush.h b/include/asm-s390/tlbflush.h index 1bb73b0e61f..73cd85bebfb 100644 --- a/include/asm-s390/tlbflush.h +++ b/include/asm-s390/tlbflush.h @@ -1,7 +1,6 @@ #ifndef _S390_TLBFLUSH_H #define _S390_TLBFLUSH_H -#include <linux/config.h> #include <linux/mm.h> #include <asm/processor.h> diff --git a/include/asm-s390/types.h b/include/asm-s390/types.h index 5738ad63537..ae2951cc83a 100644 --- a/include/asm-s390/types.h +++ b/include/asm-s390/types.h @@ -58,7 +58,6 @@ typedef __signed__ long saddr_t; #ifndef __ASSEMBLY__ -#include <linux/config.h> typedef signed char s8; typedef unsigned char u8; diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h index 41c2792ff6b..aa7a243862e 100644 --- a/include/asm-s390/unistd.h +++ b/include/asm-s390/unistd.h @@ -392,11 +392,11 @@ #endif -/* user-visible error numbers are in the range -1 - -122: see <asm-s390/errno.h> */ +#ifdef __KERNEL__ #define __syscall_return(type, res) \ do { \ - if ((unsigned long)(res) >= (unsigned long)(-125)) { \ + if ((unsigned long)(res) >= (unsigned long)(-4095)) {\ errno = -(res); \ res = -1; \ } \ @@ -546,7 +546,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \ __syscall_return(type,__res); \ } -#ifdef __KERNEL__ #define __ARCH_WANT_IPC_PARSE_VERSION #define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_SYS_ALARM @@ -573,11 +572,9 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \ # define __ARCH_WANT_COMPAT_SYS_TIME # define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND # endif -#endif #ifdef __KERNEL_SYSCALLS__ -#include <linux/config.h> #include <linux/compiler.h> #include <linux/types.h> #include <asm/ptrace.h> @@ -625,7 +622,7 @@ asmlinkage long sys_rt_sigaction(int sig, struct sigaction __user *oact, size_t sigsetsize); -#endif +#endif /* __KERNEL_SYSCALLS__ */ /* * "Conditional" syscalls @@ -635,4 +632,5 @@ asmlinkage long sys_rt_sigaction(int sig, */ #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") +#endif /* __KERNEL__ */ #endif /* _ASM_S390_UNISTD_H_ */ diff --git a/include/asm-s390/vtoc.h b/include/asm-s390/vtoc.h index d1de5b7ebb0..3a5267d90d2 100644 --- a/include/asm-s390/vtoc.h +++ b/include/asm-s390/vtoc.h @@ -177,27 +177,27 @@ struct vtoc_format7_label } __attribute__ ((packed)); struct vtoc_cms_label { - u8 label_id[4]; /* Label identifier */ - u8 vol_id[6]; /* Volid */ - u16 version_id; /* Version identifier */ - u32 block_size; /* Disk block size */ - u32 origin_ptr; /* Disk origin pointer */ - u32 usable_count; /* Number of usable cylinders/blocks */ - u32 formatted_count; /* Maximum number of formatted cylinders/ + __u8 label_id[4]; /* Label identifier */ + __u8 vol_id[6]; /* Volid */ + __u16 version_id; /* Version identifier */ + __u32 block_size; /* Disk block size */ + __u32 origin_ptr; /* Disk origin pointer */ + __u32 usable_count; /* Number of usable cylinders/blocks */ + __u32 formatted_count; /* Maximum number of formatted cylinders/ * blocks */ - u32 block_count; /* Disk size in CMS blocks */ - u32 used_count; /* Number of CMS blocks in use */ - u32 fst_size; /* File Status Table (FST) size */ - u32 fst_count; /* Number of FSTs per CMS block */ - u8 format_date[6]; /* Disk FORMAT date */ - u8 reserved1[2]; - u32 disk_offset; /* Disk offset when reserved*/ - u32 map_block; /* Allocation Map Block with next hole */ - u32 hblk_disp; /* Displacement into HBLK data of next hole */ - u32 user_disp; /* Displacement into user part of Allocation + __u32 block_count; /* Disk size in CMS blocks */ + __u32 used_count; /* Number of CMS blocks in use */ + __u32 fst_size; /* File Status Table (FST) size */ + __u32 fst_count; /* Number of FSTs per CMS block */ + __u8 format_date[6]; /* Disk FORMAT date */ + __u8 reserved1[2]; + __u32 disk_offset; /* Disk offset when reserved*/ + __u32 map_block; /* Allocation Map Block with next hole */ + __u32 hblk_disp; /* Displacement into HBLK data of next hole */ + __u32 user_disp; /* Displacement into user part of Allocation * map */ - u8 reserved2[4]; - u8 segment_name[8]; /* Name of shared segment */ + __u8 reserved2[4]; + __u8 segment_name[8]; /* Name of shared segment */ } __attribute__ ((packed)); #endif /* _ASM_S390_VTOC_H */ diff --git a/include/asm-s390/z90crypt.h b/include/asm-s390/z90crypt.h new file mode 100644 index 00000000000..31a2439b07b --- /dev/null +++ b/include/asm-s390/z90crypt.h @@ -0,0 +1,212 @@ +/* + * include/asm-s390/z90crypt.h + * + * z90crypt 1.3.3 (user-visible header) + * + * Copyright (C) 2001, 2005 IBM Corporation + * Author(s): Robert Burroughs + * Eric Rossman (edrossma@us.ibm.com) + * + * Hotplug & misc device support: Jochen Roehrig (roehrig@de.ibm.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __ASM_S390_Z90CRYPT_H +#define __ASM_S390_Z90CRYPT_H +#include <linux/ioctl.h> + +#define z90crypt_VERSION 1 +#define z90crypt_RELEASE 3 // 2 = PCIXCC, 3 = rewrite for coding standards +#define z90crypt_VARIANT 3 // 3 = CEX2A support + +/** + * struct ica_rsa_modexpo + * + * Requirements: + * - outputdatalength is at least as large as inputdatalength. + * - All key parts are right justified in their fields, padded on + * the left with zeroes. + * - length(b_key) = inputdatalength + * - length(n_modulus) = inputdatalength + */ +struct ica_rsa_modexpo { + char __user * inputdata; + unsigned int inputdatalength; + char __user * outputdata; + unsigned int outputdatalength; + char __user * b_key; + char __user * n_modulus; +}; + +/** + * struct ica_rsa_modexpo_crt + * + * Requirements: + * - inputdatalength is even. + * - outputdatalength is at least as large as inputdatalength. + * - All key parts are right justified in their fields, padded on + * the left with zeroes. + * - length(bp_key) = inputdatalength/2 + 8 + * - length(bq_key) = inputdatalength/2 + * - length(np_key) = inputdatalength/2 + 8 + * - length(nq_key) = inputdatalength/2 + * - length(u_mult_inv) = inputdatalength/2 + 8 + */ +struct ica_rsa_modexpo_crt { + char __user * inputdata; + unsigned int inputdatalength; + char __user * outputdata; + unsigned int outputdatalength; + char __user * bp_key; + char __user * bq_key; + char __user * np_prime; + char __user * nq_prime; + char __user * u_mult_inv; +}; + +#define Z90_IOCTL_MAGIC 'z' // NOTE: Need to allocate from linux folks + +/** + * Interface notes: + * + * The ioctl()s which are implemented (along with relevant details) + * are: + * + * ICARSAMODEXPO + * Perform an RSA operation using a Modulus-Exponent pair + * This takes an ica_rsa_modexpo struct as its arg. + * + * NOTE: please refer to the comments preceding this structure + * for the implementation details for the contents of the + * block + * + * ICARSACRT + * Perform an RSA operation using a Chinese-Remainder Theorem key + * This takes an ica_rsa_modexpo_crt struct as its arg. + * + * NOTE: please refer to the comments preceding this structure + * for the implementation details for the contents of the + * block + * + * Z90STAT_TOTALCOUNT + * Return an integer count of all device types together. + * + * Z90STAT_PCICACOUNT + * Return an integer count of all PCICAs. + * + * Z90STAT_PCICCCOUNT + * Return an integer count of all PCICCs. + * + * Z90STAT_PCIXCCMCL2COUNT + * Return an integer count of all MCL2 PCIXCCs. + * + * Z90STAT_PCIXCCMCL3COUNT + * Return an integer count of all MCL3 PCIXCCs. + * + * Z90STAT_CEX2CCOUNT + * Return an integer count of all CEX2Cs. + * + * Z90STAT_CEX2ACOUNT + * Return an integer count of all CEX2As. + * + * Z90STAT_REQUESTQ_COUNT + * Return an integer count of the number of entries waiting to be + * sent to a device. + * + * Z90STAT_PENDINGQ_COUNT + * Return an integer count of the number of entries sent to a + * device awaiting the reply. + * + * Z90STAT_TOTALOPEN_COUNT + * Return an integer count of the number of open file handles. + * + * Z90STAT_DOMAIN_INDEX + * Return the integer value of the Cryptographic Domain. + * + * Z90STAT_STATUS_MASK + * Return an 64 element array of unsigned chars for the status of + * all devices. + * 0x01: PCICA + * 0x02: PCICC + * 0x03: PCIXCC_MCL2 + * 0x04: PCIXCC_MCL3 + * 0x05: CEX2C + * 0x06: CEX2A + * 0x0d: device is disabled via the proc filesystem + * + * Z90STAT_QDEPTH_MASK + * Return an 64 element array of unsigned chars for the queue + * depth of all devices. + * + * Z90STAT_PERDEV_REQCNT + * Return an 64 element array of unsigned integers for the number + * of successfully completed requests per device since the device + * was detected and made available. + * + * ICAZ90STATUS (deprecated) + * Return some device driver status in a ica_z90_status struct + * This takes an ica_z90_status struct as its arg. + * + * NOTE: this ioctl() is deprecated, and has been replaced with + * single ioctl()s for each type of status being requested + * + * Z90STAT_PCIXCCCOUNT (deprecated) + * Return an integer count of all PCIXCCs (MCL2 + MCL3). + * This is DEPRECATED now that MCL3 PCIXCCs are treated differently from + * MCL2 PCIXCCs. + * + * Z90QUIESCE (not recommended) + * Quiesce the driver. This is intended to stop all new + * requests from being processed. Its use is NOT recommended, + * except in circumstances where there is no other way to stop + * callers from accessing the driver. Its original use was to + * allow the driver to be "drained" of work in preparation for + * a system shutdown. + * + * NOTE: once issued, this ban on new work cannot be undone + * except by unloading and reloading the driver. + */ + +/** + * Supported ioctl calls + */ +#define ICARSAMODEXPO _IOC(_IOC_READ|_IOC_WRITE, Z90_IOCTL_MAGIC, 0x05, 0) +#define ICARSACRT _IOC(_IOC_READ|_IOC_WRITE, Z90_IOCTL_MAGIC, 0x06, 0) + +/* DEPRECATED status calls (bound for removal at some point) */ +#define ICAZ90STATUS _IOR(Z90_IOCTL_MAGIC, 0x10, struct ica_z90_status) +#define Z90STAT_PCIXCCCOUNT _IOR(Z90_IOCTL_MAGIC, 0x43, int) + +/* unrelated to ICA callers */ +#define Z90QUIESCE _IO(Z90_IOCTL_MAGIC, 0x11) + +/* New status calls */ +#define Z90STAT_TOTALCOUNT _IOR(Z90_IOCTL_MAGIC, 0x40, int) +#define Z90STAT_PCICACOUNT _IOR(Z90_IOCTL_MAGIC, 0x41, int) +#define Z90STAT_PCICCCOUNT _IOR(Z90_IOCTL_MAGIC, 0x42, int) +#define Z90STAT_PCIXCCMCL2COUNT _IOR(Z90_IOCTL_MAGIC, 0x4b, int) +#define Z90STAT_PCIXCCMCL3COUNT _IOR(Z90_IOCTL_MAGIC, 0x4c, int) +#define Z90STAT_CEX2CCOUNT _IOR(Z90_IOCTL_MAGIC, 0x4d, int) +#define Z90STAT_CEX2ACOUNT _IOR(Z90_IOCTL_MAGIC, 0x4e, int) +#define Z90STAT_REQUESTQ_COUNT _IOR(Z90_IOCTL_MAGIC, 0x44, int) +#define Z90STAT_PENDINGQ_COUNT _IOR(Z90_IOCTL_MAGIC, 0x45, int) +#define Z90STAT_TOTALOPEN_COUNT _IOR(Z90_IOCTL_MAGIC, 0x46, int) +#define Z90STAT_DOMAIN_INDEX _IOR(Z90_IOCTL_MAGIC, 0x47, int) +#define Z90STAT_STATUS_MASK _IOR(Z90_IOCTL_MAGIC, 0x48, char[64]) +#define Z90STAT_QDEPTH_MASK _IOR(Z90_IOCTL_MAGIC, 0x49, char[64]) +#define Z90STAT_PERDEV_REQCNT _IOR(Z90_IOCTL_MAGIC, 0x4a, int[64]) + +#endif /* __ASM_S390_Z90CRYPT_H */ |