kmod/testsuite/stripped-module.h
Lucas De Marchi fca5b9bcd4 testsuite: use right offset for module name
We need to cope with the case in which a 32 bits machine is opening a 64
bits kernel module and vice-versa. The offset in `struct module' are
different and do not depend on the architecture we are running, but
rather on the architecture they were created for.

This fixes `make check' in 32 bits machines (since we are shipping 64
bits modules for testing)
2012-06-21 11:30:56 -03:00

33 lines
589 B
C

#ifndef _TESTSUITE_STRIPPED_MODULE_H
#define _TESTSUITE_STRIPPED_MODULE_H
enum module_state
{
MODULE_STATE_LIVE,
MODULE_STATE_COMING,
MODULE_STATE_GOING,
};
struct list_head {
struct list_head *next, *prev;
};
#define MODULE_NAME_LEN (64 - sizeof(unsigned long))
struct module
{
enum module_state state;
/* Member of list of modules */
struct list_head list;
/* Unique handle for this module */
char name[MODULE_NAME_LEN];
};
/* padding */
#define MODULE_NAME_OFFSET_64 4 + 4 + 2 * 8
#define MODULE_NAME_OFFSET_32 4 + 2 * 4
#endif