drm/rockchip: vop2: Fix the windows switch between different layers
[drm/drm-misc.git] / arch / riscv / kernel / pi / archrandom_early.c
blob3f05d3cf3b7b22808877cdfffb5c2c9a9e4eb637
1 // SPDX-License-Identifier: GPL-2.0-only
3 #include <asm/csr.h>
4 #include <linux/processor.h>
6 #include "pi.h"
8 /*
9 * To avoid rewriting code include asm/archrandom.h and create macros
10 * for the functions that won't be included.
12 #undef riscv_has_extension_unlikely
13 #define riscv_has_extension_likely(...) false
14 #undef pr_err_once
15 #define pr_err_once(...)
17 #include <asm/archrandom.h>
19 u64 get_kaslr_seed_zkr(const uintptr_t dtb_pa)
21 unsigned long seed = 0;
23 if (!fdt_early_match_extension_isa((const void *)dtb_pa, "zkr"))
24 return 0;
26 if (!csr_seed_long(&seed))
27 return 0;
29 return seed;