Minor mods on linux patches

This commit is contained in:
Bahadir Balban
2009-10-21 21:27:41 +03:00
parent 4f5ab576b8
commit c6bdd65e48
4 changed files with 11 additions and 11 deletions

View File

@@ -96,8 +96,8 @@ def build_parse_options():
parser.error("options -f and -r are mutually exclusive") parser.error("options -f and -r are mutually exclusive")
exit() exit()
# -f implies -c # -f or -r or -n or -a implies -c
if options.cml_file: if options.cml_file or options.ncont or options.arch or options.reset_config:
options.config = 1 options.config = 1
return options, args return options, args

View File

@@ -19,7 +19,7 @@ from scripts.loader.generate_loader_asm import *
from config.lib import * from config.lib import *
# Function to determine the LMA for 'final.elf' # Function to determine the LMA for 'final.elf'
def find_lma_codezero(target, source, env): def find_loader_load_address(target, source, env):
# Start/end addresses of various physical memory regions defined # Start/end addresses of various physical memory regions defined
array_start = [] array_start = []
array_end = [] array_end = []
@@ -52,7 +52,7 @@ def find_lma_codezero(target, source, env):
# Create target file # Create target file
with open(source[1].path, 'r') as input: with open(source[1].path, 'r') as input:
buffer = input.read() buffer = input.read()
print 'LMA FOR FINAL.ELF IS : ' + str(conv_hex(loadaddr)) #print 'Load address for final.elf: ' + str(conv_hex(loadaddr))
with open(target[0].path, 'w+') as output: with open(target[0].path, 'w+') as output:
output.write(buffer % str(conv_hex(loadaddr))) output.write(buffer % str(conv_hex(loadaddr)))
@@ -67,7 +67,7 @@ loader_image_S = Command(join(PROJROOT, 'loader/images.S'), [join(BUILDDIR, 'ker
gen_loader_images_S) gen_loader_images_S)
lma_lds = Command(join(BUILDDIR, 'loader/linker.lds'), \ lma_lds = Command(join(BUILDDIR, 'loader/linker.lds'), \
[join(BUILDDIR, 'kernel.elf'), \ [join(BUILDDIR, 'kernel.elf'), \
join(PROJROOT, 'loader/linker.lds.in')], find_lma_codezero) join(PROJROOT, 'loader/linker.lds.in')], find_loader_load_address)
src = Glob('*.[cS]') src = Glob('*.[cS]')
objs = env.Object(src) objs = env.Object(src)

View File

@@ -4,12 +4,12 @@
* Copyright (C) 2008-2009 B Labs Ltd. * Copyright (C) 2008-2009 B Labs Ltd.
*/ */
lma_codezero = %s; load_address = %s;
ENTRY(_start) ENTRY(_start)
SECTIONS SECTIONS
{ {
. = lma_codezero; . = load_address;
.text : { *(.text.head) *(.text) } .text : { *(.text.head) *(.text) }
.rodata : { *(.rodata) } .rodata : { *(.rodata) }
.rodata1 : { *(.rodata1) } .rodata1 : { *(.rodata1) }

View File

@@ -60,7 +60,7 @@ cinfo_end = \
pager_start = \ pager_start = \
''' '''
\t\t[0] = { \t\t[0] = {
\t\t\t.start_address = (CONFIG_CONT%d_INIT_PROG_COUNTER), \t\t\t.start_address = (CONFIG_CONT%d_START_PC_ADDR),
\t\t\t.pager_lma = __pfn(CONFIG_CONT%d_PAGER_LMA), \t\t\t.pager_lma = __pfn(CONFIG_CONT%d_PAGER_LMA),
\t\t\t.pager_vma = __pfn(CONFIG_CONT%d_PAGER_VMA), \t\t\t.pager_vma = __pfn(CONFIG_CONT%d_PAGER_VMA),
\t\t\t.pager_size = __pfn(CONFIG_CONT%d_PAGER_SIZE), \t\t\t.pager_size = __pfn(CONFIG_CONT%d_PAGER_SIZE),
@@ -171,14 +171,14 @@ pager_ifdefs_todotext = \
pager_ifdefs = \ pager_ifdefs = \
''' '''
#if defined(CONFIG_CONT%(cn)d_TYPE_LINUX) #if defined(CONFIG_CONT%(cn)d_TYPE_LINUX)
#define CONFIG_CONT%(cn)d_INIT_PROG_COUNTER \ #define CONFIG_CONT%(cn)d_START_PC_ADDR \\
(CONFIG_CONT%(cn)d_LINUX_ZRELADDR - CONFIG_CONT%(cn)d_LINUX_PHYS_OFFSET + \ (CONFIG_CONT%(cn)d_LINUX_ZRELADDR - CONFIG_CONT%(cn)d_LINUX_PHYS_OFFSET + \\
CONFIG_CONT%(cn)d_LINUX_PAGE_OFFSET) CONFIG_CONT%(cn)d_LINUX_PAGE_OFFSET)
#define CONFIG_CONT%(cn)d_PAGER_LMA (CONFIG_CONT%(cn)d_LINUX_PHYS_OFFSET) #define CONFIG_CONT%(cn)d_PAGER_LMA (CONFIG_CONT%(cn)d_LINUX_PHYS_OFFSET)
#define CONFIG_CONT%(cn)d_PAGER_VMA (CONFIG_CONT%(cn)d_LINUX_PAGE_OFFSET) #define CONFIG_CONT%(cn)d_PAGER_VMA (CONFIG_CONT%(cn)d_LINUX_PAGE_OFFSET)
#define CONFIG_CONT%(cn)d_PAGER_SIZE CONFIG_CONT%(cn)d_LINUX_MAPSIZE #define CONFIG_CONT%(cn)d_PAGER_SIZE CONFIG_CONT%(cn)d_LINUX_MAPSIZE
#else #else
#define CONFIG_CONT%(cn)d_INIT_PROG_COUNTER (CONFIG_CONT%(cn)d_PAGER_VMA) #define CONFIG_CONT%(cn)d_START_PC_ADDR (CONFIG_CONT%(cn)d_PAGER_VMA)
#endif #endif
''' '''
def generate_pager_memory_ifdefs(containers): def generate_pager_memory_ifdefs(containers):