diff options
author | Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> | 2016-04-18 13:45:10 +0200 |
---|---|---|
committer | Cornelia Huck <cornelia.huck@de.ibm.com> | 2017-05-02 15:08:54 +0200 |
commit | cfe2124a7f7285bfe5bf91e068f88437d1f8a591 (patch) | |
tree | 15e8299f9febfd31efe4f1c8d7d64122ffd95ccf | |
parent | 5559716c98ff1afd61b0f6707e261bf9579a37e7 (diff) | |
download | qemu-cfe2124a7f7285bfe5bf91e068f88437d1f8a591.zip qemu-cfe2124a7f7285bfe5bf91e068f88437d1f8a591.tar.gz qemu-cfe2124a7f7285bfe5bf91e068f88437d1f8a591.tar.bz2 |
pc-bios/s390-ccw: Make ebcdic/ascii conversion public
Make the ebcdic_to_ascii function public to the rest of the
"bios" code, as the volume label is no more the single thing
to be converted.
Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com>
Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
-rw-r--r-- | pc-bios/s390-ccw/bootmap.h | 22 | ||||
-rw-r--r-- | pc-bios/s390-ccw/main.c | 11 | ||||
-rw-r--r-- | pc-bios/s390-ccw/s390-ccw.h | 13 |
3 files changed, 24 insertions, 22 deletions
diff --git a/pc-bios/s390-ccw/bootmap.h b/pc-bios/s390-ccw/bootmap.h index bea1687..9073de2 100644 --- a/pc-bios/s390-ccw/bootmap.h +++ b/pc-bios/s390-ccw/bootmap.h @@ -264,28 +264,6 @@ typedef enum { /* utility code below */ -static const unsigned char ebc2asc[256] = - /* 0123456789abcdef0123456789abcdef */ - "................................" /* 1F */ - "................................" /* 3F */ - " ...........<(+|&.........!$*);." /* 5F first.chr.here.is.real.space */ - "-/.........,%_>?.........`:#@'=\""/* 7F */ - ".abcdefghi.......jklmnopqr......" /* 9F */ - "..stuvwxyz......................" /* BF */ - ".ABCDEFGHI.......JKLMNOPQR......" /* DF */ - "..STUVWXYZ......0123456789......";/* FF */ - -static inline void ebcdic_to_ascii(const char *src, - char *dst, - unsigned int size) -{ - unsigned int i; - for (i = 0; i < size; i++) { - unsigned c = src[i]; - dst[i] = ebc2asc[c]; - } -} - static inline void print_volser(const void *volser) { char ascii[8]; diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index 0946766..393d732 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -15,6 +15,17 @@ char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE))); static SubChannelId blk_schid = { .one = 1 }; IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE))); +const unsigned char ebc2asc[256] = + /* 0123456789abcdef0123456789abcdef */ + "................................" /* 1F */ + "................................" /* 3F */ + " ...........<(+|&.........!$*);." /* 5F first.chr.here.is.real.space */ + "-/.........,%_>?.........`:#@'=\""/* 7F */ + ".abcdefghi.......jklmnopqr......" /* 9F */ + "..stuvwxyz......................" /* BF */ + ".ABCDEFGHI.......JKLMNOPQR......" /* DF */ + "..STUVWXYZ......0123456789......";/* FF */ + /* * Priniciples of Operations (SA22-7832-09) chapter 17 requires that * a subsystem-identification is at 184-187 and bytes 188-191 are zero diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h index ded67bc..4e0aab2 100644 --- a/pc-bios/s390-ccw/s390-ccw.h +++ b/pc-bios/s390-ccw/s390-ccw.h @@ -189,4 +189,17 @@ static inline void IPL_check(bool term, const char *message) } } +extern const unsigned char ebc2asc[256]; +static inline void ebcdic_to_ascii(const char *src, + char *dst, + unsigned int size) +{ + unsigned int i; + + for (i = 0; i < size; i++) { + unsigned c = src[i]; + dst[i] = ebc2asc[c]; + } +} + #endif /* S390_CCW_H */ |