X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fsvm%2Fssvm.h;h=1c0373f126c3cdea6479152c695a2c09130c7d8f;hb=c5df8c71c;hp=09e1707450bd4e612656defcd3d63f0663f7cc7a;hpb=a332c46a51f9b4e13963340dfee1318e7513c124;p=vpp.git diff --git a/src/svm/ssvm.h b/src/svm/ssvm.h index 09e1707450b..1c0373f126c 100644 --- a/src/svm/ssvm.h +++ b/src/svm/ssvm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Cisco and/or its affiliates. + * Copyright (c) 2015-2019 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: @@ -37,7 +37,6 @@ #include #include #include -#include #ifndef MMAP_PAGESIZE #define MMAP_PAGESIZE (clib_mem_get_page_size()) @@ -65,9 +64,9 @@ typedef struct void *heap; /* Segment must be mapped at this address, or no supper */ - u64 ssvm_va; + uword ssvm_va; /* The actual mmap size */ - u64 ssvm_size; + uword ssvm_size; u32 master_pid; u32 slave_pid; u8 *name; @@ -104,7 +103,7 @@ ssvm_lock (ssvm_shared_header_t * h, u32 my_pid, u32 tag) return; } - while (__sync_lock_test_and_set (&h->lock, 1)) + while (clib_atomic_test_and_set (&h->lock)) ; h->owner_pid = my_pid; @@ -115,7 +114,7 @@ ssvm_lock (ssvm_shared_header_t * h, u32 my_pid, u32 tag) always_inline void ssvm_lock_non_recursive (ssvm_shared_header_t * h, u32 tag) { - while (__sync_lock_test_and_set (&h->lock, 1)) + while (clib_atomic_test_and_set (&h->lock)) ; h->tag = tag;