2005-04-16 18:20:36 -04:00
|
|
|
#include <stdio.h>
|
2005-05-05 19:15:27 -04:00
|
|
|
#include <kernel-offsets.h>
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2005-05-05 19:15:27 -04:00
|
|
|
void print_ptr(char *name, char *type, int offset)
|
2005-04-16 18:20:36 -04:00
|
|
|
{
|
2005-05-05 19:15:27 -04:00
|
|
|
printf("#define %s(task) ((%s *) &(((char *) (task))[%d]))\n", name, type,
|
2005-04-16 18:20:36 -04:00
|
|
|
offset);
|
|
|
|
}
|
|
|
|
|
2005-05-05 19:15:27 -04:00
|
|
|
void print(char *name, char *type, int offset)
|
2005-04-16 18:20:36 -04:00
|
|
|
{
|
2005-05-05 19:15:27 -04:00
|
|
|
printf("#define %s(task) *((%s *) &(((char *) (task))[%d]))\n", name, type,
|
2005-04-16 18:20:36 -04:00
|
|
|
offset);
|
|
|
|
}
|
|
|
|
|
2005-05-05 19:15:27 -04:00
|
|
|
int main(int argc, char **argv)
|
2005-04-16 18:20:36 -04: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-05 19:15:27 -04:00
|
|
|
print_ptr("TASK_REGS", "union uml_pt_regs", TASK_REGS);
|
|
|
|
print("TASK_PID", "int", TASK_PID);
|
2005-04-16 18:20:36 -04:00
|
|
|
printf("\n");
|
|
|
|
printf("#endif\n");
|
2005-05-05 19:15:27 -04:00
|
|
|
return(0);
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|