Skip to content

Commit

Permalink
xtensa: Autogenerate offsets in struct thread_info
Browse files Browse the repository at this point in the history
Maintaining offsets by hand is no fun.

Reported-by: Guenter Roeck <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
  • Loading branch information
richardweinberger committed Apr 12, 2015
1 parent 3050a35 commit cb418fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
11 changes: 0 additions & 11 deletions arch/xtensa/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,6 @@ struct thread_info {
xtregs_user_t xtregs_user;
};

#else /* !__ASSEMBLY__ */

/* offsets into the thread_info struct for assembly code access */
#define TI_TASK 0x00000000
#define TI_EXEC_DOMAIN 0x00000004
#define TI_FLAGS 0x00000008
#define TI_STATUS 0x0000000C
#define TI_CPU 0x00000010
#define TI_PRE_COUNT 0x00000014
#define TI_ADDR_LIMIT 0x00000018

#endif

/*
Expand Down
8 changes: 8 additions & 0 deletions arch/xtensa/kernel/asm-offsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ int main(void)
DEFINE(TASK_THREAD_INFO, offsetof (struct task_struct, stack));
DEFINE(TASK_STRUCT_SIZE, sizeof (struct task_struct));

/* offsets in thread_info struct */
OFFSET(TI_TASK, thread_info, task);
OFFSET(TI_FLAGS, thread_info, flags);
OFFSET(TI_STSTUS, thread_info, status);
OFFSET(TI_CPU, thread_info, cpu);
OFFSET(TI_PRE_COUNT, thread_info, preempt_count);
OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit);

/* struct thread_info (offset from start_struct) */
DEFINE(THREAD_RA, offsetof (struct task_struct, thread.ra));
DEFINE(THREAD_SP, offsetof (struct task_struct, thread.sp));
Expand Down

0 comments on commit cb418fd

Please sign in to comment.