aboutsummaryrefslogtreecommitdiff
path: root/linux-user/hppa
diff options
context:
space:
mode:
Diffstat (limited to 'linux-user/hppa')
-rw-r--r--linux-user/hppa/sockbits.h97
-rw-r--r--linux-user/hppa/syscall_nr.h353
-rw-r--r--linux-user/hppa/target_cpu.h35
-rw-r--r--linux-user/hppa/target_signal.h29
-rw-r--r--linux-user/hppa/target_structs.h54
-rw-r--r--linux-user/hppa/target_syscall.h237
-rw-r--r--linux-user/hppa/termbits.h219
7 files changed, 1024 insertions, 0 deletions
diff --git a/linux-user/hppa/sockbits.h b/linux-user/hppa/sockbits.h
new file mode 100644
index 0000000000..5044619e16
--- /dev/null
+++ b/linux-user/hppa/sockbits.h
@@ -0,0 +1,97 @@
+#define TARGET_SOL_SOCKET 0xffff
+
+#define TARGET_SO_DEBUG 0x0001
+#define TARGET_SO_REUSEADDR 0x0004
+#define TARGET_SO_KEEPALIVE 0x0008
+#define TARGET_SO_DONTROUTE 0x0010
+#define TARGET_SO_BROADCAST 0x0020
+#define TARGET_SO_LINGER 0x0080
+#define TARGET_SO_OOBINLINE 0x0100
+#define TARGET_SO_REUSEPORT 0x0200
+#define TARGET_SO_SNDBUF 0x1001
+#define TARGET_SO_RCVBUF 0x1002
+#define TARGET_SO_SNDBUFFORCE 0x100a
+#define TARGET_SO_RCVBUFFORCE 0x100b
+#define TARGET_SO_SNDLOWAT 0x1003
+#define TARGET_SO_RCVLOWAT 0x1004
+#define TARGET_SO_SNDTIMEO 0x1005
+#define TARGET_SO_RCVTIMEO 0x1006
+#define TARGET_SO_ERROR 0x1007
+#define TARGET_SO_TYPE 0x1008
+#define TARGET_SO_PROTOCOL 0x1028
+#define TARGET_SO_DOMAIN 0x1029
+#define TARGET_SO_PEERNAME 0x2000
+#define TARGET_SO_NO_CHECK 0x400b
+#define TARGET_SO_PRIORITY 0x400c
+#define TARGET_SO_BSDCOMPAT 0x400e
+#define TARGET_SO_PASSCRED 0x4010
+#define TARGET_SO_PEERCRED 0x4011
+#define TARGET_SO_TIMESTAMP 0x4012
+#define TARGET_SCM_TIMESTAMP TARGET_SO_TIMESTAMP
+#define TARGET_SO_TIMESTAMPNS 0x4013
+#define TARGET_SCM_TIMESTAMPNS TARGET_SO_TIMESTAMPNS
+
+#define TARGET_SO_SECURITY_AUTHENTICATION 0x4016
+#define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 0x4017
+#define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 0x4018
+
+#define TARGET_SO_BINDTODEVICE 0x4019
+#define TARGET_SO_ATTACH_FILTER 0x401a
+#define TARGET_SO_DETACH_FILTER 0x401b
+#define TARGET_SO_GET_FILTER TARGET_SO_ATTACH_FILTER
+#define TARGET_SO_ACCEPTCONN 0x401c
+#define TARGET_SO_PEERSEC 0x401d
+#define TARGET_SO_PASSSEC 0x401e
+#define TARGET_SO_MARK 0x401f
+#define TARGET_SO_TIMESTAMPING 0x4020
+#define TARGET_SCM_TIMESTAMPING TARGET_SO_TIMESTAMPING
+#define TARGET_SO_RXQ_OVFL 0x4021
+#define TARGET_SO_WIFI_STATUS 0x4022
+#define TARGET_SCM_WIFI_STATUS TARGET_SO_WIFI_STATUS
+#define TARGET_SO_PEEK_OFF 0x4023
+#define TARGET_SO_NOFCS 0x4024
+#define TARGET_SO_LOCK_FILTER 0x4025
+#define TARGET_SO_SELECT_ERR_QUEUE 0x4026
+#define TARGET_SO_BUSY_POLL 0x4027
+#define TARGET_SO_MAX_PACING_RATE 0x4028
+#define TARGET_SO_BPF_EXTENSIONS 0x4029
+#define TARGET_SO_INCOMING_CPU 0x402A
+#define TARGET_SO_ATTACH_BPF 0x402B
+#define TARGET_SO_DETACH_BPF TARGET_SO_DETACH_FILTER
+
+#define TARGET_SO_ATTACH_REUSEPORT_CBPF 0x402C
+#define TARGET_SO_ATTACH_REUSEPORT_EBPF 0x402D
+
+#define TARGET_SO_CNX_ADVICE 0x402E
+
+/** sock_type - Socket types - default values
+ *
+ *
+ * @SOCK_STREAM - stream (connection) socket
+ * @SOCK_DGRAM - datagram (conn.less) socket
+ * @SOCK_RAW - raw socket
+ * @SOCK_RDM - reliably-delivered message
+ * @SOCK_SEQPACKET - sequential packet socket
+ * @SOCK_DCCP - Datagram Congestion Control Protocol socket
+ * @SOCK_PACKET - linux specific way of getting packets at the dev level.
+ * For writing rarp and other similar things on the user
+ * level.
+ * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag.
+ * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag.
+ */
+enum sock_type {
+ TARGET_SOCK_STREAM = 1,
+ TARGET_SOCK_DGRAM = 2,
+ TARGET_SOCK_RAW = 3,
+ TARGET_SOCK_RDM = 4,
+ TARGET_SOCK_SEQPACKET = 5,
+ TARGET_SOCK_DCCP = 6,
+ TARGET_SOCK_PACKET = 10,
+ TARGET_SOCK_CLOEXEC = 010000000,
+ TARGET_SOCK_NONBLOCK = 0x40000000,
+};
+
+#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
+#define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */
+
+#define ARCH_HAS_SOCKET_TYPES 1
diff --git a/linux-user/hppa/syscall_nr.h b/linux-user/hppa/syscall_nr.h
new file mode 100644
index 0000000000..0f396fa1e2
--- /dev/null
+++ b/linux-user/hppa/syscall_nr.h
@@ -0,0 +1,353 @@
+/*
+ * This file contains the system call numbers.
+ */
+
+#define TARGET_NR_restart_syscall 0
+#define TARGET_NR_exit 1
+#define TARGET_NR_fork 2
+#define TARGET_NR_read 3
+#define TARGET_NR_write 4
+#define TARGET_NR_open 5
+#define TARGET_NR_close 6
+#define TARGET_NR_waitpid 7
+#define TARGET_NR_creat 8
+#define TARGET_NR_link 9
+#define TARGET_NR_unlink 10
+#define TARGET_NR_execve 11
+#define TARGET_NR_chdir 12
+#define TARGET_NR_time 13
+#define TARGET_NR_mknod 14
+#define TARGET_NR_chmod 15
+#define TARGET_NR_lchown 16
+#define TARGET_NR_socket 17
+#define TARGET_NR_stat 18
+#define TARGET_NR_lseek 19
+#define TARGET_NR_getpid 20
+#define TARGET_NR_mount 21
+#define TARGET_NR_bind 22
+#define TARGET_NR_setuid 23
+#define TARGET_NR_getuid 24
+#define TARGET_NR_stime 25
+#define TARGET_NR_ptrace 26
+#define TARGET_NR_alarm 27
+#define TARGET_NR_fstat 28
+#define TARGET_NR_pause 29
+#define TARGET_NR_utime 30
+#define TARGET_NR_connect 31
+#define TARGET_NR_listen 32
+#define TARGET_NR_access 33
+#define TARGET_NR_nice 34
+#define TARGET_NR_accept 35
+#define TARGET_NR_sync 36
+#define TARGET_NR_kill 37
+#define TARGET_NR_rename 38
+#define TARGET_NR_mkdir 39
+#define TARGET_NR_rmdir 40
+#define TARGET_NR_dup 41
+#define TARGET_NR_pipe 42
+#define TARGET_NR_times 43
+#define TARGET_NR_getsockname 44
+#define TARGET_NR_brk 45
+#define TARGET_NR_setgid 46
+#define TARGET_NR_getgid 47
+#define TARGET_NR_signal 48
+#define TARGET_NR_geteuid 49
+#define TARGET_NR_getegid 50
+#define TARGET_NR_acct 51
+#define TARGET_NR_umount2 52
+#define TARGET_NR_getpeername 53
+#define TARGET_NR_ioctl 54
+#define TARGET_NR_fcntl 55
+#define TARGET_NR_socketpair 56
+#define TARGET_NR_setpgid 57
+#define TARGET_NR_send 58
+#define TARGET_NR_uname 59
+#define TARGET_NR_umask 60
+#define TARGET_NR_chroot 61
+#define TARGET_NR_ustat 62
+#define TARGET_NR_dup2 63
+#define TARGET_NR_getppid 64
+#define TARGET_NR_getpgrp 65
+#define TARGET_NR_setsid 66
+#define TARGET_NR_pivot_root 67
+#define TARGET_NR_sgetmask 68
+#define TARGET_NR_ssetmask 69
+#define TARGET_NR_setreuid 70
+#define TARGET_NR_setregid 71
+#define TARGET_NR_mincore 72
+#define TARGET_NR_sigpending 73
+#define TARGET_NR_sethostname 74
+#define TARGET_NR_setrlimit 75
+#define TARGET_NR_getrlimit 76
+#define TARGET_NR_getrusage 77
+#define TARGET_NR_gettimeofday 78
+#define TARGET_NR_settimeofday 79
+#define TARGET_NR_getgroups 80
+#define TARGET_NR_setgroups 81
+#define TARGET_NR_sendto 82
+#define TARGET_NR_symlink 83
+#define TARGET_NR_lstat 84
+#define TARGET_NR_readlink 85
+#define TARGET_NR_uselib 86
+#define TARGET_NR_swapon 87
+#define TARGET_NR_reboot 88
+#define TARGET_NR_mmap2 89
+#define TARGET_NR_mmap 90
+#define TARGET_NR_munmap 91
+#define TARGET_NR_truncate 92
+#define TARGET_NR_ftruncate 93
+#define TARGET_NR_fchmod 94
+#define TARGET_NR_fchown 95
+#define TARGET_NR_getpriority 96
+#define TARGET_NR_setpriority 97
+#define TARGET_NR_recv 98
+#define TARGET_NR_statfs 99
+#define TARGET_NR_fstatfs 100
+#define TARGET_NR_stat64 101
+#define TARGET_NR_socketcall 102
+#define TARGET_NR_syslog 103
+#define TARGET_NR_setitimer 104
+#define TARGET_NR_getitimer 105
+#define TARGET_NR_capget 106
+#define TARGET_NR_capset 107
+#define TARGET_NR_pread64 108
+#define TARGET_NR_pwrite64 109
+#define TARGET_NR_getcwd 110
+#define TARGET_NR_vhangup 111
+#define TARGET_NR_fstat64 112
+#define TARGET_NR_vfork 113
+#define TARGET_NR_wait4 114
+#define TARGET_NR_swapoff 115
+#define TARGET_NR_sysinfo 116
+#define TARGET_NR_shutdown 117
+#define TARGET_NR_fsync 118
+#define TARGET_NR_madvise 119
+#define TARGET_NR_clone 120
+#define TARGET_NR_setdomainname 121
+#define TARGET_NR_sendfile 122
+#define TARGET_NR_recvfrom 123
+#define TARGET_NR_adjtimex 124
+#define TARGET_NR_mprotect 125
+#define TARGET_NR_sigprocmask 126
+#define TARGET_NR_create_module 127
+#define TARGET_NR_init_module 128
+#define TARGET_NR_delete_module 129
+#define TARGET_NR_get_kernel_syms 130
+#define TARGET_NR_quotactl 131
+#define TARGET_NR_getpgid 132
+#define TARGET_NR_fchdir 133
+#define TARGET_NR_bdflush 134
+#define TARGET_NR_sysfs 135
+#define TARGET_NR_personality 136
+#define TARGET_NR_afs_syscall 137 /* Syscall for Andrew File System */
+#define TARGET_NR_setfsuid 138
+#define TARGET_NR_setfsgid 139
+#define TARGET_NR__llseek 140
+#define TARGET_NR_getdents 141
+#define TARGET_NR__newselect 142
+#define TARGET_NR_flock 143
+#define TARGET_NR_msync 144
+#define TARGET_NR_readv 145
+#define TARGET_NR_writev 146
+#define TARGET_NR_getsid 147
+#define TARGET_NR_fdatasync 148
+#define TARGET_NR__sysctl 149
+#define TARGET_NR_mlock 150
+#define TARGET_NR_munlock 151
+#define TARGET_NR_mlockall 152
+#define TARGET_NR_munlockall 153
+#define TARGET_NR_sched_setparam 154
+#define TARGET_NR_sched_getparam 155
+#define TARGET_NR_sched_setscheduler 156
+#define TARGET_NR_sched_getscheduler 157
+#define TARGET_NR_sched_yield 158
+#define TARGET_NR_sched_get_priority_max 159
+#define TARGET_NR_sched_get_priority_min 160
+#define TARGET_NR_sched_rr_get_interval 161
+#define TARGET_NR_nanosleep 162
+#define TARGET_NR_mremap 163
+#define TARGET_NR_setresuid 164
+#define TARGET_NR_getresuid 165
+#define TARGET_NR_sigaltstack 166
+#define TARGET_NR_query_module 167
+#define TARGET_NR_poll 168
+#define TARGET_NR_nfsservctl 169
+#define TARGET_NR_setresgid 170
+#define TARGET_NR_getresgid 171
+#define TARGET_NR_prctl 172
+#define TARGET_NR_rt_sigreturn 173
+#define TARGET_NR_rt_sigaction 174
+#define TARGET_NR_rt_sigprocmask 175
+#define TARGET_NR_rt_sigpending 176
+#define TARGET_NR_rt_sigtimedwait 177
+#define TARGET_NR_rt_sigqueueinfo 178
+#define TARGET_NR_rt_sigsuspend 179
+#define TARGET_NR_chown 180
+#define TARGET_NR_setsockopt 181
+#define TARGET_NR_getsockopt 182
+#define TARGET_NR_sendmsg 183
+#define TARGET_NR_recvmsg 184
+#define TARGET_NR_semop 185
+#define TARGET_NR_semget 186
+#define TARGET_NR_semctl 187
+#define TARGET_NR_msgsnd 188
+#define TARGET_NR_msgrcv 189
+#define TARGET_NR_msgget 190
+#define TARGET_NR_msgctl 191
+#define TARGET_NR_shmat 192
+#define TARGET_NR_shmdt 193
+#define TARGET_NR_shmget 194
+#define TARGET_NR_shmctl 195
+#define TARGET_NR_getpmsg 196
+#define TARGET_NR_putpmsg 197
+#define TARGET_NR_lstat64 198
+#define TARGET_NR_truncate64 199
+#define TARGET_NR_ftruncate64 200
+#define TARGET_NR_getdents64 201
+#define TARGET_NR_fcntl64 202
+#define TARGET_NR_attrctl 203
+#define TARGET_NR_acl_get 204
+#define TARGET_NR_acl_set 205
+#define TARGET_NR_gettid 206
+#define TARGET_NR_readahead 207
+#define TARGET_NR_tkill 208
+#define TARGET_NR_sendfile64 209
+#define TARGET_NR_futex 210
+#define TARGET_NR_sched_setaffinity 211
+#define TARGET_NR_sched_getaffinity 212
+#define TARGET_NR_set_thread_area 213
+#define TARGET_NR_get_thread_area 214
+#define TARGET_NR_io_setup 215
+#define TARGET_NR_io_destroy 216
+#define TARGET_NR_io_getevents 217
+#define TARGET_NR_io_submit 218
+#define TARGET_NR_io_cancel 219
+#define TARGET_NR_alloc_hugepages 220
+#define TARGET_NR_free_hugepages 221
+#define TARGET_NR_exit_group 222
+#define TARGET_NR_lookup_dcookie 223
+#define TARGET_NR_epoll_create 224
+#define TARGET_NR_epoll_ctl 225
+#define TARGET_NR_epill_wait 226
+#define TARGET_NR_remap_file_pages 227
+#define TARGET_NR_semtimedop 228
+#define TARGET_NR_mq_open 229
+#define TARGET_NR_mq_unlink 230
+#define TARGET_NR_mq_timedsend 231
+#define TARGET_NR_mq_timedreceive 232
+#define TARGET_NR_mq_notify 233
+#define TARGET_NR_mq_getsetattr 234
+#define TARGET_NR_waitid 235
+#define TARGET_NR_fadvise64_64 236
+#define TARGET_NR_set_tid_address 237
+#define TARGET_NR_setxattr 238
+#define TARGET_NR_lsetxattr 239
+#define TARGET_NR_fsetxattr 240
+#define TARGET_NR_getxattr 241
+#define TARGET_NR_lgetxattr 242
+#define TARGET_NR_fgetxattr 243
+#define TARGET_NR_listxattr 244
+#define TARGET_NR_llistxattr 245
+#define TARGET_NR_flistxattr 246
+#define TARGET_NR_removexattr 247
+#define TARGET_NR_lremovexattr 248
+#define TARGET_NR_fremovexattr 249
+#define TARGET_NR_timer_create 250
+#define TARGET_NR_timer_settime 251
+#define TARGET_NR_timer_gettime 252
+#define TARGET_NR_timer_getoverrun 253
+#define TARGET_NR_timer_delete 254
+#define TARGET_NR_clock_settime 255
+#define TARGET_NR_clock_gettime 256
+#define TARGET_NR_clock_getres 257
+#define TARGET_NR_clock_nanosleep 258
+#define TARGET_NR_tgkill 259
+#define TARGET_NR_mbind 260
+#define TARGET_NR_get_mempolicy 261
+#define TARGET_NR_set_mempolicy 262
+#define TARGET_NR_vserver 263
+#define TARGET_NR_add_key 264
+#define TARGET_NR_request_key 265
+#define TARGET_NR_keyctl 266
+#define TARGET_NR_ioprio_set 267
+#define TARGET_NR_ioprio_get 268
+#define TARGET_NR_inotify_init 269
+#define TARGET_NR_inotify_add_watch 270
+#define TARGET_NR_inotify_rm_watch 271
+#define TARGET_NR_migrate_pages 272
+#define TARGET_NR_pselect6 273
+#define TARGET_NR_ppoll 274
+#define TARGET_NR_openat 275
+#define TARGET_NR_mkdirat 276
+#define TARGET_NR_mknotat 277
+#define TARGET_NR_fchownat 278
+#define TARGET_NR_futimesat 279
+#define TARGET_NR_fstatat64 280
+#define TARGET_NR_unlinkat 281
+#define TARGET_NR_renameat 282
+#define TARGET_NR_linkat 283
+#define TARGET_NR_symlinkat 284
+#define TARGET_NR_readlinkat 285
+#define TARGET_NR_fchmodat 286
+#define TARGET_NR_faccessat 287
+#define TARGET_NR_unshare 288
+#define TARGET_NR_set_robust_list 289
+#define TARGET_NR_get_robust_list 290
+#define TARGET_NR_splice 291
+#define TARGET_NR_sync_file_range 292
+#define TARGET_NR_tee 293
+#define TARGET_NR_vmsplice 294
+#define TARGET_NR_move_pages 295
+#define TARGET_NR_getcpu 296
+#define TARGET_NR_epoll_pwait 297
+#define TARGET_NR_statfs64 298
+#define TARGET_NR_fstatfs64 299
+#define TARGET_NR_kexec_load 300
+#define TARGET_NR_utimensat 301
+#define TARGET_NR_signalfd 302
+#define TARGET_NR_timerfd 303
+#define TARGET_NR_eventfd 304
+#define TARGET_NR_fallocate 305
+#define TARGET_NR_timerfd_create 306
+#define TARGET_NR_timerfd_settime 307
+#define TARGET_NR_timerfd_gettime 308
+#define TARGET_NR_signalfd4 309
+#define TARGET_NR_eventfd2 310
+#define TARGET_NR_epoll_create1 311
+#define TARGET_NR_dup3 312
+#define TARGET_NR_pipe2 313
+#define TARGET_NR_inotify_init1 314
+#define TARGET_NR_preadv 315
+#define TARGET_NR_pwritev 316
+#define TARGET_NR_rt_tgsigqueueinfo 317
+#define TARGET_NR_perf_event_open 318
+#define TARGET_NR_recvmmsg 319
+#define TARGET_NR_accept4 320
+#define TARGET_NR_prlimit64 321
+#define TARGET_NR_fanotify_init 322
+#define TARGET_NR_fanotify_mark 323
+#define TARGET_NR_clock_adjtime 324
+#define TARGET_NR_name_to_handle_at 325
+#define TARGET_NR_open_by_handle_at 326
+#define TARGET_NR_syncfs 327
+#define TARGET_NR_setns 328
+#define TARGET_NR_sendmmsg 329
+#define TARGET_NR_process_vm_readv 330
+#define TARGET_NR_process_vm_writev 331
+#define TARGET_NR_kcmp 332
+#define TARGET_NR_finit_module 333
+#define TARGET_NR_sched_setattr 334
+#define TARGET_NR_sched_getattr 335
+#define TARGET_NR_utimes 336
+#define TARGET_NR_renameat2 337
+#define TARGET_NR_seccomp 338
+#define TARGET_NR_getrandom 339
+#define TARGET_NR_memfd_create 340
+#define TARGET_NR_bpf 341
+#define TARGET_NR_execveat 342
+#define TARGET_NR_membarrier 343
+#define TARGET_NR_userfaultfd 344
+#define TARGET_NR_mlock2 345
+#define TARGET_NR_copy_file_range 346
+#define TARGET_NR_preadv2 347
+#define TARGET_NR_pwritev2 348
diff --git a/linux-user/hppa/target_cpu.h b/linux-user/hppa/target_cpu.h
new file mode 100644
index 0000000000..1a5cecad3c
--- /dev/null
+++ b/linux-user/hppa/target_cpu.h
@@ -0,0 +1,35 @@
+/*
+ * HPPA specific CPU ABI and functions for linux-user
+ *
+ * Copyright (c) 2016 Richard Henderson
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef ALPHA_TARGET_CPU_H
+#define ALPHA_TARGET_CPU_H
+
+static inline void cpu_clone_regs(CPUHPPAState *env, target_ulong newsp)
+{
+ if (newsp) {
+ env->gr[30] = newsp;
+ }
+ env->gr[28] = 0;
+}
+
+static inline void cpu_set_tls(CPUHPPAState *env, target_ulong newtls)
+{
+ env->cr27 = newtls;
+}
+
+#endif
diff --git a/linux-user/hppa/target_signal.h b/linux-user/hppa/target_signal.h
new file mode 100644
index 0000000000..e115890b48
--- /dev/null
+++ b/linux-user/hppa/target_signal.h
@@ -0,0 +1,29 @@
+#ifndef HPPA_TARGET_SIGNAL_H
+#define HPPA_TARGET_SIGNAL_H
+
+#include "cpu.h"
+
+/* this struct defines a stack used during syscall handling */
+
+typedef struct target_sigaltstack {
+ abi_ulong ss_sp;
+ int32_t ss_flags;
+ abi_ulong ss_size;
+} target_stack_t;
+
+
+/*
+ * sigaltstack controls
+ */
+#define TARGET_SS_ONSTACK 1
+#define TARGET_SS_DISABLE 2
+
+#define TARGET_MINSIGSTKSZ 2048
+#define TARGET_SIGSTKSZ 8192
+
+static inline abi_ulong get_sp_from_cpustate(CPUHPPAState *state)
+{
+ return state->gr[30];
+}
+
+#endif /* HPPA_TARGET_SIGNAL_H */
diff --git a/linux-user/hppa/target_structs.h b/linux-user/hppa/target_structs.h
new file mode 100644
index 0000000000..b560b1872b
--- /dev/null
+++ b/linux-user/hppa/target_structs.h
@@ -0,0 +1,54 @@
+/*
+ * HPPA specific structures for linux-user
+ *
+ * Copyright (c) 2016 Richard Henderson
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef HPPA_TARGET_STRUCTS_H
+#define HPPA_TARGET_STRUCTS_H
+
+struct target_ipc_perm {
+ abi_int __key; /* Key. */
+ abi_uint uid; /* Owner's user ID. */
+ abi_uint gid; /* Owner's group ID. */
+ abi_uint cuid; /* Creator's user ID. */
+ abi_uint cgid; /* Creator's group ID. */
+ abi_ushort __pad1;
+ abi_ushort mode; /* Read/write permission. */
+ abi_ushort __pad2;
+ abi_ushort __seq; /* Sequence number. */
+ abi_uint __pad3;
+ uint64_t __unused1;
+ uint64_t __unused2;
+};
+
+struct target_shmid_ds {
+ struct target_ipc_perm shm_perm; /* operation permission struct */
+ abi_uint __pad1;
+ abi_ulong shm_atime; /* time of last shmat() */
+ abi_uint __pad2;
+ abi_ulong shm_dtime; /* time of last shmdt() */
+ abi_uint __pad3;
+ abi_ulong shm_ctime; /* time of last change by shmctl() */
+ abi_uint __pad4;
+ abi_long shm_segsz; /* size of segment in bytes */
+ abi_int shm_cpid; /* pid of creator */
+ abi_int shm_lpid; /* pid of last shmop */
+ abi_ulong shm_nattch; /* number of current attaches */
+ abi_ulong __unused1;
+ abi_ulong __unused2;
+};
+
+#endif
diff --git a/linux-user/hppa/target_syscall.h b/linux-user/hppa/target_syscall.h
new file mode 100644
index 0000000000..ac18a9c575
--- /dev/null
+++ b/linux-user/hppa/target_syscall.h
@@ -0,0 +1,237 @@
+#ifndef HPPA_TARGET_SYSCALL_H
+#define HPPA_TARGET_SYSCALL_H
+
+struct target_pt_regs {
+ target_ulong gr[32];
+ uint64_t fr[32];
+ target_ulong sr[8];
+ target_ulong iasq[2];
+ target_ulong iaoq[2];
+ target_ulong cr27;
+ target_ulong __pad0;
+ target_ulong orig_r28;
+ target_ulong ksp;
+ target_ulong kpc;
+ target_ulong sar;
+ target_ulong iir;
+ target_ulong isr;
+ target_ulong ior;
+ target_ulong ipsw;
+};
+
+#define UNAME_MACHINE "hppa"
+#define UNAME_MINIMUM_RELEASE "2.6.32"
+#define TARGET_CLONE_BACKWARDS
+#define TARGET_MINSIGSTKSZ 2048
+#define TARGET_MLOCKALL_MCL_CURRENT 1
+#define TARGET_MLOCKALL_MCL_FUTURE 2
+
+#undef TARGET_ENOMSG
+#define TARGET_ENOMSG 35
+#undef TARGET_EIDRM
+#define TARGET_EIDRM 36
+#undef TARGET_ECHRNG
+#define TARGET_ECHRNG 37
+#undef TARGET_EL2NSYNC
+#define TARGET_EL2NSYNC 38
+#undef TARGET_EL3HLT
+#define TARGET_EL3HLT 39
+#undef TARGET_EL3RST
+#define TARGET_EL3RST 40
+#undef TARGET_ELNRNG
+#define TARGET_ELNRNG 41
+#undef TARGET_EUNATCH
+#define TARGET_EUNATCH 42
+#undef TARGET_ENOCSI
+#define TARGET_ENOCSI 43
+#undef TARGET_EL2HLT
+#define TARGET_EL2HLT 44
+#undef TARGET_EDEADLK
+#define TARGET_EDEADLK 45
+#undef TARGET_ENOLCK
+#define TARGET_ENOLCK 46
+#undef TARGET_EILSEQ
+#define TARGET_EILSEQ 47
+
+#undef TARGET_ENONET
+#define TARGET_ENONET 50
+#undef TARGET_ENODATA
+#define TARGET_ENODATA 51
+#undef TARGET_ETIME
+#define TARGET_ETIME 52
+#undef TARGET_ENOSR
+#define TARGET_ENOSR 53
+#undef TARGET_ENOSTR
+#define TARGET_ENOSTR 54
+#undef TARGET_ENOPKG
+#define TARGET_ENOPKG 55
+
+#undef TARGET_ENOLINK
+#define TARGET_ENOLINK 57
+#undef TARGET_EADV
+#define TARGET_EADV 58
+#undef TARGET_ESRMNT
+#define TARGET_ESRMNT 59
+#undef TARGET_ECOMM
+#define TARGET_ECOMM 60
+#undef TARGET_EPROTO
+#define TARGET_EPROTO 61
+
+#undef TARGET_EMULTIHOP
+#define TARGET_EMULTIHOP 64
+
+#undef TARGET_EDOTDOT
+#define TARGET_EDOTDOT 66
+#undef TARGET_EBADMSG
+#define TARGET_EBADMSG 67
+#undef TARGET_EUSERS
+#define TARGET_EUSERS 68
+#undef TARGET_EDQUOT
+#define TARGET_EDQUOT 69
+#undef TARGET_ESTALE
+#define TARGET_ESTALE 70
+#undef TARGET_EREMOTE
+#define TARGET_EREMOTE 71
+#undef TARGET_EOVERFLOW
+#define TARGET_EOVERFLOW 72
+
+#undef TARGET_EBADE
+#define TARGET_EBADE 160
+#undef TARGET_EBADR
+#define TARGET_EBADR 161
+#undef TARGET_EXFULL
+#define TARGET_EXFULL 162
+#undef TARGET_ENOANO
+#define TARGET_ENOANO 163
+#undef TARGET_EBADRQC
+#define TARGET_EBADRQC 164
+#undef TARGET_EBADSLT
+#define TARGET_EBADSLT 165
+#undef TARGET_EBFONT
+#define TARGET_EBFONT 166
+#undef TARGET_ENOTUNIQ
+#define TARGET_ENOTUNIQ 167
+#undef TARGET_EBADFD
+#define TARGET_EBADFD 168
+#undef TARGET_EREMCHG
+#define TARGET_EREMCHG 169
+#undef TARGET_ELIBACC
+#define TARGET_ELIBACC 170
+#undef TARGET_ELIBBAD
+#define TARGET_ELIBBAD 171
+#undef TARGET_ELIBSCN
+#define TARGET_ELIBSCN 172
+#undef TARGET_ELIBMAX
+#define TARGET_ELIBMAX 173
+#undef TARGET_ELIBEXEC
+#define TARGET_ELIBEXEC 174
+#undef TARGET_ERESTART
+#define TARGET_ERESTART 175
+#undef TARGET_ESTRPIPE
+#define TARGET_ESTRPIPE 176
+#undef TARGET_EUCLEAN
+#define TARGET_EUCLEAN 177
+#undef TARGET_ENOTNAM
+#define TARGET_ENOTNAM 178
+#undef TARGET_ENAVAIL
+#define TARGET_ENAVAIL 179
+#undef TARGET_EISNAM
+#define TARGET_EISNAM 180
+#undef TARGET_EREMOTEIO
+#define TARGET_EREMOTEIO 181
+#undef TARGET_ENOMEDIUM
+#define TARGET_ENOMEDIUM 182
+#undef TARGET_EMEDIUMTYPE
+#define TARGET_EMEDIUMTYPE 183
+#undef TARGET_ENOKEY
+#define TARGET_ENOKEY 184
+#undef TARGET_EKEYEXPIRED
+#define TARGET_EKEYEXPIRED 185
+#undef TARGET_EKEYREVOKED
+#define TARGET_EKEYREVOKED 186
+#undef TARGET_EKEYREJECTED
+#define TARGET_EKEYREJECTED 187
+
+/* Never used in linux. */
+/* #define TARGET_ENOSYM 215 */
+#undef TARGET_ENOTSOCK
+#define TARGET_ENOTSOCK 216
+#undef TARGET_EDESTADDRREQ
+#define TARGET_EDESTADDRREQ 217
+#undef TARGET_EMSGSIZE
+#define TARGET_EMSGSIZE 218
+#undef TARGET_EPROTOTYPE
+#define TARGET_EPROTOTYPE 219
+#undef TARGET_ENOPROTOOPT
+#define TARGET_ENOPROTOOPT 220
+#undef TARGET_EPROTONOSUPPORT
+#define TARGET_EPROTONOSUPPORT 221
+#undef TARGET_ESOCKTNOSUPPORT
+#define TARGET_ESOCKTNOSUPPORT 222
+#undef TARGET_EOPNOTSUPP
+#define TARGET_EOPNOTSUPP 223
+#undef TARGET_EPFNOSUPPORT
+#define TARGET_EPFNOSUPPORT 224
+#undef TARGET_EAFNOSUPPORT
+#define TARGET_EAFNOSUPPORT 225
+#undef TARGET_EADDRINUSE
+#define TARGET_EADDRINUSE 226
+#undef TARGET_EADDRNOTAVAIL
+#define TARGET_EADDRNOTAVAIL 227
+#undef TARGET_ENETDOWN
+#define TARGET_ENETDOWN 228
+#undef TARGET_ENETUNREACH
+#define TARGET_ENETUNREACH 229
+#undef TARGET_ENETRESET
+#define TARGET_ENETRESET 230
+#undef TARGET_ECONNABORTED
+#define TARGET_ECONNABORTED 231
+#undef TARGET_ECONNRESET
+#define TARGET_ECONNRESET 232
+#undef TARGET_ENOBUFS
+#define TARGET_ENOBUFS 233
+#undef TARGET_EISCONN
+#define TARGET_EISCONN 234
+#undef TARGET_ENOTCONN
+#define TARGET_ENOTCONN 235
+#undef TARGET_ESHUTDOWN
+#define TARGET_ESHUTDOWN 236
+#undef TARGET_ETOOMANYREFS
+#define TARGET_ETOOMANYREFS 237
+#undef TARGET_ETIMEDOUT
+#define TARGET_ETIMEDOUT 238
+#undef TARGET_ECONNREFUSED
+#define TARGET_ECONNREFUSED 239
+#define TARGET_EREMOTERELEASE 240
+#undef TARGET_EHOSTDOWN
+#define TARGET_EHOSTDOWN 241
+#undef TARGET_EHOSTUNREACH
+#define TARGET_EHOSTUNREACH 242
+
+#undef TARGET_EALREADY
+#define TARGET_EALREADY 244
+#undef TARGET_EINPROGRESS
+#define TARGET_EINPROGRESS 245
+#undef TARGET_ENOTEMPTY
+#define TARGET_ENOTEMPTY 247
+#undef TARGET_ENAMETOOLONG
+#define TARGET_ENAMETOOLONG 248
+#undef TARGET_ELOOP
+#define TARGET_ELOOP 249
+#undef TARGET_ENOSYS
+#define TARGET_ENOSYS 251
+
+#undef TARGET_ECANCELED
+#define TARGET_ECANCELED 253
+
+#undef TARGET_EOWNERDEAD
+#define TARGET_EOWNERDEAD 254
+#undef TARGET_ENOTRECOVERABLE
+#define TARGET_ENOTRECOVERABLE 255
+
+#undef TARGET_ERFKILL
+#define TARGET_ERFKILL 256
+#undef TARGET_EHWPOISON
+#define TARGET_EHWPOISON 257
+
+#endif /* HPPA_TARGET_SYSCALL_H */
diff --git a/linux-user/hppa/termbits.h b/linux-user/hppa/termbits.h
new file mode 100644
index 0000000000..e9633ef119
--- /dev/null
+++ b/linux-user/hppa/termbits.h
@@ -0,0 +1,219 @@
+/* from asm/termbits.h */
+
+#define TARGET_NCCS 19
+
+struct target_termios {
+ unsigned int c_iflag; /* input mode flags */
+ unsigned int c_oflag; /* output mode flags */
+ unsigned int c_cflag; /* control mode flags */
+ unsigned int c_lflag; /* local mode flags */
+ unsigned char c_line; /* line discipline */
+ unsigned char c_cc[TARGET_NCCS]; /* control characters */
+};
+
+/* c_iflag bits */
+#define TARGET_IGNBRK 0000001
+#define TARGET_BRKINT 0000002
+#define TARGET_IGNPAR 0000004
+#define TARGET_PARMRK 0000010
+#define TARGET_INPCK 0000020
+#define TARGET_ISTRIP 0000040
+#define TARGET_INLCR 0000100
+#define TARGET_IGNCR 0000200
+#define TARGET_ICRNL 0000400
+#define TARGET_IUCLC 0001000
+#define TARGET_IXON 0002000
+#define TARGET_IXANY 0004000
+#define TARGET_IXOFF 0010000
+#define TARGET_IMAXBEL 0040000
+#define TARGET_IUTF8 0100000
+
+/* c_oflag bits */
+#define TARGET_OPOST 0000001
+#define TARGET_OLCUC 0000002
+#define TARGET_ONLCR 0000004
+#define TARGET_OCRNL 0000010
+#define TARGET_ONOCR 0000020
+#define TARGET_ONLRET 0000040
+#define TARGET_OFILL 0000100
+#define TARGET_OFDEL 0000200
+#define TARGET_NLDLY 0000400
+#define TARGET_NL0 0000000
+#define TARGET_NL1 0000400
+#define TARGET_CRDLY 0003000
+#define TARGET_CR0 0000000
+#define TARGET_CR1 0001000
+#define TARGET_CR2 0002000
+#define TARGET_CR3 0003000
+#define TARGET_TABDLY 0014000
+#define TARGET_TAB0 0000000
+#define TARGET_TAB1 0004000
+#define TARGET_TAB2 0010000
+#define TARGET_TAB3 0014000
+#define TARGET_XTABS 0014000
+#define TARGET_BSDLY 0020000
+#define TARGET_BS0 0000000
+#define TARGET_BS1 0020000
+#define TARGET_VTDLY 0040000
+#define TARGET_VT0 0000000
+#define TARGET_VT1 0040000
+#define TARGET_FFDLY 0100000
+#define TARGET_FF0 0000000
+#define TARGET_FF1 0100000
+
+/* c_cflag bit meaning */
+#define TARGET_CBAUD 0010017
+#define TARGET_B0 0000000 /* hang up */
+#define TARGET_B50 0000001
+#define TARGET_B75 0000002
+#define TARGET_B110 0000003
+#define TARGET_B134 0000004
+#define TARGET_B150 0000005
+#define TARGET_B200 0000006
+#define TARGET_B300 0000007
+#define TARGET_B600 0000010
+#define TARGET_B1200 0000011
+#define TARGET_B1800 0000012
+#define TARGET_B2400 0000013
+#define TARGET_B4800 0000014
+#define TARGET_B9600 0000015
+#define TARGET_B19200 0000016
+#define TARGET_B38400 0000017
+#define TARGET_EXTA B19200
+#define TARGET_EXTB B38400
+#define TARGET_CSIZE 0000060
+#define TARGET_CS5 0000000
+#define TARGET_CS6 0000020
+#define TARGET_CS7 0000040
+#define TARGET_CS8 0000060
+#define TARGET_CSTOPB 0000100
+#define TARGET_CREAD 0000200
+#define TARGET_PARENB 0000400
+#define TARGET_PARODD 0001000
+#define TARGET_HUPCL 0002000
+#define TARGET_CLOCAL 0004000
+#define TARGET_CBAUDEX 0010000
+#define TARGET_B57600 0010001
+#define TARGET_B115200 0010002
+#define TARGET_B230400 0010003
+#define TARGET_B460800 0010004
+#define TARGET_CIBAUD 002003600000 /* input baud rate (not used) */
+#define TARGET_CMSPAR 010000000000 /* mark or space (stick) parity */
+#define TARGET_CRTSCTS 020000000000 /* flow control */
+
+/* c_lflag bits */
+#define TARGET_ISIG 0000001
+#define TARGET_ICANON 0000002
+#define TARGET_XCASE 0000004
+#define TARGET_ECHO 0000010
+#define TARGET_ECHOE 0000020
+#define TARGET_ECHOK 0000040
+#define TARGET_ECHONL 0000100
+#define TARGET_NOFLSH 0000200
+#define TARGET_TOSTOP 0000400
+#define TARGET_ECHOCTL 0001000
+#define TARGET_ECHOPRT 0002000
+#define TARGET_ECHOKE 0004000
+#define TARGET_FLUSHO 0010000
+#define TARGET_PENDIN 0040000
+#define TARGET_IEXTEN 0100000
+
+/* c_cc character offsets */
+#define TARGET_VINTR 0
+#define TARGET_VQUIT 1
+#define TARGET_VERASE 2
+#define TARGET_VKILL 3
+#define TARGET_VEOF 4
+#define TARGET_VTIME 5
+#define TARGET_VMIN 6
+#define TARGET_VSWTC 7
+#define TARGET_VSTART 8
+#define TARGET_VSTOP 9
+#define TARGET_VSUSP 10
+#define TARGET_VEOL 11
+#define TARGET_VREPRINT 12
+#define TARGET_VDISCARD 13
+#define TARGET_VWERASE 14
+#define TARGET_VLNEXT 15
+#define TARGET_VEOL2 16
+
+/* ioctls */
+
+#define TARGET_TCGETS TARGET_IOR('T', 16, struct target_termios)
+#define TARGET_TCSETS TARGET_IOW('T', 17, struct target_termios)
+#define TARGET_TCSETSW TARGET_IOW('T', 18, struct target_termios)
+#define TARGET_TCSETSF TARGET_IOW('T', 19, struct target_termios)
+#define TARGET_TCGETA TARGET_IOR('T', 1, struct target_termios)
+#define TARGET_TCSETA TARGET_IOW('T', 2, struct target_termios)
+#define TARGET_TCSETAW TARGET_IOW('T', 3, struct target_termios)
+#define TARGET_TCSETAF TARGET_IOW('T', 4, struct target_termios)
+#define TARGET_TCSBRK TARGET_IO('T', 5)
+#define TARGET_TCXONC TARGET_IO('T', 6)
+#define TARGET_TCFLSH TARGET_IO('T', 7)
+
+#define TARGET_TIOCEXCL 0x540C
+#define TARGET_TIOCNXCL 0x540D
+#define TARGET_TIOCSCTTY 0x540E
+#define TARGET_TIOCGPGRP TARGET_IOR('T', 30, int)
+#define TARGET_TIOCSPGRP TARGET_IOW('T', 29, int)
+#define TARGET_TIOCOUTQ 0x5411
+#define TARGET_TIOCSTI 0x5412
+#define TARGET_TIOCGWINSZ 0x5413
+#define TARGET_TIOCSWINSZ 0x5414
+#define TARGET_TIOCMGET 0x5415
+#define TARGET_TIOCMBIS 0x5416
+#define TARGET_TIOCMBIC 0x5417
+#define TARGET_TIOCMSET 0x5418
+#define TARGET_TIOCGSOFTCAR 0x5419
+#define TARGET_TIOCSSOFTCAR 0x541A
+#define TARGET_FIONREAD 0x541B
+#define TARGET_TIOCINQ TARGET_FIONREAD
+#define TARGET_TIOCLINUX 0x541C
+#define TARGET_TIOCCONS 0x541D
+#define TARGET_TIOCGSERIAL 0x541E
+#define TARGET_TIOCSSERIAL 0x541F
+#define TARGET_TIOCPKT 0x5420
+#define TARGET_FIONBIO 0x5421
+#define TARGET_TIOCNOTTY 0x5422
+#define TARGET_TIOCSETD 0x5423
+#define TARGET_TIOCGETD 0x5424
+#define TARGET_TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
+#define TARGET_TIOCTTYGSTRUCT 0x5426 /* For debugging only */
+#define TARGET_TIOCSBRK 0x5427 /* BSD compatibility */
+#define TARGET_TIOCCBRK 0x5428 /* BSD compatibility */
+#define TARGET_TIOCGSID TARGET_IOR('T', 20, int)
+#define TARGET_TIOCGPTN TARGET_IOR('T', 0x30, unsigned int)
+ /* Get Pty Number (of pty-mux device) */
+#define TARGET_TIOCSPTLCK TARGET_IOW('T', 0x31, int)
+ /* Lock/unlock Pty */
+
+#define TARGET_FIONCLEX 0x5450 /* these numbers need to be adjusted. */
+#define TARGET_FIOCLEX 0x5451
+#define TARGET_FIOASYNC 0x5452
+#define TARGET_TIOCSERCONFIG 0x5453
+#define TARGET_TIOCSERGWILD 0x5454
+#define TARGET_TIOCSERSWILD 0x5455
+#define TARGET_TIOCGLCKTRMIOS 0x5456
+#define TARGET_TIOCSLCKTRMIOS 0x5457
+#define TARGET_TIOCSERGSTRUCT 0x5458 /* For debugging only */
+#define TARGET_TIOCSERGETLSR 0x5459 /* Get line status register */
+#define TARGET_TIOCSERGETMULTI 0x545A /* Get multiport config */
+#define TARGET_TIOCSERSETMULTI 0x545B /* Set multiport config */
+
+#define TARGET_TIOCMIWAIT 0x545C /* wait for a change on serial */
+#define TARGET_TIOCGICOUNT 0x545D
+#define TARGET_FIOQSIZE 0x5460
+#define TARGET_TIOCSTART 0x5461
+#define TARGET_TIOCSTOP 0x5462
+#define TARGET_TIOCSLTC 0x5462
+
+/* Used for packet mode */
+#define TARGET_TIOCPKT_DATA 0
+#define TARGET_TIOCPKT_FLUSHREAD 1
+#define TARGET_TIOCPKT_FLUSHWRITE 2
+#define TARGET_TIOCPKT_STOP 4
+#define TARGET_TIOCPKT_START 8
+#define TARGET_TIOCPKT_NOSTOP 16
+#define TARGET_TIOCPKT_DOSTOP 32
+
+#define TARGET_TIOCSER_TEMT 0x01 /* Transmitter physically empty */