diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-08-16 17:46:09 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-08-16 17:46:09 +0000 |
commit | 1fe1eab7623ce4e6f32b48a19f9e27bd2ed0401c (patch) | |
tree | 5e2c5a05415ac6c703f851e0d59378ac595b21ff /sys/arch/mvme68k/stand | |
parent | 1ef3da6020db0e3dd3239636e6f95b0eb1744c29 (diff) |
ansi
Diffstat (limited to 'sys/arch/mvme68k/stand')
-rw-r--r-- | sys/arch/mvme68k/stand/prtvid/prtvid.c | 71 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/wrtvid/wrtvid.c | 107 |
2 files changed, 88 insertions, 90 deletions
diff --git a/sys/arch/mvme68k/stand/prtvid/prtvid.c b/sys/arch/mvme68k/stand/prtvid/prtvid.c index 9d56f87f457..c937d4246d0 100644 --- a/sys/arch/mvme68k/stand/prtvid/prtvid.c +++ b/sys/arch/mvme68k/stand/prtvid/prtvid.c @@ -1,13 +1,44 @@ -/* $OpenBSD: prtvid.c,v 1.4 2001/07/04 08:06:57 niklas Exp $ */ +/* $OpenBSD: prtvid.c,v 1.5 2003/08/16 17:46:08 deraadt Exp $ */ #include <stdio.h> #define __DBINTERFACE_PRIVATE #include <db.h> #include <machine/disklabel.h> -main(argc, argv) - int argc; - char *argv[]; +static void +swabvid(struct cpu_disklabel *cdl) +{ + M_32_SWAP(cdl->vid_oss); + M_16_SWAP(cdl->vid_osl); + M_16_SWAP(cdl->vid_osa_u); + M_16_SWAP(cdl->vid_osa_l); + M_32_SWAP(cdl->vid_cas); +} + +static void +swabcfg(struct cpu_disklabel *cdl) +{ + printf("swapping cfg\n"); + + M_16_SWAP(cdl->cfg_atm); + M_16_SWAP(cdl->cfg_prm); + M_16_SWAP(cdl->cfg_atm); + M_16_SWAP(cdl->cfg_rec); + M_16_SWAP(cdl->cfg_trk); + M_16_SWAP(cdl->cfg_psm); + M_16_SWAP(cdl->cfg_shd); + M_16_SWAP(cdl->cfg_pcom); + M_16_SWAP(cdl->cfg_rwcc); + M_16_SWAP(cdl->cfg_ecc); + M_16_SWAP(cdl->cfg_eatm); + M_16_SWAP(cdl->cfg_eprm); + M_16_SWAP(cdl->cfg_eatw); + M_16_SWAP(cdl->cfg_rsvc1); + M_16_SWAP(cdl->cfg_rsvc2); +} + +int +main(int argc, char *argv[]) { struct cpu_disklabel *cdl; @@ -93,35 +124,3 @@ main(argc, argv) printf("cfg_rsvc2 %x %x\n", cdl->cfg_rsvc2, (char *)&(cdl->cfg_rsvc2) - (char *)(cdl)); } - -swabvid(cdl) - struct cpu_disklabel *cdl; -{ - M_32_SWAP(cdl->vid_oss); - M_16_SWAP(cdl->vid_osl); - M_16_SWAP(cdl->vid_osa_u); - M_16_SWAP(cdl->vid_osa_l); - M_32_SWAP(cdl->vid_cas); -} - -swabcfg(cdl) - struct cpu_disklabel *cdl; -{ - printf("swapping cfg\n"); - - M_16_SWAP(cdl->cfg_atm); - M_16_SWAP(cdl->cfg_prm); - M_16_SWAP(cdl->cfg_atm); - M_16_SWAP(cdl->cfg_rec); - M_16_SWAP(cdl->cfg_trk); - M_16_SWAP(cdl->cfg_psm); - M_16_SWAP(cdl->cfg_shd); - M_16_SWAP(cdl->cfg_pcom); - M_16_SWAP(cdl->cfg_rwcc); - M_16_SWAP(cdl->cfg_ecc); - M_16_SWAP(cdl->cfg_eatm); - M_16_SWAP(cdl->cfg_eprm); - M_16_SWAP(cdl->cfg_eatw); - M_16_SWAP(cdl->cfg_rsvc1); - M_16_SWAP(cdl->cfg_rsvc2); -} diff --git a/sys/arch/mvme68k/stand/wrtvid/wrtvid.c b/sys/arch/mvme68k/stand/wrtvid/wrtvid.c index e9b4b98f230..3dd4f92e451 100644 --- a/sys/arch/mvme68k/stand/wrtvid/wrtvid.c +++ b/sys/arch/mvme68k/stand/wrtvid/wrtvid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wrtvid.c,v 1.4 2003/06/01 17:00:37 deraadt Exp $ */ +/* $OpenBSD: wrtvid.c,v 1.5 2003/08/16 17:46:08 deraadt Exp $ */ #include <sys/types.h> #include <sys/stat.h> @@ -9,9 +9,57 @@ #include <db.h> #include <machine/disklabel.h> -main(argc, argv) - int argc; - char **argv; + +#define BUF_SIZ 512 +static void +copy_exe(int exe_file, int tape_exe) +{ + char *buf; + int cnt = 0; + + buf = (char *)malloc(BUF_SIZ); + + lseek (exe_file, 0x20, SEEK_SET); + while (BUF_SIZ == (cnt = read(exe_file, buf, BUF_SIZ))) + write(tape_exe, buf, cnt); + bzero(&buf[cnt], BUF_SIZ-cnt); + write(tape_exe, buf, BUF_SIZ); +} + +static void +swabvid(struct cpu_disklabel *pcpul) +{ + M_32_SWAP(pcpul->vid_oss); + M_16_SWAP(pcpul->vid_osl); + /* + M_16_SWAP(pcpul->vid_osa_u); + M_16_SWAP(pcpul->vid_osa_l); + */ + M_32_SWAP(pcpul->vid_cas); +} + +static void +swabcfg(struct cpu_disklabel *pcpul) +{ + M_16_SWAP(pcpul->cfg_atm); + M_16_SWAP(pcpul->cfg_prm); + M_16_SWAP(pcpul->cfg_atm); + M_16_SWAP(pcpul->cfg_rec); + M_16_SWAP(pcpul->cfg_trk); + M_16_SWAP(pcpul->cfg_psm); + M_16_SWAP(pcpul->cfg_shd); + M_16_SWAP(pcpul->cfg_pcom); + M_16_SWAP(pcpul->cfg_rwcc); + M_16_SWAP(pcpul->cfg_ecc); + M_16_SWAP(pcpul->cfg_eatm); + M_16_SWAP(pcpul->cfg_eprm); + M_16_SWAP(pcpul->cfg_eatw); + M_16_SWAP(pcpul->cfg_rsvc1); + M_16_SWAP(pcpul->cfg_rsvc2); +} + +int +main(int argc, char *argv[]) { struct cpu_disklabel *pcpul; struct stat stat; @@ -50,7 +98,7 @@ main(argc, argv) if (filename[5] == 't' ) { pcpul->vid_oss = 1; - }else { + } else { pcpul->vid_oss = 2; } pcpul->vid_osl = (((stat.st_size -0x20) +511) / 512) *2; @@ -96,52 +144,3 @@ main(argc, argv) close(tape_exe); return (0); } - -#define BUF_SIZ 512 -copy_exe(exe_file, tape_exe) - int exe_file, tape_exe; -{ - char *buf; - int cnt = 0; - - buf = (char *)malloc(BUF_SIZ); - - lseek (exe_file, 0x20, SEEK_SET); - while (BUF_SIZ == (cnt = read(exe_file, buf, BUF_SIZ))) { - write(tape_exe, buf, cnt); - } - bzero(&buf[cnt], BUF_SIZ-cnt); - write(tape_exe, buf, BUF_SIZ); -} - -swabvid(pcpul) - struct cpu_disklabel *pcpul; -{ - M_32_SWAP(pcpul->vid_oss); - M_16_SWAP(pcpul->vid_osl); - /* - M_16_SWAP(pcpul->vid_osa_u); - M_16_SWAP(pcpul->vid_osa_l); - */ - M_32_SWAP(pcpul->vid_cas); -} - -swabcfg(pcpul) - struct cpu_disklabel *pcpul; -{ - M_16_SWAP(pcpul->cfg_atm); - M_16_SWAP(pcpul->cfg_prm); - M_16_SWAP(pcpul->cfg_atm); - M_16_SWAP(pcpul->cfg_rec); - M_16_SWAP(pcpul->cfg_trk); - M_16_SWAP(pcpul->cfg_psm); - M_16_SWAP(pcpul->cfg_shd); - M_16_SWAP(pcpul->cfg_pcom); - M_16_SWAP(pcpul->cfg_rwcc); - M_16_SWAP(pcpul->cfg_ecc); - M_16_SWAP(pcpul->cfg_eatm); - M_16_SWAP(pcpul->cfg_eprm); - M_16_SWAP(pcpul->cfg_eatw); - M_16_SWAP(pcpul->cfg_rsvc1); - M_16_SWAP(pcpul->cfg_rsvc2); -} |