Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * This program is used to generate definitions needed by
0004  * assembly language modules.
0005  *
0006  * We use the technique used in the OSF Mach kernel code:
0007  * generate asm statements containing #defines,
0008  * compile this file to assembler, and then extract the
0009  * #defines from the assembly-language output.
0010  *
0011  * On sparc, thread_info data is static and TI_XXX offsets are computed by hand.
0012  */
0013 
0014 #include <linux/sched.h>
0015 #include <linux/mm_types.h>
0016 // #include <linux/mm.h>
0017 #include <linux/kbuild.h>
0018 
0019 #include <asm/hibernate.h>
0020 
0021 #ifdef CONFIG_SPARC32
0022 int sparc32_foo(void)
0023 {
0024     DEFINE(AOFF_thread_fork_kpsr,
0025             offsetof(struct thread_struct, fork_kpsr));
0026     return 0;
0027 }
0028 #else
0029 int sparc64_foo(void)
0030 {
0031 #ifdef CONFIG_HIBERNATION
0032     BLANK();
0033     OFFSET(SC_REG_FP, saved_context, fp);
0034     OFFSET(SC_REG_CWP, saved_context, cwp);
0035     OFFSET(SC_REG_WSTATE, saved_context, wstate);
0036 
0037     OFFSET(SC_REG_TICK, saved_context, tick);
0038     OFFSET(SC_REG_PSTATE, saved_context, pstate);
0039 
0040     OFFSET(SC_REG_G4, saved_context, g4);
0041     OFFSET(SC_REG_G5, saved_context, g5);
0042     OFFSET(SC_REG_G6, saved_context, g6);
0043 #endif
0044     return 0;
0045 }
0046 #endif
0047 
0048 int foo(void)
0049 {
0050     BLANK();
0051     DEFINE(AOFF_task_thread, offsetof(struct task_struct, thread));
0052     BLANK();
0053     DEFINE(AOFF_mm_context, offsetof(struct mm_struct, context));
0054     BLANK();
0055     DEFINE(VMA_VM_MM,    offsetof(struct vm_area_struct, vm_mm));
0056 
0057     /* DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28); */
0058     return 0;
0059 }
0060