this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Made functions using Mach-O symbol resolvers usable with ELF

+29 -13
+1 -1
libc/gen/platfunc.h
··· 40 40 // This is a shared macro which calls PLATFUNC_VARIANT_NAME which has different 41 41 // implementations in __ASSEMBLER__ and !__ASSEMBLER__ 42 42 #define PLATFUNC_DESCRIPTOR_NAME(name, variant) \ 43 - PLATFUNC_VARIANT_NAME(platfunc_ ## name, variant) 43 + PLATFUNC_VARIANT_NAME(name, variant) 44 44 45 45 #ifdef __ASSEMBLER__ 46 46
+7 -3
libc/x86_64/string/bcopy.c
··· 23 23 */ 24 24 25 25 #include <machine/cpu_capabilities.h> 26 + #include <sys/types.h> 26 27 #include "platfunc.h" 27 28 28 29 PLATFUNC_DESCRIPTOR_PROTOTYPE(bcopy, sse42) ··· 34 35 0 35 36 }; 36 37 37 - void *bcopy_chooser() 38 + void bcopy_chooser(const void *src, void *dest, size_t n) 38 39 #ifndef DARLING 39 40 __asm__("_bcopy"); 40 41 #else 41 42 __asm__("bcopy"); 42 43 #endif 43 - void *bcopy_chooser() { 44 + void bcopy_chooser(const void *src, void *dest, size_t n) { 44 45 #ifndef DARLING 45 46 __asm__(".desc _bcopy, 0x100"); 46 47 #endif 47 - return find_platform_function((const platfunc_descriptor **) bcopy_platfunc_descriptors); 48 + void (*impl)(const void *src, void *dest, size_t n); 49 + impl = find_platform_function((const platfunc_descriptor **) bcopy_platfunc_descriptors); 50 + 51 + impl(src, dest, n); 48 52 }
+7 -3
libc/x86_64/string/bzero.c
··· 23 23 */ 24 24 25 25 #include <machine/cpu_capabilities.h> 26 + #include <sys/types.h> 26 27 #include "platfunc.h" 27 28 28 29 PLATFUNC_DESCRIPTOR_PROTOTYPE(bzero, sse42) ··· 34 35 0 35 36 }; 36 37 37 - void *bzero_chooser() __asm__("bzero"); 38 - void *bzero_chooser() { 38 + void bzero_chooser(void *s, size_t n) __asm__("bzero"); 39 + void bzero_chooser(void *s, size_t n) { 39 40 //__asm__(".desc _bzero, 0x100"); 40 - return find_platform_function((const platfunc_descriptor **) bzero_platfunc_descriptors); 41 + void (*impl)(void*, size_t); 42 + impl = find_platform_function((const platfunc_descriptor **) bzero_platfunc_descriptors); 43 + 44 + impl(s, n); 41 45 }
+7 -3
libc/x86_64/string/memcpy.c
··· 23 23 */ 24 24 25 25 #include <machine/cpu_capabilities.h> 26 + #include <sys/types.h> 26 27 #include "platfunc.h" 27 28 28 29 PLATFUNC_DESCRIPTOR_PROTOTYPE(memcpy, sse42) ··· 34 35 0 35 36 }; 36 37 37 - void *memcpy_chooser() __asm__("memcpy"); 38 - void *memcpy_chooser() { 38 + void *memcpy_chooser(void *dest, const void *src, size_t n) __asm__("memcpy"); 39 + void *memcpy_chooser(void *dest, const void *src, size_t n) { 39 40 // __asm__(".desc _memcpy, 0x100"); 40 - return find_platform_function((const platfunc_descriptor **) memcpy_platfunc_descriptors); 41 + void *(*impl)(void *, const void *, size_t); 42 + impl = find_platform_function((const platfunc_descriptor **) memcpy_platfunc_descriptors); 43 + 44 + return impl(dest, src, n); 41 45 }
+7 -3
libc/x86_64/string/memmove.c
··· 23 23 */ 24 24 25 25 #include <machine/cpu_capabilities.h> 26 + #include <sys/types.h> 26 27 #include "platfunc.h" 27 28 28 29 PLATFUNC_DESCRIPTOR_PROTOTYPE(memmove, sse42) ··· 34 35 0 35 36 }; 36 37 37 - void *memmove_chooser() __asm__("memmove"); 38 - void *memmove_chooser() { 38 + void *memmove_chooser(void *dest, const void *src, size_t n) __asm__("memmove"); 39 + void *memmove_chooser(void *dest, const void *src, size_t n) { 39 40 //__asm__(".desc _memmove, 0x100"); 40 - return find_platform_function((const platfunc_descriptor **) memmove_platfunc_descriptors); 41 + void *(*impl)(void *, const void *, size_t); 42 + impl = find_platform_function((const platfunc_descriptor **) memmove_platfunc_descriptors); 43 + 44 + return impl(dest, src, n); 41 45 }