From 855a0bf0069bc2429b9df49fc30c84a0642284c5 Mon Sep 17 00:00:00 2001 From: Antonio Huete Jimenez Date: Fri, 19 Feb 2010 19:44:34 +0100 Subject: [PATCH] usr.sbin - Include some missing programs in x86_64. Following programs were only in i386. Now they've been included also in x86_64: apm apmd battd kgmon kgzip lptcontrol mptable rndcontrol sgsc (WARNS raised to 6) sicontrol spkrtest stallion (WARNS lowered) --- sys/platform/pc64/include/cdk.h | 501 +++++++++++++++++++++++++++++++++++ sys/platform/pc64/include/comstats.h | 124 +++++++++ sys/platform/pc64/include/gsc.h | 54 ++++ usr.sbin/Makefile | 13 +- usr.sbin/apmd/Makefile | 2 +- usr.sbin/apmd/apmd.c | 3 +- usr.sbin/apmd/apmd.h | 22 ++ usr.sbin/kgmon/Makefile | 2 +- usr.sbin/kgmon/kgmon.c | 10 +- usr.sbin/sgsc/Makefile | 1 - usr.sbin/sgsc/sgsc.c | 2 +- usr.sbin/stallion/stlload/Makefile | 1 + usr.sbin/stallion/stlload/stlload.c | 2 +- usr.sbin/stallion/stlstats/Makefile | 1 + usr.sbin/stallion/stlstty/Makefile | 1 + usr.sbin/stallion/stlstty/stlstty.c | 5 + 16 files changed, 726 insertions(+), 18 deletions(-) create mode 100644 sys/platform/pc64/include/cdk.h create mode 100644 sys/platform/pc64/include/comstats.h create mode 100644 sys/platform/pc64/include/gsc.h diff --git a/sys/platform/pc64/include/cdk.h b/sys/platform/pc64/include/cdk.h new file mode 100644 index 0000000000..31d482449c --- /dev/null +++ b/sys/platform/pc64/include/cdk.h @@ -0,0 +1,501 @@ +/*****************************************************************************/ + +/* + * cdk.h -- CDK interface definitions. + * + * Copyright (c) 1994-1998 Greg Ungerer (gerg@stallion.oz.au). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Greg Ungerer. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/sys/i386/include/cdk.h,v 1.5.2.1 2001/08/30 12:29:57 murray Exp $ + * $DragonFly: src/sys/platform/pc32/include/cdk.h,v 1.3 2003/06/28 04:16:03 dillon Exp $ + */ + +#ifndef _CDK_H_ +#define _CDK_H_ + +#include + +#pragma pack(2) + +/* + * The following set of definitions is used to communicate with the + * shared memory interface of the Stallion intelligent multiport serial + * boards. The definitions in this file are taken directly from the + * document titled "Generic Stackable Interface, Downloader and + * Communications Development Kit". + */ + +/* + * Define the set of importrant shared memory addresses. These are + * required to intialize the board and get things started. All of these + * addresses are relative to the start of the shared memory. + */ +#define CDK_SIGADDR 0x200 +#define CDK_FEATADDR 0x280 +#define CDK_CDKADDR 0x300 +#define CDK_RDYADDR 0x262 + +#define CDK_ALIVEMARKER 13 + +/* + * On hardware power up the ROMs located on the EasyConnection 8/64 will + * fill out the following signature information into shared memory. This + * way the host system can quickly determine that the board is present + * and is operational. + */ +typedef struct cdkecpsig { + unsigned long magic; + unsigned short romver; + unsigned short cputype; + unsigned char panelid[8]; +} cdkecpsig_t; + +#define ECP_MAGIC 0x21504345 + +/* + * On hardware power up the ROMs located on the ONboard, Stallion and + * Brumbys will fill out the following signature information into shared + * memory. This way the host system can quickly determine that the board + * is present and is operational. + */ +typedef struct cdkonbsig { + unsigned short magic0; + unsigned short magic1; + unsigned short magic2; + unsigned short magic3; + unsigned short romver; + unsigned short memoff; + unsigned short memseg; + unsigned short amask0; + unsigned short pic; + unsigned short status; + unsigned short btype; + unsigned short clkticks; + unsigned short clkspeed; + unsigned short amask1; + unsigned short amask2; +} cdkonbsig_t; + +#define ONB_MAGIC0 0xf2a7 +#define ONB_MAGIC1 0xa149 +#define ONB_MAGIC2 0x6352 +#define ONB_MAGIC3 0xf121 + +/* + * Define the feature area structure. The feature area is the set of + * startup parameters used by the slave image when it starts executing. + * They allow for the specification of buffer sizes, debug trace, etc. + */ +typedef struct cdkfeature { + unsigned long debug; + unsigned long banner; + unsigned long etype; + unsigned long nrdevs; + unsigned long brdspec; + unsigned long txrqsize; + unsigned long rxrqsize; + unsigned long flags; +} cdkfeature_t; + +#define ETYP_DDK 0 +#define ETYP_CDK 1 + +/* + * Define the CDK header structure. This is the info that the slave + * environment sets up after it has been downloaded and started. It + * essentially provides a memory map for the shared memory interface. + */ +typedef struct cdkhdr { + unsigned short command; + unsigned short status; + unsigned short port; + unsigned short mode; + unsigned long cmd_buf[14]; + unsigned short alive_cnt; + unsigned short intrpt_mode; + unsigned char intrpt_id[8]; + unsigned char ver_release; + unsigned char ver_modification; + unsigned char ver_fix; + unsigned char deadman_restart; + unsigned short deadman; + unsigned short nrdevs; + unsigned long memp; + unsigned long hostp; + unsigned long slavep; + unsigned char hostreq; + unsigned char slavereq; + unsigned char cmd_reserved[30]; +} cdkhdr_t; + +#define MODE_DDK 0 +#define MODE_CDK 1 + +#define IMD_INTR 0x0 +#define IMD_PPINTR 0x1 +#define IMD_POLL 0xff + +/* + * Define the memory mapping structure. This structure is pointed to by + * the memp field in the stlcdkhdr struct. As many as these structures + * as required are layed out in shared memory to define how the rest of + * shared memory is divided up. There will be one for each port. + */ +typedef struct cdkmem { + unsigned short dtype; + unsigned long offset; +} cdkmem_t; + +#define TYP_UNDEFINED 0x0 +#define TYP_ASYNCTRL 0x1 +#define TYP_ASYNC 0x20 +#define TYP_PARALLEL 0x40 +#define TYP_SYNCX21 0x60 + +/*****************************************************************************/ + +/* + * Following is a set of defines and structures used to actually deal + * with the serial ports on the board. Firstly is the set of commands + * that can be applied to ports. + */ +#define ASYCMD (((unsigned long) 'a') << 8) + +#define A_NULL (ASYCMD | 0) +#define A_FLUSH (ASYCMD | 1) +#define A_BREAK (ASYCMD | 2) +#define A_GETPORT (ASYCMD | 3) +#define A_SETPORT (ASYCMD | 4) +#define A_SETPORTF (ASYCMD | 5) +#define A_SETPORTFTX (ASYCMD | 6) +#define A_SETPORTFRX (ASYCMD | 7) +#define A_GETSIGNALS (ASYCMD | 8) +#define A_SETSIGNALS (ASYCMD | 9) +#define A_SETSIGNALSF (ASYCMD | 10) +#define A_SETSIGNALSFTX (ASYCMD | 11) +#define A_SETSIGNALSFRX (ASYCMD | 12) +#define A_GETNOTIFY (ASYCMD | 13) +#define A_SETNOTIFY (ASYCMD | 14) +#define A_NOTIFY (ASYCMD | 15) +#define A_PORTCTRL (ASYCMD | 16) +#define A_GETSTATS (ASYCMD | 17) +#define A_RQSTATE (ASYCMD | 18) +#define A_FLOWSTATE (ASYCMD | 19) +#define A_CLEARSTATS (ASYCMD | 20) + +/* + * Define those arguments used for simple commands. + */ +#define FLUSHRX 0x1 +#define FLUSHTX 0x2 + +#define BREAKON -1 +#define BREAKOFF -2 + +/* + * Define the port setting structure, and all those defines that go along + * with it. Basically this structure defines the charcateristics of this + * port: baud rate, chars, parity, input/output char cooking etc. + */ +typedef struct asyport { + unsigned long baudout; + unsigned long baudin; + unsigned long iflag; + unsigned long oflag; + unsigned long lflag; + unsigned long pflag; + unsigned long flow; + unsigned long spare1; + unsigned short vtime; + unsigned short vmin; + unsigned short txlo; + unsigned short txhi; + unsigned short rxlo; + unsigned short rxhi; + unsigned short rxhog; + unsigned short spare2; + unsigned char csize; + unsigned char stopbs; + unsigned char parity; + unsigned char stopin; + unsigned char startin; + unsigned char stopout; + unsigned char startout; + unsigned char parmark; + unsigned char brkmark; + unsigned char cc[11]; +} asyport_t; + +#define PT_STOP1 0x0 +#define PT_STOP15 0x1 +#define PT_STOP2 0x2 + +#define PT_NOPARITY 0x0 +#define PT_ODDPARITY 0x1 +#define PT_EVENPARITY 0x2 +#define PT_MARKPARITY 0x3 +#define PT_SPACEPARITY 0x4 + +#define F_NONE 0x0 +#define F_IXON 0x1 +#define F_IXOFF 0x2 +#define F_IXANY 0x4 +#define F_IOXANY 0x8 +#define F_RTSFLOW 0x10 +#define F_CTSFLOW 0x20 +#define F_DTRFLOW 0x40 +#define F_DCDFLOW 0x80 +#define F_DSROFLOW 0x100 +#define F_DSRIFLOW 0x200 + +#define FI_NORX 0x1 +#define FI_RAW 0x2 +#define FI_ISTRIP 0x4 +#define FI_UCLC 0x8 +#define FI_INLCR 0x10 +#define FI_ICRNL 0x20 +#define FI_IGNCR 0x40 +#define FI_IGNBREAK 0x80 +#define FI_DSCRDBREAK 0x100 +#define FI_1MARKBREAK 0x200 +#define FI_2MARKBREAK 0x400 +#define FI_XCHNGBREAK 0x800 +#define FI_IGNRXERRS 0x1000 +#define FI_DSCDRXERRS 0x2000 +#define FI_1MARKRXERRS 0x4000 +#define FI_2MARKRXERRS 0x8000 +#define FI_XCHNGRXERRS 0x10000 +#define FI_DSCRDNULL 0x20000 + +#define FO_OLCUC 0x1 +#define FO_ONLCR 0x2 +#define FO_OOCRNL 0x4 +#define FO_ONOCR 0x8 +#define FO_ONLRET 0x10 +#define FO_ONL 0x20 +#define FO_OBS 0x40 +#define FO_OVT 0x80 +#define FO_OFF 0x100 +#define FO_OTAB1 0x200 +#define FO_OTAB2 0x400 +#define FO_OTAB3 0x800 +#define FO_OCR1 0x1000 +#define FO_OCR2 0x2000 +#define FO_OCR3 0x4000 +#define FO_OFILL 0x8000 +#define FO_ODELL 0x10000 + +#define P_RTSLOCK 0x1 +#define P_CTSLOCK 0x2 +#define P_MAPRTS 0x4 +#define P_MAPCTS 0x8 +#define P_LOOPBACK 0x10 +#define P_DTRFOLLOW 0x20 +#define P_FAKEDCD 0x40 + +#define P_RXIMIN 0x10000 +#define P_RXITIME 0x20000 +#define P_RXTHOLD 0x40000 + +/* + * Define a structure to communicate serial port signal and data state + * information. + */ +typedef struct asysigs { + unsigned long data; + unsigned long signal; + unsigned long sigvalue; +} asysigs_t; + +#define DT_TXBUSY 0x1 +#define DT_TXEMPTY 0x2 +#define DT_TXLOW 0x4 +#define DT_TXHIGH 0x8 +#define DT_TXFULL 0x10 +#define DT_TXHOG 0x20 +#define DT_TXFLOWED 0x40 +#define DT_TXBREAK 0x80 + +#define DT_RXBUSY 0x100 +#define DT_RXEMPTY 0x200 +#define DT_RXLOW 0x400 +#define DT_RXHIGH 0x800 +#define DT_RXFULL 0x1000 +#define DT_RXHOG 0x2000 +#define DT_RXFLOWED 0x4000 +#define DT_RXBREAK 0x8000 + +#define SG_DTR 0x1 +#define SG_DCD 0x2 +#define SG_RTS 0x4 +#define SG_CTS 0x8 +#define SG_DSR 0x10 +#define SG_RI 0x20 + +/* + * Define the notification setting structure. This is used to tell the + * port what events we want to be informed about. Fields here use the + * same defines as for the asysigs structure above. + */ +typedef struct asynotify { + unsigned long ctrl; + unsigned long data; + unsigned long signal; + unsigned long sigvalue; +} asynotify_t; + +/* + * Define the port control structure. It is used to do fine grain + * control operations on the port. + */ +typedef struct { + unsigned long rxctrl; + unsigned long txctrl; + char rximdch; + char tximdch; + char spare1; + char spare2; +} asyctrl_t; + +#define CT_ENABLE 0x1 +#define CT_DISABLE 0x2 +#define CT_STOP 0x4 +#define CT_START 0x8 +#define CT_STARTFLOW 0x10 +#define CT_STOPFLOW 0x20 +#define CT_SENDCHR 0x40 + +/* + * Define the stats structure kept for each port. This is a useful set + * of data collected for each port on the slave. The A_GETSTATS command + * is used to retrive this data from the slave. + */ +typedef struct asystats { + unsigned long opens; + unsigned long txchars; + unsigned long rxchars; + unsigned long txringq; + unsigned long rxringq; + unsigned long txmsgs; + unsigned long rxmsgs; + unsigned long txflushes; + unsigned long rxflushes; + unsigned long overruns; + unsigned long framing; + unsigned long parity; + unsigned long ringover; + unsigned long lost; + unsigned long rxstart; + unsigned long rxstop; + unsigned long txstart; + unsigned long txstop; + unsigned long dcdcnt; + unsigned long dtrcnt; + unsigned long ctscnt; + unsigned long rtscnt; + unsigned long dsrcnt; + unsigned long ricnt; + unsigned long txbreaks; + unsigned long rxbreaks; + unsigned long signals; + unsigned long state; + unsigned long hwid; +} asystats_t; + +/*****************************************************************************/ + +/* + * All command and control communication with a device on the slave is + * via a control block in shared memory. Each device has its own control + * block, defined by the following structure. The control block allows + * the host to open, close and control the device on the slave. + */ +typedef struct cdkctrl { + unsigned char open; + unsigned char close; + unsigned long openarg; + unsigned long closearg; + unsigned long cmd; + unsigned long status; + unsigned long args[32]; +} cdkctrl_t; + +/* + * Each device on the slave passes data to and from the host via a ring + * queue in shared memory. Define a ring queue structure to hold the + * vital information about each ring queue. Two ring queues will be + * allocated for each port, one for reveice data and one for transmit + * data. + */ +typedef struct cdkasyrq { + unsigned long offset; + unsigned short size; + unsigned short head; + unsigned short tail; +} cdkasyrq_t; + +/* + * Each asynchronous port is defined in shared memory by the following + * structure. It contains a control block to command a device, and also + * the neccessary data channel information as well. + */ +typedef struct cdkasy { + cdkctrl_t ctrl; + unsigned short notify; + asynotify_t changed; + unsigned short receive; + cdkasyrq_t rxq; + unsigned short transmit; + cdkasyrq_t txq; +} cdkasy_t; + +#pragma pack() + +/*****************************************************************************/ + +/* + * Define the set of ioctls used by the driver to do special things + * to the board. These include interrupting it, and initializeing + * the driver after board startup and shutdown. + */ +#define STL_BINTR _IO('s', 20) +#define STL_BSTART _IO('s', 21) +#define STL_BSTOP _IO('s', 22) +#define STL_BRESET _IO('s', 23) + +/* + * Define a set of ioctl extensions, used to get at special stuff. + */ +#define STL_GETPFLAG _IOR('s', 80, unsigned long) +#define STL_SETPFLAG _IOW('s', 81, unsigned long) + +/*****************************************************************************/ + +#endif diff --git a/sys/platform/pc64/include/comstats.h b/sys/platform/pc64/include/comstats.h new file mode 100644 index 0000000000..c2be5bcc81 --- /dev/null +++ b/sys/platform/pc64/include/comstats.h @@ -0,0 +1,124 @@ +/*****************************************************************************/ + +/* + * comstats.h -- Serial Port Stats. + * + * Copyright (c) 1994-1996 Greg Ungerer (gerg@stallion.oz.au). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Greg Ungerer. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/sys/i386/include/comstats.h,v 1.5 1999/08/28 00:44:09 peter Exp $ + * $DragonFly: src/sys/platform/pc32/include/comstats.h,v 1.4 2008/05/18 03:02:53 pavalos Exp $ + */ + +#ifndef _COMSTATS_H_ +#define _COMSTATS_H_ + +#include + +/* + * Serial port stats structure. The structure itself is UART + * independent, but some fields may be UART/driver specific (for + * example state). + */ + +typedef struct { + unsigned long brd; + unsigned long panel; + unsigned long port; + unsigned long hwid; + unsigned long type; + unsigned long txtotal; + unsigned long rxtotal; + unsigned long txbuffered; + unsigned long rxbuffered; + unsigned long rxoverrun; + unsigned long rxparity; + unsigned long rxframing; + unsigned long rxlost; + unsigned long txbreaks; + unsigned long rxbreaks; + unsigned long txxon; + unsigned long txxoff; + unsigned long rxxon; + unsigned long rxxoff; + unsigned long txctson; + unsigned long txctsoff; + unsigned long rxrtson; + unsigned long rxrtsoff; + unsigned long modem; + unsigned long state; + unsigned long flags; + unsigned long ttystate; + unsigned long cflags; + unsigned long iflags; + unsigned long oflags; + unsigned long lflags; + unsigned long signals; +} comstats_t; + + +/* + * Board stats structure. Returns useful info about the board. + */ + +#define COM_MAXPANELS 8 + +typedef struct { + unsigned long panel; + unsigned long type; + unsigned long hwid; + unsigned long nrports; +} companel_t; + +typedef struct { + unsigned long brd; + unsigned long type; + unsigned long hwid; + unsigned long state; + unsigned long ioaddr; + unsigned long ioaddr2; + unsigned long memaddr; + unsigned long irq; + unsigned long nrpanels; + unsigned long nrports; + companel_t panels[COM_MAXPANELS]; +} combrd_t; + + +/* + * Define the ioctl operations for stats stuff. + */ +#define COM_GETPORTSTATS _IOWR('c', 30, comstats_t) +#define COM_CLRPORTSTATS _IOWR('c', 31, comstats_t) +#define COM_GETBRDSTATS _IOWR('c', 32, combrd_t) + +/*****************************************************************************/ + +#endif diff --git a/sys/platform/pc64/include/gsc.h b/sys/platform/pc64/include/gsc.h new file mode 100644 index 0000000000..f00bbfa7b8 --- /dev/null +++ b/sys/platform/pc64/include/gsc.h @@ -0,0 +1,54 @@ +/* gsc.h - programming interface to the scanner device driver `gsc' + * + * + * Copyright (c) 1995 Gunther Schadow. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Gunther Schadow. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD: src/sys/i386/include/gsc.h,v 1.2.10.1 2000/08/03 01:01:19 peter Exp $ + * $DragonFly: src/sys/platform/pc32/include/gsc.h,v 1.2 2003/06/17 04:28:35 dillon Exp $ + */ + +#ifndef _MACHINE_GSC_H_ +#define _MACHINE_GSC_H_ + +#include + +#define GSC_GRES _IOR('S', 1, int) /* get resolution / dpi */ +#define GSC_SRES _IOW('S', 2, int) /* set resolution / dpi */ +#define GSC_GWIDTH _IOR('S', 3, int) /* get width / pixels */ +#define GSC_SWIDTH _IOW('S', 4, int) /* set width / pixels */ +#define GSC_GHEIGHT _IOR('S', 5, int) /* get height / pixels */ +#define GSC_SHEIGHT _IOW('S', 6, int) /* set height / pixels */ + +#define GSC_GBLEN _IOR('S', 7, int) /* get buffer length / lines */ +#define GSC_SBLEN _IOW('S', 8, int) /* set buffer length / lines */ +#define GSC_GBTIME _IOR('S', 9, int) /* get buffer timeout / s */ +#define GSC_SBTIME _IOW('S', 10, int) /* set buffer timeout / s */ + +#define GSC_SRESSW _IO('S', 11) /* set resolution by switch */ + +#endif /* !_MACHINE_GSC_H_ */ diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index 54b0189485..ea1a3508d4 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -174,13 +174,10 @@ SUBDIR+=editmap \ .endif .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" -SUBDIR+= btxld -.endif - -.if ${MACHINE_ARCH} == "i386" SUBDIR+=apm \ apmd \ battd \ + btxld \ kgmon \ kgzip \ lptcontrol \ @@ -189,8 +186,12 @@ SUBDIR+=apm \ sgsc \ sicontrol \ spkrtest \ - stallion \ - wlconfig + stallion +.endif + +.if ${MACHINE_ARCH} == "i386" +SUBDIR+=wlconfig + .if !defined(NO_I4B) SUBDIR+=i4b .endif diff --git a/usr.sbin/apmd/Makefile b/usr.sbin/apmd/Makefile index 3534ce7a49..7af60d373d 100644 --- a/usr.sbin/apmd/Makefile +++ b/usr.sbin/apmd/Makefile @@ -3,7 +3,7 @@ PROG= apmd SRCS= apmd.c apmdlex.l apmdparse.y y.tab.h -WARNS?= 2 +WARNS?= 3 DPADD= ${LIBL} ${LIBUTIL} LDADD= -ll -lutil diff --git a/usr.sbin/apmd/apmd.c b/usr.sbin/apmd/apmd.c index e1ca991729..7f9edcefe6 100644 --- a/usr.sbin/apmd/apmd.c +++ b/usr.sbin/apmd/apmd.c @@ -51,7 +51,6 @@ #include "apmd.h" -extern int yyparse(void); int debug_level = 0; int verbose = 0; @@ -540,7 +539,7 @@ check_battery(void) if (p -> direction == AC_POWER_STATE && !(p -> done) && ((p -> type == BATTERY_PERCENT && - p -> level == pw_info.ai_batt_life) || + p -> level == (int)pw_info.ai_batt_life) || (p -> type == BATTERY_MINUTES && p -> level == (pw_info.ai_batt_time / 60)))) { p -> done++; diff --git a/usr.sbin/apmd/apmd.h b/usr.sbin/apmd/apmd.h index 5e09fb8f29..d3fd119434 100644 --- a/usr.sbin/apmd/apmd.h +++ b/usr.sbin/apmd/apmd.h @@ -107,5 +107,27 @@ extern int register_apm_event_handlers( struct event_cmd *cmdlist); extern void free_event_cmd_list(struct event_cmd *p); +extern int yyparse(void); + void yyerror(const char *); int yylex(void); + +struct event_cmd *event_cmd_default_clone(void *); +int event_cmd_exec_act(void *); +void event_cmd_exec_dump(void *, FILE *); +struct event_cmd *event_cmd_exec_clone(void *); +void event_cmd_exec_free(void *); +int event_cmd_reject_act(void *); +struct event_cmd *clone_event_cmd_list(struct event_cmd *); +int exec_run_cmd(struct event_cmd *); +int exec_event_cmd(struct event_config *); +void read_config(void); +void dump_config(void); +void destroy_config(void); +void restart(void); +void enque_signal(int); +void wait_child(void); +int proc_signal(int); +void proc_apmevent(int); +void check_battery(void); +void event_loop(void); diff --git a/usr.sbin/kgmon/Makefile b/usr.sbin/kgmon/Makefile index 8ca9fa5e85..5d50f3b9e9 100644 --- a/usr.sbin/kgmon/Makefile +++ b/usr.sbin/kgmon/Makefile @@ -6,7 +6,7 @@ PROG= kgmon MAN= kgmon.8 DPADD= ${LIBKVM} LDADD= -lkvm -WARNS?= 1 +WARNS?= 2 # # This program may safely be run setuid-root to allow non-root diff --git a/usr.sbin/kgmon/kgmon.c b/usr.sbin/kgmon/kgmon.c index 299852fe79..a8d5843299 100644 --- a/usr.sbin/kgmon/kgmon.c +++ b/usr.sbin/kgmon/kgmon.c @@ -347,7 +347,7 @@ dumpstate(struct kvmvars *kvp) i = 0; } if (i != kvp->gpm.kcountsize) - errx(6, "read ticks: read %u, got %d: %s", + errx(6, "read ticks: read %lu, got %zd: %s", kvp->gpm.kcountsize, i, kflag ? kvm_geterr(kvp->kd) : strerror(errno)); if ((fwrite(tickbuf, kvp->gpm.kcountsize, 1, fp)) != 1) @@ -369,7 +369,7 @@ dumpstate(struct kvmvars *kvp) i = 0; } if (i != kvp->gpm.fromssize) - errx(9, "read froms: read %u, got %d: %s", + errx(9, "read froms: read %lu, got %zd: %s", kvp->gpm.fromssize, i, kflag ? kvm_geterr(kvp->kd) : strerror(errno)); if ((tos = (struct tostruct *)malloc(kvp->gpm.tossize)) == NULL) @@ -384,11 +384,11 @@ dumpstate(struct kvmvars *kvp) i = 0; } if (i != kvp->gpm.tossize) - errx(11, "read tos: read %u, got %d: %s", + errx(11, "read tos: read %lu, got %zd: %s", kvp->gpm.tossize, i, kflag ? kvm_geterr(kvp->kd) : strerror(errno)); if (debug) - warnx("lowpc 0x%x, textsize 0x%x", + warnx("lowpc 0x%tx, textsize 0x%lx", kvp->gpm.lowpc, kvp->gpm.textsize); endfrom = kvp->gpm.fromssize / sizeof(*froms); for (fromindex = 0; fromindex < endfrom; ++fromindex) { @@ -399,7 +399,7 @@ dumpstate(struct kvmvars *kvp) for (toindex = froms[fromindex]; toindex != 0; toindex = tos[toindex].link) { if (debug) - warnx("[mcleanup] frompc 0x%x selfpc 0x%x count %d", + warnx("[mcleanup] frompc 0x%lx selfpc 0x%lx count %ld", frompc, tos[toindex].selfpc, tos[toindex].count); rawarc.raw_frompc = frompc; diff --git a/usr.sbin/sgsc/Makefile b/usr.sbin/sgsc/Makefile index ff9acac639..5fdc4909f6 100644 --- a/usr.sbin/sgsc/Makefile +++ b/usr.sbin/sgsc/Makefile @@ -2,6 +2,5 @@ # $DragonFly: src/usr.sbin/sgsc/Makefile,v 1.2 2003/06/17 04:30:03 dillon Exp $ PROG= sgsc -WARNS?= 3 .include diff --git a/usr.sbin/sgsc/sgsc.c b/usr.sbin/sgsc/sgsc.c index b53678860e..fce1aee085 100644 --- a/usr.sbin/sgsc/sgsc.c +++ b/usr.sbin/sgsc/sgsc.c @@ -63,7 +63,7 @@ main(int argc, char **argv) char c; int fd; - char *file = DEFAULT_FILE; + const char *file = DEFAULT_FILE; int show_dpi = 0; int show_width = 0; diff --git a/usr.sbin/stallion/stlload/Makefile b/usr.sbin/stallion/stlload/Makefile index 8aad525556..5c242bb3bd 100644 --- a/usr.sbin/stallion/stlload/Makefile +++ b/usr.sbin/stallion/stlload/Makefile @@ -4,6 +4,7 @@ PROG= stlload MAN= stlload.8 MANSUBDIR=/i386 +WARNS?= 2 CFLAGS+=-DBOOTDIR=\"${BOOTDIR}\" diff --git a/usr.sbin/stallion/stlload/stlload.c b/usr.sbin/stallion/stlload/stlload.c index 98db957ee2..2ff4910789 100644 --- a/usr.sbin/stallion/stlload/stlload.c +++ b/usr.sbin/stallion/stlload/stlload.c @@ -375,7 +375,7 @@ download(void) strttime = time(NULL); if (verbose) - printf("Waiting for slave alive marker, time=%x timeout=%d\n", + printf("Waiting for slave alive marker, time=%lx timeout=%d\n", strttime, TIMEOUT); while (time(NULL) < (strttime + TIMEOUT)) { if (lseek(memfd, CDK_RDYADDR, SEEK_SET) != CDK_RDYADDR) { diff --git a/usr.sbin/stallion/stlstats/Makefile b/usr.sbin/stallion/stlstats/Makefile index 7a0b1ff77c..f64d69c8ce 100644 --- a/usr.sbin/stallion/stlstats/Makefile +++ b/usr.sbin/stallion/stlstats/Makefile @@ -4,6 +4,7 @@ PROG= stlstats MAN= stlstats.8 MANSUBDIR=/i386 +WARNS?= 2 DPADD= ${LIBNCURSES} ${LIBMYTINFO} LDADD= -lncurses -lmytinfo diff --git a/usr.sbin/stallion/stlstty/Makefile b/usr.sbin/stallion/stlstty/Makefile index 8cefc13302..9655d5254b 100644 --- a/usr.sbin/stallion/stlstty/Makefile +++ b/usr.sbin/stallion/stlstty/Makefile @@ -4,6 +4,7 @@ PROG= stlstty MAN= stlstty.8 MANSUBDIR=/i386 +WARNS?= 3 DPADD= ${LIBNCURSES} ${LIBMYTINFO} LDADD= -lncurses -lmytinfo diff --git a/usr.sbin/stallion/stlstty/stlstty.c b/usr.sbin/stallion/stlstty/stlstty.c index 9eb9335bf9..07fc8ceb1a 100644 --- a/usr.sbin/stallion/stlstty/stlstty.c +++ b/usr.sbin/stallion/stlstty/stlstty.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -101,6 +102,10 @@ struct stloption longops[] = { { 0, 0 } }; +/* Function prototypes */ +void getpflags(void); +void setpflags(unsigned long , unsigned long ); + /*****************************************************************************/ /* -- 2.11.4.GIT