Changeset 34120f10 in mainline for kernel/generic/src


Ignore:
Timestamp:
2023-10-27T19:38:31Z (21 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, topic/msim-upgrade, topic/simplify-dev-export
Children:
63ed840
Parents:
c89ae25 (diff), 694ca3d6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge code deduplication work

TL;DR: Added directory /common, which now contains the sole existing
copy of ADT, printf_core, and a few other pieces. Should make changes
to any of those less of a headache.

Location:
kernel/generic/src
Files:
7 deleted
20 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/console/kconsole.c

    rc89ae25 r34120f10  
    599599                /* It's a number - convert it */
    600600                uint64_t value;
    601                 char *end;
     601                const char *end;
    602602                errno_t rc = str_uint64_t(text, &end, 0, false, &value);
    603603                if (end != text + len)
  • kernel/generic/src/cpu/cpu.c

    rc89ae25 r34120f10  
    4545#include <config.h>
    4646#include <panic.h>
    47 #include <mem.h>
     47#include <memw.h>
    4848#include <adt/list.h>
    4949#include <stdio.h>
  • kernel/generic/src/ddi/ddi.c

    rc89ae25 r34120f10  
    5454#include <align.h>
    5555#include <errno.h>
    56 #include <mem.h>
     56#include <memw.h>
    5757#include <trace.h>
    5858#include <bitops.h>
  • kernel/generic/src/ddi/irq.c

    rc89ae25 r34120f10  
    4747#include <console/console.h>
    4848#include <interrupt.h>
    49 #include <mem.h>
     49#include <memw.h>
    5050#include <arch.h>
    5151
  • kernel/generic/src/ipc/ipc.c

    rc89ae25 r34120f10  
    5454#include <arch.h>
    5555#include <proc/task.h>
    56 #include <mem.h>
     56#include <memw.h>
    5757#include <stdio.h>
    5858#include <console/console.h>
  • kernel/generic/src/ipc/sysipc.c

    rc89ae25 r34120f10  
    3636#include <assert.h>
    3737#include <errno.h>
    38 #include <mem.h>
     38#include <memw.h>
    3939#include <ipc/ipc.h>
    4040#include <abi/ipc/methods.h>
  • kernel/generic/src/lib/mem.c

    rc89ae25 r34120f10  
    4141 */
    4242
    43 #include <mem.h>
     43#include <memw.h>
    4444#include <typedefs.h>
    4545
     
    7777}
    7878
    79 /** Move memory block with possible overlapping.
    80  *
    81  * Copy cnt bytes from src address to dst address. The source
    82  * 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 
    12479/** @}
    12580 */
  • kernel/generic/src/lib/ubsan.c

    rc89ae25 r34120f10  
    1010#include <stddef.h>
    1111#include <panic.h>
    12 #include <mem.h>
     12#include <memw.h>
    1313
    1414#define PRINTF(...) printf(__VA_ARGS__)
  • kernel/generic/src/main/kinit.c

    rc89ae25 r34120f10  
    6161#include <stdio.h>
    6262#include <log.h>
    63 #include <mem.h>
     63#include <memw.h>
    6464#include <console/console.h>
    6565#include <interrupt.h>
     
    6969#include <ipc/ipc.h>
    7070#include <str.h>
     71#include <str_error.h>
    7172#include <sysinfo/stats.h>
    7273#include <sysinfo/sysinfo.h>
  • kernel/generic/src/mm/as.c

    rc89ae25 r34120f10  
    6969#include <assert.h>
    7070#include <stdio.h>
    71 #include <mem.h>
     71#include <memw.h>
    7272#include <macros.h>
    7373#include <bitops.h>
  • kernel/generic/src/mm/backend_anon.c

    rc89ae25 r34120f10  
    5151#include <typedefs.h>
    5252#include <align.h>
    53 #include <mem.h>
     53#include <memw.h>
    5454#include <arch.h>
    5555
  • kernel/generic/src/mm/backend_elf.c

    rc89ae25 r34120f10  
    4848#include <genarch/mm/page_ht.h>
    4949#include <align.h>
    50 #include <mem.h>
     50#include <memw.h>
    5151#include <macros.h>
    5252#include <arch.h>
  • kernel/generic/src/mm/backend_user.c

    rc89ae25 r34120f10  
    5050#include <log.h>
    5151#include <str.h>
     52#include <str_error.h>
    5253
    5354static bool user_create(as_area_t *);
  • kernel/generic/src/mm/malloc.c

    rc89ae25 r34120f10  
    3434#include <bitops.h>
    3535#include <mm/slab.h>
    36 #include <mem.h>
     36#include <memw.h>
    3737#include <main/main.h> // malloc_init()
    3838#include <macros.h>
  • kernel/generic/src/mm/slab.c

    rc89ae25 r34120f10  
    106106#include <mm/slab.h>
    107107#include <adt/list.h>
    108 #include <mem.h>
     108#include <memw.h>
    109109#include <align.h>
    110110#include <mm/frame.h>
  • kernel/generic/src/printf/vsnprintf.c

    rc89ae25 r34120f10  
    3636#include <printf/printf_core.h>
    3737#include <str.h>
    38 #include <mem.h>
     38#include <memw.h>
    3939#include <errno.h>
    4040
  • kernel/generic/src/proc/program.c

    rc89ae25 r34120f10  
    4949#include <lib/elf_load.h>
    5050#include <str.h>
     51#include <str_error.h>
    5152#include <log.h>
    5253#include <syscall/copy.h>
  • kernel/generic/src/proc/thread.c

    rc89ae25 r34120f10  
    6262#include <arch/faddr.h>
    6363#include <atomic.h>
    64 #include <mem.h>
     64#include <memw.h>
    6565#include <stdio.h>
    6666#include <stdlib.h>
  • kernel/generic/src/synch/waitq.c

    rc89ae25 r34120f10  
    5959#include <adt/list.h>
    6060#include <arch/cycle.h>
    61 #include <mem.h>
     61#include <memw.h>
    6262
    6363/** Initialize wait queue
  • kernel/generic/src/udebug/udebug_ops.c

    rc89ae25 r34120f10  
    5151#include <udebug/udebug.h>
    5252#include <udebug/udebug_ops.h>
    53 #include <mem.h>
     53#include <memw.h>
    5454#include <stdlib.h>
    5555
Note: See TracChangeset for help on using the changeset viewer.