Fix for 4.0-current.

Submitted by:	Keith Jang (keith@freebsd.sinica.edu.tw)
This commit is contained in:
Vanilla I. Shu 2000-02-06 07:04:31 +00:00
parent fbaa8ebc9c
commit 2996fa7a7b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=25510
6 changed files with 125 additions and 0 deletions

View file

@ -0,0 +1,23 @@
--- src/vga.c.orig Sun Jan 26 18:05:00 1997
+++ src/vga.c Mon Jan 31 14:09:55 2000
@@ -382,7 +382,7 @@
/* if (!code) return;*/
VgaSetColor(fc);
if (bc & 0x8) *(vcls - dInfo.glineByte) = 0;
- for (x = 0;x < sbFReg->high;x ++, code ++, fm >>= 1) {
+ if (code) for (x = 0;x < sbFReg->high;x ++, code ++, fm >>= 1) {
if (*code) {
VgaOutByte(*code);
*gram = *gram;
@@ -620,7 +620,11 @@
Perror("ioctl CONSOLE_IO_ENABLE");
return FAILURE;
}
+#if (__FreeBSD__ <= 3)
if ((devMem = open("/dev/vga", O_RDWR|O_NDELAY) ) < 0) {
+#else
+ if ((devMem = open("/dev/mem", O_RDWR|O_NDELAY) ) < 0) {
+#endif
Perror("/dev/mem");
return FAILURE;
}

View file

@ -0,0 +1,15 @@
--- include/vga.h.orig Fri Jan 24 16:08:01 1997
+++ include/vga.h Mon Jan 31 14:13:08 2000
@@ -59,7 +59,11 @@
#if defined(linux)
#define GRAPH_BASE 0xA0000
#elif defined(__FreeBSD__)
-#define GRAPH_BASE 0x0
+# if (__FreeBSD__ <= 3)
+# define GRAPH_BASE 0x0
+# else
+# define GRAPH_BASE 0xA0000
+# endif
#endif
#define FONT_SIZE 0x2000

View file

@ -0,0 +1,34 @@
--- include/mem.h.old Tue Jan 25 20:16:57 2000
+++ include/mem.h Tue Jan 25 20:30:48 2000
@@ -46,6 +46,7 @@
"d" ((u_short) port));
}
+#if 0
static inline
void lzero(void *head, int n)
{
@@ -93,11 +94,23 @@
"D" ((long)head)
:"cx","di");
}
+#endif
extern u_char PortInb(u_short);
+#if 1
+#define bzero(b, len) bzero(b, len)
+#define bzero2(b, len) bzero(b, len)
+#define lzero(b, len) bzero(b, len)
+#define wzero(b, len) bzero(b, len)
+#define bmove(dst, src, len) bcopy(src, dst, len)
+#define brmove(dst, src, len) bcopy(src, dst, len)
+#define wmove(dst, src, len) bcopy(src, dst, len)
+#define lmove(dst, src, len) bcopy(src, dst, len)
+#else
extern void wzero(void *, int);
extern void wmove(void *, void *, int);
extern void lmove(void *, void *, int);
+#endif
extern void SafeFree(void **);
#endif

View file

@ -0,0 +1,18 @@
--- lib/mem.c.old Tue Jan 25 20:16:57 2000
+++ lib/mem.c Tue Jan 25 20:28:18 2000
@@ -44,6 +44,7 @@
return(_rval);
}
+#if 0
void wzero(void *head, int n)
{
__asm__ ("cld\n\t"
@@ -76,6 +77,7 @@
"S" ((long)src)
:"cx","di","si");
}
+#endif
void SafeFree(void **p)
{

View file

@ -0,0 +1,11 @@
--- src/main.c.old Tue Jan 25 20:16:57 2000
+++ src/main.c Tue Jan 25 20:32:52 2000
@@ -34,7 +34,7 @@
#include <version.h>
#include <term.h>
-void main(int argc, const char *argv[])
+int main(int argc, const char *argv[])
{
char *p;

View file

@ -0,0 +1,24 @@
--- src/vc.c.old Tue Jan 25 20:16:57 2000
+++ src/vc.c Tue Jan 25 20:32:35 2000
@@ -100,8 +100,8 @@
"\t andb %%bl, (%%eax)\n"
"\t incl %%eax\n"
"\t loop 1b\n"
- :
- : "eax" ((long)head), "bl" (0x7F), "c" (n)
+ : "=bl" (head), "=c" (n)
+ : "eax" ((long)head), "0" (0x7F), "1" (n)
: "bl", "cx" );
}
@@ -114,8 +114,8 @@
"\t andl %%ebx, (%%eax)\n"
"\t addl $4, %%eax\n"
"\t loop 1b\n"
- :
- : "eax" ((long)head), "ebx" (0x7F7F7F7F), "c" (n>>2)
+ : "=ebx" (head), "=c" (n)
+ : "eax" ((long)head), "0" (0x7F7F7F7F), "1" (n>>2)
: "ebx", "cx" );
}