Subversion Repositories HelenOS

Compare Revisions

Regard whitespace Rev 2721 → Rev 2722

/trunk/kernel/arch/mips32/include/mm/frame.h
42,7 → 42,7
#ifndef __ASM__
 
extern void frame_arch_init(void);
#define physmem_print()
extern void physmem_print(void);
 
#endif /* __ASM__ */
#endif /* KERNEL */
/trunk/kernel/arch/mips32/include/drivers/arc.h
257,9 → 257,9
} __attribute__ ((packed)) arc_sbp;
 
extern int arc_init(void);
extern int arc_enabled(void);
void arc_frame_init(void);
void arc_console(void);
extern int arc_reboot(void);
extern int arc_frame_init(void);
extern int arc_console(void);
 
#endif
 
/trunk/kernel/arch/mips32/src/console.c
40,11 → 40,10
 
void console_init(devno_t devno)
{
if (arc_enabled()) {
arc_console();
} else if (serial_init()) {
if (!arc_console()) {
if (serial_init())
serial_console(devno);
} else {
else
msim_console(devno);
}
}
/trunk/kernel/arch/mips32/src/mips32.c
143,14 → 143,13
{
/* EXL=1, UM=1, IE=1 */
cp0_status_write(cp0_status_read() | (cp0_status_exl_exception_bit |
cp0_status_um_bit |
cp0_status_ie_enabled_bit));
cp0_status_um_bit | cp0_status_ie_enabled_bit));
cp0_epc_write((uintptr_t) kernel_uarg->uspace_entry);
userspace_asm(((uintptr_t) kernel_uarg->uspace_stack+PAGE_SIZE),
(uintptr_t) kernel_uarg->uspace_uarg,
(uintptr_t) kernel_uarg->uspace_entry);
while (1)
;
while (1);
}
 
/** Perform mips32 specific tasks needed before the new task is run. */
180,7 → 179,9
 
void arch_reboot(void)
{
if (!arc_reboot())
___halt();
while (1);
}
 
/trunk/kernel/arch/mips32/src/mm/frame.c
45,9 → 45,7
*/
void frame_arch_init(void)
{
if (arc_enabled())
arc_frame_init();
else {
if (!arc_frame_init()) {
zone_create(0, ADDR2PFN(config.memory_size), 1, 0);
/*
* Blacklist interrupt vector
/trunk/kernel/arch/mips32/src/drivers/arc.c
110,13 → 110,8
static arc_func_vector_t *arc_entry;
 
 
static void arc_putchar(char ch);
 
/** Return true if ARC is available */
int arc_enabled(void)
{
return sbp != NULL;
}
#define arc_enabled() (sbp != NULL)
 
 
/** Print configuration data that ARC reports about component */
210,28 → 205,23
/** Read from arc bios memory map and print it
*
*/
static int cmd_arc_print_memmap(cmd_arg_t *argv)
void physmem_print(void)
{
arc_memdescriptor_t *desc;
printf("Base Size Type\n");
printf("---------- ---------- ---------\n");
 
printf("Memory map:\n");
if (arc_enabled()) {
arc_memdescriptor_t *desc = arc_entry->getmemorydescriptor(NULL);
 
desc = arc_entry->getmemorydescriptor(NULL);
while (desc) {
printf("%s: %d(%p) (size: %dKB)\n",basetypes[desc->type],
desc->basepage * ARC_FRAME,
desc->basepage * ARC_FRAME,
desc->basecount*ARC_FRAME/1024);
printf("%#10x %#10x %s\n",
desc->basepage * ARC_FRAME, desc->basecount * ARC_FRAME,
basetypes[desc->type]);
desc = arc_entry->getmemorydescriptor(desc);
}
return 1;
} else
printf("%#10x %#10x free\n", 0, config.memory_size);
}
static cmd_info_t memmap_info = {
.name = "arcmemmap",
.description = "Print arc memory map",
.func = cmd_arc_print_memmap,
.argc = 0
};
 
/** Print charactor to console */
static void arc_putchar(char ch)
243,20 → 233,8
ipl = interrupts_disable();
arc_entry->write(1, &ch, 1, &cnt);
interrupts_restore(ipl);
}
 
static int cmd_reboot(cmd_arg_t *argv)
{
arc_entry->reboot();
return 0;
}
static cmd_info_t reboot_info = {
.name = "reboot",
.description = "Reboot computer",
.func = cmd_reboot,
.argc = 0
};
 
/** Initialize ARC structure
*
276,10 → 254,6
arc_putchar('\n');
 
/* Add command for resetting the computer */
cmd_initialize(&reboot_info);
cmd_register(&reboot_info);
cmd_initialize(&memmap_info);
cmd_register(&memmap_info);
cmd_initialize(&devlist_info);
cmd_register(&devlist_info);
 
286,6 → 260,17
return 0;
}
 
int arc_reboot(void)
{
if (arc_enabled()) {
arc_entry->reboot();
return true;
}
return false;
}
 
 
static bool kbd_polling_enabled;
static chardev_t console;
 
302,7 → 287,7
if (arc_entry->getreadstatus(0))
return;
result = arc_entry->read(0, &ch, 1, &count);
if (result || count!=1) {
if ((result) || (count != 1)) {
return;
}
if (ch == '\r')
320,7 → 305,7
long result;
 
result = arc_entry->read(0, &ch, 1, &count);
if (result || count!=1) {
if ((result) || (count != 1)) {
printf("Error reading from ARC keyboard.\n");
cpu_halt();
}
353,8 → 338,9
.read = arc_read
};
 
void arc_console(void)
int arc_console(void)
{
if (arc_enabled()) {
kbd_polling_enabled = true;
chardev_initialize("arc_console", &console, &arc_ops);
361,14 → 347,20
virtual_timer_fnc = &arc_keyboard_poll;
stdin = &console;
stdout = &console;
return true;
}
 
return false;
}
 
/* Initialize frame zones from ARC firmware.
* In the future we may use even the FirmwareTemporary regions,
* currently we use the FreeMemory (what about the LoadedProgram?)
*/
void arc_frame_init(void)
int arc_frame_init(void)
{
if (arc_enabled()) {
arc_memdescriptor_t *desc;
int total = 0;
uintptr_t base;
376,8 → 368,8
 
desc = arc_entry->getmemorydescriptor(NULL);
while (desc) {
if (desc->type == FreeMemory ||
desc->type == FreeContiguous) {
if ((desc->type == FreeMemory) ||
(desc->type == FreeContiguous)) {
base = desc->basepage*ARC_FRAME;
basesize = desc->basecount*ARC_FRAME;
 
396,7 → 388,11
}
 
config.memory_size = total;
return true;
}
 
return false;
}
 
/** @}
*/