Kconfig: remove unused options config-dependent, device-driver and profiling-routine.

Kernel makefile updated.
This commit is contained in:
Serge Vakulenko
2015-09-02 18:19:30 -07:00
parent 635d8ff2f7
commit 592e2014fb
9 changed files with 104 additions and 184 deletions

View File

@@ -2,7 +2,6 @@
# Makefile for RetroBSD, pic32 target
#
# DEBUG is set to -g by kconfig if debugging is requested (kconfig -g).
# PROF is set to -pg by kconfig if profiling is requested (kconfig -p).
#
include ../gcc-config.mk
@@ -23,23 +22,13 @@ endif
S = ../..
COPTS = -I. ${IDENT} -DKERNEL
CFLAGS = -O ${COPTS}
CFLAGS = -O ${COPTS} ${PARAM}
# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
# where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
# is marked as config-dependent.
# compile rules: rules are named COMPILE_${SUFFIX}
# SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
NORMAL_C = ${CC} -c ${CFLAGS} ${PROF} $<
NORMAL_C_C = ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
DRIVER_C = ${CC} -c ${CFLAGS} ${PROF} $<
DRIVER_C_C = ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
PROFILE_C = ${CC} -p -c ${COPTS} $<
NORMAL_S = ${CC} -c ${COPTS} $<
NORMAL_S_C = ${CC} -c ${COPTS} ${PARAM} $<
COMPILE_C = ${CC} -c ${CFLAGS} $<
COMPILE_S = ${CC} -c ${COPTS} $<
%OBJS
@@ -79,7 +68,7 @@ load: unix.elf
pic32prog unix.hex
startup.o: ../startup.S
${NORMAL_S}
${COMPILE_S}
# the following are necessary because the files depend on the types of
# cpu's included in the system configuration

View File

@@ -100,10 +100,10 @@ extern void power_off();
#define LED_MISC4_OFF() LAT_CLR(LED_MISC4_PORT) = 1 << LED_MISC4_PIN
#endif
int hz = HZ;
int usechz = (1000000L + HZ - 1) / HZ;
struct timezone tz = { 8*60, 1 };
int nproc = NPROC;
int hz = HZ;
int usechz = (1000000L + HZ - 1) / HZ;
struct timezone tz = { TIMEZONE, DST };
int nproc = NPROC;
struct namecache namecache [NNAMECACHE];
char bufdata [NBUF * MAXBSIZE];
@@ -113,8 +113,8 @@ struct mount mount [NMOUNT];
struct buf buf [NBUF], bfreelist [BQUEUES];
struct bufhd bufhash [BUFHSZ];
struct cblock cfree [NCLIST];
struct proc proc [NPROC];
struct file file [NFILE];
struct proc proc [NPROC];
struct file file [NFILE];
/*
* Remove the ifdef/endif to run the kernel in unsecure mode even when in

View File

@@ -40,7 +40,9 @@
#ifndef NBUF
#define NBUF 10 /* number of i/o buffers */
#endif
#ifndef MAXUSERS
#define MAXUSERS 1 /* number of user logins */
#endif
#ifndef NPROC
#define NPROC 10 /* number of processes */
#endif

View File

@@ -17,7 +17,7 @@ ldscript "cfg/bootloader-max32.ld"
# Need to set locally
timezone 8 dst
maxusers 2
maxusers 1
# Standard system options
#options "CONFIG=MAX32" # TODO

View File

@@ -1,11 +1,10 @@
IDENT=-DCHIPKIT_MAX -DPIC32MX7 -DPWM_ENABLED -DADC_ENABLED -DGPIO_ENABLED -DSD0_CS_PIN=14 -DSD0_CS_PORT=TRISC -DSD0_PORT=2 -DSD0_MHZ=10 -DSPI_ENABLED -DCONSOLE_DEVICE=tty0 -DUART4_ENABLED -DUART3_ENABLED -DUART2_ENABLED -DUART1_ENABLED -DLED_KERNEL_PIN=3 -DLED_KERNEL_PORT=TRISA -DUCB_METER -DEXEC_SCRIPT -DEXEC_ELF -DEXEC_AOUT -DBUS_DIV=1 -DHZ=100 -DBUS_KHZ=80000 -DCPU_KHZ=80000
LDSCRIPT="cfg/bootloader-max32.ld"
PARAM=-DTIMEZONE=480 -DDST=1 -DMAXUSERS=2
PARAM=-DTIMEZONE=480 -DDST=1 -DMAXUSERS=1
#
# Makefile for RetroBSD, pic32 target
#
# DEBUG is set to -g by kconfig if debugging is requested (kconfig -g).
# PROF is set to -pg by kconfig if profiling is requested (kconfig -p).
#
include ../gcc-config.mk
@@ -26,25 +25,15 @@ endif
S = ../..
COPTS = -I. ${IDENT} -DKERNEL
CFLAGS = -O ${COPTS}
CFLAGS = -O ${COPTS} ${PARAM}
# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
# where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
# is marked as config-dependent.
# compile rules: rules are named COMPILE_${SUFFIX}
# SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
NORMAL_C = ${CC} -c ${CFLAGS} ${PROF} $<
NORMAL_C_C = ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
COMPILE_C = ${CC} -c ${CFLAGS} $<
COMPILE_S = ${CC} -c ${COPTS} $<
DRIVER_C = ${CC} -c ${CFLAGS} ${PROF} $<
DRIVER_C_C = ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
PROFILE_C = ${CC} -p -c ${COPTS} $<
NORMAL_S = ${CC} -c ${COPTS} $<
NORMAL_S_C = ${CC} -c ${COPTS} ${PARAM} $<
OBJS=exec_aout.o exec_conf.o exec_elf.o exec_script.o exec_subr.o \
OBJS = exec_aout.o exec_conf.o exec_elf.o exec_script.o exec_subr.o \
init_main.o init_sysent.o kern_clock.o kern_descrip.o \
kern_exec.o kern_exit.o kern_fork.o kern_mman.o kern_proc.o \
kern_prot.o kern_prot2.o kern_resource.o kern_sig.o kern_sig2.o \
@@ -57,7 +46,7 @@ OBJS=exec_aout.o exec_conf.o exec_elf.o exec_script.o exec_subr.o \
clock.o cons.o devsw.o exception.o gpio.o machdep.o mem.o pwm.o \
rd_sd.o signal.o spi.o spi_bus.o swap.o sysctl.o uart.o
CFILES=$S/kernel/exec_aout.c $S/kernel/exec_conf.c $S/kernel/exec_elf.c \
CFILES = $S/kernel/exec_aout.c $S/kernel/exec_conf.c $S/kernel/exec_elf.c \
$S/kernel/exec_script.c $S/kernel/exec_subr.c \
$S/kernel/init_main.c $S/kernel/init_sysent.c \
$S/kernel/kern_clock.c $S/kernel/kern_descrip.c \
@@ -108,7 +97,7 @@ unix.elf: ${SYSTEM_DEP} swapunix.o
${SYSTEM_LD_TAIL}
swapunix.o: swapunix.c
${NORMAL_C}
${COMPILE_C}
all: unix.elf
@@ -126,7 +115,7 @@ load: unix.elf
pic32prog unix.hex
startup.o: ../startup.S
${NORMAL_S}
${COMPILE_S}
# the following are necessary because the files depend on the types of
# cpu's included in the system configuration
@@ -145,197 +134,197 @@ ioconf.o: ioconf.c
${CC} -c ${CFLAGS} ioconf.c
exec_aout.o: $S/kernel/exec_aout.c
${NORMAL_C}
${COMPILE_C}
exec_conf.o: $S/kernel/exec_conf.c
${NORMAL_C}
${COMPILE_C}
exec_elf.o: $S/kernel/exec_elf.c
${NORMAL_C}
${COMPILE_C}
exec_script.o: $S/kernel/exec_script.c
${NORMAL_C}
${COMPILE_C}
exec_subr.o: $S/kernel/exec_subr.c
${NORMAL_C}
${COMPILE_C}
init_main.o: $S/kernel/init_main.c
${NORMAL_C}
${COMPILE_C}
init_sysent.o: $S/kernel/init_sysent.c
${NORMAL_C}
${COMPILE_C}
kern_clock.o: $S/kernel/kern_clock.c
${NORMAL_C}
${COMPILE_C}
kern_descrip.o: $S/kernel/kern_descrip.c
${NORMAL_C}
${COMPILE_C}
kern_exec.o: $S/kernel/kern_exec.c
${NORMAL_C}
${COMPILE_C}
kern_exit.o: $S/kernel/kern_exit.c
${NORMAL_C}
${COMPILE_C}
kern_fork.o: $S/kernel/kern_fork.c
${NORMAL_C}
${COMPILE_C}
kern_mman.o: $S/kernel/kern_mman.c
${NORMAL_C}
${COMPILE_C}
kern_proc.o: $S/kernel/kern_proc.c
${NORMAL_C}
${COMPILE_C}
kern_prot.o: $S/kernel/kern_prot.c
${NORMAL_C}
${COMPILE_C}
kern_prot2.o: $S/kernel/kern_prot2.c
${NORMAL_C}
${COMPILE_C}
kern_resource.o: $S/kernel/kern_resource.c
${NORMAL_C}
${COMPILE_C}
kern_sig.o: $S/kernel/kern_sig.c
${NORMAL_C}
${COMPILE_C}
kern_sig2.o: $S/kernel/kern_sig2.c
${NORMAL_C}
${COMPILE_C}
kern_subr.o: $S/kernel/kern_subr.c
${NORMAL_C}
${COMPILE_C}
kern_synch.o: $S/kernel/kern_synch.c
${NORMAL_C}
${COMPILE_C}
kern_sysctl.o: $S/kernel/kern_sysctl.c
${NORMAL_C}
${COMPILE_C}
kern_time.o: $S/kernel/kern_time.c
${NORMAL_C}
${COMPILE_C}
rdisk.o: $S/kernel/rdisk.c
${NORMAL_C}
${COMPILE_C}
subr_prf.o: $S/kernel/subr_prf.c
${NORMAL_C}
${COMPILE_C}
subr_rmap.o: $S/kernel/subr_rmap.c
${NORMAL_C}
${COMPILE_C}
sys_generic.o: $S/kernel/sys_generic.c
${NORMAL_C}
${COMPILE_C}
sys_inode.o: $S/kernel/sys_inode.c
${NORMAL_C}
${COMPILE_C}
sys_pipe.o: $S/kernel/sys_pipe.c
${NORMAL_C}
${COMPILE_C}
sys_process.o: $S/kernel/sys_process.c
${NORMAL_C}
${COMPILE_C}
syscalls.o: $S/kernel/syscalls.c
${NORMAL_C}
${COMPILE_C}
tty.o: $S/kernel/tty.c
${NORMAL_C}
${COMPILE_C}
tty_subr.o: $S/kernel/tty_subr.c
${NORMAL_C}
${COMPILE_C}
tty_tty.o: $S/kernel/tty_tty.c
${NORMAL_C}
${COMPILE_C}
ufs_alloc.o: $S/kernel/ufs_alloc.c
${NORMAL_C}
${COMPILE_C}
ufs_bio.o: $S/kernel/ufs_bio.c
${NORMAL_C}
${COMPILE_C}
ufs_bmap.o: $S/kernel/ufs_bmap.c
${NORMAL_C}
${COMPILE_C}
ufs_dsort.o: $S/kernel/ufs_dsort.c
${NORMAL_C}
${COMPILE_C}
ufs_fio.o: $S/kernel/ufs_fio.c
${NORMAL_C}
${COMPILE_C}
ufs_inode.o: $S/kernel/ufs_inode.c
${NORMAL_C}
${COMPILE_C}
ufs_mount.o: $S/kernel/ufs_mount.c
${NORMAL_C}
${COMPILE_C}
ufs_namei.o: $S/kernel/ufs_namei.c
${NORMAL_C}
${COMPILE_C}
ufs_subr.o: $S/kernel/ufs_subr.c
${NORMAL_C}
${COMPILE_C}
ufs_syscalls.o: $S/kernel/ufs_syscalls.c
${NORMAL_C}
${COMPILE_C}
ufs_syscalls2.o: $S/kernel/ufs_syscalls2.c
${NORMAL_C}
${COMPILE_C}
vfs_vnops.o: $S/kernel/vfs_vnops.c
${NORMAL_C}
${COMPILE_C}
vm_sched.o: $S/kernel/vm_sched.c
${NORMAL_C}
${COMPILE_C}
vm_swap.o: $S/kernel/vm_swap.c
${NORMAL_C}
${COMPILE_C}
vm_swp.o: $S/kernel/vm_swp.c
${NORMAL_C}
${COMPILE_C}
adc.o: $S/pic32/adc.c
${NORMAL_C}
${COMPILE_C}
clock.o: $S/pic32/clock.c
${NORMAL_C}
${COMPILE_C}
cons.o: $S/pic32/cons.c
${NORMAL_C}
${COMPILE_C}
devsw.o: $S/pic32/devsw.c
${NORMAL_C}
${COMPILE_C}
exception.o: $S/pic32/exception.c
${NORMAL_C}
${COMPILE_C}
gpio.o: $S/pic32/gpio.c
${NORMAL_C}
${COMPILE_C}
machdep.o: $S/pic32/machdep.c
${NORMAL_C}
${COMPILE_C}
mem.o: $S/pic32/mem.c
${NORMAL_C}
${COMPILE_C}
pwm.o: $S/pic32/pwm.c
${NORMAL_C}
${COMPILE_C}
rd_sd.o: $S/pic32/rd_sd.c
${NORMAL_C}
${COMPILE_C}
signal.o: $S/pic32/signal.c
${NORMAL_C}
${COMPILE_C}
spi.o: $S/pic32/spi.c
${NORMAL_C}
${COMPILE_C}
spi_bus.o: $S/pic32/spi_bus.c
${NORMAL_C}
${COMPILE_C}
swap.o: $S/pic32/swap.c
${NORMAL_C}
${COMPILE_C}
sysctl.o: $S/pic32/sysctl.c
${NORMAL_C}
${COMPILE_C}
uart.o: $S/pic32/uart.c
${NORMAL_C}
${COMPILE_C}

View File

@@ -82,17 +82,10 @@ struct file_list {
/*
* Types.
*/
#define DRIVER 1
#define NORMAL 2
#define INVISIBLE 3
#define PROFILING 4
#define SYSTEMSPEC 5
#define SWAPSPEC 6
/*
* Attributes (flags).
*/
#define CONFIGDEP 1
#define NORMAL 1
#define INVISIBLE 2
#define SYSTEMSPEC 3
#define SWAPSPEC 4
struct idlst {
char *id;
@@ -171,7 +164,6 @@ struct file_list *ftab, *conf_list, **confp, *comp_list, **compp;
int zone, hadtz;
int dst;
int hz;
int profiling;
int debugging;
int maxusers;

View File

@@ -6,7 +6,7 @@
.Nd build kernel configuration files
.Sh SYNOPSIS
.Nm kconfig
.Op Fl p
.Op Fl g
.Ar system_name
.Sh DESCRIPTION
.Pp
@@ -26,15 +26,12 @@ section below)
Available option and operand:
.Pp
.Bl -tag -width SYSTEM_NAME
.It Fl p
.It Fl g
If the
.Fl p
option is supplied,
.Nm kconfig
will configure a kernel for profiling; for example,
.Xr kgmon 8
and
.Xr gprof 1 .
will configure a kernel for debugging.
.It Ar SYSTEM_NAME
specifies the name of the kernel configuration file
containing device specifications, configuration options

View File

@@ -48,14 +48,11 @@ int main(argc, argv)
{
int ch;
while ((ch = getopt(argc, argv, "gp")) != EOF)
while ((ch = getopt(argc, argv, "g")) != EOF)
switch (ch) {
case 'g':
debugging++;
break;
case 'p':
profiling++;
break;
case '?':
default:
goto usage;

View File

@@ -147,7 +147,7 @@ void read_files()
register struct opt *op;
char *wd, *this, *needs, *special;
char fname[32];
int nreqs, first = 1, configdep, isdup, std, filetype;
int nreqs, first = 1, isdup, std, filetype;
ftab = 0;
(void) strcpy(fname, "../files.kconf");
@@ -158,9 +158,7 @@ void read_files()
}
next:
/*
* filename [ standard | optional ] [ config-dependent ]
* [ dev* | profiling-routine ] [ device-driver]
* [ compile-with "compile rule" ]
* filename [ standard | optional ] [ dev* ] [ compile-with "compile rule" ]
*/
wd = get_word(fp);
if (wd == (char *)EOF) {
@@ -193,7 +191,6 @@ next:
fname, this, tp->f_fn);
nreqs = 0;
special = 0;
configdep = 0;
needs = 0;
std = 0;
filetype = NORMAL;
@@ -207,10 +204,6 @@ nextparam:
next_word(fp, wd);
if (wd == 0)
goto doneparam;
if (eq(wd, "config-dependent")) {
configdep++;
goto nextparam;
}
if (eq(wd, "compile-with")) {
next_quoted_word(fp, wd);
if (wd == 0) {
@@ -222,14 +215,6 @@ nextparam:
goto nextparam;
}
nreqs++;
if (eq(wd, "device-driver")) {
filetype = DRIVER;
goto nextparam;
}
if (eq(wd, "profiling-routine")) {
filetype = PROFILING;
goto nextparam;
}
if (needs == 0 && nreqs == 1)
needs = strdup(wd);
if (isdup)
@@ -283,15 +268,11 @@ doneparam:
fname, this);
exit(1);
}
if (filetype == PROFILING && profiling == 0)
goto next;
if (tp == 0)
tp = new_fent();
tp->f_fn = this;
tp->f_type = filetype;
tp->f_flags = 0;
if (configdep)
tp->f_flags |= CONFIGDEP;
tp->f_needs = needs;
tp->f_special = special;
if (pf && pf->f_type == INVISIBLE)
@@ -307,7 +288,7 @@ void do_objs(fp)
register char *cp, och, *sp;
char swapname[32];
fprintf(fp, "OBJS=");
fprintf(fp, "OBJS = ");
lpos = 6;
for (tp = ftab; tp != 0; tp = tp->f_next) {
if (tp->f_type == INVISIBLE)
@@ -344,7 +325,7 @@ void do_cfiles(fp)
register int lpos, len;
char swapname[32];
fputs("CFILES=", fp);
fputs("CFILES = ", fp);
lpos = 8;
for (tp = ftab; tp; tp = tp->f_next)
if (tp->f_type != INVISIBLE) {
@@ -400,31 +381,8 @@ void do_rules(f)
fprintf(f, "%so: $S/%s%c\n", tail(np), np, och);
special = ftp->f_special;
if (special == 0) {
char *ftype = "???";
static char cmd[128];
switch (ftp->f_type) {
case NORMAL:
ftype = "NORMAL";
break;
case DRIVER:
ftype = "DRIVER";
break;
case PROFILING:
if (!profiling)
continue;
ftype = "PROFILE";
break;
default:
printf("config: don't know rules for %s\n", np);
break;
}
(void)sprintf(cmd, "${%s_%c%s}", ftype, toupper(och),
ftp->f_flags & CONFIGDEP? "_C" : "");
sprintf(cmd, "${COMPILE_%c}", toupper(och));
special = cmd;
}
*cp = och;
@@ -476,8 +434,6 @@ void makefile()
exit(1);
}
fprintf(ofp, "IDENT=-D%s", raise(ident));
if (profiling)
fprintf(ofp, " -DGPROF");
if (cputype == 0) {
printf("cpu type must be specified\n");
exit(1);
@@ -518,8 +474,6 @@ void makefile()
fprintf(ofp, "%s=%s\n", op->op_name, op->op_value);
if (debugging)
fprintf(ofp, "DEBUG=-g\n");
if (profiling)
fprintf(ofp, "PROF=-pg\n");
while (fgets(line, BUFSIZ, ifp) != 0) {
if (*line != '%') {
fprintf(ofp, "%s", line);
@@ -564,7 +518,7 @@ void do_swapspec(f, name)
else
fprintf(f, "swapgeneric.o: $A/%s/swapgeneric.c\n",
machinename);
fprintf(f, "\t${NORMAL_C}\n\n");
fprintf(f, "\t${COMPILE_C}\n\n");
}
struct file_list *