/picolibc-latest/newlib/libc/stdio/ |
D | open_memstream.c | 8 <<open_memstream>>, <<open_wmemstream>>---open a write stream around an arbitrary-length string 18 size_t *restrict <[size]>); 22 size_t *restrict <[size]>); 25 <<open_memstream>> creates a seekable, byte-oriented <<FILE>> stream that 26 wraps an arbitrary-length buffer, created as if by <<malloc>>. The current 27 contents of *<[buf]> are ignored; this implementation uses *<[size]> 28 as a hint of the maximum size expected, but does not fail if the hint 29 was wrong. The parameters <[buf]> and <[size]> are later stored 31 current address and usable size of the allocated string; although 34 either *<[buf]> or *<[size]> prior to <<fclose>>. [all …]
|
D | fmemopen.c | 8 <<fmemopen>>---open a stream around a fixed-length string 15 FILE *fmemopen(void *restrict <[buf]>, size_t <[size]>, 20 fixed-length buffer of <[size]> bytes starting at <[buf]>. The stream 23 <[size]> bytes are automatically provided as if by <<malloc>>, with 24 the initial size of 0, and <[mode]> must contain <<+>> so that data 29 The stream also maintains a current file size, which is never greater 30 than <[size]>. If <[mode]> starts with <<r>>, the position starts at 31 <<0>>, and file size starts at <[size]> if <[buf]> was provided. If 32 <[mode]> starts with <<w>>, the position and file size start at <<0>>, 34 <[mode]> starts with <<a>>, the position and file size start at the [all …]
|
/picolibc-latest/newlib/testsuite/newlib.string/ |
D | memmove1.c | 1 /* A minor test-program for memmove. 29 /* Test moves of 0..MAX bytes; overlapping-src-higher, 30 overlapping-src-lower and non-overlapping. The overlap varies with 31 1..N where N is the size moved. This means an order of MAX**2 32 iterations. The size of an octet may seem appropriate for MAX and 34 making this 256 added 90s to the test-run (2GHz P4) while 64 (4s) was 36 #define MAX 64 macro 51 /* A safe target-independent memmove. */ 58 while (n-- > 0) in mymemmove() 64 while (n-- > 0) in mymemmove() [all …]
|
/picolibc-latest/newlib/libc/ctype/ |
D | towctrans_l.c | 15 It was designed to be compact for a minimal table size. 22 towupper (c) = c - 1 37 be split up (reduce limit max=255 e.g. to max=127 or max=63 in 38 script mkcaseconv, check increasing table size). 48 * MSP430 has 20-bit integers which the compiler attempts to use and 67 bisearch (wint_t ucs, const struct caseconv_entry *table, size_t max) in bisearch() argument 72 if (ucs < first(table[0]) || ucs > last(table[max])) in bisearch() 74 while (max >= min) in bisearch() 76 mid = (min + max) / 2; in bisearch() 80 max = mid - 1; in bisearch() [all …]
|
/picolibc-latest/newlib/libc/search/ |
D | hash_page.c | 1 /*- 79 ((__uint16_t *)(P))[1] = hashp->BSIZE - 3 * sizeof(__uint16_t); \ 80 ((__uint16_t *)(P))[2] = hashp->BSIZE; \ 98 off = OFFSET(bp) - key->size; in putpair() 99 memmove(p + off, key->data, key->size); in putpair() 103 off -= val->size; in putpair() 104 memmove(p + off, val->data, val->size); in putpair() 109 bp[n + 1] = off - ((n + 3) * sizeof(__uint16_t)); in putpair() 116 * -1 error 127 bp = (__uint16_t *)bufp->page; in __delpair() [all …]
|
D | hash.c | 1 /*- 72 /* Macros for min/max. */ 76 #ifndef MAX 77 #define MAX(a,b) (((a)>(b))?(a):(b)) macro 81 #define MOD(x, y) ((x) & ((y) - 1)) 87 #define ERROR (-1) 122 hashp->fp = -1; 130 hashp->flags = flags; 144 if ((hashp->fp = open(file, flags, mode)) == -1) 151 fstat64(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0) [all …]
|
/picolibc-latest/newlib/libc/tinystdio/ |
D | snprintf.c | 30 /* $Id: snprintf.c 1944 2009-04-01 23:12:20Z arcanum $ */ 40 /* Restrict max output length to INT_MAX, as snprintf() return in snprintf() 42 between estimated len and f.size field. So we can write a in snprintf() 43 negative value into f.size in the case of n was 0. Note, in snprintf() 44 that f.size will be a max number of nonzero symbols. */ in snprintf() 49 struct __file_str f = FDEV_SETUP_STRING_WRITE(s, n ? n - 1 : 0); in snprintf() 64 #pragma GCC diagnostic ignored "-Wmissing-attributes"
|
D | vsnprintf.c | 30 /* $Id: vsnprintf.c 1944 2009-04-01 23:12:20Z arcanum $ */ 39 /* Restrict max output length to INT_MAX, as snprintf() return in vsnprintf() 41 between estimated len and f.size field. So we can write a in vsnprintf() 42 negative value into f.size in the case of n was 0. Note, in vsnprintf() 43 that f.size will be a max number of nonzero symbols. */ in vsnprintf() 48 struct __file_str f = FDEV_SETUP_STRING_WRITE(s, n ? n - 1 : 0); in vsnprintf() 61 #pragma GCC diagnostic ignored "-Wmissing-attributes"
|
/picolibc-latest/test/ |
D | malloc_stress.c | 2 * SPDX-License-Identifier: BSD-3-Clause 53 randint(int max) in randint() argument 56 return random() % max; in randint() 65 for (i = 0; i < NUM_MALLOC - 1; i++) { in shuffle_order() 66 int j = randint(NUM_MALLOC - 1 - i) + i + 1; in shuffle_order() 102 size_t size = block_size[i]; in check_block() local 109 for (j = 0; j < size; j++) in check_block() 138 printf("non-free bytes in arena %zu free %zu\n", info.arena, info.fordblks); in check_malloc() 175 /* Test slowly increasing size of a block using realloc */ in main() 202 #pragma GCC diagnostic ignored "-Walloc-size-larger-than=PTRDIFF_MAX" in main() [all …]
|
D | test-memset.c | 2 * SPDX-License-Identifier: BSD-3-Clause 86 check(char *label, void *buf, size_t size, size_t start, size_t end, int c) in check() argument 92 for (p = 0; p < size; p++) { in check() 107 randrange(size_t max) in randrange() argument 112 for (pot = 1; pot && pot < max; pot <<= 1) in randrange() 116 rnd = random() & (pot - 1); in randrange() 117 if (rnd < max) in randrange() 145 memset(b + start, c, end - start); in test() 149 bzero(b + start, end - start); in test() 154 __aeabi_memset(b + start, end - start, c); in test() [all …]
|
D | test-funopen.c | 2 * SPDX-License-Identifier: BSD-3-Clause 60 #define max(a, b) ((SEEK_T) (a) > (SEEK_T) (b) ? (SEEK_T) (a) : (SEEK_T) (b)) macro 66 n = min(n, test_end - test_pos); in test_read() 76 n = min(n, sizeof(test_buf) - test_pos); in test_write() 79 test_end = max(test_end, test_pos); in test_write() 100 return -1; in test_seek() 130 check(ret == strlen(MESSAGE), "fread size"); in main()
|
/picolibc-latest/.github/workflows/ |
D | linux.yml | 6 - main 9 - main 14 group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} 15 cancel-in-progress: true 22 IMAGE_FILE: dockerimg-linux.tar.zst 23 IMAGE: picolibc-linux 24 PACKAGES_FILE: picolibc/.github/linux-packages.txt 25 EXTRA_FILE: picolibc/.github/linux-files.txt 28 cache-maker: 29 runs-on: ubuntu-latest [all …]
|
D | steps-head | 2 - name: Clone picolibc 7 - name: Restore the Docker Image 11 … key: ${{ env.IMAGE_FILE }}-${{ hashFiles( env.DOCKERFILE, env.PACKAGES_FILE, env.EXTRA_FILE ) }} 12 fail-on-cache-miss: true 14 - name: Load and Check the Docker Image 16 docker load -i $IMAGE_FILE 17 docker images -a $IMAGE 22 - name: install ccache 23 if: matrix.test == './.github/do-zephyr' 25 …wget -nv https://github.com/ccache/ccache/releases/download/v4.8.2/ccache-4.8.2-linux-x86_64.tar.xz [all …]
|
D | zephyr.yml | 6 - main 9 - main 14 group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} 15 cancel-in-progress: true 18 # .github/do-zephyr --buildtype release 22 DOCKERFILE: picolibc/.github/Dockerfile-zephyr 23 IMAGE_FILE: dockerimg-zephyr.tar.zst 25 PACKAGES_FILE: picolibc/.github/zephyr-packages.txt 26 EXTRA_FILE: picolibc/.github/zephyr-files.txt 29 cache-maker: [all …]
|
/picolibc-latest/newlib/libc/machine/rx/ |
D | strncat.S | 14 ;; r3 => Max number of bytes to copy 16 cmp #0, r3 ; If max is zero we have nothing to do. 41 mov #-1, r3 ; Search until we run out of memory. 62 .size _strncat, . - _strncat
|
D | strncmp.S | 14 ;; R3: max number of bytes to compare 43 mov #-1,r1 ; Carry not set, result should be negative 46 .size _strncmp, . - _strncmp
|
D | memchr.S | 13 ;; R3: max number to scan 15 …mov.b r2, r2 ; The mov.b below sign extends as it loads, so make sure that r2 is sign-extended as… 34 .size _memchr, . - _memchr
|
/picolibc-latest/newlib/libc/stdlib/ |
D | nano-memalign.c | 29 #include "nano-malloc.h" 36 * s: required size. 52 if ((align & (align-1)) != 0) in memalign() 58 align = MAX(align, MALLOC_MINSIZE); in memalign() 60 if (s > MALLOC_MAXSIZE - align) in memalign() 66 s = __align_up(MAX(s,1), MALLOC_CHUNK_ALIGN); in memalign() 80 offset = (size_t) (aligned_p - allocated); in memalign() 91 _set_size(new_chunk_p, _size(chunk_p) - offset); in memalign() 98 offset = _size(chunk_p) - chunk_size(s); in memalign() 103 *_size_ref(chunk_p) -= offset; in memalign()
|
D | nano-malloc.h | 65 /* -------------------------------------- 66 * | size | 67 * chunk->| When allocated: data | 70 * -------------------------------------- 73 * address of 'size' may not be aligned to MALLOC_CHUNK_ALIGN. But it 76 * size is set so that a chunk starting at chunk+size will be 79 * We can't use a single struct containing both size and next as that 80 * may insert padding between the size and pointer fields when 85 size_t size; member 104 /* nominal "page size" */ [all …]
|
D | nano-malloc.c | 29 #include "nano-malloc.h" 42 * already aligned - only ask for extra padding after we know we 56 return (void *)-1; in __malloc_sbrk_aligned() 61 return (void *)-1; in __malloc_sbrk_aligned() 65 /* sbrk returns -1 if fail to allocate */ in __malloc_sbrk_aligned() 66 if (p == (void *)-1) in __malloc_sbrk_aligned() 75 align_p = __align_up(p + MALLOC_HEAD, MALLOC_CHUNK_ALIGN) - MALLOC_HEAD; in __malloc_sbrk_aligned() 85 intptr_t adjust = align_p - p; in __malloc_sbrk_aligned() 88 return (void *) -1; in __malloc_sbrk_aligned() 104 size_t add_size = MAX(MALLOC_MINSIZE, new_size - _size(c)); in __malloc_grow_chunk() [all …]
|
/picolibc-latest/cmake/ |
D | TC-arm-none-eabi.ld | 2 * SPDX-License-Identifier: BSD-3-Clause 86 /* read-only data */ 99 /* Need to pre-align so that the symbols come after padding */ 132 /* Need to pre-align so that the symbols come after padding */ 165 PROVIDE( __data_size = __data_end - __data_start ); 166 PROVIDE( __data_source_size = __data_source_end - __data_source ); 176 PROVIDE( __tbss_offset = ADDR(.tbss) - ADDR(.tdata) ); 178 PROVIDE( __tls_size = __tls_end - __tls_base ); 179 PROVIDE( __tls_align = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss)) ); 180 PROVIDE( __arm32_tls_tcb_offset = MAX(8, __tls_align) ); [all …]
|
D | TC-microbit.ld | 2 * SPDX-License-Identifier: BSD-3-Clause 86 /* read-only data */ 99 /* Need to pre-align so that the symbols come after padding */ 132 /* Need to pre-align so that the symbols come after padding */ 165 PROVIDE( __data_size = __data_end - __data_start ); 166 PROVIDE( __data_source_size = __data_source_end - __data_source ); 176 PROVIDE( __tbss_offset = ADDR(.tbss) - ADDR(.tdata) ); 178 PROVIDE( __tls_size = __tls_end - __tls_base ); 179 PROVIDE( __tls_align = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss)) ); 180 PROVIDE( __arm32_tls_tcb_offset = MAX(8, __tls_align) ); [all …]
|
/picolibc-latest/ |
D | picolibc.ld.in | 2 * SPDX-License-Identifier: BSD-3-Clause 79 /* Need to pre-align so that the symbols come after padding */ 101 /* read-only data */ 175 /* Need to pre-align so that the symbols come after padding */ 213 PROVIDE( @PREFIX@__data_size = @PREFIX@__data_end - @PREFIX@__data_start ); 214 PROVIDE( @PREFIX@__data_source_size = @PREFIX@__data_source_end - @PREFIX@__data_source ); 224 PROVIDE( @PREFIX@__tbss_offset = ADDR(.tbss) - ADDR(.tdata) ); 226 PROVIDE( @PREFIX@__tls_size = @PREFIX@__tls_end - @PREFIX@__tls_base ); 227 PROVIDE( @PREFIX@__tls_align = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss)) ); 228 …IX@__tls_size_align = (@PREFIX@__tls_size + @PREFIX@__tls_align - 1) & ~(@PREFIX@__tls_align - 1)); [all …]
|
/picolibc-latest/newlib/libc/machine/xtensa/machine/ |
D | core-isa.h | 2 #include <xtensa/config/core-isa.h> 6 * xtensa/config/core-isa.h -- HAL definitions that are dependent on Xtensa 14 Copyright (c) 1999-2010 Tensilica Inc. 49 /*---------------------------------------------------------------------- 51 ----------------------------------------------------------------------*/ 53 #define XCHAL_HAVE_BE 0 /* big-endian byte ordering */ 57 #define XCHAL_MAX_INSTRUCTION_SIZE 3 /* max instr bytes (3..8) */ 59 #define XCHAL_HAVE_DENSITY 1 /* 16-bit instructions */ 60 #define XCHAL_HAVE_LOOPS 0 /* zero-overhead loops */ 62 #define XCHAL_HAVE_MINMAX 0 /* MIN/MAX instructions */ [all …]
|
/picolibc-latest/newlib/libc/machine/sh/ |
D | strncpy.S | 11 #define ZPAD_MASK(src, dst) addi src, -1, dst 14 byterev src, dst; addi dst, -1, dst; byterev dst, dst 29 addi r20, -8, r5 30 /* If the size is greater than 8, we know we can read beyond the first 37 ori r3, -8, r38 46 addi r5, -8, r36 52 stlo.q r22, -8, r0 54 sthi.q r22, -1, r0 58 // At end; we might re-read a few bytes when we fetch the last quad. 64 ldlo.q r7, -8, r1 [all …]
|