Fixes for CMD_LINE, and other fixes to set up ga-6bxc.

mtrr.c, remove redundant define
string.h bug with 0 in strlen
This commit is contained in:
Ronald G. Minnich 2001-01-18 23:11:26 +00:00
parent c4de6e712f
commit b56912ec3a
7 changed files with 58 additions and 25 deletions

View file

@ -48,7 +48,6 @@ floppy: all
# can put it on the floppy (see ROOTDOIT)
romimage: linuxbios.rom vmlinux.bin.gz.block
cat vmlinux.bin.gz.block linuxbios.rom > romimage
cp romimage /tmp
linuxbios.rom: linuxbios.strip mkrom
./mkrom -s 64 -f -o linuxbios.rom linuxbios.strip

View file

@ -28,7 +28,7 @@
#ifndef lint
static char rcsid[] = "$Id$";
#endif
#define DEBUG
#include <cpu/p6/msr.h>
#include <cpu/p6/mtrr.h>
#include <printk.h>

View file

@ -6,14 +6,6 @@
* (c) 1999 Martin Mares <mj@ucw.cz>
*/
#undef DEBUG
#ifdef DEBUG
#define DBG(x...) printk(x)
#else
#define DBG(x...)
#endif
#define PCI_PROBE_BIOS 1
#define PCI_PROBE_CONF1 2
#define PCI_PROBE_CONF2 4

View file

@ -4,10 +4,38 @@
//extern inline void strcpy(char *dst, char *src) {while (*src) *dst++ = *src++;}
//extern inline int strlen(char *src) { int i = 0; while (*src++) i++; return i;}
#if 1
extern inline int strnlen(const char *src, int max) {
int i = 0;
while ((*src++) && (i < max))
i++;
return i;
if (max<0) {
while (*src++)
i++;
return i;
}
else {
while ((*src++) && (i < max))
i++;
return i;
}
}
#else
static inline size_t strnlen(const char * s, size_t count)
{
int d0;
register int __res;
__asm__ __volatile__(
"movl %2,%0\n\t"
"jmp 2f\n"
"1:\tcmpb $0,(%0)\n\t"
"je 3f\n\t"
"incl %0\n"
"2:\tdecl %1\n\t"
"cmpl $-1,%1\n\t"
"jne 1b\n"
"3:\tsubl %2,%0"
:"=a" (__res), "=&d" (d0)
:"c" (s),"1" (count));
return __res;
}
#endif

View file

@ -6,3 +6,7 @@
void mainboard_fixup()
{
}
void final_mainboard_fixup()
{
}

View file

@ -30,6 +30,11 @@ void nvram_on()
// for now, I am putting in the old keyboard code, until we figure out
// the best way to do this -- RGM
#ifdef NO_KEYBOARD
void keyboard_on()
{
}
#else
void keyboard_on()
{
u32 controlbits;
@ -70,5 +75,5 @@ void keyboard_on()
/* now keyboard should work, ha ha. */
pc_keyboard_init();
}
#endif

View file

@ -22,6 +22,7 @@ linuxbiosbase = 0xf0000;
objectrules = [];
userrules = [];
userdefines = [];
# this is the absolute base rule, and so is very special.
mainrulelist = "all"
@ -191,16 +192,16 @@ def adddepend(dir, rule):
makebaserules[rulename][0] = makebaserules[rulename][0] + " " + depend
def makedefine(dir, rule):
userrules.append(rule)
userdefines.append(rule)
def option(dir, option):
makeoptions[option] = 1;
makeoptions[option] = "-D" + option
def nooption(dir, option):
makeoptions[option] = 0;
makeoptions[option] = "-U" + option
def commandline(dir, command):
rule = "CMD_LINE=\'\"" + command + "\"\'"
makedefine(dir, rule)
makeoptions["CMD_LINE"] = "-DCMD_LINE=\'\"" + command + "\"\'"
# we do all these rules by hand because docipl will always be special
# it's more or less a stand-alone bootstrap
@ -406,10 +407,8 @@ def writemakefile(path):
file.write("TOP=%s\n" % (treetop))
file.write("CPUFLAGS=\n")
for z in makeoptions.keys():
if (makeoptions[z]):
file.write("CPUFLAGS += -D%s\n" % (z))
else:
file.write("CPUFLAGS += -U%s\n" % (z))
print "key is %s, val %s\n" % (z, makeoptions[z])
file.write("CPUFLAGS += %s\n" % (makeoptions[z]))
# print out all the object dependencies
# There is ALWAYS a crt0.o
@ -417,14 +416,20 @@ def writemakefile(path):
for i in range(len(objectrules)):
file.write("OBJECTS += %s\n" % (objectrules[i][0]))
# print out the base rules
# print out the user defines
for i in range(len(userdefines)):
print "rule %d is %s" % (i, userdefines[i])
file.write("%s\n" % userdefines[i])
# print out the base rules
# need to have a rule that counts on 'all'
file.write("mainrule: %s\n" % mainrulelist)
# for i in range(len(baserules)):
# file.write("%s\n" % baserules[i])
for i in range(len(userrules)):
print "rule %d is %s" % (i, userrules[i])
file.write("%s\n" % userrules[i])
# print out any user rules