Skip to content

Commit 20d7338

Browse files
t-8chchenhuacai
authored andcommitted
LoongArch: Use UAPI types in ptrace UAPI header
The kernel UAPI headers already contain fixed-width integer types, there is no need to rely on the libc types. There may not be a libc available or the libc may not provides the <stdint.h>, like for example on nolibc. This also aligns the header with the rest of the LoongArch UAPI headers. Fixes: 803b0fc ("LoongArch: Add process management") Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent 6a23ae0 commit 20d7338

1 file changed

Lines changed: 18 additions & 22 deletions

File tree

arch/loongarch/include/uapi/asm/ptrace.h

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010

1111
#include <linux/types.h>
1212

13-
#ifndef __KERNEL__
14-
#include <stdint.h>
15-
#endif
16-
1713
/*
1814
* For PTRACE_{POKE,PEEK}USR. 0 - 31 are GPRs,
1915
* 32 is syscall's original ARG0, 33 is PC, 34 is BADVADDR.
@@ -41,44 +37,44 @@ struct user_pt_regs {
4137
} __attribute__((aligned(8)));
4238

4339
struct user_fp_state {
44-
uint64_t fpr[32];
45-
uint64_t fcc;
46-
uint32_t fcsr;
40+
__u64 fpr[32];
41+
__u64 fcc;
42+
__u32 fcsr;
4743
};
4844

4945
struct user_lsx_state {
5046
/* 32 registers, 128 bits width per register. */
51-
uint64_t vregs[32*2];
47+
__u64 vregs[32*2];
5248
};
5349

5450
struct user_lasx_state {
5551
/* 32 registers, 256 bits width per register. */
56-
uint64_t vregs[32*4];
52+
__u64 vregs[32*4];
5753
};
5854

5955
struct user_lbt_state {
60-
uint64_t scr[4];
61-
uint32_t eflags;
62-
uint32_t ftop;
56+
__u64 scr[4];
57+
__u32 eflags;
58+
__u32 ftop;
6359
};
6460

6561
struct user_watch_state {
66-
uint64_t dbg_info;
62+
__u64 dbg_info;
6763
struct {
68-
uint64_t addr;
69-
uint64_t mask;
70-
uint32_t ctrl;
71-
uint32_t pad;
64+
__u64 addr;
65+
__u64 mask;
66+
__u32 ctrl;
67+
__u32 pad;
7268
} dbg_regs[8];
7369
};
7470

7571
struct user_watch_state_v2 {
76-
uint64_t dbg_info;
72+
__u64 dbg_info;
7773
struct {
78-
uint64_t addr;
79-
uint64_t mask;
80-
uint32_t ctrl;
81-
uint32_t pad;
74+
__u64 addr;
75+
__u64 mask;
76+
__u32 ctrl;
77+
__u32 pad;
8278
} dbg_regs[14];
8379
};
8480

0 commit comments

Comments
 (0)