Date: Sat, 13 Dec 2008 17:11:01 +0000 From: Bruce Simpson <bms@incunabulum.net> To: freebsd-embedded@FreeBSD.org Subject: ARM closet cleaning: static kenv Message-ID: <4943ECA5.6030203@incunabulum.net>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------070206030508060602000706 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit This is a patch for avila_machdep to tell it to use a statically compiled kenv vector. I found I needed it when hacking on the NSLU2. cheers BMS --------------070206030508060602000706 Content-Type: text/plain; name="arm-use-env.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="arm-use-env.diff" Index: sys/arm/xscale/ixp425/avila_machdep.c =================================================================== --- sys/arm/xscale/ixp425/avila_machdep.c (revision 186036) +++ sys/arm/xscale/ixp425/avila_machdep.c (working copy) @@ -259,6 +259,7 @@ vm_offset_t freemem_after; vm_offset_t lastaddr; uint32_t memsize; + char *p; set_cpufuncs(); lastaddr = fake_preload_metadata(); @@ -475,16 +476,29 @@ phys_avail[i++] = trunc_page(0x10000000 + memsize - 1); phys_avail[i++] = 0; phys_avail[i] = 0; - + + /* use static kernel environment if so configured */ + if (envmode == 1) + kern_envp = static_env; + + /* + * Catch case of boot_verbose set in environment. + */ + if ((p = getenv("boot_verbose")) != NULL) { + if (strcmp(p, "yes") == 0 || strcmp(p, "YES") == 0) { + boothowto |= RB_VERBOSE; + } + freeenv(p); + } + + if (boothowto & RB_VERBOSE) + bootverbose = 1; + /* Do basic tuning, hz etc */ init_param1(); init_param2(physmem); kdb_init(); - /* use static kernel environment if so configured */ - if (envmode == 1) - kern_envp = static_env; - return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - sizeof(struct pcb))); } --------------070206030508060602000706--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4943ECA5.6030203>