make.base(i386 & alpha)

make.base -- renamed OBJECTS to OBJECTS-1 to allow conditional compilation of objects
ldscript.base -- realized that assignemnts to the location counter inside of sections
           are relative to their start so simplfied the code
pirq_routing.h -- includeded types.h so we don't have suprises
hardwaremain.c -- unconditionally included arch/smp/mpsec.h
arch/i386/smp/Config introduced conitional on the compilation objects into
                  the compilation process
         ioapic.c -- removed (now) unneeded ifdef around this file
         mpsec.c -- removed (now) unneeded ifdef around this file

cpu/cpufixup.h -- Fix typo in the case when no cpufixup is needed.
parts/framebuffer.h -- Added a missing semicolon.
smp/atomic.h -- renamed second atmoic_inc to atomic_dec oops.

tyan/guinnes/Config -- reordered the options so they are grouped a little
                better and said mptable.o is dependent on HAVE_MP_TABLE
tyan/guiness/mainboard.c -- small change for clarity.

northsouthbridge/sis/630/northbridge.c
northsouthbridge/sis/630/southbridge.c
           -- Remove unused include of the now dead param.h

NLBConfig.py
          -- Only include numeric options in the linker script
          -- Update to handle adding a condition for when to build
             objects
This commit is contained in:
Eric W. Biederman 2001-08-15 21:30:08 +00:00
parent 94b5887f47
commit 71be41d193
16 changed files with 47 additions and 48 deletions

View file

@ -16,8 +16,8 @@ makerule documentation: $(SOURCES) ; doxygen LinuxBIOSDoc.config
addaction linuxbios $(LINK)
addaction linuxbios nm -n linuxbios > linuxbios.map
makerule linuxbios.a : $(OBJECTS) ; rm -f linuxbios.a
addaction linuxbios.a ar cr linuxbios.a $(OBJECTS)
makerule linuxbios.a : $(OBJECTS-1) ; rm -f linuxbios.a
addaction linuxbios.a ar cr linuxbios.a $(OBJECTS-1)
makerule crt0.s: crt0.S ; $(CC) $(CPPFLAGS) -I$(TOP)/src -E $< > crt0.s

View file

@ -96,24 +96,20 @@ SECTIONS
.heap (.): {
_heap = .;
/* Reserve 256K for the heap */
. = . + ( HEAP_SIZE );
. = HEAP_SIZE ;
_eheap = .;
}
.stack (.) : {
_stack = .;
/* Reserve 64k stack for each possible cpu */
. = . + ((MAX_CPUS) * (STACK_SIZE));
. = ((MAX_CPUS) * (STACK_SIZE));
_estack = .;
}
_lreset = _eldata;
_lreset = _ROMTOP;
. = _lreset;
_deadspace = (_ROMTOP - _lreset);
.reset (.) : AT (_lreset) {
. = . + _deadspace;
_reset_vector = .;
*(.reset_vector)
_ereset_vector = . ;
. = . + (16 - (1 + (_ereset_vector - _reset_vector)));
. = 15 ;
BYTE(0x00);
}
_elreset = _lreset + SIZEOF(.reset);

View file

@ -38,8 +38,8 @@ makerule etags: $(SOURCES) ; etags $(SOURCES)
makerule tags: $(SOURCES) ; gctags $(SOURCES)
makerule documentation: $(SOURCES) ; doxygen LinuxBIOSDoc.config
makerule linuxbios.a : $(OBJECTS) ; rm -f linuxbios.a
addaction linuxbios.a ar cr linuxbios.a $(OBJECTS)
makerule linuxbios.a : $(OBJECTS-1) ; rm -f linuxbios.a
addaction linuxbios.a ar cr linuxbios.a $(OBJECTS-1)
makerule crt0.s: crt0.S $(TOP)/src/cpu/p5/start32.inc ; $(CPP) $(CPPFLAGS) -I$(TOP)/src $< > crt0.s

View file

@ -1,6 +1,8 @@
#ifndef ARCH_PIRQ_ROUTING_H
#define ARCH_PIRQ_ROUTING_H
#include <types.h>
#define PIRQ_SIGNATURE (('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24))
#define PIRQ_VERSION 0x0100

View file

@ -56,9 +56,7 @@ static char rcsid[] = "$Id$";
#include <arch/pirq_routing.h>
#include <arch/ioapic.h>
#include <smp/atomic.h>
#if defined(SMP)
#include<arch/smp/mpspec.h>
#endif
#include <arch/smp/mpspec.h>
static int cpu_initialize(unsigned long totalram)

View file

@ -1,3 +1,3 @@
object mpspec.o
object ioapic.o
object start_stop.o
object mpspec.o HAVE_MP_TABLE
object ioapic.o IOAPIC
object start_stop.o SMP

View file

@ -1,4 +1,3 @@
#if defined(IOAPIC)
#include <arch/ioapic.h>
#include <printk.h>
@ -134,4 +133,3 @@ void setup_ioapic(void)
a->reg, a->value_low, a->value_high);
}
}
#endif /* IOAPIC */

View file

@ -1,5 +1,3 @@
#ifdef HAVE_MP_TABLE
#ifndef lint
static char rcsid[] = "$Id$";
#endif
@ -240,4 +238,3 @@ void write_smp_table(void *v)
}
#endif /* 0 */
#endif /* HAVE_MP_TABLE */

View file

@ -11,7 +11,7 @@
# define cpufixup(totalram) p6_cpufixup(totalram)
# endif
#else
# define cpu_fixup(totalram) do {} while(0)
# define cpufixup(totalram) do {} while(0)
#endif
#endif /* CPU_CPUFIXUP_H */

View file

@ -2,7 +2,7 @@
#define PART_FRAMEBUFFER_H
#ifdef HAVE_FRAMEBUFFER
void framebuffer_on(void)
void framebuffer_on(void);
#else
# define framebuffer_on() do {} while(0)
#endif /* HAVE_FRAMEBUFFER */

View file

@ -45,7 +45,7 @@ typedef struct { int counter; } atomic_t;
* Atomically decrements @v by 1. Note that the guaranteed
* useful range of an atomic_t is only 24 bits.
*/
#define atomic_inc(v) (((v)->counter)--)
#define atomic_dec(v) (((v)->counter)--)
#endif /* SMP */

View file

@ -27,7 +27,7 @@ option ENABLE_FIXED_AND_VARIABLE_MTRRS
object mainboard.o
object mptable.o
object mptable.o HAVE_MP_TABLE
#object irq_tables.o
#keyboard pc80
dir ../../../pc80
@ -40,12 +40,12 @@ option SMBUS_MEM_DEVICE_INC=1
option SIO_BASE=0x2e
option SMP=1
option IOAPIC=1
option MAX_CPUS=2
option HAVE_MP_TABLE=1
option USE_AMD_NDA_CODE=1
option FINAL_MAINBOARD_FIXUP=1
option HAVE_HARD_RESET=1
option HAVE_MP_TABLE=1
option STACK_SIZE=0x10000
option MAX_CPUS=2
option XIP_ROM_SIZE=0x8000
option XIP_ROM_BASE=0xffff8000
nooption MEMORY_HOLE

View file

@ -427,7 +427,7 @@ static void setup_pci_irq_to_isa_routing(void)
* PIRQC -> 11
* PIRQD -> 3
*/
pci_write_config_word(dev, 0x56, 0x3ba5);
pci_write_config_word(dev, 0x56,(3 << 12)|(0xb << 8)|(0xa <<4)|(5 <<0));
}
}

View file

@ -16,7 +16,6 @@ static char rcsid[] =
#include <subr.h>
#include <pci.h>
#include <pci_ids.h>
#include <northsouthbridge/sis/630/param.h>
/* these functions query the hardware to figure out how much ram is in
* the machine. They then place that information in the parameter block.

View file

@ -16,7 +16,6 @@ static char rcsid[] =
#include <subr.h>
#include <pci.h>
#include <pci_ids.h>
#include <northsouthbridge/sis/630/param.h>
#include <cpu/p5/io.h>
void keyboard_on()

View file

@ -40,17 +40,17 @@ def add_main_rule_dependency(new_dependency):
# this is a tuple, object name, source it depends on,
# and an optional rule (can be empty) for actually building
# the object
def addobject(object, sourcepath, rule):
objectrules.append([object, sourcepath, rule])
def addobject(object, sourcepath, rule, condition):
objectrules.append([object, sourcepath, rule, condition])
# OK, let's face it, make sucks.
# if you have a rule like this:
# a.o: /some/long/path/a.c
# make won't apply the .c.o rule. Toy!
def addobject_defaultrule(object, sourcepath):
defaultrule = "\t $(CC) -c $(CFLAGS) $<"
objectrules.append([object, sourcepath, defaultrule])
def addobject_defaultrule(object, sourcepath, condition):
defaultrule = "\t $(CC) -c $(CFLAGS) -o $@ $<"
addobject(object, sourcepath, defaultrule, condition)
# for all these functions, you need:
# the dir that the Config file is in
@ -136,7 +136,7 @@ def keyboard(dir, keyboard_name):
if (debug):
print "KEYBOARD"
keyboard_dir = os.path.join(treetop, 'src', keyboard_name)
addobject_defaultrule('keyboard.o', keyboard_dir)
addobject_defaultrule('keyboard.o', keyboard_dir,'')
def cpu(dir, cpu_name):
common_command_action(dir, 'cpu', cpu_name)
@ -165,7 +165,7 @@ def superio(dir, superio_name):
# note that superio is w.r.t. treetop
buildfullpath('superio', superio_name)
dir = os.path.join(treetop, 'src', 'superio', superio_name)
addobject_defaultrule('superio.o', dir)
addobject_defaultrule('superio.o', dir,'')
# commands are of the form:
# superio_name [name=val]*
@ -186,11 +186,10 @@ def nsuperio(dir, superio_commands):
superio_decl_name = re.sub("/", "_", superio_name)
buildfullpath('superio', superio_name)
dir = os.path.join(treetop, 'src', 'superio', superio_name)
defaultrule = "\t $(CC) -c $(CFLAGS) -o $@ $<"
object="superio_%s.o" % superio_decl_name
superio_source = dir + "/superio.c"
objectrules.append([object, superio_source, defaultrule])
addobject_defaultrule('nsuperio.o', "")
addobject_defaultrule(object, superio_source,'')
addobject_defaultrule('nsuperio.o', "", '')
rest = m.group(2)
superio_cmds = '';
m = command_re.match(rest)
@ -230,8 +229,13 @@ def mainboardinit(dir, file):
mainboardfilelist.append(file)
print "Added mainboard init file: ", file
def object(dir, obj_name):
addobject_defaultrule(obj_name, dir)
def object(dir, command):
wspc = string.whitespace
command_re = re.compile("([^" + wspc + "]+)([" + wspc + "]([^" + wspc + "]*)|)")
m = command_re.match(command)
obj_name = m.group(1)
condition = m.group(3)
addobject_defaultrule(obj_name, dir, condition)
# for eventual user-defined rules.
# pattern is name : deps ; rule
@ -510,8 +514,9 @@ def writeldscript(path):
keys = makeoptions.keys()
keys.sort()
for key in keys:
if makeoptions[key] :
file.write("%s = %s;\n" % (key, makeoptions[key]))
value = makeoptions[key]
if re.match("^(0x[0-9a-fA-F]+|0[0-7]+|[0-9]+)$", value):
file.write("%s = %s;\n" % (key, value))
ldlines = readfile(ldscriptbase)
if (debug):
@ -581,9 +586,14 @@ def writemakefile(path):
# print out all the object dependencies
# There is ALWAYS a crt0.o
file.write("OBJECTS=crt0.o\n")
file.write("OBJECTS-1 := crt0.o\n")
for i in range(len(objectrules)):
file.write("OBJECTS += %s\n" % (objectrules[i][0]))
obj_name = objectrules[i][0]
obj_cond = objectrules[i][3]
if not obj_cond :
file.write("OBJECTS-1 += %s\n" % (obj_name))
else:
file.write("OBJECTS-$(%s) += %s\n" % (obj_cond, obj_name))
file.write("SOURCES=\n")