diff options
Diffstat (limited to 'libc')
| -rw-r--r-- | libc/Android.mk | 1 | ||||
| -rw-r--r-- | libc/arch-x86/bionic/syscall.S | 52 | ||||
| -rw-r--r-- | libc/bionic/malloc_leak.c | 5 | ||||
| -rw-r--r-- | libc/bionic/pututline.c | 2 | ||||
| -rw-r--r-- | libc/bionic/ssp.c | 4 | ||||
| -rw-r--r-- | libc/include/dlfcn.h | 12 | ||||
| -rw-r--r-- | libc/kernel/common/linux/a1026.h | 67 | ||||
| -rw-r--r-- | libc/kernel/common/linux/msm_kgsl.h | 9 | ||||
| -rw-r--r-- | libc/kernel/common/linux/tpa2018d1.h | 33 | ||||
| -rw-r--r-- | libc/string/strcasecmp.c | 4 | ||||
| -rw-r--r-- | libc/string/strchr.c | 2 | ||||
| -rwxr-xr-x | libc/string/strcoll.c | 2 | ||||
| -rw-r--r-- | libc/string/strlcat.c | 4 | ||||
| -rw-r--r-- | libc/string/strlcpy.c | 2 | ||||
| -rw-r--r-- | libc/string/strncat.c | 2 | ||||
| -rw-r--r-- | libc/string/strncmp.c | 3 | ||||
| -rw-r--r-- | libc/string/strncpy.c | 4 | ||||
| -rw-r--r-- | libc/string/strpbrk.c | 2 | ||||
| -rw-r--r-- | libc/string/strrchr.c | 4 | ||||
| -rw-r--r-- | libc/string/strsep.c | 2 | ||||
| -rw-r--r-- | libc/string/strstr.c | 2 | ||||
| -rwxr-xr-x | libc/string/strxfrm.c | 2 | ||||
| -rw-r--r-- | libc/unistd/pread.c | 4 | ||||
| -rw-r--r-- | libc/unistd/pwrite.c | 4 | ||||
| -rw-r--r-- | libc/zoneinfo/zoneinfo.dat | bin | 169880 -> 168809 bytes | |||
| -rw-r--r-- | libc/zoneinfo/zoneinfo.idx | bin | 29016 -> 29172 bytes | |||
| -rw-r--r-- | libc/zoneinfo/zoneinfo.version | 2 |
27 files changed, 202 insertions, 28 deletions
diff --git a/libc/Android.mk b/libc/Android.mk index bafc118..9013e9a 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -329,6 +329,7 @@ libc_common_src_files += \ arch-x86/bionic/setjmp.S \ arch-x86/bionic/_setjmp.S \ arch-x86/bionic/vfork.S \ + arch-x86/bionic/syscall.S \ arch-x86/string/bzero.S \ arch-x86/string/memset.S \ arch-x86/string/memcmp.S \ diff --git a/libc/arch-x86/bionic/syscall.S b/libc/arch-x86/bionic/syscall.S new file mode 100644 index 0000000..71abe6b --- /dev/null +++ b/libc/arch-x86/bionic/syscall.S @@ -0,0 +1,52 @@ +/* + * Generic syscall call. + * Upon entry + * %eax: system call number + * %ebx: arg0 to system call + * %ecx: arg.. + * %edx: arg.. + * %esi: arg.. + * %edi: arg.. + * We push these (to save them) load them up with the + * values from the calling frame (not all will actually be valid) + * and make the syscall. + */ + +#include <sys/linux-syscalls.h> + + .text + .type syscall, @function + .globl syscall + .align 4 + +syscall: + push %eax + push %ebx + push %ecx + push %edx + push %esi + push %edi + mov 28(%esp),%eax + mov 32(%esp),%ebx + mov 36(%esp),%ecx + mov 40(%esp),%edx + mov 44(%esp),%esi + mov 48(%esp),%edi + + int $0x80 + + cmpl $-129, %eax + jb 1f + negl %eax + pushl %eax + call __set_errno + addl $4, %esp + orl $-1, %eax +1: + pop %edi + pop %esi + pop %edx + pop %ecx + pop %ebx + pop %eax + ret diff --git a/libc/bionic/malloc_leak.c b/libc/bionic/malloc_leak.c index 305f954..ad1d2b4 100644 --- a/libc/bionic/malloc_leak.c +++ b/libc/bionic/malloc_leak.c @@ -665,8 +665,9 @@ void* chk_realloc(void* mem, size_t bytes) } if (new_buffer) { - size_t size = (bytes < old_bytes)?(bytes):(old_bytes); - memcpy(new_buffer, mem, size); + if (bytes > old_bytes) + bytes = old_bytes; + memcpy(new_buffer, mem, bytes); chk_free(mem); } diff --git a/libc/bionic/pututline.c b/libc/bionic/pututline.c index 2449068..c8427f7 100644 --- a/libc/bionic/pututline.c +++ b/libc/bionic/pututline.c @@ -34,7 +34,7 @@ void pututline(struct utmp* utmp) { FILE* f; struct utmp u; - int i; + long i; if (!(f = fopen(_PATH_UTMP, "w+"))) return; diff --git a/libc/bionic/ssp.c b/libc/bionic/ssp.c index 20794f4..f83b2a4 100644 --- a/libc/bionic/ssp.c +++ b/libc/bionic/ssp.c @@ -76,9 +76,9 @@ void __stack_chk_fail(void) sigprocmask(SIG_BLOCK, &sigmask, NULL); /* Use /proc/self/exe link to obtain the program name for logging - * purposes. If it's not available, we set it to "unknown" */ + * purposes. If it's not available, we set it to "<unknown>" */ if ((count = readlink("/proc/self/exe", path, sizeof(path) - 1)) == -1) { - strlcpy(path, "unknown", sizeof(path)); + strlcpy(path, "<unknown>", sizeof(path)); } else { path[count] = '\0'; } diff --git a/libc/include/dlfcn.h b/libc/include/dlfcn.h index 9582796..f84d1d1 100644 --- a/libc/include/dlfcn.h +++ b/libc/include/dlfcn.h @@ -32,10 +32,22 @@ __BEGIN_DECLS +typedef struct { + const char *dli_fname; /* Pathname of shared object that + contains address */ + void *dli_fbase; /* Address at which shared object + is loaded */ + const char *dli_sname; /* Name of nearest symbol with address + lower than addr */ + void *dli_saddr; /* Exact address of symbol named + in dli_sname */ +} Dl_info; + extern void* dlopen(const char* filename, int flag); extern int dlclose(void* handle); extern const char* dlerror(void); extern void* dlsym(void* handle, const char* symbol); +extern int dladdr(void* addr, Dl_info *info); enum { RTLD_NOW = 0, diff --git a/libc/kernel/common/linux/a1026.h b/libc/kernel/common/linux/a1026.h new file mode 100644 index 0000000..2bf6190 --- /dev/null +++ b/libc/kernel/common/linux/a1026.h @@ -0,0 +1,67 @@ +/**************************************************************************** + **************************************************************************** + *** + *** This header was automatically generated from a Linux kernel header + *** of the same name, to make information necessary for userspace to + *** call into the kernel available to libc. It contains only constants, + *** structures, and macros generated from the original header, and thus, + *** contains no copyrightable information. + *** + **************************************************************************** + ****************************************************************************/ +#ifndef __LINUX_A1026_H +#define __LINUX_A1026_H + +#include <linux/ioctl.h> + +#define A1026_MAX_FW_SIZE (32*1024) +struct a1026img { + unsigned char *buf; + unsigned img_size; +}; + +enum A1026_PathID { + A1026_PATH_SUSPEND, + A1026_PATH_INCALL_RECEIVER, + A1026_PATH_INCALL_HEADSET, + A1026_PATH_INCALL_SPEAKER, + A1026_PATH_INCALL_BT, + A1026_PATH_VR_NO_NS_RECEIVER, + A1026_PATH_VR_NO_NS_HEADSET, + A1026_PATH_VR_NO_NS_SPEAKER, + A1026_PATH_VR_NO_NS_BT, + A1026_PATH_VR_NS_RECEIVER, + A1026_PATH_VR_NS_HEADSET, + A1026_PATH_VR_NS_SPEAKER, + A1026_PATH_VR_NS_BT, + A1026_PATH_RECORD_RECEIVER, + A1026_PATH_RECORD_HEADSET, + A1026_PATH_RECORD_SPEAKER, + A1026_PATH_RECORD_BT, + A1026_PATH_CAMCORDER, + A1026_PATH_INCALL_TTY +}; + +enum A1026_NS_states { + A1026_NS_STATE_AUTO, + A1026_NS_STATE_OFF, + A1026_NS_STATE_CT, + A1026_NS_STATE_FT, + A1026_NS_NUM_STATES +}; + +#define A1026_IOCTL_MAGIC 'u' + +#define A1026_BOOTUP_INIT _IOW(A1026_IOCTL_MAGIC, 0x01, struct a1026img *) +#define A1026_SET_CONFIG _IOW(A1026_IOCTL_MAGIC, 0x02, enum A1026_PathID) +#define A1026_SET_NS_STATE _IOW(A1026_IOCTL_MAGIC, 0x03, enum A1026_NS_states) + +#define A1026_SET_MIC_ONOFF _IOW(A1026_IOCTL_MAGIC, 0x50, unsigned) +#define A1026_SET_MICSEL_ONOFF _IOW(A1026_IOCTL_MAGIC, 0x51, unsigned) +#define A1026_READ_DATA _IOR(A1026_IOCTL_MAGIC, 0x52, unsigned) +#define A1026_WRITE_MSG _IOW(A1026_IOCTL_MAGIC, 0x53, unsigned) +#define A1026_SYNC_CMD _IO(A1026_IOCTL_MAGIC, 0x54) +#define A1026_SET_CMD_FILE _IOW(A1026_IOCTL_MAGIC, 0x55, unsigned) + +#endif + diff --git a/libc/kernel/common/linux/msm_kgsl.h b/libc/kernel/common/linux/msm_kgsl.h index d717e57..740ba60 100644 --- a/libc/kernel/common/linux/msm_kgsl.h +++ b/libc/kernel/common/linux/msm_kgsl.h @@ -139,6 +139,8 @@ struct kgsl_drawctxt_destroy { struct kgsl_sharedmem_from_pmem { int pmem_fd; unsigned int gpuaddr; + unsigned int len; + unsigned int offset; }; #define IOCTL_KGSL_SHAREDMEM_FROM_PMEM _IOWR(KGSL_IOC_TYPE, 0x20, struct kgsl_sharedmem_from_pmem) @@ -188,5 +190,12 @@ struct kgsl_sharedmem_from_vmalloc { #define IOCTL_KGSL_SHAREDMEM_FLUSH_CACHE _IOW(KGSL_IOC_TYPE, 0x24, struct kgsl_sharedmem_free) +struct kgsl_drawctxt_set_bin_base_offset { + unsigned int drawctxt_id; + unsigned int offset; +}; + +#define IOCTL_KGSL_DRAWCTXT_SET_BIN_BASE_OFFSET _IOW(KGSL_IOC_TYPE, 0x25, struct kgsl_drawctxt_set_bin_base_offset) + #endif diff --git a/libc/kernel/common/linux/tpa2018d1.h b/libc/kernel/common/linux/tpa2018d1.h new file mode 100644 index 0000000..4ae31fc --- /dev/null +++ b/libc/kernel/common/linux/tpa2018d1.h @@ -0,0 +1,33 @@ +/**************************************************************************** + **************************************************************************** + *** + *** This header was automatically generated from a Linux kernel header + *** of the same name, to make information necessary for userspace to + *** call into the kernel available to libc. It contains only constants, + *** structures, and macros generated from the original header, and thus, + *** contains no copyrightable information. + *** + **************************************************************************** + ****************************************************************************/ +#ifndef _LINUX_TPA2018D1_H +#define _LINUX_TPA2018D1_H + +#include <linux/ioctl.h> + +enum tpa2018d1_mode { + TPA2018_MODE_OFF, + TPA2018_MODE_PLAYBACK, + TPA2018_MODE_RINGTONE, + TPA2018_MODE_VOICE_CALL, + TPA2018_NUM_MODES, +}; + +#define TPA2018_IOCTL_MAGIC 'a' +#define TPA2018_SET_CONFIG _IOW(TPA2018_IOCTL_MAGIC, 1, unsigned) +#define TPA2018_READ_CONFIG _IOR(TPA2018_IOCTL_MAGIC, 2, unsigned) +#define TPA2018_SET_PARAM _IOW(TPA2018_IOCTL_MAGIC, 3, unsigned) +#define TPA2018_SET_MODE _IOW(TPA2018_IOCTL_MAGIC, 4, unsigned) + +#endif + + diff --git a/libc/string/strcasecmp.c b/libc/string/strcasecmp.c index 12f3a09..2be0913 100644 --- a/libc/string/strcasecmp.c +++ b/libc/string/strcasecmp.c @@ -98,8 +98,8 @@ strncasecmp(const char *s1, const char *s2, size_t n) if (cm[*us1] != cm[*us2++]) return (cm[*us1] - cm[*--us2]); if (*us1++ == '\0') - break; + break; } while (--n != 0); - } + } return (0); } diff --git a/libc/string/strchr.c b/libc/string/strchr.c index e33694c..31ba4e2 100644 --- a/libc/string/strchr.c +++ b/libc/string/strchr.c @@ -38,6 +38,6 @@ strchr(const char *p, int ch) return((char *)p); if (!*p) return((char *)NULL); - } + } /* NOTREACHED */ } diff --git a/libc/string/strcoll.c b/libc/string/strcoll.c index 365cad5..e3b1ec3 100755 --- a/libc/string/strcoll.c +++ b/libc/string/strcoll.c @@ -36,5 +36,5 @@ int strcoll(const char *s1, const char *s2) { - return strcmp (s1, s2); + return strcmp(s1, s2); } diff --git a/libc/string/strlcat.c b/libc/string/strlcat.c index ad2215b..ceab094 100644 --- a/libc/string/strlcat.c +++ b/libc/string/strlcat.c @@ -46,9 +46,9 @@ strlcat(char *dst, const char *src, size_t siz) if (n != 1) { *d++ = *s; n--; - } + } s++; - } + } *d = '\0'; return(dlen + (s - src)); /* count does not include NUL */ diff --git a/libc/string/strlcpy.c b/libc/string/strlcpy.c index 38277eb..d32b659 100644 --- a/libc/string/strlcpy.c +++ b/libc/string/strlcpy.c @@ -37,7 +37,7 @@ strlcpy(char *dst, const char *src, size_t siz) if ((*d++ = *s++) == '\0') break; } - } + } /* Not enough room in dst, add NUL and traverse rest of src */ if (n == 0) { diff --git a/libc/string/strncat.c b/libc/string/strncat.c index 1cb9405..c4df4f2 100644 --- a/libc/string/strncat.c +++ b/libc/string/strncat.c @@ -52,6 +52,6 @@ strncat(char *dst, const char *src, size_t n) d++; } while (--n != 0); *d = 0; - } + } return (dst); } diff --git a/libc/string/strncmp.c b/libc/string/strncmp.c index 9da41ab..1768808 100644 --- a/libc/string/strncmp.c +++ b/libc/string/strncmp.c @@ -38,14 +38,13 @@ int strncmp(const char *s1, const char *s2, size_t n) { - if (n == 0) return (0); do { if (*s1 != *s2++) return (*(unsigned char *)s1 - *(unsigned char *)--s2); if (*s1++ == 0) - break; + break; } while (--n != 0); return (0); } diff --git a/libc/string/strncpy.c b/libc/string/strncpy.c index b91091b..4426cbe 100644 --- a/libc/string/strncpy.c +++ b/libc/string/strncpy.c @@ -54,8 +54,8 @@ strncpy(char *dst, const char *src, size_t n) /* NUL pad the remaining n-1 bytes */ while (--n != 0) *d++ = 0; - break; - } + break; + } } while (--n != 0); } return (dst); diff --git a/libc/string/strpbrk.c b/libc/string/strpbrk.c index 6ba3796..cd3b71c 100644 --- a/libc/string/strpbrk.c +++ b/libc/string/strpbrk.c @@ -38,7 +38,7 @@ strpbrk(const char *s1, const char *s2) { const char *scanp; int c, sc; - + while ((c = *s1++) != 0) { for (scanp = s2; (sc = *scanp++) != 0;) if (sc == c) diff --git a/libc/string/strrchr.c b/libc/string/strrchr.c index 2800781..4918f82 100644 --- a/libc/string/strrchr.c +++ b/libc/string/strrchr.c @@ -34,12 +34,12 @@ char * strrchr(const char *p, int ch) { char *save; - + for (save = NULL;; ++p) { if (*p == ch) save = (char *)p; if (!*p) return(save); - } + } /* NOTREACHED */ } diff --git a/libc/string/strsep.c b/libc/string/strsep.c index bcca681..c44bc5b 100644 --- a/libc/string/strsep.c +++ b/libc/string/strsep.c @@ -34,7 +34,7 @@ /* * Get next token from string *stringp, where tokens are possibly-empty - * strings separated by characters from delim. + * strings separated by characters from delim. * * Writes NULs into the string at *stringp to end tokens. * delim need not remain constant from call to call. diff --git a/libc/string/strstr.c b/libc/string/strstr.c index debe96c..95a865b 100644 --- a/libc/string/strstr.c +++ b/libc/string/strstr.c @@ -51,6 +51,6 @@ strstr(const char *s, const char *find) } while (sc != c); } while (strncmp(s, find, len) != 0); s--; - } + } return ((char *)s); } diff --git a/libc/string/strxfrm.c b/libc/string/strxfrm.c index f1843b5..3c4d707 100755 --- a/libc/string/strxfrm.c +++ b/libc/string/strxfrm.c @@ -29,7 +29,7 @@ /* * Transform string s2 to string s1 using the current locale so that - * strcmp of transformed strings yields the same result as strcoll. + * strcmp of transformed strings yields the same result as strcoll. * Since Bionic really does not support locales, we assume we always use * the C locale. * diff --git a/libc/unistd/pread.c b/libc/unistd/pread.c index d2f71f7..b55623e 100644 --- a/libc/unistd/pread.c +++ b/libc/unistd/pread.c @@ -25,10 +25,10 @@ #include <sys/types.h> #include <unistd.h> -extern int __pread64(int fd, void *buf, size_t nbytes, off_t lo, off_t hi); +extern int __pread64(int fd, void *buf, size_t nbytes, loff_t offset); ssize_t pread(int fd, void *buf, size_t nbytes, off_t offset) { - return __pread64(fd, buf, nbytes, offset, 0); + return __pread64(fd, buf, nbytes, offset); } diff --git a/libc/unistd/pwrite.c b/libc/unistd/pwrite.c index 5adf40a..ea080d2 100644 --- a/libc/unistd/pwrite.c +++ b/libc/unistd/pwrite.c @@ -28,10 +28,10 @@ #include <sys/types.h> #include <unistd.h> -extern int __pwrite64(int fd, void *buf, size_t nbytes, off_t lo, off_t hi); +extern int __pwrite64(int fd, void *buf, size_t nbytes, loff_t offset); ssize_t pwrite(int fd, void *buf, size_t nbytes, off_t offset) { - return __pwrite64(fd, buf, nbytes, offset, 0); + return __pwrite64(fd, buf, nbytes, offset); } diff --git a/libc/zoneinfo/zoneinfo.dat b/libc/zoneinfo/zoneinfo.dat Binary files differindex e5bf25a..c9f0b6f 100644 --- a/libc/zoneinfo/zoneinfo.dat +++ b/libc/zoneinfo/zoneinfo.dat diff --git a/libc/zoneinfo/zoneinfo.idx b/libc/zoneinfo/zoneinfo.idx Binary files differindex 78a3650..cb560db 100644 --- a/libc/zoneinfo/zoneinfo.idx +++ b/libc/zoneinfo/zoneinfo.idx diff --git a/libc/zoneinfo/zoneinfo.version b/libc/zoneinfo/zoneinfo.version index 289c5d1..57a3708 100644 --- a/libc/zoneinfo/zoneinfo.version +++ b/libc/zoneinfo/zoneinfo.version @@ -1 +1 @@ -2007h +2009s |
