[BACK]Return to asm-offsets.c CVS log [TXT][DIR] Up to [Development] / linux-2.6-xfs / arch / avr32 / kernel

File: [Development] / linux-2.6-xfs / arch / avr32 / kernel / asm-offsets.c (download)

Revision 1.1, Tue Oct 31 15:49:12 2006 UTC (10 years, 11 months ago) by tes.longdrop.melbourne.sgi.com
Branch: MAIN

Merge up to 2.6.19-rc3
Merge of 2.6.x-xfs-melb:linux:27325b by kenmcd.

/*
 * Generate definitions needed by assembly language modules.
 * This code generates raw asm output which is post-processed
 * to extract and format the required data.
 */

#include <linux/thread_info.h>

#define DEFINE(sym, val) \
        asm volatile("\n->" #sym " %0 " #val : : "i" (val))

#define BLANK() asm volatile("\n->" : : )

#define OFFSET(sym, str, mem) \
        DEFINE(sym, offsetof(struct str, mem));

void foo(void)
{
	OFFSET(TI_task, thread_info, task);
	OFFSET(TI_exec_domain, thread_info, exec_domain);
	OFFSET(TI_flags, thread_info, flags);
	OFFSET(TI_cpu, thread_info, cpu);
	OFFSET(TI_preempt_count, thread_info, preempt_count);
	OFFSET(TI_restart_block, thread_info, restart_block);
}