diff options
author | Dimitri John Ledkov <xnox@ubuntu.com> | 2016-11-24 16:48:43 +0000 |
---|---|---|
committer | Dimitri John Ledkov <xnox@ubuntu.com> | 2016-11-24 16:48:43 +0000 |
commit | b33f77cf05cb266494ef8dacd21758271e7103a6 (patch) | |
tree | bf5b172d5a7b9bee3877c4fc838cc3ebf9aa308f /src/include/s390_common.h |
Import libica_3.0.1.orig.tar.gz
[dgit import orig libica_3.0.1.orig.tar.gz]
Diffstat (limited to 'src/include/s390_common.h')
-rw-r--r-- | src/include/s390_common.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/include/s390_common.h b/src/include/s390_common.h new file mode 100644 index 0000000..e66baa8 --- /dev/null +++ b/src/include/s390_common.h @@ -0,0 +1,40 @@ +/* This program is released under the Common Public License V1.0 + * + * You should have received a copy of Common Public License V1.0 along with + * with this program. + */ + +/** + * Authors: Holger Dengler <hd@linux.vnet.ibm.com> + * + * Copyright IBM Corp. 2011 + */ +#include <stdint.h> + +#ifndef S390_COMMON_H +#define S390_COMMON_H + +#define UNDIRECTED_FC(x) (((x)/2)*2) + +struct uint128 { + uint64_t g[2]; +}; + +static inline void block_xor(unsigned char dest[], unsigned char a[], + unsigned char b[], unsigned int length) +{ + unsigned int i; + for (i = 0; i < length; i++) { + dest[i] = a[i] ^ b[i]; + } +} + +static inline void memcpy_r_allign(void *dest, int dest_bs, + void *src, int src_bs, int size) +{ + memcpy((unsigned char *)dest + (dest_bs - size), + (unsigned char *)src + (src_bs - size), size); +} + +#endif /* S390_COMMON_H */ + |