Changeset 105 for trunk


Ignore:
Timestamp:
Jun 30, 2017, 9:07:32 AM (7 years ago)
Author:
max@…
Message:

add a few atomic functions

Location:
trunk/hal/x86_64/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/core/hal_atomic.c

    r51 r105  
    11/*
    2  * hal_atomic.c - implementation of Generic Atomic Operations API for TSAR-MIPS32
    3  *
    4  * Author  Alain Greiner (2016)
     2 * hal_atomic.c - implementation of Generic Atomic Operations API for x86
    53 *
    6  * Copyright (c) UPMC Sorbonne Universites
    7  *
    8  * This file is part of ALMOS-MKH..
     4 * Copyright (c) 2017 Maxime Villard
    95 *
    10  * ALMOS-MKH. is free software; you can redistribute it and/or modify it
     6 * This file is part of ALMOS-MKH.
     7 *
     8 * ALMOS-MKH is free software; you can redistribute it and/or modify it
    119 * under the terms of the GNU General Public License as published by
    1210 * the Free Software Foundation; version 2.0 of the License.
    1311 *
    14  * ALMOS-MKH. is distributed in the hope that it will be useful, but
     12 * ALMOS-MKH is distributed in the hope that it will be useful, but
    1513 * WITHOUT ANY WARRANTY; without even the implied warranty of
    1614 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     
    2826                     int32_t    val )
    2927{
    30         x86_panic((char *)__func__);
     28        atomic_and_32((volatile uint32_t *)ptr, val);
    3129}
    3230
     
    3432                    int32_t    val )
    3533{
    36         x86_panic((char *)__func__);
     34        atomic_or_32((volatile uint32_t *)ptr, val);
    3735}
    3836
     
    4038                         int32_t   val )
    4139{
    42         x86_panic((char *)__func__);
    43         return 0;
     40        return atomic_add_32((volatile uint32_t *)ptr, val);
    4441}
    4542
     
    4845                       uint32_t   new )
    4946{
    50         x86_panic((char *)__func__);
    51         return 0;
     47        return (atomic_cas_32((volatile uint32_t *)ptr, old, new) == old);
    5248}
    5349
  • trunk/hal/x86_64/core/hal_remote.c

    r98 r105  
    11/*
    2  * hal_remote.c - implementation of Generic Remote Access API for TSAR-MIPS32
    3  *
    4  * Authors : Mohammed Karaoui (2015)
    5  *           Alain Greiner    (2016)
     2 * hal_remote.c - implementation of Generic Remote Access API x86
    63 *
    7  * Copyright (c) UPMC Sorbonne Universites
    8  *
    9  * This file is part of ALMOS-MKH..
     4 * Copyright (c) 2017 Maxime Villard
    105 *
    11  * ALMOS-MKH. is free software; you can redistribute it and/or modify it
     6 * This file is part of ALMOS-MKH.
     7 *
     8 * ALMOS-MKH is free software; you can redistribute it and/or modify it
    129 * under the terms of the GNU General Public License as published by
    1310 * the Free Software Foundation; version 2.0 of the License.
    1411 *
    15  * ALMOS-MKH. is distributed in the hope that it will be useful, but
     12 * ALMOS-MKH is distributed in the hope that it will be useful, but
    1613 * WITHOUT ANY WARRANTY; without even the implied warranty of
    1714 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Note: See TracChangeset for help on using the changeset viewer.