aboutsummaryrefslogtreecommitdiffstats
path: root/roms/u-boot/arch/riscv/lib/asm-offsets.c
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/u-boot/arch/riscv/lib/asm-offsets.c
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/u-boot/arch/riscv/lib/asm-offsets.c')
-rw-r--r--roms/u-boot/arch/riscv/lib/asm-offsets.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/roms/u-boot/arch/riscv/lib/asm-offsets.c b/roms/u-boot/arch/riscv/lib/asm-offsets.c
new file mode 100644
index 000000000..f1fe089b3
--- /dev/null
+++ b/roms/u-boot/arch/riscv/lib/asm-offsets.c
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
+ *
+ * From arch/x86/lib/asm-offsets.c
+ *
+ * This program is used to generate definitions needed by
+ * assembly language modules.
+ */
+
+#include <common.h>
+#include <asm/global_data.h>
+#include <linux/kbuild.h>
+
+int main(void)
+{
+ DEFINE(GD_BOOT_HART, offsetof(gd_t, arch.boot_hart));
+ DEFINE(GD_FIRMWARE_FDT_ADDR, offsetof(gd_t, arch.firmware_fdt_addr));
+#ifndef CONFIG_XIP
+ DEFINE(GD_AVAILABLE_HARTS, offsetof(gd_t, arch.available_harts));
+#endif
+
+ return 0;
+}