History log of /linux-master/arch/mips/fw/lib/cmdline.c
Revision Date Author Comments
# ee1809ed 10-Apr-2023 Jiaxun Yang <jiaxun.yang@flygoat.com>

MIPS: fw: Allow firmware to pass a empty env

fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: https://github.com/clbr/n64bootloader/issues/5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>


# 78bdbbac 25-Mar-2020 Masahiro Yamada <masahiroy@kernel.org>

MIPS: do not compile generic functions for CONFIG_CAVIUM_OCTEON_SOC

MIPS provides multiple definitions for the following functions:

fw_init_cmdline
__delay
__udelay
__ndelay
memmove
__rmemcpy
memcpy
__copy_user

The generic ones are defined in lib-y objects, which are overridden by
the Octeon ones when CONFIG_CAVIUM_OCTEON_SOC is enabled.

The use of EXPORT_SYMBOL in static libraries potentially causes a
problem for the llvm linker [1]. So, I want to forcibly link lib-y
objects to vmlinux when CONFIG_MODULES=y.

As a groundwork, we must fix multiple definitions that have previously
been hidden by lib-y.

If you look at lib/string.c, arch can define __HAVE_ARCH_* to opt out
the generic implementation.

Similarly, this commit adds CONFIG_HAVE_PLAT_* to allow a platform
to opt out the MIPS generic code.

[1]: https://github.com/ClangBuiltLinux/linux/issues/515

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>


# 484c3449 07-Nov-2014 Alban Bedel <albeu@free.fr>

MIPS: FW: Use kstrtoul() to parse unsigned long from the fw environment

Fix some value corruptions with values that can't be represented in a
signed long.

Signed-off-by: Alban Bedel <albeu@free.fr>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8358/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>


# 4a792e56 07-Nov-2014 Alban Bedel <albeu@free.fr>

MIPS: FW: Fix parsing u-boot environment

When reading u-boot's key=value pairs it should skip the '=' and not
use the next argument.

Signed-off-by: Alban Bedel <albeu@free.fr>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8357/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>


# 14aecdd4 25-Mar-2013 Steven J. Hill <Steven.Hill@imgtec.com>

MIPS: FW: Add environment variable processing.

Add parsing of the environment and command line variables passed to
the kernel to the firmware library.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>