From: Mike Frysinger Date: Fri, 23 Jan 2009 13:00:04 -0500 Subject: [U-Boot] [PATCH 03/40] Blackfin: convert CMD_LINE_ADDR to CONFIG_LINUX_CMDLINE_{ADDR, SIZE} In-Reply-To: <1232733641-29276-1-git-send-email-vapier@gentoo.org> References: <1232733641-29276-1-git-send-email-vapier@gentoo.org> Message-ID: <1232733641-29276-4-git-send-email-vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Signed-off-by: Mike Frysinger --- include/asm-blackfin/blackfin-config-post.h | 7 +++++-- lib_blackfin/bootm.c | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/include/asm-blackfin/blackfin-config-post.h b/include/asm-blackfin/blackfin-config-post.h index 0ab68ac..936001a 100644 --- a/include/asm-blackfin/blackfin-config-post.h +++ b/include/asm-blackfin/blackfin-config-post.h @@ -65,8 +65,11 @@ #endif /* Using L1 scratch pad makes sense for everyone by default. */ -#ifndef CMD_LINE_ADDR -# define CMD_LINE_ADDR L1_SRAM_SCRATCH +#ifndef CONFIG_LINUX_CMDLINE_ADDR +# define CONFIG_LINUX_CMDLINE_ADDR L1_SRAM_SCRATCH +#endif +#ifndef CONFIG_LINUX_CMDLINE_SIZE +# define CONFIG_LINUX_CMDLINE_SIZE L1_SRAM_SCRATCH_SIZE #endif #endif diff --git a/lib_blackfin/bootm.c b/lib_blackfin/bootm.c index 195eb9c..2954ce6 100644 --- a/lib_blackfin/bootm.c +++ b/lib_blackfin/bootm.c @@ -20,14 +20,14 @@ extern void swap_to(int device_id); static char *make_command_line(void) { - char *dest = (char *)CMD_LINE_ADDR; + char *dest = (char *)CONFIG_LINUX_CMDLINE_ADDR; char *bootargs = getenv("bootargs"); if (bootargs == NULL) return NULL; - strncpy(dest, bootargs, 0x1000); - dest[0xfff] = 0; + strncpy(dest, bootargs, CONFIG_LINUX_CMDLINE_SIZE); + dest[CONFIG_LINUX_CMDLINE_SIZE - 1] = 0; return dest; } -- 1.6.1