Changeset 133461c in mainline for uspace/lib/c/arch/arm32/src/atomic.c


Ignore:
Timestamp:
2023-10-22T17:49:28Z (13 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1c6c3e1d, cc73f6d4
Parents:
78f0422c
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-10-22 17:44:39)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-10-22 17:49:28)
Message:

Align arm32 atomic op prototypes with compiler's expectations

Based on a patch by @vhotspur, but without explicit casts
between pointer types. Those are evil footguns.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/arm32/src/atomic.c

    r78f0422c r133461c  
    3838volatile unsigned *ras_page;
    3939
    40 bool __atomic_compare_exchange_4(volatile unsigned *mem, unsigned *expected, unsigned desired, bool weak, int success, int failure)
     40bool __atomic_compare_exchange_4(volatile void *mem0, void *expected0,
     41    unsigned desired, bool weak, int success, int failure)
    4142{
     43        volatile unsigned *mem = mem0;
     44        unsigned *expected = expected0;
     45
    4246        (void) success;
    4347        (void) failure;
     
    8286}
    8387
    84 unsigned short __atomic_fetch_add_2(volatile unsigned short *mem, unsigned short val, int model)
     88unsigned short __atomic_fetch_add_2(volatile void *mem0, unsigned short val,
     89    int model)
    8590{
     91        volatile unsigned short *mem = mem0;
     92
    8693        (void) model;
    8794
     
    116123}
    117124
    118 unsigned __atomic_fetch_add_4(volatile unsigned *mem, unsigned val, int model)
     125unsigned __atomic_fetch_add_4(volatile void *mem0, unsigned val, int model)
    119126{
     127        volatile unsigned *mem = mem0;
     128
    120129        (void) model;
    121130
     
    150159}
    151160
    152 unsigned __atomic_fetch_sub_4(volatile unsigned *mem, unsigned val, int model)
     161unsigned __atomic_fetch_sub_4(volatile void *mem, unsigned val, int model)
    153162{
    154163        return __atomic_fetch_add_4(mem, -val, model);
Note: See TracChangeset for help on using the changeset viewer.