Module Name: src
Committed By: tsutsui
Date: Sat Feb 14 05:03:09 UTC 2015
Modified Files:
src/sys/arch/luna68k/stand/boot: bmd.c disklabel.c kbd.c rcvbuf.h
samachdep.h sc.c scsi.c scsireg.h scsivar.h sioreg.h ufs_disksubr.c
Log Message:
Use proper signedness and exact-width interger types.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/bmd.c \
src/sys/arch/luna68k/stand/boot/ufs_disksubr.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/luna68k/stand/boot/disklabel.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/kbd.c \
src/sys/arch/luna68k/stand/boot/rcvbuf.h \
src/sys/arch/luna68k/stand/boot/scsivar.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/luna68k/stand/boot/samachdep.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/luna68k/stand/boot/sc.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/luna68k/stand/boot/scsi.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/scsireg.h \
src/sys/arch/luna68k/stand/boot/sioreg.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/luna68k/stand/boot/bmd.c
diff -u src/sys/arch/luna68k/stand/boot/bmd.c:1.4 src/sys/arch/luna68k/stand/boot/bmd.c:1.5
--- src/sys/arch/luna68k/stand/boot/bmd.c:1.4 Sat Jan 11 15:51:02 2014
+++ src/sys/arch/luna68k/stand/boot/bmd.c Sat Feb 14 05:03:09 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: bmd.c,v 1.4 2014/01/11 15:51:02 tsutsui Exp $ */
+/* $NetBSD: bmd.c,v 1.5 2015/02/14 05:03:09 tsutsui Exp $ */
/*
* Copyright (c) 1992 OMRON Corporation.
@@ -86,8 +86,8 @@
union bmd_rfcnt {
struct {
- short rfc_hcnt;
- short rfc_vcnt;
+ int16_t rfc_hcnt;
+ int16_t rfc_vcnt;
} p;
uint32_t u;
};
@@ -117,9 +117,9 @@ union bmd_rfcnt {
#define SKIP_NEXT_LINE(addr) (addr += (PL_WIDTH - SL_WIDTH))
-void bmd_draw_char(char *, char *, int, int, int);
-void bmd_reverse_char(char *, char *, int, int);
-void bmd_erase_char(char *, char *, int, int);
+void bmd_draw_char(uint8_t *, uint8_t *, int, int, int);
+void bmd_reverse_char(uint8_t *, uint8_t *, int, int);
+void bmd_erase_char(uint8_t *, uint8_t *, int, int);
void bmd_erase_screen(volatile uint32_t *);
void bmd_scroll_screen(volatile uint32_t *, volatile uint32_t *,
int, int, int, int);
@@ -130,13 +130,13 @@ struct bmd_linec {
struct bmd_linec *bl_prev;
int bl_col;
int bl_end;
- u_char bl_line[128];
+ uint8_t bl_line[128];
};
struct bmd_softc {
int bc_stat;
- char *bc_raddr;
- char *bc_waddr;
+ uint8_t *bc_raddr;
+ uint8_t *bc_waddr;
int bc_xmin;
int bc_xmax;
int bc_ymin;
@@ -280,7 +280,7 @@ void
bmdinit(void)
{
volatile uint32_t *bmd_rfcnt = (uint32_t *)0xB1000000;
- volatile long *bmd_bmsel = (long *)0xB1040000;
+ volatile uint32_t *bmd_bmsel = (uint32_t *)0xB1040000;
struct bmd_softc *bp = &bmd_softc;
struct bmd_linec *bq;
int i;
@@ -290,8 +290,8 @@ bmdinit(void)
* adjust plane position
*/
- bp->bc_raddr = (char *)0xB10C0008; /* plane-0 hardware address */
- bp->bc_waddr = (char *)0xB1080008; /* common bitmap hardware address */
+ bp->bc_raddr = (uint8_t *)0xB10C0008; /* plane-0 hardware address */
+ bp->bc_waddr = (uint8_t *)0xB1080008; /* common bitmap hardware address */
rfcnt.p.rfc_hcnt = 7; /* shift left 16 dot */
rfcnt.p.rfc_vcnt = -27; /* shift down 1 dot */
*bmd_rfcnt = rfcnt.u;
@@ -331,7 +331,7 @@ bmdinit(void)
}
void
-bmdadjust(short hcnt, short vcnt)
+bmdadjust(int16_t hcnt, int16_t vcnt)
{
volatile uint32_t *bmd_rfcnt = (uint32_t *)0xB1000000;
union bmd_rfcnt rfcnt;
@@ -462,7 +462,7 @@ bmdclear(void)
*/
void
-bmd_draw_char(char *raddr, char *waddr, int col, int row, int c)
+bmd_draw_char(uint8_t *raddr, uint8_t *waddr, int col, int row, int c)
{
volatile uint16_t *p, *q;
volatile uint32_t *lp, *lq;
@@ -533,7 +533,7 @@ bmd_draw_char(char *raddr, char *waddr,
}
void
-bmd_reverse_char(char *raddr, char *waddr, int col, int row)
+bmd_reverse_char(uint8_t *raddr, uint8_t *waddr, int col, int row)
{
volatile uint16_t *p, *q;
volatile uint32_t *lp, *lq;
@@ -595,7 +595,7 @@ bmd_reverse_char(char *raddr, char *wadd
}
void
-bmd_erase_char(char *raddr, char *waddr, int col, int row)
+bmd_erase_char(uint8_t *raddr, uint8_t *waddr, int col, int row)
{
bmd_draw_char(raddr, waddr, col, row, 0);
Index: src/sys/arch/luna68k/stand/boot/ufs_disksubr.c
diff -u src/sys/arch/luna68k/stand/boot/ufs_disksubr.c:1.4 src/sys/arch/luna68k/stand/boot/ufs_disksubr.c:1.5
--- src/sys/arch/luna68k/stand/boot/ufs_disksubr.c:1.4 Sat Jan 11 15:51:02 2014
+++ src/sys/arch/luna68k/stand/boot/ufs_disksubr.c Sat Feb 14 05:03:09 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_disksubr.c,v 1.4 2014/01/11 15:51:02 tsutsui Exp $ */
+/* $NetBSD: ufs_disksubr.c,v 1.5 2015/02/14 05:03:09 tsutsui Exp $ */
/*
* Copyright (c) 1992 OMRON Corporation.
@@ -91,7 +91,7 @@
char *
readdisklabel(int ctlr, int id, struct disklabel *lp)
{
- u_char *bp = lbl_buff;
+ uint8_t *bp = lbl_buff;
struct disklabel *dlp;
char *msg = NULL;
static struct scsi_generic_cdb cdb = {
Index: src/sys/arch/luna68k/stand/boot/disklabel.c
diff -u src/sys/arch/luna68k/stand/boot/disklabel.c:1.6 src/sys/arch/luna68k/stand/boot/disklabel.c:1.7
--- src/sys/arch/luna68k/stand/boot/disklabel.c:1.6 Fri Jan 2 19:42:05 2015
+++ src/sys/arch/luna68k/stand/boot/disklabel.c Sat Feb 14 05:03:09 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: disklabel.c,v 1.6 2015/01/02 19:42:05 christos Exp $ */
+/* $NetBSD: disklabel.c,v 1.7 2015/02/14 05:03:09 tsutsui Exp $ */
/*
* Copyright (c) 1992 OMRON Corporation.
@@ -91,17 +91,17 @@ static void display(struct disklabel *);
#define FS_MAGIC FS_UFS1_MAGIC
#define LABEL_SIZE BBSIZE
-u_char lbl_buff[LABEL_SIZE];
+uint8_t lbl_buff[LABEL_SIZE];
#if 0
-u_short
+uint16_t
dkcksum(struct disklabel *lp)
{
- u_short *start, *end;
- u_short sum = 0;
+ uint16_t *start, *end;
+ uint16_t sum = 0;
- start = (u_short *)lp;
- end = (u_short *)&lp->d_partitions[lp->d_npartitions];
+ start = (uint16_t *)lp;
+ end = (uint16_t *)&lp->d_partitions[lp->d_npartitions];
while (start < end)
sum ^= *start++;
return sum;
@@ -114,7 +114,7 @@ disklabel(int argc, char *argv[])
struct scd_dk_label *omp = (struct scd_dk_label *) lbl_buff;
struct disklabel *bp = (struct disklabel *)&lbl_buff[LABELOFFSET];
struct fs *fp = (struct fs *) lbl_buff;
- u_short *p;
+ uint16_t *p;
u_long chksum, count;
char *q;
int i, j;
@@ -180,7 +180,7 @@ disklabel(int argc, char *argv[])
/* checksum of disk-label */
chksum = 0;
count = sizeof(struct scd_dk_label) / sizeof(short int);
- for (p= (u_short *) lbl_buff; count > 0; count--) {
+ for (p= (uint16_t *)lbl_buff; count > 0; count--) {
if (count == 1)
printf("Check Sum: 0x%lx\n", chksum);
chksum ^= *p++;
@@ -243,7 +243,7 @@ disklabel(int argc, char *argv[])
/* restump checksum of OMRON disklabel */
chksum = 0;
count = sizeof(struct scd_dk_label) / sizeof(short int);
- for (p= (u_short *) lbl_buff; count > 1; count--) {
+ for (p= (uint16_t *)lbl_buff; count > 1; count--) {
chksum ^= *p++;
}
printf("chksum: 0x%lx\n", chksum);
@@ -293,7 +293,7 @@ disklabel(int argc, char *argv[])
/* restump checksum of OMRON disklabel */
chksum = 0;
count = sizeof(struct scd_dk_label) / sizeof(short int);
- for (p = (u_short *)lbl_buff; count > 1; count--) {
+ for (p = (uint16_t *)lbl_buff; count > 1; count--) {
chksum ^= *p++;
}
omp->dkl_cksum = chksum;
Index: src/sys/arch/luna68k/stand/boot/kbd.c
diff -u src/sys/arch/luna68k/stand/boot/kbd.c:1.2 src/sys/arch/luna68k/stand/boot/kbd.c:1.3
--- src/sys/arch/luna68k/stand/boot/kbd.c:1.2 Sat Jan 11 15:51:02 2014
+++ src/sys/arch/luna68k/stand/boot/kbd.c Sat Feb 14 05:03:09 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: kbd.c,v 1.2 2014/01/11 15:51:02 tsutsui Exp $ */
+/* $NetBSD: kbd.c,v 1.3 2015/02/14 05:03:09 tsutsui Exp $ */
/*
* Copyright (c) 1992 OMRON Corporation.
@@ -215,7 +215,7 @@ int ctrl_flag = 0;
int meta_flag = 0;
int
-kbd_decode(u_char code)
+kbd_decode(uint8_t code)
{
unsigned int c, updown = 0;
Index: src/sys/arch/luna68k/stand/boot/rcvbuf.h
diff -u src/sys/arch/luna68k/stand/boot/rcvbuf.h:1.2 src/sys/arch/luna68k/stand/boot/rcvbuf.h:1.3
--- src/sys/arch/luna68k/stand/boot/rcvbuf.h:1.2 Sat Jan 11 15:51:02 2014
+++ src/sys/arch/luna68k/stand/boot/rcvbuf.h Sat Feb 14 05:03:09 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: rcvbuf.h,v 1.2 2014/01/11 15:51:02 tsutsui Exp $ */
+/* $NetBSD: rcvbuf.h,v 1.3 2015/02/14 05:03:09 tsutsui Exp $ */
/*
* Copyright (c) 1992 OMRON Corporation.
@@ -78,9 +78,9 @@
#define RBUF_SIZE 128
struct rcvbuf {
- u_char * volatile rb_push;
- u_char * volatile rb_pop;
- u_char rb_buf[RBUF_SIZE + 4];
+ uint8_t * volatile rb_push;
+ uint8_t * volatile rb_pop;
+ uint8_t rb_buf[RBUF_SIZE + 4];
};
#define RBUF_INIT(n) \
Index: src/sys/arch/luna68k/stand/boot/scsivar.h
diff -u src/sys/arch/luna68k/stand/boot/scsivar.h:1.2 src/sys/arch/luna68k/stand/boot/scsivar.h:1.3
--- src/sys/arch/luna68k/stand/boot/scsivar.h:1.2 Fri Jan 10 11:12:03 2014
+++ src/sys/arch/luna68k/stand/boot/scsivar.h Sat Feb 14 05:03:09 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: scsivar.h,v 1.2 2014/01/10 11:12:03 tsutsui Exp $ */
+/* $NetBSD: scsivar.h,v 1.3 2015/02/14 05:03:09 tsutsui Exp $ */
/*
* Copyright (c) 1992 OMRON Corporation.
@@ -74,16 +74,16 @@ struct scsi_softc {
struct scsidevice *sc_spc;
int sc_ctlr;
- u_char *sc_buf; /* Data Buffer Pointor*/
- u_char *sc_cdb; /* CDB Buffer Pointor */
+ uint8_t *sc_buf; /* Data Buffer Pointor*/
+ uint8_t *sc_cdb; /* CDB Buffer Pointor */
volatile int *sc_lock; /* Lock Flag addres */
int sc_flags; /* SPC Status Flags */
int sc_phase; /* Current SCSI Phase */
int sc_target; /* Current Target ID */
int sc_len; /* Buffer Length */
int sc_cdblen; /* CDB length */
- u_char sc_stat;
- u_char sc_msg[7];
+ uint8_t sc_stat;
+ uint8_t sc_msg[7];
};
Index: src/sys/arch/luna68k/stand/boot/samachdep.h
diff -u src/sys/arch/luna68k/stand/boot/samachdep.h:1.19 src/sys/arch/luna68k/stand/boot/samachdep.h:1.20
--- src/sys/arch/luna68k/stand/boot/samachdep.h:1.19 Mon Apr 21 11:06:55 2014
+++ src/sys/arch/luna68k/stand/boot/samachdep.h Sat Feb 14 05:03:09 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: samachdep.h,v 1.19 2014/04/21 11:06:55 tsutsui Exp $ */
+/* $NetBSD: samachdep.h,v 1.20 2015/02/14 05:03:09 tsutsui Exp $ */
/*
* Copyright (c) 1982, 1990, 1993
@@ -65,7 +65,7 @@ void bmccnputc(dev_t, int);
/* bmd.c */
void bmdinit(void);
int bmdputc(int);
-void bmdadjust(short, short);
+void bmdadjust(int16_t, int16_t);
void bmdclear(void);
/* boot.c */
@@ -81,7 +81,7 @@ void cnputc(int);
int make_device(const char *, int *, int *, int *, char **);
/* disklabel.c */
-extern u_char lbl_buff[];
+extern uint8_t lbl_buff[];
int disklabel(int, char **);
/* font.c */
@@ -107,7 +107,7 @@ extern const char *default_bootdev;
extern int default_unit;
/* kbd.c */
-int kbd_decode(u_char);
+int kbd_decode(uint8_t);
/* lance.c */
void *lance_attach(int, void *, void *, uint8_t *);
@@ -165,18 +165,18 @@ int scinit(int, void *);
struct scsi_inquiry;
bool scident(uint, uint, uint, struct scsi_inquiry *, uint32_t *);
struct scsi_generic_cdb;
-int scsi_immed_command(int, int, int, struct scsi_generic_cdb *, u_char *,
+int scsi_immed_command(int, int, int, struct scsi_generic_cdb *, uint8_t *,
unsigned int);
-int scsi_request_sense(int, int, int, u_char *, unsigned int);
+int scsi_request_sense(int, int, int, uint8_t *, unsigned int);
int scsi_test_unit_rdy(int, int, int);
int scsi_format_unit(int, int, int);
int scintr(void);
/* scsi.c */
int scsi(int, char **);
-int scsi_read_raw(u_int, u_int, u_int, u_char *, u_int);
-int scsi_read(u_int, u_char *, u_int);
-int scsi_write(u_int, u_char *, u_int);
+int scsi_read_raw(u_int, u_int, u_int, uint8_t *, u_int);
+int scsi_read(u_int, uint8_t *, u_int);
+int scsi_write(u_int, uint8_t *, u_int);
/* screen.c */
int screen(int, char **);
Index: src/sys/arch/luna68k/stand/boot/sc.c
diff -u src/sys/arch/luna68k/stand/boot/sc.c:1.11 src/sys/arch/luna68k/stand/boot/sc.c:1.12
--- src/sys/arch/luna68k/stand/boot/sc.c:1.11 Wed Apr 16 11:18:00 2014
+++ src/sys/arch/luna68k/stand/boot/sc.c Sat Feb 14 05:03:09 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: sc.c,v 1.11 2014/04/16 11:18:00 tsutsui Exp $ */
+/* $NetBSD: sc.c,v 1.12 2015/02/14 05:03:09 tsutsui Exp $ */
/*
* Copyright (c) 1992 OMRON Corporation.
@@ -87,11 +87,11 @@
static void screset(struct scsi_softc *);
static void scprobe(struct scsi_softc *, uint, uint);
-static int issue_select(struct scsidevice *, u_char);
-static void ixfer_start(struct scsidevice *, int, u_char, int);
-static void ixfer_out(struct scsidevice *, int, u_char *);
-static void ixfer_in(struct scsidevice *, int, u_char *);
-static int scrun(int, int, u_char *, int, u_char *, int, volatile int *);
+static int issue_select(struct scsidevice *, uint8_t);
+static void ixfer_start(struct scsidevice *, int, uint8_t, int);
+static void ixfer_out(struct scsidevice *, int, uint8_t *);
+static void ixfer_in(struct scsidevice *, int, uint8_t *);
+static int scrun(int, int, uint8_t *, int, uint8_t *, int, volatile int *);
static int scfinish(int);
static void scabort(struct scsi_softc *);
@@ -198,7 +198,7 @@ scident(uint ctlr, uint target, uint lun
if (i < 0 || --tries < 0)
return false;
if (i == STS_CHECKCOND) {
- u_char sensebuf[8];
+ uint8_t sensebuf[8];
struct scsi_xsense *sp = (struct scsi_xsense *)sensebuf;
scsi_request_sense(ctlr, target, lun, sensebuf, 8);
@@ -208,9 +208,9 @@ scident(uint ctlr, uint target, uint lun
}
DELAY(1000);
}
- if (scsi_immed_command(ctlr, target, lun, &inq, (u_char *)&inqbuf,
+ if (scsi_immed_command(ctlr, target, lun, &inq, (uint8_t *)&inqbuf,
sizeof(inqbuf)) ||
- scsi_immed_command(ctlr, target, lun, &cap, (u_char *)&capbuf,
+ scsi_immed_command(ctlr, target, lun, &cap, (uint8_t *)&capbuf,
sizeof(capbuf)))
/* doesn't exist or not a CCS device */
return false;
@@ -271,7 +271,7 @@ scprobe(struct scsi_softc *hs, uint targ
*/
int
-issue_select(struct scsidevice *hd, u_char target)
+issue_select(struct scsidevice *hd, uint8_t target)
{
hd->scsi_pctl = 0;
@@ -300,7 +300,7 @@ issue_select(struct scsidevice *hd, u_ch
*/
void
-ixfer_start(struct scsidevice *hd, int len, u_char phase, int wait)
+ixfer_start(struct scsidevice *hd, int len, uint8_t phase, int wait)
{
hd->scsi_tch = ((len & 0xff0000) >> 16);
@@ -311,7 +311,7 @@ ixfer_start(struct scsidevice *hd, int l
}
void
-ixfer_out(struct scsidevice *hd, int len, u_char *buf)
+ixfer_out(struct scsidevice *hd, int len, uint8_t *buf)
{
for (; len > 0; len--) {
@@ -323,7 +323,7 @@ ixfer_out(struct scsidevice *hd, int len
}
void
-ixfer_in(struct scsidevice *hd, int len, u_char *buf)
+ixfer_in(struct scsidevice *hd, int len, uint8_t *buf)
{
for (; len > 0; len--) {
@@ -340,7 +340,7 @@ ixfer_in(struct scsidevice *hd, int len,
*/
int
-scrun(int ctlr, int target, u_char *cdb, int cdblen, u_char *buf, int len,
+scrun(int ctlr, int target, uint8_t *cdb, int cdblen, uint8_t *buf, int len,
volatile int *lock)
{
struct scsi_softc *hs;
@@ -500,7 +500,8 @@ scsi_test_unit_rdy(int ctlr, int target,
}
int
-scsi_request_sense(int ctlr, int target, int lun, u_char *buf, unsigned int len)
+scsi_request_sense(int ctlr, int target, int lun, uint8_t *buf,
+ unsigned int len)
{
static struct scsi_cdb6 cdb = { CMD_REQUEST_SENSE };
int status;
@@ -545,7 +546,7 @@ scsi_request_sense(int ctlr, int target,
int
scsi_immed_command(int ctlr, int target, int lun, struct scsi_generic_cdb *cdb,
- u_char *buf, unsigned int len)
+ uint8_t *buf, unsigned int len)
{
int status;
volatile int lock;
@@ -596,7 +597,7 @@ scsi_format_unit(int ctlr, int target, i
cdb.lun = lun;
- if (!(scrun(ctlr, target, (void *)&cdb, 6, (u_char *) 0, 0, &lock))) {
+ if (!(scrun(ctlr, target, (void *)&cdb, 6, NULL, 0, &lock))) {
#ifdef DEBUG
printf("scsi_format_unit: Command Transfer Failed.\n");
#endif
@@ -633,9 +634,9 @@ scintr(void)
{
struct scsi_softc *hs;
struct scsidevice *hd;
- u_char ints, temp;
+ uint8_t ints, temp;
int i;
- u_char *buf;
+ uint8_t *buf;
int len;
for (i = 0; i < NSC; i++) {
Index: src/sys/arch/luna68k/stand/boot/scsi.c
diff -u src/sys/arch/luna68k/stand/boot/scsi.c:1.5 src/sys/arch/luna68k/stand/boot/scsi.c:1.6
--- src/sys/arch/luna68k/stand/boot/scsi.c:1.5 Sat Jan 11 15:51:02 2014
+++ src/sys/arch/luna68k/stand/boot/scsi.c Sat Feb 14 05:03:09 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: scsi.c,v 1.5 2014/01/11 15:51:02 tsutsui Exp $ */
+/* $NetBSD: scsi.c,v 1.6 2015/02/14 05:03:09 tsutsui Exp $ */
/*
* Copyright (c) 1992 OMRON Corporation.
@@ -86,7 +86,7 @@ int scsi_device = 6;
#define SENSBUFF 8 /* デバイスドライバでセンスデータ */
/* の長さを8バイト以内に固定して */
-u_char sensbuff[SENSBUFF]; /* 8以上は無意味である。 */
+uint8_t sensbuff[SENSBUFF]; /* 8以上は無意味である。 */
static struct scsi_inquiry inquirybuf;
static struct scsi_generic_cdb inquiry = {
@@ -131,7 +131,7 @@ scsi(int argc, char *argv[])
scsi_request_sense( 0, scsi_device, 0, sensbuff, SENSBUFF);
} else if (!strcmp(argv[1], "inquiry")) {
if (scsi_immed_command( 0, scsi_device, 0, &inquiry,
- (u_char *)&inquirybuf, sizeof(inquirybuf)) == 0) {
+ (uint8_t *)&inquirybuf, sizeof(inquirybuf)) == 0) {
printf("Type:\t0x%x\n", inquirybuf.type);
printf("Qualifier:\t0x%x\n", inquirybuf.qual);
printf("Version:\t0x%x\n", inquirybuf.version);
@@ -154,7 +154,7 @@ scsi(int argc, char *argv[])
}
} else if (!strcmp(argv[1], "read_capacity")) {
if (scsi_immed_command( 0, scsi_device, 0, &capacity,
- (u_char *)&capacitybuf, sizeof(capacitybuf)) == 0) {
+ (uint8_t *)&capacitybuf, sizeof(capacitybuf)) == 0) {
printf("Logical Block Address:\t%ld (0x%lx)\n",
capacitybuf[0], capacitybuf[0]);
printf("Block Length:\t\t%ld (0x%lx)\n",
@@ -194,7 +194,7 @@ static struct scsi_generic_cdb scsi_cdb
};
int
-scsi_read_raw(u_int target, u_int blk, u_int nblk, u_char *buff, u_int len)
+scsi_read_raw(u_int target, u_int blk, u_int nblk, uint8_t *buff, u_int len)
{
struct scsi_generic_cdb *cdb = &scsi_cdb;
@@ -215,7 +215,7 @@ scsi_read_raw(u_int target, u_int blk, u
}
int
-scsi_read(u_int blk, u_char *buff, u_int len)
+scsi_read(u_int blk, uint8_t *buff, u_int len)
{
u_int nblk = len >> DEV_BSHIFT;
@@ -223,7 +223,7 @@ scsi_read(u_int blk, u_char *buff, u_int
}
int
-scsi_write(u_int blk, u_char *buff, u_int len)
+scsi_write(u_int blk, uint8_t *buff, u_int len)
{
struct scsi_generic_cdb *cdb = &scsi_cdb;
Index: src/sys/arch/luna68k/stand/boot/scsireg.h
diff -u src/sys/arch/luna68k/stand/boot/scsireg.h:1.3 src/sys/arch/luna68k/stand/boot/scsireg.h:1.4
--- src/sys/arch/luna68k/stand/boot/scsireg.h:1.3 Fri Jan 3 07:17:19 2014
+++ src/sys/arch/luna68k/stand/boot/scsireg.h Sat Feb 14 05:03:09 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: scsireg.h,v 1.3 2014/01/03 07:17:19 tsutsui Exp $ */
+/* $NetBSD: scsireg.h,v 1.4 2015/02/14 05:03:09 tsutsui Exp $ */
/*
* Copyright (c) 1990, 1992, 1993
@@ -39,77 +39,77 @@
*/
struct scsidevice {
- volatile u_char scsi_bdid, p0, p1, p2; /* 000 */
- volatile u_char scsi_sctl, p3, p4, p5; /* 004 */
-#define SCTL_DISABLE 0x80
-#define SCTL_CTRLRST 0x40
-#define SCTL_DIAG 0x20
-#define SCTL_ABRT_ENAB 0x10
-#define SCTL_PARITY_ENAB 0x08
-#define SCTL_SEL_ENAB 0x04
-#define SCTL_RESEL_ENAB 0x02
-#define SCTL_INTR_ENAB 0x01
- volatile u_char scsi_scmd, p6, p7, p8; /* 008 */
-#define SCMD_RST 0x10
-#define SCMD_ICPT_XFR 0x08
-#define SCMD_PROG_XFR 0x04
-#define SCMD_PAD 0x01 /* if initiator */
-#define SCMD_PERR_STOP 0x01 /* if target */
- /* command codes */
-#define SCMD_BUS_REL 0x00
-#define SCMD_SELECT 0x20
-#define SCMD_RST_ATN 0x40
-#define SCMD_SET_ATN 0x60
-#define SCMD_XFR 0x80
-#define SCMD_XFR_PAUSE 0xa0
-#define SCMD_RST_ACK 0xc0
-#define SCMD_SET_ACK 0xe0
- volatile u_char scsi_tmod, p9, p10, p11; /* 00C */
-#define TMOD_SYNC 0x80
- volatile u_char scsi_ints, p12, p13, p14; /* 010 */
-#define INTS_SEL 0x80
-#define INTS_RESEL 0x40
-#define INTS_DISCON 0x20
-#define INTS_CMD_DONE 0x10
-#define INTS_SRV_REQ 0x08
-#define INTS_TIMEOUT 0x04
-#define INTS_HARD_ERR 0x02
-#define INTS_RST 0x01
- volatile u_char scsi_psns, p15, p16, p17; /* 014 */
-#define PSNS_REQ 0x80
-#define PSNS_ACK 0x40
-#define PSNS_ATN 0x20
-#define PSNS_SEL 0x10
-#define PSNS_BSY 0x08
-#define scsi_sdgc scsi_psns
-#define SDGC_XFER_ENAB 0x20
- volatile u_char scsi_ssts, p18, p19, p20; /* 018 */
-#define SSTS_INITIATOR 0x80
-#define SSTS_TARGET 0x40
-#define SSTS_BUSY 0x20
-#define SSTS_XFR 0x10
-#define SSTS_ACTIVE (SSTS_INITIATOR|SSTS_XFR)
-#define SSTS_RST 0x08
-#define SSTS_TCZERO 0x04
-#define SSTS_DREG_FULL 0x02
-#define SSTS_DREG_EMPTY 0x01
- volatile u_char scsi_serr, p21, p22, p23; /* 01C */
-#define SERR_SCSI_PAR 0x80
-#define SERR_SPC_PAR 0x40
-#define SERR_XFER_OUT 0x20
-#define SERR_TC_PAR 0x08
-#define SERR_PHASE_ERR 0x04
-#define SERR_SHORT_XFR 0x02
-#define SERR_OFFSET 0x01
- volatile u_char scsi_pctl, p24, p25, p26; /* 020 */
-#define PCTL_BFINT_ENAB 0x80
- volatile u_char scsi_mbc, p27, p28, p29; /* 024 */
- volatile u_char scsi_dreg, p30, p31, p32; /* 028 */
- volatile u_char scsi_temp, p33, p34, p35; /* 02C */
- volatile u_char scsi_tch, p36, p37, p38; /* 030 */
- volatile u_char scsi_tcm, p39, p40, p41; /* 034 */
- volatile u_char scsi_tcl, p42, p43, p44; /* 038 */
- volatile u_char scsi_exbf, p45, p46, p47; /* 03C */
+ volatile uint8_t scsi_bdid, p0, p1, p2; /* 000 */
+ volatile uint8_t scsi_sctl, p3, p4, p5; /* 004 */
+#define SCTL_DISABLE 0x80
+#define SCTL_CTRLRST 0x40
+#define SCTL_DIAG 0x20
+#define SCTL_ABRT_ENAB 0x10
+#define SCTL_PARITY_ENAB 0x08
+#define SCTL_SEL_ENAB 0x04
+#define SCTL_RESEL_ENAB 0x02
+#define SCTL_INTR_ENAB 0x01
+ volatile uint8_t scsi_scmd, p6, p7, p8; /* 008 */
+#define SCMD_RST 0x10
+#define SCMD_ICPT_XFR 0x08
+#define SCMD_PROG_XFR 0x04
+#define SCMD_PAD 0x01 /* if initiator */
+#define SCMD_PERR_STOP 0x01 /* if target */
+ /* command codes */
+#define SCMD_BUS_REL 0x00
+#define SCMD_SELECT 0x20
+#define SCMD_RST_ATN 0x40
+#define SCMD_SET_ATN 0x60
+#define SCMD_XFR 0x80
+#define SCMD_XFR_PAUSE 0xa0
+#define SCMD_RST_ACK 0xc0
+#define SCMD_SET_ACK 0xe0
+ volatile uint8_t scsi_tmod, p9, p10, p11; /* 00C */
+#define TMOD_SYNC 0x80
+ volatile uint8_t scsi_ints, p12, p13, p14; /* 010 */
+#define INTS_SEL 0x80
+#define INTS_RESEL 0x40
+#define INTS_DISCON 0x20
+#define INTS_CMD_DONE 0x10
+#define INTS_SRV_REQ 0x08
+#define INTS_TIMEOUT 0x04
+#define INTS_HARD_ERR 0x02
+#define INTS_RST 0x01
+ volatile uint8_t scsi_psns, p15, p16, p17; /* 014 */
+#define PSNS_REQ 0x80
+#define PSNS_ACK 0x40
+#define PSNS_ATN 0x20
+#define PSNS_SEL 0x10
+#define PSNS_BSY 0x08
+#define scsi_sdgc scsi_psns
+#define SDGC_XFER_ENAB 0x20
+ volatile uint8_t scsi_ssts, p18, p19, p20; /* 018 */
+#define SSTS_INITIATOR 0x80
+#define SSTS_TARGET 0x40
+#define SSTS_BUSY 0x20
+#define SSTS_XFR 0x10
+#define SSTS_ACTIVE (SSTS_INITIATOR|SSTS_XFR)
+#define SSTS_RST 0x08
+#define SSTS_TCZERO 0x04
+#define SSTS_DREG_FULL 0x02
+#define SSTS_DREG_EMPTY 0x01
+ volatile uint8_t scsi_serr, p21, p22, p23; /* 01C */
+#define SERR_SCSI_PAR 0x80
+#define SERR_SPC_PAR 0x40
+#define SERR_XFER_OUT 0x20
+#define SERR_TC_PAR 0x08
+#define SERR_PHASE_ERR 0x04
+#define SERR_SHORT_XFR 0x02
+#define SERR_OFFSET 0x01
+ volatile uint8_t scsi_pctl, p24, p25, p26; /* 020 */
+#define PCTL_BFINT_ENAB 0x80
+ volatile uint8_t scsi_mbc, p27, p28, p29; /* 024 */
+ volatile uint8_t scsi_dreg, p30, p31, p32; /* 028 */
+ volatile uint8_t scsi_temp, p33, p34, p35; /* 02C */
+ volatile uint8_t scsi_tch, p36, p37, p38; /* 030 */
+ volatile uint8_t scsi_tcm, p39, p40, p41; /* 034 */
+ volatile uint8_t scsi_tcl, p42, p43, p44; /* 038 */
+ volatile uint8_t scsi_exbf, p45, p46, p47; /* 03C */
};
/* psns/pctl phase lines as bits */
@@ -193,66 +193,66 @@ struct scsidevice {
/* command descriptor blocks */
struct scsi_cdb6 {
- u_char cmd; /* command code */
- u_char lun: 3, /* logical unit on ctlr */
+ uint8_t cmd; /* command code */
+ uint8_t lun: 3, /* logical unit on ctlr */
lbah: 5; /* msb of read/write logical block addr */
- u_char lbam; /* middle byte of l.b.a. */
- u_char lbal; /* lsb of l.b.a. */
- u_char len; /* transfer length */
- u_char xtra;
+ uint8_t lbam; /* middle byte of l.b.a. */
+ uint8_t lbal; /* lsb of l.b.a. */
+ uint8_t len; /* transfer length */
+ uint8_t xtra;
};
struct scsi_cdb10 {
- u_char cmd; /* command code */
- u_char lun: 3, /* logical unit on ctlr */
+ uint8_t cmd; /* command code */
+ uint8_t lun: 3, /* logical unit on ctlr */
: 4,
rel: 1; /* l.b.a. is relative addr if =1 */
- u_char lbah; /* msb of read/write logical block addr */
- u_char lbahm; /* high middle byte of l.b.a. */
- u_char lbalm; /* low middle byte of l.b.a. */
- u_char lbal; /* lsb of l.b.a. */
- u_char reserved;
- u_char lenh; /* msb transfer length */
- u_char lenl; /* lsb transfer length */
- u_char xtra;
+ uint8_t lbah; /* msb of read/write logical block addr */
+ uint8_t lbahm; /* high middle byte of l.b.a. */
+ uint8_t lbalm; /* low middle byte of l.b.a. */
+ uint8_t lbal; /* lsb of l.b.a. */
+ uint8_t reserved;
+ uint8_t lenh; /* msb transfer length */
+ uint8_t lenl; /* lsb transfer length */
+ uint8_t xtra;
};
/* basic sense data */
struct scsi_sense {
- u_char valid: 1, /* l.b.a. is valid */
+ uint8_t valid: 1, /* l.b.a. is valid */
class: 3,
code: 4;
- u_char vu: 4, /* vendor unique */
+ uint8_t vu: 4, /* vendor unique */
lbah: 4;
- u_char lbam;
- u_char lbal;
+ uint8_t lbam;
+ uint8_t lbal;
};
struct scsi_xsense {
- u_char valid: 1, /* l.b.a. is valid */
+ uint8_t valid: 1, /* l.b.a. is valid */
class: 3,
code: 4;
- u_char segment;
- u_char filemark: 1,
+ uint8_t segment;
+ uint8_t filemark: 1,
eom: 1,
ili: 1, /* illegal length indicator */
rsvd: 1,
key: 4;
- u_char info1;
- u_char info2;
- u_char info3;
- u_char info4;
- u_char len; /* additional sense length */
+ uint8_t info1;
+ uint8_t info2;
+ uint8_t info3;
+ uint8_t info4;
+ uint8_t len; /* additional sense length */
};
/* inquiry data */
struct scsi_inquiry {
- u_char type;
- u_char qual;
- u_char version;
- u_char rsvd;
- u_char len;
+ uint8_t type;
+ uint8_t qual;
+ uint8_t version;
+ uint8_t rsvd;
+ uint8_t len;
char class[3];
char vendor_id[8];
char product_id[16];
@@ -261,5 +261,5 @@ struct scsi_inquiry {
struct scsi_generic_cdb {
int len; /* cdb length (in bytes) */
- u_char cdb[28]; /* cdb to use on next read/write */
+ uint8_t cdb[28]; /* cdb to use on next read/write */
};
Index: src/sys/arch/luna68k/stand/boot/sioreg.h
diff -u src/sys/arch/luna68k/stand/boot/sioreg.h:1.3 src/sys/arch/luna68k/stand/boot/sioreg.h:1.4
--- src/sys/arch/luna68k/stand/boot/sioreg.h:1.3 Sat Jan 11 15:51:02 2014
+++ src/sys/arch/luna68k/stand/boot/sioreg.h Sat Feb 14 05:03:09 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: sioreg.h,v 1.3 2014/01/11 15:51:02 tsutsui Exp $ */
+/* $NetBSD: sioreg.h,v 1.4 2015/02/14 05:03:09 tsutsui Exp $ */
/*
* Copyright (c) 1992 OMRON Corporation.
@@ -73,10 +73,10 @@
/* sioreg.h NOV-26-1991 */
struct siodevice {
- volatile u_char sio_data;
- u_char sio_pad1;
- volatile u_char sio_cmd;
- u_char sio_pad2;
+ volatile uint8_t sio_data;
+ uint8_t sio_pad1;
+ volatile uint8_t sio_cmd;
+ uint8_t sio_pad2;
};
#define sio_stat sio_cmd