Merge changes I0feda6b2,I22d13fde,I49d7d09d,Ice490bfe into lmp-mr1-dev

* changes:
  Fix the type of u_ar0 in <sys/user.h>.
  Add greg_t for arm64.
  POSIX says <signal.h> gets you ucontext_t.
  Add in_port_t and move it and in_addr_t to the correct header file.
This commit is contained in:
Elliott Hughes 2014-10-29 23:22:30 +00:00 committed by Android (Google) Code Review
commit b0693ec582
5 changed files with 19 additions and 13 deletions

View File

@ -25,6 +25,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#ifndef _ARPA_INET_H_ #ifndef _ARPA_INET_H_
#define _ARPA_INET_H_ #define _ARPA_INET_H_
@ -34,8 +35,6 @@
__BEGIN_DECLS __BEGIN_DECLS
typedef uint32_t in_addr_t;
in_addr_t inet_addr(const char*); in_addr_t inet_addr(const char*);
int inet_aton(const char*, struct in_addr*); int inet_aton(const char*, struct in_addr*);
in_addr_t inet_lnaof(struct in_addr); in_addr_t inet_lnaof(struct in_addr);

View File

@ -25,6 +25,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#ifndef _NETINET_IN_H_ #ifndef _NETINET_IN_H_
#define _NETINET_IN_H_ #define _NETINET_IN_H_
@ -43,6 +44,9 @@ __BEGIN_DECLS
#define INET_ADDRSTRLEN 16 #define INET_ADDRSTRLEN 16
typedef uint16_t in_port_t;
typedef uint32_t in_addr_t;
extern int bindresvport (int sd, struct sockaddr_in *sin); extern int bindresvport (int sd, struct sockaddr_in *sin);
static const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; static const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;

View File

@ -48,6 +48,9 @@
# include <linux/signal.h> # include <linux/signal.h>
#endif #endif
#include <sys/ucontext.h>
#define __BIONIC_HAVE_UCONTEXT_T
__BEGIN_DECLS __BEGIN_DECLS
typedef int sig_atomic_t; typedef int sig_atomic_t;

View File

@ -68,11 +68,9 @@ typedef struct ucontext {
struct ucontext* uc_link; struct ucontext* uc_link;
stack_t uc_stack; stack_t uc_stack;
mcontext_t uc_mcontext; mcontext_t uc_mcontext;
sigset_t uc_sigmask;
// Android has a wrong (smaller) sigset_t on ARM. // Android has a wrong (smaller) sigset_t on ARM.
union { uint32_t __padding_rt_sigset;
sigset_t bionic;
uint32_t kernel[2];
} uc_sigmask;
// The kernel adds extra padding after uc_sigmask to match glibc sigset_t on ARM. // The kernel adds extra padding after uc_sigmask to match glibc sigset_t on ARM.
char __padding[120]; char __padding[120];
unsigned long uc_regspace[128] __attribute__((__aligned__(8))); unsigned long uc_regspace[128] __attribute__((__aligned__(8)));
@ -80,6 +78,10 @@ typedef struct ucontext {
#elif defined(__aarch64__) #elif defined(__aarch64__)
#define NGREG 34 /* x0..x30 + sp + pc + pstate */
typedef unsigned long greg_t;
typedef greg_t gregset_t[NGREG];
#include <asm/sigcontext.h> #include <asm/sigcontext.h>
typedef struct sigcontext mcontext_t; typedef struct sigcontext mcontext_t;
@ -152,11 +154,9 @@ typedef struct ucontext {
struct ucontext* uc_link; struct ucontext* uc_link;
stack_t uc_stack; stack_t uc_stack;
mcontext_t uc_mcontext; mcontext_t uc_mcontext;
sigset_t uc_sigmask;
// Android has a wrong (smaller) sigset_t on x86. // Android has a wrong (smaller) sigset_t on x86.
union { uint32_t __padding_rt_sigset;
sigset_t bionic;
uint32_t kernel[2];
} uc_sigmask;
struct _libc_fpstate __fpregs_mem; struct _libc_fpstate __fpregs_mem;
} ucontext_t; } ucontext_t;

View File

@ -91,7 +91,7 @@ struct user {
unsigned long start_stack; unsigned long start_stack;
long int signal; long int signal;
int reserved; int reserved;
unsigned long u_ar0; struct user_regs_struct* u_ar0;
struct user_fpregs_struct* u_fpstate; struct user_fpregs_struct* u_fpstate;
unsigned long magic; unsigned long magic;
char u_comm[32]; char u_comm[32];
@ -155,7 +155,7 @@ struct user {
long int signal; long int signal;
int reserved; int reserved;
int pad1; int pad1;
unsigned long u_ar0; struct user_regs_struct* u_ar0;
struct user_fpregs_struct* u_fpstate; struct user_fpregs_struct* u_fpstate;
unsigned long magic; unsigned long magic;
char u_comm[32]; char u_comm[32];
@ -175,7 +175,7 @@ struct user {
unsigned long start_data; unsigned long start_data;
unsigned long start_stack; unsigned long start_stack;
long int signal; long int signal;
unsigned long u_ar0; void* u_ar0;
unsigned long magic; unsigned long magic;
char u_comm[32]; char u_comm[32];
}; };