4 * Copyright (c) 2005 NONAKA Kimihiro
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 #include <lib/libsa/stand.h>
30 #include <lib/libkern/libkern.h>
32 #include <sys/bootblock.h>
43 extern struct landisk_boot_params boot_params
;
45 static int consdev
= CONSDEV_BIOSCONS
;
54 case CONSDEV_BIOSCONS
:
58 switch (boot_params
.bp_conspeed
) {
70 scif_init(boot_params
.bp_conspeed
);
86 case CONSDEV_BIOSCONS
:
87 return bioscons_getc();
100 case CONSDEV_BIOSCONS
:
119 case CONSDEV_BIOSCONS
:
120 return scif_status2();
123 return scif_status();
128 awaitkey(int timeout
, int tell
)
133 i
= timeout
* POLL_FREQ
;
136 if (tell
&& (i
% POLL_FREQ
) == 0) {
140 sprintf(numbuf
, "%d ", i
/ POLL_FREQ
);
141 len
= strlen(numbuf
);
142 for (j
= 0; j
< len
; j
++)
143 numbuf
[len
+ j
] = '\b';
144 numbuf
[len
+ j
] = '\0';
148 /* flush input buffer */
156 delay(1000 / POLL_FREQ
);