Changeset b169619 in mainline for kernel/generic
- Timestamp:
- 2023-10-27T17:38:32Z (2 years ago)
- Branches:
- master, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 44e8541
- Parents:
- c89ae25
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-10-27 13:19:20)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-10-27 17:38:32)
- Location:
- kernel/generic
- Files:
-
- 1 added
- 2 deleted
- 21 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/cc.h
rc89ae25 rb169619 38 38 39 39 #ifndef __clang__ 40 #define ATTRIBUTE_OPTIMIZE(opt) \41 __attribute__ ((optimize(opt)))42 40 #define ATTRIBUTE_USED \ 43 41 __attribute__ ((used)) 44 42 #else 45 #define ATTRIBUTE_OPTIMIZE(opt)46 43 #define ATTRIBUTE_USED 47 44 #endif -
kernel/generic/include/cpu/cpu_mask.h
rc89ae25 rb169619 37 37 #include <cpu.h> 38 38 #include <config.h> 39 #include < lib/memfnc.h>39 #include <memw.h> 40 40 41 41 /** Iterates over all cpu id's whose bit is included in the cpu mask. -
kernel/generic/include/memw.h
rc89ae25 rb169619 38 38 #include <stddef.h> 39 39 #include <stdint.h> 40 #include <cc.h>41 40 42 #ifdef CONFIG_LTO 43 #define DO_NOT_DISCARD ATTRIBUTE_USED 44 #else 45 #define DO_NOT_DISCARD 46 #endif 47 48 #define memset(dst, val, cnt) __builtin_memset((dst), (val), (cnt)) 49 #define memcpy(dst, src, cnt) __builtin_memcpy((dst), (src), (cnt)) 50 #define memcmp(s1, s2, cnt) __builtin_memcmp((s1), (s2), (cnt)) 41 #include <mem.h> 51 42 52 43 extern void memsetb(void *, size_t, uint8_t) … … 54 45 extern void memsetw(void *, size_t, uint16_t) 55 46 __attribute__((nonnull(1))); 56 extern void *memmove(void *, const void *, size_t)57 __attribute__((nonnull(1, 2))) DO_NOT_DISCARD;58 47 59 48 #endif -
kernel/generic/meson.build
rc89ae25 rb169619 36 36 37 37 generic_src += files( 38 'common/stdc/mem.c', 39 38 40 'src/adt/bitmap.c', 39 41 'src/adt/hash_table.c', … … 73 75 'src/lib/halt.c', 74 76 'src/lib/mem.c', 75 'src/lib/memfnc.c',76 77 'src/lib/ra.c', 77 78 'src/lib/rd.c', -
kernel/generic/src/cpu/cpu.c
rc89ae25 rb169619 45 45 #include <config.h> 46 46 #include <panic.h> 47 #include <mem .h>47 #include <memw.h> 48 48 #include <adt/list.h> 49 49 #include <stdio.h> -
kernel/generic/src/ddi/ddi.c
rc89ae25 rb169619 54 54 #include <align.h> 55 55 #include <errno.h> 56 #include <mem .h>56 #include <memw.h> 57 57 #include <trace.h> 58 58 #include <bitops.h> -
kernel/generic/src/ddi/irq.c
rc89ae25 rb169619 47 47 #include <console/console.h> 48 48 #include <interrupt.h> 49 #include <mem .h>49 #include <memw.h> 50 50 #include <arch.h> 51 51 -
kernel/generic/src/ipc/ipc.c
rc89ae25 rb169619 54 54 #include <arch.h> 55 55 #include <proc/task.h> 56 #include <mem .h>56 #include <memw.h> 57 57 #include <stdio.h> 58 58 #include <console/console.h> -
kernel/generic/src/ipc/sysipc.c
rc89ae25 rb169619 36 36 #include <assert.h> 37 37 #include <errno.h> 38 #include <mem .h>38 #include <memw.h> 39 39 #include <ipc/ipc.h> 40 40 #include <abi/ipc/methods.h> -
kernel/generic/src/lib/gsort.c
rc89ae25 rb169619 41 41 42 42 #include <gsort.h> 43 #include <mem .h>43 #include <memw.h> 44 44 #include <stdlib.h> 45 45 -
kernel/generic/src/lib/mem.c
rc89ae25 rb169619 41 41 */ 42 42 43 #include <mem .h>43 #include <memw.h> 44 44 #include <typedefs.h> 45 45 … … 77 77 } 78 78 79 /** Move memory block with possible overlapping.80 *81 * Copy cnt bytes from src address to dst address. The source82 * and destination memory areas may overlap.83 *84 * @param dst Destination address to copy to.85 * @param src Source address to copy from.86 * @param cnt Number of bytes to copy.87 *88 * @return Destination address.89 *90 */91 void *memmove(void *dst, const void *src, size_t cnt)92 {93 /* Nothing to do? */94 if (src == dst)95 return dst;96 97 /* Non-overlapping? */98 if ((dst >= src + cnt) || (src >= dst + cnt))99 return memcpy(dst, src, cnt);100 101 uint8_t *dp;102 const uint8_t *sp;103 104 /* Which direction? */105 if (src > dst) {106 /* Forwards. */107 dp = dst;108 sp = src;109 110 while (cnt-- != 0)111 *dp++ = *sp++;112 } else {113 /* Backwards. */114 dp = dst + (cnt - 1);115 sp = src + (cnt - 1);116 117 while (cnt-- != 0)118 *dp-- = *sp--;119 }120 121 return dst;122 }123 124 79 /** @} 125 80 */ -
kernel/generic/src/lib/ubsan.c
rc89ae25 rb169619 10 10 #include <stddef.h> 11 11 #include <panic.h> 12 #include <mem .h>12 #include <memw.h> 13 13 14 14 #define PRINTF(...) printf(__VA_ARGS__) -
kernel/generic/src/main/kinit.c
rc89ae25 rb169619 61 61 #include <stdio.h> 62 62 #include <log.h> 63 #include <mem .h>63 #include <memw.h> 64 64 #include <console/console.h> 65 65 #include <interrupt.h> -
kernel/generic/src/mm/as.c
rc89ae25 rb169619 69 69 #include <assert.h> 70 70 #include <stdio.h> 71 #include <mem .h>71 #include <memw.h> 72 72 #include <macros.h> 73 73 #include <bitops.h> -
kernel/generic/src/mm/backend_anon.c
rc89ae25 rb169619 51 51 #include <typedefs.h> 52 52 #include <align.h> 53 #include <mem .h>53 #include <memw.h> 54 54 #include <arch.h> 55 55 -
kernel/generic/src/mm/backend_elf.c
rc89ae25 rb169619 48 48 #include <genarch/mm/page_ht.h> 49 49 #include <align.h> 50 #include <mem .h>50 #include <memw.h> 51 51 #include <macros.h> 52 52 #include <arch.h> -
kernel/generic/src/mm/malloc.c
rc89ae25 rb169619 34 34 #include <bitops.h> 35 35 #include <mm/slab.h> 36 #include <mem .h>36 #include <memw.h> 37 37 #include <main/main.h> // malloc_init() 38 38 #include <macros.h> -
kernel/generic/src/mm/slab.c
rc89ae25 rb169619 106 106 #include <mm/slab.h> 107 107 #include <adt/list.h> 108 #include <mem .h>108 #include <memw.h> 109 109 #include <align.h> 110 110 #include <mm/frame.h> -
kernel/generic/src/printf/vsnprintf.c
rc89ae25 rb169619 36 36 #include <printf/printf_core.h> 37 37 #include <str.h> 38 #include <mem .h>38 #include <memw.h> 39 39 #include <errno.h> 40 40 -
kernel/generic/src/proc/thread.c
rc89ae25 rb169619 62 62 #include <arch/faddr.h> 63 63 #include <atomic.h> 64 #include <mem .h>64 #include <memw.h> 65 65 #include <stdio.h> 66 66 #include <stdlib.h> -
kernel/generic/src/synch/waitq.c
rc89ae25 rb169619 59 59 #include <adt/list.h> 60 60 #include <arch/cycle.h> 61 #include <mem .h>61 #include <memw.h> 62 62 63 63 /** Initialize wait queue -
kernel/generic/src/udebug/udebug_ops.c
rc89ae25 rb169619 51 51 #include <udebug/udebug.h> 52 52 #include <udebug/udebug_ops.h> 53 #include <mem .h>53 #include <memw.h> 54 54 #include <stdlib.h> 55 55
Note:
See TracChangeset
for help on using the changeset viewer.