Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset fac0ac7 in mainline


Ignore:
Timestamp:
2018-05-15T18:48:49Z (3 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master
Children:
7c3fb9b, 99013b84
Parents:
47e00b83
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-05-15 17:23:07)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-05-15 18:48:49)
Message:

Fix the return value of memcpy_to/from_uspace().

Location:
kernel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/abs32le/src/abs32le.c

    r47e00b83 rfac0ac7  
    126126}
    127127
    128 errno_t memcpy_from_uspace(void *dst, const void *uspace_src, size_t size)
     128uintptr_t memcpy_from_uspace(void *dst, const void *uspace_src, size_t size)
    129129{
    130         return EOK;
     130        return 0;
    131131}
    132132
    133 errno_t memcpy_to_uspace(void *uspace_dst, const void *src, size_t size)
     133uintptr_t memcpy_to_uspace(void *uspace_dst, const void *src, size_t size)
    134134{
    135         return EOK;
     135        return 0;
    136136}
    137137
  • kernel/arch/riscv64/src/riscv64.c

    r47e00b83 rfac0ac7  
    143143}
    144144
    145 errno_t memcpy_from_uspace(void *dst, const void *uspace_src, size_t size)
     145uintptr_t memcpy_from_uspace(void *dst, const void *uspace_src, size_t size)
    146146{
    147         return EOK;
     147        return 0;
    148148}
    149149
    150 errno_t memcpy_to_uspace(void *uspace_dst, const void *src, size_t size)
     150uintptr_t memcpy_to_uspace(void *uspace_dst, const void *src, size_t size)
    151151{
    152         return EOK;
     152        return 0;
    153153}
    154154
  • kernel/generic/include/syscall/copy.h

    r47e00b83 rfac0ac7  
    4949/*
    5050 * This interface must be implemented by each architecture.
     51 * The functions return zero on failure and nonzero on success.
    5152 */
    52 extern errno_t memcpy_from_uspace(void *dst, const void *uspace_src, size_t size);
    53 extern errno_t memcpy_to_uspace(void *uspace_dst, const void *src, size_t size);
     53extern uintptr_t memcpy_from_uspace(void *dst, const void *uspace_src, size_t size);
     54extern uintptr_t memcpy_to_uspace(void *uspace_dst, const void *src, size_t size);
    5455
    5556#endif
  • kernel/generic/src/syscall/copy.c

    r47e00b83 rfac0ac7  
    9090        THREAD->in_copy_from_uspace = true;
    9191
    92         rc = memcpy_from_uspace(dst, uspace_src, size);
     92        rc = !memcpy_from_uspace(dst, uspace_src, size) ? EPERM : EOK;
    9393
    9494        THREAD->in_copy_from_uspace = false;
    9595
    9696        interrupts_restore(ipl);
    97         return !rc ? EPERM : EOK;
     97        return rc;
    9898}
    9999
     
    141141        THREAD->in_copy_to_uspace = true;
    142142
    143         rc = memcpy_to_uspace(uspace_dst, src, size);
     143        rc = !memcpy_to_uspace(uspace_dst, src, size) ? EPERM : EOK;
    144144
    145145        THREAD->in_copy_to_uspace = false;
    146146
    147147        interrupts_restore(ipl);
    148         return !rc ? EPERM : 0;
     148        return rc;
    149149}
    150150
Note: See TracChangeset for help on using the changeset viewer.