2005-04-17 06:20:36 +08:00
|
|
|
#include <stdio.h>
|
2005-05-06 07:15:27 +08:00
|
|
|
#include <kernel-offsets.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-05-06 07:15:27 +08:00
|
|
|
void print_ptr(char *name, char *type, int offset)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2005-05-06 07:15:27 +08:00
|
|
|
printf("#define %s(task) ((%s *) &(((char *) (task))[%d]))\n", name, type,
|
2005-04-17 06:20:36 +08:00
|
|
|
offset);
|
|
|
|
}
|
|
|
|
|
2005-05-06 07:15:27 +08:00
|
|
|
void print(char *name, char *type, int offset)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2005-05-06 07:15:27 +08:00
|
|
|
printf("#define %s(task) *((%s *) &(((char *) (task))[%d]))\n", name, type,
|
2005-04-17 06:20:36 +08:00
|
|
|
offset);
|
|
|
|
}
|
|
|
|
|
2005-05-06 07:15:27 +08:00
|
|
|
int main(int argc, char **argv)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
|
|
|
printf("/*\n");
|
|
|
|
printf(" * Generated by mk_task\n");
|
|
|
|
printf(" */\n");
|
|
|
|
printf("\n");
|
|
|
|
printf("#ifndef __TASK_H\n");
|
|
|
|
printf("#define __TASK_H\n");
|
|
|
|
printf("\n");
|
2005-05-06 07:15:27 +08:00
|
|
|
print_ptr("TASK_REGS", "union uml_pt_regs", TASK_REGS);
|
|
|
|
print("TASK_PID", "int", TASK_PID);
|
2005-04-17 06:20:36 +08:00
|
|
|
printf("\n");
|
|
|
|
printf("#endif\n");
|
2005-05-06 07:15:27 +08:00
|
|
|
return(0);
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|