Linux Audio

Check our new training course

Embedded Linux training

Mar 31-Apr 8, 2025
Register
Loading...
v6.13.7
  1// SPDX-License-Identifier: GPL-2.0
  2/*
  3 * Generate definitions needed by assembly language modules.
  4 * This code generates raw asm output which is post-processed to extract
  5 * and format the required data.
  6 */
  7#define COMPILE_OFFSETS
  8
  9#include <linux/crypto.h>
 10#include <crypto/aria.h>
 11#include <linux/sched.h>
 12#include <linux/stddef.h>
 13#include <linux/hardirq.h>
 14#include <linux/suspend.h>
 15#include <linux/kbuild.h>
 16#include <asm/processor.h>
 17#include <asm/thread_info.h>
 18#include <asm/sigframe.h>
 19#include <asm/bootparam.h>
 20#include <asm/suspend.h>
 21#include <asm/tlbflush.h>
 22#include <asm/tdx.h>
 23
 24#ifdef CONFIG_XEN
 25#include <xen/interface/xen.h>
 26#endif
 27
 28#ifdef CONFIG_X86_32
 29# include "asm-offsets_32.c"
 30#else
 31# include "asm-offsets_64.c"
 32#endif
 33
 34static void __used common(void)
 35{
 36	BLANK();
 37	OFFSET(TASK_threadsp, task_struct, thread.sp);
 38#ifdef CONFIG_STACKPROTECTOR
 39	OFFSET(TASK_stack_canary, task_struct, stack_canary);
 40#endif
 41
 42	BLANK();
 
 
 
 43	OFFSET(pbe_address, pbe, address);
 44	OFFSET(pbe_orig_address, pbe, orig_address);
 45	OFFSET(pbe_next, pbe, next);
 46
 47#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
 48	BLANK();
 49	OFFSET(IA32_SIGCONTEXT_ax, sigcontext_32, ax);
 50	OFFSET(IA32_SIGCONTEXT_bx, sigcontext_32, bx);
 51	OFFSET(IA32_SIGCONTEXT_cx, sigcontext_32, cx);
 52	OFFSET(IA32_SIGCONTEXT_dx, sigcontext_32, dx);
 53	OFFSET(IA32_SIGCONTEXT_si, sigcontext_32, si);
 54	OFFSET(IA32_SIGCONTEXT_di, sigcontext_32, di);
 55	OFFSET(IA32_SIGCONTEXT_bp, sigcontext_32, bp);
 56	OFFSET(IA32_SIGCONTEXT_sp, sigcontext_32, sp);
 57	OFFSET(IA32_SIGCONTEXT_ip, sigcontext_32, ip);
 58
 59	BLANK();
 60	OFFSET(IA32_RT_SIGFRAME_sigcontext, rt_sigframe_ia32, uc.uc_mcontext);
 61#endif
 62
 63#ifdef CONFIG_XEN
 64	BLANK();
 65	OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask);
 66	OFFSET(XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending);
 67	OFFSET(XEN_vcpu_info_arch_cr2, vcpu_info, arch.cr2);
 68#endif
 69
 70	BLANK();
 71	OFFSET(TDX_MODULE_rcx, tdx_module_args, rcx);
 72	OFFSET(TDX_MODULE_rdx, tdx_module_args, rdx);
 73	OFFSET(TDX_MODULE_r8,  tdx_module_args, r8);
 74	OFFSET(TDX_MODULE_r9,  tdx_module_args, r9);
 75	OFFSET(TDX_MODULE_r10, tdx_module_args, r10);
 76	OFFSET(TDX_MODULE_r11, tdx_module_args, r11);
 77	OFFSET(TDX_MODULE_r12, tdx_module_args, r12);
 78	OFFSET(TDX_MODULE_r13, tdx_module_args, r13);
 79	OFFSET(TDX_MODULE_r14, tdx_module_args, r14);
 80	OFFSET(TDX_MODULE_r15, tdx_module_args, r15);
 81	OFFSET(TDX_MODULE_rbx, tdx_module_args, rbx);
 82	OFFSET(TDX_MODULE_rdi, tdx_module_args, rdi);
 83	OFFSET(TDX_MODULE_rsi, tdx_module_args, rsi);
 84
 85	BLANK();
 86	OFFSET(BP_scratch, boot_params, scratch);
 87	OFFSET(BP_secure_boot, boot_params, secure_boot);
 88	OFFSET(BP_loadflags, boot_params, hdr.loadflags);
 89	OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch);
 90	OFFSET(BP_version, boot_params, hdr.version);
 91	OFFSET(BP_kernel_alignment, boot_params, hdr.kernel_alignment);
 92	OFFSET(BP_init_size, boot_params, hdr.init_size);
 93	OFFSET(BP_pref_address, boot_params, hdr.pref_address);
 94
 95	BLANK();
 96	DEFINE(PTREGS_SIZE, sizeof(struct pt_regs));
 97
 98	/* TLB state for the entry code */
 99	OFFSET(TLB_STATE_user_pcid_flush_mask, tlb_state, user_pcid_flush_mask);
100
101	/* Layout info for cpu_entry_area */
102	OFFSET(CPU_ENTRY_AREA_entry_stack, cpu_entry_area, entry_stack_page);
103	DEFINE(SIZEOF_entry_stack, sizeof(struct entry_stack));
104	DEFINE(MASK_entry_stack, (~(sizeof(struct entry_stack) - 1)));
105
106	/* Offset for fields in tss_struct */
107	OFFSET(TSS_sp0, tss_struct, x86_tss.sp0);
108	OFFSET(TSS_sp1, tss_struct, x86_tss.sp1);
109	OFFSET(TSS_sp2, tss_struct, x86_tss.sp2);
110	OFFSET(X86_top_of_stack, pcpu_hot, top_of_stack);
111	OFFSET(X86_current_task, pcpu_hot, current_task);
112#ifdef CONFIG_MITIGATION_CALL_DEPTH_TRACKING
113	OFFSET(X86_call_depth, pcpu_hot, call_depth);
114#endif
115#if IS_ENABLED(CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64)
116	/* Offset for fields in aria_ctx */
117	BLANK();
118	OFFSET(ARIA_CTX_enc_key, aria_ctx, enc_key);
119	OFFSET(ARIA_CTX_dec_key, aria_ctx, dec_key);
120	OFFSET(ARIA_CTX_rounds, aria_ctx, rounds);
121#endif
122
123}
v5.14.15
 1// SPDX-License-Identifier: GPL-2.0
 2/*
 3 * Generate definitions needed by assembly language modules.
 4 * This code generates raw asm output which is post-processed to extract
 5 * and format the required data.
 6 */
 7#define COMPILE_OFFSETS
 8
 9#include <linux/crypto.h>
 
10#include <linux/sched.h>
11#include <linux/stddef.h>
12#include <linux/hardirq.h>
13#include <linux/suspend.h>
14#include <linux/kbuild.h>
15#include <asm/processor.h>
16#include <asm/thread_info.h>
17#include <asm/sigframe.h>
18#include <asm/bootparam.h>
19#include <asm/suspend.h>
20#include <asm/tlbflush.h>
 
21
22#ifdef CONFIG_XEN
23#include <xen/interface/xen.h>
24#endif
25
26#ifdef CONFIG_X86_32
27# include "asm-offsets_32.c"
28#else
29# include "asm-offsets_64.c"
30#endif
31
32static void __used common(void)
33{
34	BLANK();
35	OFFSET(TASK_threadsp, task_struct, thread.sp);
36#ifdef CONFIG_STACKPROTECTOR
37	OFFSET(TASK_stack_canary, task_struct, stack_canary);
38#endif
39
40	BLANK();
41	OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx);
42
43	BLANK();
44	OFFSET(pbe_address, pbe, address);
45	OFFSET(pbe_orig_address, pbe, orig_address);
46	OFFSET(pbe_next, pbe, next);
47
48#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
49	BLANK();
50	OFFSET(IA32_SIGCONTEXT_ax, sigcontext_32, ax);
51	OFFSET(IA32_SIGCONTEXT_bx, sigcontext_32, bx);
52	OFFSET(IA32_SIGCONTEXT_cx, sigcontext_32, cx);
53	OFFSET(IA32_SIGCONTEXT_dx, sigcontext_32, dx);
54	OFFSET(IA32_SIGCONTEXT_si, sigcontext_32, si);
55	OFFSET(IA32_SIGCONTEXT_di, sigcontext_32, di);
56	OFFSET(IA32_SIGCONTEXT_bp, sigcontext_32, bp);
57	OFFSET(IA32_SIGCONTEXT_sp, sigcontext_32, sp);
58	OFFSET(IA32_SIGCONTEXT_ip, sigcontext_32, ip);
59
60	BLANK();
61	OFFSET(IA32_RT_SIGFRAME_sigcontext, rt_sigframe_ia32, uc.uc_mcontext);
62#endif
63
64#ifdef CONFIG_XEN
65	BLANK();
66	OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask);
67	OFFSET(XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending);
68	OFFSET(XEN_vcpu_info_arch_cr2, vcpu_info, arch.cr2);
69#endif
70
71	BLANK();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72	OFFSET(BP_scratch, boot_params, scratch);
73	OFFSET(BP_secure_boot, boot_params, secure_boot);
74	OFFSET(BP_loadflags, boot_params, hdr.loadflags);
75	OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch);
76	OFFSET(BP_version, boot_params, hdr.version);
77	OFFSET(BP_kernel_alignment, boot_params, hdr.kernel_alignment);
78	OFFSET(BP_init_size, boot_params, hdr.init_size);
79	OFFSET(BP_pref_address, boot_params, hdr.pref_address);
80
81	BLANK();
82	DEFINE(PTREGS_SIZE, sizeof(struct pt_regs));
83
84	/* TLB state for the entry code */
85	OFFSET(TLB_STATE_user_pcid_flush_mask, tlb_state, user_pcid_flush_mask);
86
87	/* Layout info for cpu_entry_area */
88	OFFSET(CPU_ENTRY_AREA_entry_stack, cpu_entry_area, entry_stack_page);
89	DEFINE(SIZEOF_entry_stack, sizeof(struct entry_stack));
90	DEFINE(MASK_entry_stack, (~(sizeof(struct entry_stack) - 1)));
91
92	/* Offset for fields in tss_struct */
93	OFFSET(TSS_sp0, tss_struct, x86_tss.sp0);
94	OFFSET(TSS_sp1, tss_struct, x86_tss.sp1);
95	OFFSET(TSS_sp2, tss_struct, x86_tss.sp2);
 
 
 
 
 
 
 
 
 
 
 
 
 
96}