blob: 0933518aa8bd2a6862533474b95a400b82a51341 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#include <stdio.h>
#include <asm/types.h>
/* For some reason, x86_64 nowhere defines u64 and u32, even though they're
* used throughout the headers.
*/
typedef __u64 u64;
typedef __u32 u32;
#include <asm/user.h>
int main(int argc, char **argv)
{
printf("/*\n");
printf(" * Generated by mk_user_constants\n");
printf(" */\n");
printf("\n");
printf("#ifndef __UM_USER_CONSTANTS_H\n");
printf("#define __UM_USER_CONSTANTS_H\n");
printf("\n");
/* I'd like to use FRAME_SIZE from ptrace.h here, but that's wrong on
* x86_64 (216 vs 168 bytes). user_regs_struct is the correct size on
* both x86_64 and i386.
*/
printf("#define UM_FRAME_SIZE %d\n", (int) sizeof(struct user_regs_struct));
printf("\n");
printf("#endif\n");
return(0);
}
|