From 6e86430130cfdc05891cf7ad77e1919cd0e46714 Mon Sep 17 00:00:00 2001 From: Arun Thomas Date: Thu, 27 Jan 2011 12:18:33 +0000 Subject: [PATCH] Remove code for kernel task stack initialization We no longer have kernel tasks, so this code is unnecessary --- kernel/glo.h | 1 - kernel/main.c | 17 ++------------ kernel/table.c | 52 +++++++++++++++-------------------------- kernel/type.h | 1 - servers/is/dmp_kernel.c | 4 ++-- 5 files changed, 23 insertions(+), 52 deletions(-) diff --git a/kernel/glo.h b/kernel/glo.h index d3d76babf..b53ae4d2b 100644 --- a/kernel/glo.h +++ b/kernel/glo.h @@ -74,7 +74,6 @@ EXTERN util_timingdata_t timingdata[TIMING_CATEGORIES]; /* Variables that are initialized elsewhere are just extern here. */ extern struct boot_image image[]; /* system image processes */ -extern char *t_stack[]; /* task stack space */ extern struct segdesc_s gdt[]; /* global descriptor table */ EXTERN volatile int serial_debug_active; diff --git a/kernel/main.c b/kernel/main.c index 7a3770b2b..c9c5ea711 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -129,7 +129,6 @@ PUBLIC int main(void) int hdrindex; /* index to array of a.out headers */ phys_clicks text_base; vir_clicks text_clicks, data_clicks, st_clicks; - reg_t ktsb; /* kernel task stack base */ struct exec e_hdr; /* for a copy of an a.out header */ size_t argsz; /* size of arguments passed to crtso on stack */ @@ -141,17 +140,11 @@ PUBLIC int main(void) proc_init(); - /* Set up proc table entries for processes in boot image. The stacks of the - * kernel tasks are initialized to an array in data space. The stacks + /* Set up proc table entries for processes in boot image. The stacks * of the servers have been added to the data segment by the monitor, so - * the stack pointer is set to the end of the data segment. All the - * processes are in low memory on the 8086. On the 386 only the kernel - * is in low memory, the rest is loaded in extended memory. + * the stack pointer is set to the end of the data segment. */ - /* Task stacks. */ - ktsb = (reg_t) t_stack; - for (i=0; i < NR_BOOT_PROCS; ++i) { int schedulable_proc; proc_nr_t proc_nr; @@ -226,12 +219,6 @@ PUBLIC int main(void) } if (iskerneln(proc_nr)) { /* part of the kernel? */ - if (ip->stksize > 0) { /* HARDWARE stack size is 0 */ - rp->p_priv->s_stack_guard = (reg_t *) ktsb; - *rp->p_priv->s_stack_guard = STACK_GUARD; - } - ktsb += ip->stksize; /* point to high end of stack */ - rp->p_reg.sp = ktsb; /* this task's initial stack ptr */ hdrindex = 0; /* all use the first a.out header */ } else { hdrindex = 1 + i-NR_TASKS; /* system/user processes */ diff --git a/kernel/table.c b/kernel/table.c index 23d046da7..cde061411 100644 --- a/kernel/table.c +++ b/kernel/table.c @@ -34,17 +34,6 @@ #include "ipc.h" #include -/* Define stack sizes for the kernel tasks included in the system image. */ -#define NO_STACK 0 -#define SMALL_STACK (1024 * sizeof(char *)) -#define IDL_S SMALL_STACK /* 3 intr, 3 temps, 4 db for Intel */ -#define HRD_S NO_STACK /* dummy task, uses kernel stack */ -#define TSK_S SMALL_STACK /* system and clock task */ - -/* Stack space for all the task stacks. Declared as (char *) to align it. */ -#define TOT_STACK_SPACE (IDL_S + HRD_S + (2 * TSK_S)) -PUBLIC char *t_stack[TOT_STACK_SPACE / sizeof(char *)]; - /* Define boot process flags. */ #define BVM_F (PROC_FULLVM) /* boot processes with VM */ #define OVM_F (PERF_SYS_CORE_FULLVM ? PROC_FULLVM : 0) /* critical boot @@ -61,33 +50,30 @@ PUBLIC char *t_stack[TOT_STACK_SPACE / sizeof(char *)]; * allow reliable asynchronous publishing of system events. RS comes right after * to prioritize ping messages periodically delivered to system processes. * - * Each entry provides the process number, flags, quantum size, scheduling - * queue, and a name for the process table. The initial program counter and - * stack size is also provided for kernel tasks. - * - * Note: the quantum size must be positive in all cases! + * Each entry provides the process number, flags, and a name for the process + * table. */ PUBLIC struct boot_image image[] = { -/* process nr, flags, stack, name */ -{IDLE, 0, IDL_S, "idle" }, -{CLOCK, 0, IDL_S, "clock" }, -{SYSTEM, 0, IDL_S, "system"}, -{HARDWARE, 0, HRD_S, "kernel"}, +/* process nr, flags, name */ +{IDLE, 0, "idle" }, +{CLOCK, 0, "clock" }, +{SYSTEM, 0, "system"}, +{HARDWARE, 0, "kernel"}, -{DS_PROC_NR, BVM_F, 0, "ds" }, -{RS_PROC_NR, 0, 0, "rs" }, +{DS_PROC_NR, BVM_F, "ds" }, +{RS_PROC_NR, 0, "rs" }, -{PM_PROC_NR, OVM_F, 0, "pm" }, -{SCHED_PROC_NR,OVM_F, 0, "sched" }, -{VFS_PROC_NR, OVM_F, 0, "vfs" }, -{MEM_PROC_NR, BVM_F, 0, "memory"}, -{LOG_PROC_NR, BVM_F, 0, "log" }, -{TTY_PROC_NR, BVM_F, 0, "tty" }, -{MFS_PROC_NR, BVM_F, 0, "mfs" }, -{VM_PROC_NR, 0, 0, "vm" }, -{PFS_PROC_NR, BVM_F, 0, "pfs" }, -{INIT_PROC_NR, BVM_F, 0, "init" }, +{PM_PROC_NR, OVM_F, "pm" }, +{SCHED_PROC_NR,OVM_F, "sched" }, +{VFS_PROC_NR, OVM_F, "vfs" }, +{MEM_PROC_NR, BVM_F, "memory"}, +{LOG_PROC_NR, BVM_F, "log" }, +{TTY_PROC_NR, BVM_F, "tty" }, +{MFS_PROC_NR, BVM_F, "mfs" }, +{VM_PROC_NR, 0, "vm" }, +{PFS_PROC_NR, BVM_F, "pfs" }, +{INIT_PROC_NR, BVM_F, "init" }, }; /* Verify the size of the system image table at compile time. diff --git a/kernel/type.h b/kernel/type.h index 664e503e1..61e79ef84 100644 --- a/kernel/type.h +++ b/kernel/type.h @@ -14,7 +14,6 @@ typedef struct { /* bitmap for system indexes */ struct boot_image { proc_nr_t proc_nr; /* process number to use */ int flags; /* process flags */ - int stksize; /* stack size for tasks */ char proc_name[P_NAME_LEN]; /* name in process table */ endpoint_t endpoint; /* endpoint number when started */ }; diff --git a/servers/is/dmp_kernel.c b/servers/is/dmp_kernel.c index 8fd66b41b..56ab425be 100644 --- a/servers/is/dmp_kernel.c +++ b/servers/is/dmp_kernel.c @@ -223,9 +223,9 @@ PUBLIC void image_dmp() printf("---name- -nr- flags -stack-\n"); for (m=0; mproc_name, ip->proc_nr, - boot_flags_str(ip->flags), ip->stksize); + boot_flags_str(ip->flags)); } printf("\n"); }