mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 17:04:19 +01:00
Make pcvt compile and run again after find_display() is gone as part of
the new-bus changes. Also fix several compiler warnings.
This commit is contained in:
parent
7725a6c940
commit
00f8b3fd87
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=45854
@ -41,7 +41,7 @@
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* @(#)pcvt_drv.c, 3.20, Last Edit-Date: [Sun Apr 2 19:09:19 1995]
|
||||
* @(#)pcvt_drv.c, 3.20, Last Edit-Date: [Mon Apr 19 17:10:09 1999]
|
||||
*
|
||||
*/
|
||||
|
||||
@ -104,10 +104,6 @@ extern int getchar __P((void));
|
||||
extern u_short *Crtat;
|
||||
#endif /* PCVT_NETBSD */
|
||||
|
||||
static unsigned __debug = 0; /*0xffe */
|
||||
static __color;
|
||||
static nrow;
|
||||
|
||||
static void vgapelinit(void); /* read initial VGA DAC palette */
|
||||
|
||||
#if defined XSERVER && !PCVT_USL_VT_COMPAT
|
||||
@ -618,7 +614,7 @@ pcwrite(Dev_t dev, struct uio *uio, int flag)
|
||||
int
|
||||
pcioctl(Dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
|
||||
{
|
||||
register error;
|
||||
register int error;
|
||||
register struct tty *tp;
|
||||
|
||||
if((tp = get_pccons(dev)) == NULL)
|
||||
@ -1038,7 +1034,7 @@ pcstart(register struct tty *tp)
|
||||
|
||||
s = spltty();
|
||||
|
||||
while (len = q_to_b(rbp, buf, PCVT_PCBURST))
|
||||
while((len = q_to_b(rbp, buf, PCVT_PCBURST)) > 0)
|
||||
{
|
||||
/*
|
||||
* We need to do this outside spl since it could be fairly
|
||||
@ -1169,29 +1165,29 @@ int
|
||||
#endif
|
||||
pccnprobe(struct consdev *cp)
|
||||
{
|
||||
struct isa_device *dvp;
|
||||
static int uarg = 0;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* Take control if we are the highest priority enabled display device.
|
||||
*/
|
||||
dvp = find_display();
|
||||
if (dvp == NULL || dvp->id_driver != &vtdriver) {
|
||||
cp->cn_pri = CN_DEAD;
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef _DEV_KBD_KBDREG_H_
|
||||
/*
|
||||
* Don't reset the keyboard via `kbdio' just yet.
|
||||
* The system clock has not been calibrated...
|
||||
*/
|
||||
reset_keyboard = 0;
|
||||
if (kbd == NULL) {
|
||||
if (kbd == NULL)
|
||||
{
|
||||
kbd_configure(KB_CONF_PROBE_ONLY);
|
||||
i = kbd_allocate("*", -1, (void *)&kbd, pcevent, (void *)dvp->id_unit);
|
||||
i = kbd_allocate("*", -1, (void *)&kbd, pcevent, (void *)&uarg);
|
||||
if (i >= 0)
|
||||
{
|
||||
uarg = i;
|
||||
kbd = kbd_get_keyboard(i);
|
||||
}
|
||||
else
|
||||
{
|
||||
cp->cn_pri = CN_DEAD;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#if PCVT_SCANSET == 2
|
||||
@ -1384,88 +1380,6 @@ pcparam(struct tty *tp, struct termios *t)
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* special characters */
|
||||
#define bs 8
|
||||
#define lf 10
|
||||
#define cr 13
|
||||
#define cntlc 3
|
||||
#define del 0177
|
||||
#define cntld 4
|
||||
|
||||
static int
|
||||
getchar(void)
|
||||
{
|
||||
u_char thechar;
|
||||
int x;
|
||||
|
||||
kbd_polling = 1;
|
||||
|
||||
x = splhigh();
|
||||
|
||||
sput(">", 1, 1, 0);
|
||||
|
||||
async_update(UPDATE_KERN);
|
||||
|
||||
thechar = *(sgetc(0));
|
||||
|
||||
kbd_polling = 0;
|
||||
|
||||
splx(x);
|
||||
|
||||
switch (thechar)
|
||||
{
|
||||
default:
|
||||
if (thechar >= ' ')
|
||||
sput(&thechar, 1, 1, 0);
|
||||
return(thechar);
|
||||
|
||||
case cr:
|
||||
case lf:
|
||||
sput("\r\n", 1, 2, 0);
|
||||
return(lf);
|
||||
|
||||
case bs:
|
||||
case del:
|
||||
sput("\b \b", 1, 3, 0);
|
||||
return(thechar);
|
||||
|
||||
case cntlc:
|
||||
sput("^C\r\n", 1, 4, 0) ;
|
||||
cpu_reset();
|
||||
|
||||
case cntld:
|
||||
sput("^D\r\n", 1, 4, 0) ;
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
|
||||
#define DPAUSE 1
|
||||
|
||||
void
|
||||
dprintf(unsigned flgs, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
if((flgs&__debug) > DPAUSE)
|
||||
{
|
||||
__color = ffs(flgs&__debug)+1;
|
||||
va_start(ap,fmt);
|
||||
vprintf(fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (flgs & DPAUSE || nrow%24 == 23)
|
||||
{
|
||||
int x;
|
||||
x = splhigh();
|
||||
if(nrow%24 == 23)
|
||||
nrow = 0;
|
||||
(void)sgetc(0);
|
||||
splx(x);
|
||||
}
|
||||
}
|
||||
__color = 0;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*
|
||||
* read initial VGA palette (as stored by VGA ROM BIOS) into
|
||||
* palette save area
|
||||
|
@ -38,7 +38,7 @@
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* @(#)pcvt_kbd.c, 3.20, Last Edit-Date: [Sun Apr 2 18:59:04 1995]
|
||||
* @(#)pcvt_kbd.c, 3.20, Last Edit-Date: [Mon Apr 19 17:16:47 1999]
|
||||
*
|
||||
*/
|
||||
|
||||
@ -715,7 +715,7 @@ kbd_code_init1(void)
|
||||
static
|
||||
void ovlinit(int force)
|
||||
{
|
||||
register i;
|
||||
register int i;
|
||||
|
||||
if(force || ovlinitflag==0)
|
||||
{
|
||||
@ -1808,7 +1808,7 @@ rmkeydef(int key)
|
||||
static int
|
||||
setkeydef(Ovl_tbl *data)
|
||||
{
|
||||
register i;
|
||||
register int i;
|
||||
|
||||
if( data->keynum > MAXKEYNUM ||
|
||||
(data->type & KBD_MASK) == KBD_BREAK ||
|
||||
|
@ -38,7 +38,7 @@
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* @(#)pcvt_kbd.h, 3.20, Last Edit-Date: [Sun Apr 2 18:59:08 1995]
|
||||
* @(#)pcvt_kbd.h, 3.20, Last Edit-Date: [Mon Apr 19 17:14:46 1999]
|
||||
*
|
||||
*/
|
||||
|
||||
@ -106,7 +106,7 @@ typedef struct
|
||||
|
||||
static Ovl_tbl *ovltbl; /* the table itself */
|
||||
|
||||
static ovlinitflag = 0; /* the init flag for the table */
|
||||
static int ovlinitflag = 0; /* the init flag for the table */
|
||||
|
||||
/*
|
||||
* key codes >= 128 denote "virtual" shift/control
|
||||
|
@ -35,7 +35,7 @@
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* @(#)pcvt_out.c, 3.20, Last Edit-Date: [Sun Apr 2 18:59:11 1995]
|
||||
* @(#)pcvt_out.c, 3.20, Last Edit-Date: [Mon Apr 19 17:18:58 1999]
|
||||
*
|
||||
*/
|
||||
|
||||
@ -173,7 +173,7 @@ sput (u_char *s, U_char kernel, int len, int page)
|
||||
attrib = kernel ? kern_attr : svsp->c_attr;
|
||||
|
||||
while (len-- > 0)
|
||||
if (ch = *(s++))
|
||||
if((ch = *(s++)) > 0)
|
||||
{
|
||||
if(svsp->sevenbit)
|
||||
ch &= 0x7f;
|
||||
@ -1862,7 +1862,7 @@ update_hp(struct video_state *svsp)
|
||||
*((svsp->Crtat + ((svsp->screen_rows + 2) * svsp->maxcol))
|
||||
+ svsp->maxcol - 3) = user_attr | '[';
|
||||
*((svsp->Crtat + ((svsp->screen_rows + 2) * svsp->maxcol))
|
||||
+ svsp->maxcol - 2) = user_attr | current_video_screen + '0';
|
||||
+ svsp->maxcol - 2) = user_attr | (current_video_screen + '0');
|
||||
*((svsp->Crtat + ((svsp->screen_rows + 2) * svsp->maxcol))
|
||||
+ svsp->maxcol - 1) = user_attr | ']';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user