/kernel/trunk/tools/config.py |
---|
289,7 → 289,6 |
if oper== '=' and condval != defaults[condname]: |
return False |
if oper== '!=' and condval == defaults[condname]: |
print 2 |
return False |
if ctype=='cnf': |
return False |
/kernel/trunk/arch/mips32/include/mm/memory_init.h |
---|
31,7 → 31,9 |
#include <config.h> |
/* When this function is called, we do not have ARC initiated |
* - provide some reasonable minimum and update it later |
*/ |
#define get_memory_size() CONFIG_MEMORY_SIZE |
//#define get_memory_size() 150*1024*1024 |
#endif |
/kernel/trunk/arch/mips32/include/drivers/arc.h |
---|
33,6 → 33,8 |
#define ARC_BASE_ADDR 0x1000; |
#define ARC_MAGIC 0x53435241 |
/* Frame size used by ARC */ |
#define ARC_FRAME 4096 |
typedef enum { |
SystemClass = 0, |
207,10 → 209,12 |
__u32 adaptercount; |
}__attribute__ ((packed)) arc_sbp; |
extern int init_arc(void); |
extern int arc_init(void); |
extern void arc_print_memory_map(void); |
extern int arc_enabled(void); |
extern void arc_putchar(char ch); |
extern void arc_print_devices(void); |
extern int arc_getchar(void); |
void arc_frame_init(void); |
#endif |
/kernel/trunk/arch/mips32/src/mm/frame.c |
---|
33,8 → 33,22 |
#include <config.h> |
#include <panic.h> |
#include <print.h> |
#include <arch/drivers/arc.h> |
/** Create memory zones |
* |
* If ARC is known, read information from ARC, otherwise |
* assume some defaults. |
* - blacklist first FRAME because there is an exception vector |
*/ |
void frame_arch_init(void) |
{ |
zone_create_in_region(KA2PA(KERNEL_LOAD_ADDRESS), config.memory_size & ~(FRAME_SIZE-1)); |
/* Blacklist first 4KB, exception vector */ |
frame_region_not_free(0, FRAME_SIZE); |
if (arc_enabled()) |
arc_frame_init(); |
else |
zone_create_in_region(KA2PA(KERNEL_LOAD_ADDRESS), |
config.memory_size & ~(FRAME_SIZE-1)); |
} |
/kernel/trunk/arch/mips32/src/drivers/arc.c |
---|
31,6 → 31,8 |
#include <print.h> |
#include <arch.h> |
#include <arch/byteorder.h> |
#include <arch/mm/frame.h> |
#include <mm/frame.h> |
/* This is a good joke, SGI HAS different types than NT bioses... */ |
/* Here is the SGI type */ |
101,7 → 103,7 |
* |
* @return 0 - ARC OK, -1 - ARC does not exist |
*/ |
int init_arc(void) |
int arc_init(void) |
{ |
if (sbp->signature != ARC_MAGIC) { |
sbp = NULL; |
165,8 → 167,8 |
desc = arc_entry->getmemorydescriptor(NULL); |
while (desc) { |
printf("%s: %d (size: %dKB)\n",basetypes[desc->type], |
desc->basepage * 4096, |
desc->basecount*4); |
desc->basepage * ARC_FRAME, |
desc->basecount*ARC_FRAME/1024); |
desc = arc_entry->getmemorydescriptor(desc); |
} |
} |
202,3 → 204,27 |
return '\n'; |
return ch; |
} |
/* 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) |
{ |
arc_memdescriptor_t *desc; |
int total = 0; |
desc = arc_entry->getmemorydescriptor(NULL); |
while (desc) { |
if (desc->type == FreeMemory || |
desc->type == FreeContiguous) { |
total += desc->basecount*ARC_FRAME; |
zone_create_in_region(desc->basepage*ARC_FRAME, |
desc->basecount*ARC_FRAME); |
} |
desc = arc_entry->getmemorydescriptor(desc); |
} |
config.memory_size = total; |
} |
/kernel/trunk/arch/mips32/src/mips32.c |
---|
55,7 → 55,7 |
/* It is not assumed by default */ |
interrupts_disable(); |
init_arc(); |
arc_init(); |
/* Copy the exception vectors to the right places */ |
memcpy(TLB_EXC, (char *)tlb_refill_entry, EXCEPTION_JUMP_SIZE); |