Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 672 → Rev 673

/kernel/trunk/generic/include/cpu.h
74,6 → 74,7
extern cpu_t *cpus;
 
extern void cpu_init(void);
extern void cpu_list(void);
 
extern void cpu_arch_init(void);
extern void cpu_identify(void);
/kernel/trunk/generic/include/main/version.h
0,0 → 1,34
/*
* Copyright (C) 2006 Jakub Jermar
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
#ifndef __VERSION_H__
#define __VERSION_H__
 
extern void version_print(void);
 
#endif
/kernel/trunk/generic/src/console/cmd.c
45,10 → 45,11
#include <macros.h>
#include <debug.h>
#include <symtab.h>
 
#include <cpu.h>
#include <mm/tlb.h>
#include <arch/mm/tlb.h>
#include <mm/frame.h>
#include <main/version.h>
 
/** Data and methods for 'help' command. */
static int cmd_help(cmd_arg_t *argv);
119,8 → 120,6
.argv = set4_argv
};
 
 
 
/** Data and methods for 'call0' command. */
static char call0_buf[MAX_CMDLINE+1];
static char carg1_buf[MAX_CMDLINE+1];
232,13 → 231,13
.argc = 0
};
 
/** Data and methods for 'ptlb' command. */
static int cmd_ptlb(cmd_arg_t *argv);
cmd_info_t ptlb_info = {
.name = "ptlb",
/** Data and methods for 'tlb' command. */
static int cmd_tlb(cmd_arg_t *argv);
cmd_info_t tlb_info = {
.name = "tlb",
.description = "Print TLB of current processor.",
.help = NULL,
.func = cmd_ptlb,
.func = cmd_tlb,
.argc = 0,
.argv = NULL
};
262,7 → 261,6
.len = sizeof(zone_buf)
};
 
 
static cmd_info_t zone_info = {
.name = "zone",
.description = "Show memory zone structure.",
271,8 → 269,31
.argv = &zone_argv
};
 
/** Data and methods for 'cpus' command. */
static int cmd_cpus(cmd_arg_t *argv);
cmd_info_t cpus_info = {
.name = "cpus",
.description = "List all processors.",
.help = NULL,
.func = cmd_cpus,
.argc = 0,
.argv = NULL
};
 
/** Data and methods for 'version' command. */
static int cmd_version(cmd_arg_t *argv);
cmd_info_t version_info = {
.name = "version",
.description = "Print version information.",
.help = NULL,
.func = cmd_version,
.argc = 0,
.argv = NULL
};
 
 
 
 
/** Initialize command info structure.
*
* @param cmd Command info structure.
327,9 → 348,9
if (!cmd_register(&halt_info))
panic("could not register command %s\n", halt_info.name);
 
cmd_initialize(&ptlb_info);
if (!cmd_register(&ptlb_info))
panic("could not register command %s\n", ptlb_info.name);
cmd_initialize(&tlb_info);
if (!cmd_register(&tlb_info))
panic("could not register command %s\n", tlb_info.name);
 
cmd_initialize(&zones_info);
if (!cmd_register(&zones_info))
339,6 → 360,15
if (!cmd_register(&zone_info))
panic("could not register command %s\n", zone_info.name);
 
cmd_initialize(&cpus_info);
if (!cmd_register(&cpus_info))
panic("could not register command %s\n", cpus_info.name);
cmd_initialize(&version_info);
if (!cmd_register(&version_info))
panic("could not register command %s\n", version_info.name);
 
}
 
538,7 → 568,7
*
* @return Always returns 1.
*/
int cmd_ptlb(cmd_arg_t *argv)
int cmd_tlb(cmd_arg_t *argv)
{
tlb_print();
return 1;
576,13 → 606,36
return 1;
}
 
 
int cmd_zones(cmd_arg_t * argv) {
printf("Zones listing not implemented\n");
return 1;
}
 
int cmd_zone(cmd_arg_t * argv) {
printf("Zone details not implemented\n");
return 1;
}
 
/** Command for listing processors.
*
* @param argv Ignored.
*
* return Always 1.
*/
int cmd_cpus(cmd_arg_t *argv)
{
cpu_list();
return 1;
}
 
/** Command for printing kernel version.
*
* @param argv Ignored.
*
* return Always 1.
*/
int cmd_version(cmd_arg_t *argv)
{
version_print();
return 1;
}
/kernel/trunk/generic/src/main/kinit.c
69,7 → 69,6
void kinit(void *arg)
{
thread_t *t;
int i;
#ifdef CONFIG_USERSPACE
vm_t *m;
vm_area_t *a;
100,15 → 99,12
/*
* Now that all CPUs are up, we can report what we've found.
*/
for (i = 0; i < config.cpu_count; i++) {
if (cpus[i].active)
cpu_print_report(&cpus[i]);
else
printf("cpu%d: not active\n", i);
}
cpu_list();
 
#ifdef CONFIG_SMP
if (config.cpu_count > 1) {
int i;
/*
* For each CPU, create its load balancing thread.
*/
/kernel/trunk/generic/src/main/main.c
41,6 → 41,7
#include <cpu.h>
#include <align.h>
#include <interrupt.h>
#include <main/version.h>
 
#ifdef CONFIG_SMP
#include <arch/smp/apic.h>
64,24 → 65,6
 
#include <typedefs.h>
 
char *project = "SPARTAN kernel";
char *copyright = "Copyright (C) 2001-2006 HelenOS project";
char *release = RELEASE;
char *name = NAME;
char *arch = ARCH;
 
#ifdef REVISION
char *revision = ", revision " REVISION;
#else
char *revision = "";
#endif
 
#ifdef TIMESTAMP
char *timestamp = " on " TIMESTAMP;
#else
char *timestamp = "";
#endif
 
config_t config;
context_t ctx;
 
167,7 → 150,7
kconsole_init();
 
/* Exception handler initialization, before architecture
* starts adding it's own handlers
* starts adding its own handlers
*/
exc_init();
177,8 → 160,9
page_init();
tlb_init();
arch_post_mm_init();
printf("%s, release %s (%s)%s\nBuilt%s for %s\n%s\n", project, release, name, revision, timestamp, arch, copyright);
 
version_print();
 
printf("%P: hardcoded_ktext_size=%dK, hardcoded_kdata_size=%dK\n",
config.base, hardcoded_ktext_size/1024, hardcoded_kdata_size/1024);
 
/kernel/trunk/generic/src/main/version.c
0,0 → 1,54
/*
* Copyright (C) 2006 Jakub Jermar
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
#include <main/version.h>
#include <print.h>
 
char *project = "SPARTAN kernel";
char *copyright = "Copyright (C) 2001-2006 HelenOS project";
char *release = RELEASE;
char *name = NAME;
char *arch = ARCH;
 
#ifdef REVISION
char *revision = ", revision " REVISION;
#else
char *revision = "";
#endif
 
#ifdef TIMESTAMP
char *timestamp = " on " TIMESTAMP;
#else
char *timestamp = "";
#endif
 
/** Print version information. */
void version_print(void)
{
printf("%s, release %s (%s)%s\nBuilt%s for %s\n%s\n", project, release, name, revision, timestamp, arch, copyright);
}
/kernel/trunk/generic/src/cpu/cpu.c
38,6 → 38,7
#include <typedefs.h>
#include <memstr.h>
#include <list.h>
#include <print.h>
 
cpu_t *cpus;
 
88,3 → 89,16
cpu_identify();
cpu_arch_init();
}
 
/** List all processors. */
void cpu_list(void)
{
int i;
 
for (i = 0; i < config.cpu_count; i++) {
if (cpus[i].active)
cpu_print_report(&cpus[i]);
else
printf("cpu%d: not active\n", i);
}
}
/kernel/trunk/generic/src/interrupt/interrupt.c
31,6 → 31,7
#include <console/kconsole.h>
#include <console/console.h>
#include <console/chardev.h>
#include <console/cmd.h>
#include <panic.h>
#include <print.h>
#include <symtab.h>
111,7 → 112,7
}
 
static cmd_info_t exc_info = {
.name = "pexc",
.name = "exc",
.description = "Print exception table.",
.func = exc_print_cmd,
.help = NULL,
127,8 → 128,7
for (i=0;i < IVT_ITEMS; i++)
exc_register(i, "undef", exc_undef);
 
spinlock_initialize(&exc_info.lock, "kconsole_excinfo");
link_initialize(&exc_info.link);
cmd_initialize(&exc_info);
if (!cmd_register(&exc_info))
panic("could not register command %s\n", exc_info.name);
}
/kernel/trunk/Makefile
106,6 → 106,7
generic/src/main/main.c \
generic/src/main/kinit.c \
generic/src/main/uinit.c \
generic/src/main/version.c \
generic/src/proc/scheduler.c \
generic/src/proc/thread.c \
generic/src/proc/task.c \
/kernel/trunk/arch/mips32/src/debugger.c
41,8 → 41,8
SPINLOCK_INITIALIZE(bkpoint_lock);
 
static int cmd_print_breakpoints(cmd_arg_t *argv);
static cmd_info_t pbkpt_info = {
.name = "pbkpt",
static cmd_info_t bkpts_info = {
.name = "bkpts",
.description = "Print breakpoint table.",
.func = cmd_print_breakpoints,
.argc = 0,
264,9 → 264,9
for (i=0; i<BKPOINTS_MAX; i++)
breakpoints[i].address = NULL;
cmd_initialize(&pbkpt_info);
if (!cmd_register(&pbkpt_info))
panic("could not register command %s\n", pbkpt_info.name);
cmd_initialize(&bkpts_info);
if (!cmd_register(&bkpts_info))
panic("could not register command %s\n", bkpts_info.name);
 
cmd_initialize(&delbkpt_info);
if (!cmd_register(&delbkpt_info))