Skip to contentSkip to conversation

linux-user: Fix TARGET_MAP* and TARGET_F_??LCK for hppa arch

PATCH In review Helge Deller 3 participants 4 messages Mar 11, 2017 – May 30, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user: Fix TARGET_MAP* and TARGET_F_??LCK for hppa arch

TARGET_MAP_TYPE needs to be 0x03 instead of 0x0f on the hppa architecture, otherwise it conflicts with MAP_FIXED which is 0x04.

Add missing TARGET_MAP_STACK and TARGET_MAP_HUGETLB values.

Fix TARGET_F_RDLCK, TARGET_F_WRLCK and TARGET_F_UNLCK.

linux-user/syscall_defs.h +9 -0
index 2620b56..f356189 100644
@@ -1329,7 +1329,11 @@ struct target_winsize {
 /* Common */
 #define TARGET_MAP_SHARED	0x01		/* Share changes */
 #define TARGET_MAP_PRIVATE	0x02		/* Changes are private */
+#if defined(TARGET_HPPA)
+#define TARGET_MAP_TYPE		0x03		/* Mask for type of mapping */
+#else
 #define TARGET_MAP_TYPE		0x0f		/* Mask for type of mapping */
+#endif
 
 /* Target specific */
 #if defined(TARGET_MIPS)
@@ -1372,6 +1376,8 @@ struct target_winsize {
 #define TARGET_MAP_NORESERVE	0x04000		/* no check for reservations */
 #define TARGET_MAP_POPULATE	0x10000		/* pop (prefault) pagetables */
 #define TARGET_MAP_NONBLOCK	0x20000		/* do not block on IO */
+#define TARGET_MAP_STACK	0x40000		/* give out an address that is best suited for process/thread stacks */
+#define TARGET_MAP_HUGETLB	0x80000		/* create a huge page mapping */
 #else
 #define TARGET_MAP_FIXED	0x10		/* Interpret addr exactly */
 #define TARGET_MAP_ANONYMOUS	0x20		/* don't use a file */
@@ -2350,6 +2356,9 @@ struct target_statfs64 {
 #define TARGET_F_SETOWN        24       /*  for sockets. */
 #define TARGET_F_GETOWN        23       /*  for sockets. */
 #elif defined(TARGET_HPPA)
+#define TARGET_F_RDLCK         1
+#define TARGET_F_WRLCK         2
+#define TARGET_F_UNLCK         3
 #define TARGET_F_GETLK         5
 #define TARGET_F_SETLK         6
 #define TARGET_F_SETLKW        7
#1 lore raw
Quoted 8 lines · Helge Deller

TARGET_MAP_TYPE needs to be 0x03 instead of 0x0f on the hppa architecture, otherwise it conflicts with MAP_FIXED which is 0x04.

Add missing TARGET_MAP_STACK and TARGET_MAP_HUGETLB values.

Fix TARGET_F_RDLCK, TARGET_F_WRLCK and TARGET_F_UNLCK.

I applied the MAP_FIXED and TARGET_F_* parts separately in my tree. I'd like to see what others think about the other MAP_* defines before including that.

r~

#2 lore raw
Quoted 6 lines · Richard Henderson
Quoted 5 lines · Helge Deller

TARGET_MAP_TYPE needs to be 0x03 instead of 0x0f on the hppa architecture, otherwise it conflicts with MAP_FIXED which is 0x04.

Add missing TARGET_MAP_STACK and TARGET_MAP_HUGETLB values.

Quoted 7 lines
Quoted 3 lines

Fix TARGET_F_RDLCK, TARGET_F_WRLCK and TARGET_F_UNLCK.

I applied the MAP_FIXED and TARGET_F_* parts separately in my tree. I'd like to see what others think about the other MAP_* defines before including that.

What's the current state of these patches? Are these patches still waiting for opinions?

Riku

#3 lore raw
Quoted 9 lines · Riku Voipio
Quoted 8 lines · Richard Henderson
Quoted 7 lines · Helge Deller

TARGET_MAP_TYPE needs to be 0x03 instead of 0x0f on the hppa architecture, otherwise it conflicts with MAP_FIXED which is 0x04.

Add missing TARGET_MAP_STACK and TARGET_MAP_HUGETLB values.

Fix TARGET_F_RDLCK, TARGET_F_WRLCK and TARGET_F_UNLCK.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

I applied the MAP_FIXED and TARGET_F_* parts separately in my tree. I'd like to see what others think about the other MAP_* defines before including that.

What's the current state of these patches? Are these patches still waiting for opinions?

It would be nice to get them included (if it hasn't happened yet).

Helge