Back to home page

LXR

 
 

    


0001 /*
0002  * Copyright 2010 Tilera Corporation. All Rights Reserved.
0003  *
0004  *   This program is free software; you can redistribute it and/or
0005  *   modify it under the terms of the GNU General Public License
0006  *   as published by the Free Software Foundation, version 2.
0007  *
0008  *   This program is distributed in the hope that it will be useful, but
0009  *   WITHOUT ANY WARRANTY; without even the implied warranty of
0010  *   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
0011  *   NON INFRINGEMENT.  See the GNU General Public License for
0012  *   more details.
0013  *
0014  * Generates definitions from c-type structures used by assembly sources.
0015  */
0016 
0017 /* Check for compatible compiler early in the build. */
0018 #ifdef CONFIG_TILEGX
0019 # ifndef __tilegx__
0020 #  error Can only build TILE-Gx configurations with tilegx compiler
0021 # endif
0022 # ifndef __LP64__
0023 #  error Must not specify -m32 when building the TILE-Gx kernel
0024 # endif
0025 #else
0026 # ifdef __tilegx__
0027 #  error Can not build TILEPro configurations with tilegx compiler
0028 # endif
0029 #endif
0030 
0031 #include <linux/kbuild.h>
0032 #include <linux/thread_info.h>
0033 #include <linux/sched.h>
0034 #include <linux/hardirq.h>
0035 #include <linux/ptrace.h>
0036 #include <hv/hypervisor.h>
0037 
0038 void foo(void)
0039 {
0040     DEFINE(SINGLESTEP_STATE_BUFFER_OFFSET,
0041            offsetof(struct single_step_state, buffer));
0042     DEFINE(SINGLESTEP_STATE_FLAGS_OFFSET,
0043            offsetof(struct single_step_state, flags));
0044     DEFINE(SINGLESTEP_STATE_ORIG_PC_OFFSET,
0045            offsetof(struct single_step_state, orig_pc));
0046     DEFINE(SINGLESTEP_STATE_NEXT_PC_OFFSET,
0047            offsetof(struct single_step_state, next_pc));
0048     DEFINE(SINGLESTEP_STATE_BRANCH_NEXT_PC_OFFSET,
0049            offsetof(struct single_step_state, branch_next_pc));
0050     DEFINE(SINGLESTEP_STATE_UPDATE_VALUE_OFFSET,
0051            offsetof(struct single_step_state, update_value));
0052 
0053     DEFINE(THREAD_INFO_TASK_OFFSET,
0054            offsetof(struct thread_info, task));
0055     DEFINE(THREAD_INFO_FLAGS_OFFSET,
0056            offsetof(struct thread_info, flags));
0057     DEFINE(THREAD_INFO_STATUS_OFFSET,
0058            offsetof(struct thread_info, status));
0059     DEFINE(THREAD_INFO_HOMECACHE_CPU_OFFSET,
0060            offsetof(struct thread_info, homecache_cpu));
0061     DEFINE(THREAD_INFO_PREEMPT_COUNT_OFFSET,
0062            offsetof(struct thread_info, preempt_count));
0063     DEFINE(THREAD_INFO_STEP_STATE_OFFSET,
0064            offsetof(struct thread_info, step_state));
0065 #ifdef __tilegx__
0066     DEFINE(THREAD_INFO_UNALIGN_JIT_BASE_OFFSET,
0067            offsetof(struct thread_info, unalign_jit_base));
0068     DEFINE(THREAD_INFO_UNALIGN_JIT_TMP_OFFSET,
0069            offsetof(struct thread_info, unalign_jit_tmp));
0070 #endif
0071 
0072     DEFINE(TASK_STRUCT_THREAD_KSP_OFFSET,
0073            offsetof(struct task_struct, thread.ksp));
0074     DEFINE(TASK_STRUCT_THREAD_PC_OFFSET,
0075            offsetof(struct task_struct, thread.pc));
0076 
0077     DEFINE(HV_TOPOLOGY_WIDTH_OFFSET,
0078            offsetof(HV_Topology, width));
0079     DEFINE(HV_TOPOLOGY_HEIGHT_OFFSET,
0080            offsetof(HV_Topology, height));
0081 
0082     DEFINE(IRQ_CPUSTAT_SYSCALL_COUNT_OFFSET,
0083            offsetof(irq_cpustat_t, irq_syscall_count));
0084 }