Unverified Commit b3311827 authored by Jesse Taube's avatar Jesse Taube Committed by Palmer Dabbelt
Browse files

RISC-V: pi: Add kernel/pi/pi.h



Add pi.h header for declarations of the kernel/pi prefixed functions
and any other related declarations.

Suggested-by: default avatarCharlie Jenkins <charlie@rivosinc.com>
Signed-off-by: default avatarJesse Taube <jesse@rivosinc.com>
Reviewed-by: default avatarAlexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20240709173937.510084-4-jesse@rivosinc.com


Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent d57e19fc
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -6,15 +6,9 @@
#include <asm/pgtable.h>
#include <asm/setup.h>

static char early_cmdline[COMMAND_LINE_SIZE];
#include "pi.h"

/*
 * Declare the functions that are exported (but prefixed) here so that LLVM
 * does not complain it lacks the 'static' keyword (which, if added, makes
 * LLVM complain because the function is actually unused in this file).
 */
u64 set_satp_mode_from_cmdline(uintptr_t dtb_pa);
bool set_nokaslr_from_cmdline(uintptr_t dtb_pa);
static char early_cmdline[COMMAND_LINE_SIZE];

static char *get_early_cmdline(uintptr_t dtb_pa)
{
+1 −6
Original line number Diff line number Diff line
@@ -3,12 +3,7 @@
#include <linux/init.h>
#include <linux/libfdt.h>

/*
 * Declare the functions that are exported (but prefixed) here so that LLVM
 * does not complain it lacks the 'static' keyword (which, if added, makes
 * LLVM complain because the function is actually unused in this file).
 */
u64 get_kaslr_seed(uintptr_t dtb_pa);
#include "pi.h"

u64 get_kaslr_seed(uintptr_t dtb_pa)
{
+17 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _RISCV_PI_H_
#define _RISCV_PI_H_

#include <linux/types.h>

/*
 * The following functions are exported (but prefixed). Declare them here so
 * that LLVM does not complain it lacks the 'static' keyword (which, if
 * added, makes LLVM complain because the function is unused).
 */

u64 get_kaslr_seed(uintptr_t dtb_pa);
bool set_nokaslr_from_cmdline(uintptr_t dtb_pa);
u64 set_satp_mode_from_cmdline(uintptr_t dtb_pa);

#endif /* _RISCV_PI_H_ */