X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=common%2Fcmd_log.c;h=873ee4037196e1488ac78b9e21b6d9cb44208cdf;hb=8b07e1565c9e99e8c01614655967a923076f03f0;hp=ee291c1b4da36633021b50b8daa6ef8fc24bf6e6;hpb=bb0f32d0bad65fc6948ce6032f9004a70e11fef4;p=karo-tx-uboot.git diff --git a/common/cmd_log.c b/common/cmd_log.c index ee291c1b4d..873ee40371 100644 --- a/common/cmd_log.c +++ b/common/cmd_log.c @@ -5,23 +5,7 @@ * Code used from linux/kernel/printk.c * Copyright (C) 1991, 1992 Linus Torvalds * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0+ * * Comments: * @@ -49,8 +33,8 @@ DECLARE_GLOBAL_DATA_PTR; /* Local prototypes */ -static void logbuff_putc(const char c); -static void logbuff_puts(const char *s); +static void logbuff_putc(struct stdio_dev *dev, const char c); +static void logbuff_puts(struct stdio_dev *dev, const char *s); static int logbuff_printk(const char *line); static char buf[1024]; @@ -68,7 +52,7 @@ static char *lbuf; unsigned long __logbuffer_base(void) { - return CONFIG_SYS_SDRAM_BASE + gd->ram_size - LOGBUFF_LEN; + return CONFIG_SYS_SDRAM_BASE + get_effective_memsize() - LOGBUFF_LEN; } unsigned long logbuffer_base(void) __attribute__((weak, alias("__logbuffer_base"))); @@ -159,7 +143,7 @@ int drv_logbuff_init(void) return (rc == 0) ? 1 : rc; } -static void logbuff_putc(const char c) +static void logbuff_putc(struct stdio_dev *dev, const char c) { char buf[2]; buf[0] = c; @@ -167,7 +151,7 @@ static void logbuff_putc(const char c) logbuff_printk(buf); } -static void logbuff_puts(const char *s) +static void logbuff_puts(struct stdio_dev *dev, const char *s) { logbuff_printk (s); } @@ -197,6 +181,7 @@ void logbuff_log(char *msg) */ int do_log(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { + struct stdio_dev *sdev = NULL; char *s; unsigned long i, start, size; @@ -204,7 +189,7 @@ int do_log(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) /* Log concatenation of all arguments separated by spaces */ for (i = 2; i < argc; i++) { logbuff_printk(argv[i]); - logbuff_putc((i < argc - 1) ? ' ' : '\n'); + logbuff_putc(sdev, (i < argc - 1) ? ' ' : '\n'); } return 0; }