Changeset 2bcf6c6 in mainline for kernel/test/atomic/atomic1.c


Ignore:
Timestamp:
2012-07-27T13:34:48Z (12 years ago)
Author:
Adam Hraska <adam.hraska+hos@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4ec9ea41
Parents:
3bb732b
Message:

Added atomic_cas_ptr() including a sanity test for ia32 and amd64.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/test/atomic/atomic1.c

    r3bb732b r2bcf6c6  
    6060                return "Failed atomic_get() after atomic_predec()";
    6161       
     62        void *ptr = 0;
     63        void *a_ptr = &a;
     64        if (atomic_cas_ptr(&ptr, 0, a_ptr) != 0)
     65                return "Failed atomic_cas_ptr(): bad return value";
     66        if (ptr != a_ptr)
     67                return "Failed atomic_cas_ptr(): bad pointer value";
     68        if (atomic_cas_ptr(&ptr, 0, 0) != a_ptr)
     69                return "Failed atomic_cas_ptr(): indicated change";
     70        if (ptr != a_ptr)
     71                return "Failed atomic_cas_ptr(): changed the ptr";
     72       
    6273        return NULL;
    6374}
Note: See TracChangeset for help on using the changeset viewer.