XXX: rtcalarm/rtcalarm.c refers obsolete /dev/pow0
This commit is contained in:
tsutsui 2011-05-19 21:26:38 +00:00
parent 188ae306aa
commit a0e931c0ee
12 changed files with 488 additions and 477 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.8 2001/12/12 01:49:59 tv Exp $
# $NetBSD: Makefile,v 1.9 2011/05/19 21:26:38 tsutsui Exp $
#
# Makefile for bellctrl
@ -10,6 +10,7 @@ sample.fm: sample_fm.c
dd bs=1 skip=32 count=52 if=sample.aout of=$@
rm sample.aout
WARNS?= 4
PROG= bellctrl
NOMAN= # defined
CPPFLAGS+=-I${.CURDIR}/../../..

View File

@ -1,4 +1,4 @@
/* $NetBSD: bellctrl.c,v 1.11 2006/08/04 02:30:48 mhitch Exp $ */
/* $NetBSD: bellctrl.c,v 1.12 2011/05/19 21:26:39 tsutsui Exp $ */
/*
* bellctrl - OPM bell controller (for NetBSD/X680x0)
@ -6,11 +6,12 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: bellctrl.c,v 1.11 2006/08/04 02:30:48 mhitch Exp $");
__RCSID("$NetBSD: bellctrl.c,v 1.12 2011/05/19 21:26:39 tsutsui Exp $");
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
#include <string.h>
#include <sys/file.h>
@ -35,18 +36,18 @@ static struct bell_info values = {
};
/* function prototype */
int is_number(char *, int);
int is_number(const char *, int);
void set_bell_vol(int);
void set_bell_pitch(int);
void set_bell_dur(int);
void set_voice_param(char *, int);
void set_voice_param(const char *, int);
void set_bell_param(void);
int usage(char *, char *);
int usage(const char *, const char *);
int
main(int argc, char **argv)
{
register char *arg;
const char *arg;
int percent;
int i;
@ -153,9 +154,9 @@ main(int argc, char **argv)
}
int
is_number(char *arg, int maximum)
is_number(const char *arg, int maximum)
{
register char *p;
const char *p;
if (arg[0] == '-' && arg[1] == '1' && arg[2] == '\0')
return 1;
@ -189,7 +190,7 @@ set_bell_dur(int duration)
}
void
set_voice_param(char *path, int flag)
set_voice_param(const char *path, int flag)
{
int fd;
@ -238,7 +239,7 @@ set_bell_param(void)
}
int
usage(char *fmt, char *arg)
usage(const char *fmt, const char *arg)
{
if (fmt) {
fprintf(stderr, "%s: ", progName);

View File

@ -1,5 +1,6 @@
# $NetBSD: Makefile,v 1.5 2001/12/12 01:49:59 tv Exp $
# $NetBSD: Makefile,v 1.6 2011/05/19 21:26:39 tsutsui Exp $
WARNS?= 4
PROG=loadfont
NOMAN= # defined

View File

@ -1,6 +1,7 @@
# $NetBSD: Makefile,v 1.11 2005/12/11 12:19:45 christos Exp $
# $NetBSD: Makefile,v 1.12 2011/05/19 21:26:39 tsutsui Exp $
# Makefile for loadkmap
WARNS?= 4
PROG= loadkmap
NOMAN= # defined
FILES= ascii_kmap jis_kmap

View File

@ -1,9 +1,9 @@
/* $NetBSD: ascii_kmap.c,v 1.6 2005/12/11 12:19:45 christos Exp $ */
/* $NetBSD: ascii_kmap.c,v 1.7 2011/05/19 21:26:39 tsutsui Exp $ */
/* from: arch/amiga/dev/kbdmap.c */
/* modified for X680x0 by Masaru Oki */
#include <sys/cdefs.h>
__RCSID("$NetBSD: ascii_kmap.c,v 1.6 2005/12/11 12:19:45 christos Exp $");
__RCSID("$NetBSD: ascii_kmap.c,v 1.7 2011/05/19 21:26:39 tsutsui Exp $");
#include <machine/kbdmap.h>
@ -19,228 +19,228 @@ __RCSID("$NetBSD: ascii_kmap.c,v 1.6 2005/12/11 12:19:45 christos Exp $");
struct kbdmap ascii_kbdmap = {
/* normal map */
{
0, 0, /* 0x00 */
0, ESC,
0, '1',
0, '2',
0, '3',
0, '4',
0, '5',
0, '6',
0, '7', /* 0x08 */
0, '8',
0, '9',
0, '0',
0, '-',
0, '=',
0, '\\',
0, DEL, /* really BS, DEL & BS swapped */
0, '\t', /* 0x10 */
C, 'q',
C, 'w',
C, 'e',
C, 'r',
C, 't',
C, 'y',
C, 'u',
C, 'i', /* 0x18 */
C, 'o',
C, 'p',
0, '[',
0, ']',
0, '\r', /* return */
C, 'a',
C, 's',
C, 'd', /* 0x20 */
C, 'f',
C, 'g',
C, 'h',
C, 'j',
C, 'k',
C, 'l',
0, ';',
0, '\'', /* 0x28 */
0, '`',
C, 'z',
C, 'x',
C, 'c',
C, 'v',
C, 'b',
C, 'n',
C, 'm', /* 0x30 */
0, ',',
0, '.',
0, '/',
0, '_',
0, ' ',
0, 0, /* HOME */
0, '\b', /* really DEL, BS & DEL swapped */
0, 0, /* 0x38 ROLLUP */
0, 0, /* ROLLDOWN */
0, 0, /* UNDO */
S, 0x0C, /* CRSR LEFT */
S, 0x00, /* now it gets hairy.. CRSR UP */
S, 0x08, /* CRSR RIGHT */
S, 0x04, /* CRSR DOWN */
K, 0, /* CLR */
K, '/', /* 0x40 */
K, '*',
K, '-',
K, '7',
K, '8',
K, '9',
K, '+',
K, '4',
K, '5', /* 0x48 */
K, '6',
K, '=',
K, '1',
K, '2',
K, '3',
K, '\r', /* enter */
K, '0',
K, ',', /* 0x50 */
K, '.',
0, 0,
0, 0,
S, 0x42, /* HELP */
0, 0,
0, 0,
0, 0,
0, 0, /* 0x58 */
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0, /* 0x60 */
0, 0,
0, 0,
S, 0x10, /* F1 */
S, 0x15, /* F2 */
S, 0x1A, /* F3 */
S, 0x1F, /* F4 */
S, 0x24, /* F5 */
S, 0x29, /* F6 */
S, 0x2E, /* F7 */
S, 0x33, /* 0x58 F8 */
S, 0x38, /* F9 */
S, 0x3D, /* F10 */
{0, 0}, /* 0x00 */
{0, ESC},
{0, '1'},
{0, '2'},
{0, '3'},
{0, '4'},
{0, '5'},
{0, '6'},
{0, '7'}, /* 0x08 */
{0, '8'},
{0, '9'},
{0, '0'},
{0, '-'},
{0, '='},
{0, '\\'},
{0, DEL}, /* really BS, DEL & BS swapped */
{0, '\t'}, /* 0x10 */
{C, 'q'},
{C, 'w'},
{C, 'e'},
{C, 'r'},
{C, 't'},
{C, 'y'},
{C, 'u'},
{C, 'i'}, /* 0x18 */
{C, 'o'},
{C, 'p'},
{0, '['},
{0, ']'},
{0, '\r'}, /* return */
{C, 'a'},
{C, 's'},
{C, 'd'}, /* 0x20 */
{C, 'f'},
{C, 'g'},
{C, 'h'},
{C, 'j'},
{C, 'k'},
{C, 'l'},
{0, ';'},
{0, '\''}, /* 0x28 */
{0, '`'},
{C, 'z'},
{C, 'x'},
{C, 'c'},
{C, 'v'},
{C, 'b'},
{C, 'n'},
{C, 'm'}, /* 0x30 */
{0, ','},
{0, '.'},
{0, '/'},
{0, '_'},
{0, ' '},
{0, 0}, /* HOME */
{0, '\b'}, /* really DEL, BS & DEL swapped */
{0, 0}, /* 0x38 ROLLUP */
{0, 0}, /* ROLLDOWN */
{0, 0}, /* UNDO */
{S, 0x0C}, /* CRSR LEFT */
{S, 0x00}, /* now it gets hairy.. CRSR UP */
{S, 0x08}, /* CRSR RIGHT */
{S, 0x04}, /* CRSR DOWN */
{K, 0}, /* CLR */
{K, '/'}, /* 0x40 */
{K, '*'},
{K, '-'},
{K, '7'},
{K, '8'},
{K, '9'},
{K, '+'},
{K, '4'},
{K, '5'}, /* 0x48 */
{K, '6'},
{K, '='},
{K, '1'},
{K, '2'},
{K, '3'},
{K, '\r'}, /* enter */
{K, '0'},
{K, ','}, /* 0x50 */
{K, '.'},
{0, 0},
{0, 0},
{S, 0x42}, /* HELP */
{0, 0},
{0, 0},
{0, 0},
{0, 0}, /* 0x58 */
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0}, /* 0x60 */
{0, 0},
{0, 0},
{S, 0x10}, /* F1 */
{S, 0x15}, /* F2 */
{S, 0x1A}, /* F3 */
{S, 0x1F}, /* F4 */
{S, 0x24}, /* F5 */
{S, 0x29}, /* F6 */
{S, 0x2E}, /* F7 */
{S, 0x33}, /* 0x58 F8 */
{S, 0x38}, /* F9 */
{S, 0x3D}, /* F10 */
},
/* shifted map */
{
0, 0, /* 0x00 */
0, ESC,
0, '!',
0, '@',
0, '#',
0, '$',
0, '%',
0, '^',
0, '&', /* 0x08 */
0, '*',
0, '(',
0, ')',
0, '_',
0, '+',
0, '|',
0, DEL, /* really BS, DEL & BS swapped */
0, '\t', /* 0x10 shift TAB */
C, 'Q',
C, 'W',
C, 'E',
C, 'R',
C, 'T',
C, 'Y',
C, 'U',
C, 'I', /* 0x18 */
C, 'O',
C, 'P',
0, '{',
0, '}',
0, '\r', /* return */
C, 'A',
C, 'S',
C, 'D', /* 0x20 */
C, 'F',
C, 'G',
C, 'H',
C, 'J',
C, 'K',
C, 'L',
0, ':',
0, '\"', /* 0x28 */
0, '~',
C, 'Z',
C, 'X',
C, 'C',
C, 'V',
C, 'B',
C, 'N',
C, 'M', /* 0x30 */
0, '<', /* 0x38 */
0, '>',
0, '?',
0, '_',
0, ' ',
0, 0, /* HOME */
0, '\b', /* really DEL, BS & DEL swapped */
0, 0, /* 0x38 ROLLUP */
0, 0, /* ROLLDOWN */
0, 0, /* UNDO */
0, 0, /* shift CRSR LEFT */
0, 0, /* shift CRSR UP */
0, 0, /* shift CRSR RIGHT */
0, 0, /* shift CRSR DOWN */
D, 0, /* CLR */
D, '/', /* 0x40 */
D, '*',
D, '-',
D, '7',
D, '8',
D, '9',
D, '+',
D, '4',
D, '5', /* 0x48 */
D, '6',
D, '=',
D, '1',
D, '2',
D, '3',
K, '\r', /* enter */
D, '0',
D, ',', /* 0x50 */
D, '.',
0, 0,
0, 0,
S, 0x42, /* HELP */
0, 0,
0, 0,
0, 0,
0, 0, /* 0x58 */
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0, /* 0x60 */
0, 0,
0, 0,
S, 0x5D, /* shift F1 */
S, 0x63, /* shift F2 */
S, 0x69, /* shift F3 */
S, 0x6F, /* shift F4 */
S, 0x75, /* shift F5 */
S, 0x7B, /* shift F6 */
S, 0x81, /* shift F7 */
S, 0x87, /* 0x58 shift F8 */
S, 0x8D, /* shift F9 */
S, 0x93, /* shift F10 */
{0, 0}, /* 0x00 */
{0, ESC},
{0, '!'},
{0, '@'},
{0, '#'},
{0, '$'},
{0, '%'},
{0, '^'},
{0, '&'}, /* 0x08 */
{0, '*'},
{0, '('},
{0, ')'},
{0, '_'},
{0, '+'},
{0, '|'},
{0, DEL}, /* really BS, DEL & BS swapped */
{0, '\t'}, /* 0x10 shift TAB */
{C, 'Q'},
{C, 'W'},
{C, 'E'},
{C, 'R'},
{C, 'T'},
{C, 'Y'},
{C, 'U'},
{C, 'I'}, /* 0x18 */
{C, 'O'},
{C, 'P'},
{0, '{'},
{0, '}'},
{0, '\r'}, /* return */
{C, 'A'},
{C, 'S'},
{C, 'D'}, /* 0x20 */
{C, 'F'},
{C, 'G'},
{C, 'H'},
{C, 'J'},
{C, 'K'},
{C, 'L'},
{0, ':'},
{0, '\"'}, /* 0x28 */
{0, '~'},
{C, 'Z'},
{C, 'X'},
{C, 'C'},
{C, 'V'},
{C, 'B'},
{C, 'N'},
{C, 'M'}, /* 0x30 */
{0, '<'}, /* 0x38 */
{0, '>'},
{0, '?'},
{0, '_'},
{0, ' '},
{0, 0}, /* HOME */
{0, '\b'}, /* really DEL, BS & DEL swapped */
{0, 0}, /* 0x38 ROLLUP */
{0, 0}, /* ROLLDOWN */
{0, 0}, /* UNDO */
{0, 0}, /* shift CRSR LEFT */
{0, 0}, /* shift CRSR UP */
{0, 0}, /* shift CRSR RIGHT */
{0, 0}, /* shift CRSR DOWN */
{D, 0}, /* CLR */
{D, '/'}, /* 0x40 */
{D, '*'},
{D, '-'},
{D, '7'},
{D, '8'},
{D, '9'},
{D, '+'},
{D, '4'},
{D, '5'}, /* 0x48 */
{D, '6'},
{D, '='},
{D, '1'},
{D, '2'},
{D, '3'},
{K, '\r'}, /* enter */
{D, '0'},
{D, ','}, /* 0x50 */
{D, '.'},
{0, 0},
{0, 0},
{S, 0x42}, /* HELP */
{0, 0},
{0, 0},
{0, 0},
{0, 0}, /* 0x58 */
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0}, /* 0x60 */
{0, 0},
{0, 0},
{S, 0x5D}, /* shift F1 */
{S, 0x63}, /* shift F2 */
{S, 0x69}, /* shift F3 */
{S, 0x6F}, /* shift F4 */
{S, 0x75}, /* shift F5 */
{S, 0x7B}, /* shift F6 */
{S, 0x81}, /* shift F7 */
{S, 0x87}, /* 0x58 shift F8 */
{S, 0x8D}, /* shift F9 */
{S, 0x93}, /* shift F10 */
},

View File

@ -1,9 +1,9 @@
/* $NetBSD: jis_kmap.c,v 1.5 2005/12/11 12:19:45 christos Exp $ */
/* $NetBSD: jis_kmap.c,v 1.6 2011/05/19 21:26:39 tsutsui Exp $ */
/* from: arch/amiga/dev/kbdmap.c */
/* modified for X680x0 by Masaru Oki */
#include <sys/cdefs.h>
__RCSID("$NetBSD: jis_kmap.c,v 1.5 2005/12/11 12:19:45 christos Exp $");
__RCSID("$NetBSD: jis_kmap.c,v 1.6 2011/05/19 21:26:39 tsutsui Exp $");
#include <machine/kbdmap.h>
@ -19,228 +19,228 @@ __RCSID("$NetBSD: jis_kmap.c,v 1.5 2005/12/11 12:19:45 christos Exp $");
struct kbdmap ascii_kbdmap = {
/* normal map */
{
0, 0, /* 0x00 */
0, ESC,
0, '1',
0, '2',
0, '3',
0, '4',
0, '5',
0, '6',
0, '7', /* 0x08 */
0, '8',
0, '9',
0, '0',
0, '-',
0, '^',
0, '\\',
0, DEL, /* really BS, DEL & BS swapped */
0, '\t', /* 0x10 */
C, 'q',
C, 'w',
C, 'e',
C, 'r',
C, 't',
C, 'y',
C, 'u',
C, 'i', /* 0x18 */
C, 'o',
C, 'p',
0, '@',
0, '[',
0, '\r', /* return */
C, 'a',
C, 's',
C, 'd', /* 0x20 */
C, 'f',
C, 'g',
C, 'h',
C, 'j',
C, 'k',
C, 'l',
0, ';',
0, ':', /* 0x28 */
0, ']',
C, 'z',
C, 'x',
C, 'c',
C, 'v',
C, 'b',
C, 'n',
C, 'm', /* 0x30 */
0, ',',
0, '.',
0, '/',
0, '_',
0, ' ',
0, 0, /* HOME */
0, '\b', /* really DEL, BS & DEL swapped */
0, 0, /* 0x38 ROLLUP */
0, 0, /* ROLLDOWN */
0, 0, /* UNDO */
S, 0x0C, /* CRSR LEFT */
S, 0x00, /* now it gets hairy.. CRSR UP */
S, 0x08, /* CRSR RIGHT */
S, 0x04, /* CRSR DOWN */
0, 0, /* CLR */
K, '/', /* 0x40 */
K, '*',
K, '-',
K, '7',
K, '8',
K, '9',
K, '+',
K, '4',
K, '5', /* 0x48 */
K, '6',
K, '=',
K, '1',
K, '2',
K, '3',
K, '\r', /* enter */
K, '0',
K, ',', /* 0x50 */
K, '.',
0, 0,
0, 0,
S, 0x42, /* HELP */
0, 0,
0, 0,
0, 0,
0, 0, /* 0x58 */
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0, /* 0x60 */
0, 0,
0, 0,
S, 0x10, /* F1 */
S, 0x15, /* F2 */
S, 0x1A, /* F3 */
S, 0x1F, /* F4 */
S, 0x24, /* F5 */
S, 0x29, /* F6 */
S, 0x2E, /* F7 */
S, 0x33, /* 0x58 F8 */
S, 0x38, /* F9 */
S, 0x3D, /* F10 */
{0, 0}, /* 0x00 */
{0, ESC},
{0, '1'},
{0, '2'},
{0, '3'},
{0, '4'},
{0, '5'},
{0, '6'},
{0, '7'}, /* 0x08 */
{0, '8'},
{0, '9'},
{0, '0'},
{0, '-'},
{0, '^'},
{0, '\\'},
{0, DEL}, /* really BS, DEL & BS swapped */
{0, '\t'}, /* 0x10 */
{C, 'q'},
{C, 'w'},
{C, 'e'},
{C, 'r'},
{C, 't'},
{C, 'y'},
{C, 'u'},
{C, 'i'}, /* 0x18 */
{C, 'o'},
{C, 'p'},
{0, '@'},
{0, '['},
{0, '\r'}, /* return */
{C, 'a'},
{C, 's'},
{C, 'd'}, /* 0x20 */
{C, 'f'},
{C, 'g'},
{C, 'h'},
{C, 'j'},
{C, 'k'},
{C, 'l'},
{0, ';'},
{0, ':'}, /* 0x28 */
{0, ']'},
{C, 'z'},
{C, 'x'},
{C, 'c'},
{C, 'v'},
{C, 'b'},
{C, 'n'},
{C, 'm'}, /* 0x30 */
{0, ','},
{0, '.'},
{0, '/'},
{0, '_'},
{0, ' '},
{0, 0}, /* HOME */
{0, '\b'}, /* really DEL, BS & DEL swapped */
{0, 0}, /* 0x38 ROLLUP */
{0, 0}, /* ROLLDOWN */
{0, 0}, /* UNDO */
{S, 0x0C}, /* CRSR LEFT */
{S, 0x00}, /* now it gets hairy.. CRSR UP */
{S, 0x08}, /* CRSR RIGHT */
{S, 0x04}, /* CRSR DOWN */
{0, 0}, /* CLR */
{K, '/'}, /* 0x40 */
{K, '*'},
{K, '-'},
{K, '7'},
{K, '8'},
{K, '9'},
{K, '+'},
{K, '4'},
{K, '5'}, /* 0x48 */
{K, '6'},
{K, '='},
{K, '1'},
{K, '2'},
{K, '3'},
{K, '\r'}, /* enter */
{K, '0'},
{K, ','}, /* 0x50 */
{K, '.'},
{0, 0},
{0, 0},
{S, 0x42}, /* HELP */
{0, 0},
{0, 0},
{0, 0},
{0, 0}, /* 0x58 */
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0}, /* 0x60 */
{0, 0},
{0, 0},
{S, 0x10}, /* F1 */
{S, 0x15}, /* F2 */
{S, 0x1A}, /* F3 */
{S, 0x1F}, /* F4 */
{S, 0x24}, /* F5 */
{S, 0x29}, /* F6 */
{S, 0x2E}, /* F7 */
{S, 0x33}, /* 0x58 F8 */
{S, 0x38}, /* F9 */
{S, 0x3D}, /* F10 */
},
/* shifted map */
{
0, 0, /* 0x00 */
0, ESC,
0, '!',
0, '\"',
0, '#',
0, '$',
0, '%',
0, '&',
0, '\'', /* 0x08 */
0, '(',
0, ')',
0, 0,
0, '=',
0, '~',
0, '|',
0, DEL, /* really BS, DEL & BS swapped */
0, '\t', /* 0x10 shift TAB */
C, 'Q',
C, 'W',
C, 'E',
C, 'R',
C, 'T',
C, 'Y',
C, 'U',
C, 'I', /* 0x18 */
C, 'O',
C, 'P',
0, '`',
0, '{',
0, '\r', /* return */
C, 'A',
C, 'S',
C, 'D', /* 0x20 */
C, 'F',
C, 'G',
C, 'H',
C, 'J',
C, 'K',
C, 'L',
0, '+',
0, '*', /* 0x28 */
0, '}',
C, 'Z',
C, 'X',
C, 'C',
C, 'V',
C, 'B',
C, 'N',
C, 'M', /* 0x30 */
0, '<', /* 0x38 */
0, '>',
0, '?',
0, '_',
0, ' ',
0, 0, /* HOME */
0, '\b', /* really DEL, BS & DEL swapped */
0, 0, /* 0x38 ROLLUP */
0, 0, /* ROLLDOWN */
0, 0, /* UNDO */
0, 0, /* shift CRSR LEFT */
0, 0, /* shift CRSR UP */
0, 0, /* shift CRSR RIGHT */
0, 0, /* shift CRSR DOWN */
D, 0, /* CLR */
D, '/', /* 0x40 */
D, '*',
D, '-',
D, '7',
D, '8',
D, '9',
D, '+',
D, '4',
D, '5', /* 0x48 */
D, '6',
D, '=',
D, '1',
D, '2',
D, '3',
K, '\r', /* enter */
D, '0',
D, ',', /* 0x50 */
D, '.',
0, 0,
0, 0,
S, 0x42, /* HELP */
0, 0,
0, 0,
0, 0,
0, 0, /* 0x58 */
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0, /* 0x60 */
0, 0,
0, 0,
S, 0x5D, /* shift F1 */
S, 0x63, /* shift F2 */
S, 0x69, /* shift F3 */
S, 0x6F, /* shift F4 */
S, 0x75, /* shift F5 */
S, 0x7B, /* shift F6 */
S, 0x81, /* shift F7 */
S, 0x87, /* 0x58 shift F8 */
S, 0x8D, /* shift F9 */
S, 0x93, /* shift F10 */
{0, 0}, /* 0x00 */
{0, ESC},
{0, '!'},
{0, '\"'},
{0, '#'},
{0, '$'},
{0, '%'},
{0, '&'},
{0, '\''}, /* 0x08 */
{0, '('},
{0, ')'},
{0, 0},
{0, '='},
{0, '~'},
{0, '|'},
{0, DEL}, /* really BS, DEL & BS swapped */
{0, '\t'}, /* 0x10 shift TAB */
{C, 'Q'},
{C, 'W'},
{C, 'E'},
{C, 'R'},
{C, 'T'},
{C, 'Y'},
{C, 'U'},
{C, 'I'}, /* 0x18 */
{C, 'O'},
{C, 'P'},
{0, '`'},
{0, '{'},
{0, '\r'}, /* return */
{C, 'A'},
{C, 'S'},
{C, 'D'}, /* 0x20 */
{C, 'F'},
{C, 'G'},
{C, 'H'},
{C, 'J'},
{C, 'K'},
{C, 'L'},
{0, '+'},
{0, '*'}, /* 0x28 */
{0, '}'},
{C, 'Z'},
{C, 'X'},
{C, 'C'},
{C, 'V'},
{C, 'B'},
{C, 'N'},
{C, 'M'}, /* 0x30 */
{0, '<'}, /* 0x38 */
{0, '>'},
{0, '?'},
{0, '_'},
{0, ' '},
{0, 0}, /* HOME */
{0, '\b'}, /* really DEL, BS & DEL swapped */
{0, 0}, /* 0x38 ROLLUP */
{0, 0}, /* ROLLDOWN */
{0, 0}, /* UNDO */
{0, 0}, /* shift CRSR LEFT */
{0, 0}, /* shift CRSR UP */
{0, 0}, /* shift CRSR RIGHT */
{0, 0}, /* shift CRSR DOWN */
{D, 0}, /* CLR */
{D, '/'}, /* 0x40 */
{D, '*'},
{D, '-'},
{D, '7'},
{D, '8'},
{D, '9'},
{D, '+'},
{D, '4'},
{D, '5'}, /* 0x48 */
{D, '6'},
{D, '='},
{D, '1'},
{D, '2'},
{D, '3'},
{K, '\r'}, /* enter */
{D, '0'},
{D, ','}, /* 0x50 */
{D, '.'},
{0, 0},
{0, 0},
{S, 0x42}, /* HELP */
{0, 0},
{0, 0},
{0, 0},
{0, 0}, /* 0x58 */
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0}, /* 0x60 */
{0, 0},
{0, 0},
{S, 0x5D}, /* shift F1 */
{S, 0x63}, /* shift F2 */
{S, 0x69}, /* shift F3 */
{S, 0x6F}, /* shift F4 */
{S, 0x75}, /* shift F5 */
{S, 0x7B}, /* shift F6 */
{S, 0x81}, /* shift F7 */
{S, 0x87}, /* 0x58 shift F8 */
{S, 0x8D}, /* shift F9 */
{S, 0x93}, /* shift F10 */
},

View File

@ -1,4 +1,4 @@
/* $NetBSD: loadkmap.c,v 1.9 2006/08/04 02:30:00 mhitch Exp $ */
/* $NetBSD: loadkmap.c,v 1.10 2011/05/19 21:26:39 tsutsui Exp $ */
/*
* loadkmap - load keyboard map (for NetBSD/X680x0)
* from: amiga/stand/loadkmap/loadkmap.c
@ -6,10 +6,12 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: loadkmap.c,v 1.9 2006/08/04 02:30:00 mhitch Exp $");
__RCSID("$NetBSD: loadkmap.c,v 1.10 2011/05/19 21:26:39 tsutsui Exp $");
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <machine/kbdmap.h>

View File

@ -1,5 +1,6 @@
# $NetBSD: Makefile,v 1.5 2001/12/12 01:50:00 tv Exp $
# $NetBSD: Makefile,v 1.6 2011/05/19 21:26:39 tsutsui Exp $
WARNS?= 4
PROG=palette
NOMAN=# defined

View File

@ -1,4 +1,4 @@
/* $NetBSD: palette.c,v 1.7 2007/03/04 06:01:07 christos Exp $ */
/* $NetBSD: palette.c,v 1.8 2011/05/19 21:26:39 tsutsui Exp $ */
/*
* pelette - manipulate text colormap for NetBSD/x68k.
* author: Masaru Oki
@ -7,10 +7,11 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: palette.c,v 1.7 2007/03/04 06:01:07 christos Exp $");
__RCSID("$NetBSD: palette.c,v 1.8 2011/05/19 21:26:39 tsutsui Exp $");
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/mman.h>

View File

@ -1,5 +1,6 @@
# $NetBSD: Makefile,v 1.5 2001/12/12 01:50:00 tv Exp $
# $NetBSD: Makefile,v 1.6 2011/05/19 21:26:39 tsutsui Exp $
WARNS?= 4
PROG=rtcalarm
NOMAN=# defined

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtcalarm.c,v 1.10 2009/11/28 02:56:14 isaki Exp $ */
/* $NetBSD: rtcalarm.c,v 1.11 2011/05/19 21:26:39 tsutsui Exp $ */
/*
* Copyright (c) 1995 MINOURA Makoto.
* All rights reserved.
@ -38,6 +38,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
@ -50,9 +51,9 @@ static char *numstr(unsigned int);
static void showontime(unsigned int);
static void disablealarm(void);
static void setinfo(int, char **);
static int strnum(const char *, int);
static int strnum(const char *, size_t);
static char *devicefile = "/dev/pow0"; /* default path */
static const char *devicefile = "/dev/pow0"; /* default path */
int
main(int argc, char *argv[])
@ -87,10 +88,10 @@ showinfo(void)
fd = open(devicefile, O_RDONLY);
if (fd < 0)
err("Opening %s", devicefile);
err(EXIT_FAILURE, "Opening %s", devicefile);
if (ioctl(fd, POWIOCGALARMINFO, &alarminfo) < 0)
err("POWIOCGALARMINFO");
err(EXIT_FAILURE, "POWIOCGALARMINFO");
close(fd);
if (alarminfo.al_enable) {
@ -108,8 +109,8 @@ showinfo(void)
printf("Never shut down automatically.\n");
else
printf("Shut down in %d seconds (%d minutes).\n",
alarminfo.al_offtime,
alarminfo.al_offtime / 60);
(int)alarminfo.al_offtime,
(int)alarminfo.al_offtime / 60);
} else {
printf("RTC alarm is disabled.\n");
}
@ -180,9 +181,9 @@ disablealarm(void)
fd = open(devicefile, O_WRONLY);
if (fd < 0)
err("Opening %s", devicefile);
err(EXIT_FAILURE, "Opening %s", devicefile);
if (ioctl(fd, POWIOCSALARMINFO, &alarminfo) < 0)
err("POWIOCSALARMINFO");
err(EXIT_FAILURE, "POWIOCSALARMINFO");
close(fd);
}
@ -193,7 +194,7 @@ setinfo(int argc, char **argv)
int week = 0x0f;
int hour = 0xffff;
int day = 0xff;
int offtime = 0;
int off_time = 0;
int dowhat = 0;
int fd;
struct x68k_alarminfo alarminfo;
@ -209,10 +210,10 @@ setinfo(int argc, char **argv)
usage();
break;
case 'm': /* for X minits */
offtime = atoi(optarg);
off_time = atoi(optarg);
break;
case 's': /* for X seconds */
offtime = atoi(optarg) / 60;
off_time = atoi(optarg) / 60;
break;
case 'c': /* channel */
dowhat = atoi(optarg) + 0x30 - 1;
@ -226,7 +227,7 @@ setinfo(int argc, char **argv)
#ifdef DEBUG
printf("week: %x, day:%x, for:%d, hour:%x\n",
week, day, offtime, strnum(argv[optind], 5));
week, day, off_time, strnum(argv[optind], 5));
#endif
hour = strnum(argv[optind], 5);
@ -236,18 +237,18 @@ setinfo(int argc, char **argv)
alarminfo.al_enable = 1;
alarminfo.al_ontime = (week << 24) | (day << 16) | hour;
alarminfo.al_dowhat = dowhat;
alarminfo.al_offtime = offtime * 60;
alarminfo.al_offtime = off_time * 60;
fd = open(devicefile, O_WRONLY);
if (fd < 0)
err("Opening %s", devicefile);
err(EXIT_FAILURE, "Opening %s", devicefile);
if (ioctl(fd, POWIOCSALARMINFO, &alarminfo) < 0)
err("POWIOCSALARMINFO");
err(EXIT_FAILURE, "POWIOCSALARMINFO");
close(fd);
}
static int
strnum(const char *str, int wid)
strnum(const char *str, size_t wid)
{
int r;

View File

@ -1,5 +1,6 @@
# $NetBSD: Makefile,v 1.5 2001/12/12 01:50:01 tv Exp $
# $NetBSD: Makefile,v 1.6 2011/05/19 21:26:39 tsutsui Exp $
WARNS?= 4
PROG=tvctrl
NOMAN=# defined