Igor Murashkin | 311fdf5 | 2016-07-22 15:59:16 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | // Export lockword values. |
| 18 | |
| 19 | #if defined(DEFINE_INCLUDE_DEPENDENCIES) |
| 20 | #include "lock_word.h" // art::LockWord |
| 21 | #endif |
| 22 | |
| 23 | #define DEFINE_LOCK_WORD_EXPR(macro_name, type, constant_field_name) \ |
| 24 | DEFINE_EXPR(LOCK_WORD_ ## macro_name, type, art::LockWord::constant_field_name) |
| 25 | |
Vladimir Marko | c8b1d5e | 2018-05-15 16:07:12 +0100 | [diff] [blame] | 26 | // FIXME: The naming is inconsistent, the `Shifted` -> `_SHIFTED` suffix is sometimes missing. |
Igor Murashkin | 311fdf5 | 2016-07-22 15:59:16 -0700 | [diff] [blame] | 27 | DEFINE_LOCK_WORD_EXPR(STATE_SHIFT, int32_t, kStateShift) |
Vladimir Marko | c8b1d5e | 2018-05-15 16:07:12 +0100 | [diff] [blame] | 28 | DEFINE_LOCK_WORD_EXPR(STATE_MASK_SHIFTED, uint32_t, kStateMaskShifted) |
Igor Murashkin | 311fdf5 | 2016-07-22 15:59:16 -0700 | [diff] [blame] | 29 | DEFINE_LOCK_WORD_EXPR(READ_BARRIER_STATE_SHIFT, int32_t, kReadBarrierStateShift) |
Vladimir Marko | c8b1d5e | 2018-05-15 16:07:12 +0100 | [diff] [blame] | 30 | DEFINE_LOCK_WORD_EXPR(READ_BARRIER_STATE_MASK, uint32_t, kReadBarrierStateMaskShifted) |
Igor Murashkin | 311fdf5 | 2016-07-22 15:59:16 -0700 | [diff] [blame] | 31 | DEFINE_LOCK_WORD_EXPR(READ_BARRIER_STATE_MASK_TOGGLED, uint32_t, kReadBarrierStateMaskShiftedToggled) |
Vladimir Marko | c8b1d5e | 2018-05-15 16:07:12 +0100 | [diff] [blame] | 32 | DEFINE_LOCK_WORD_EXPR(THIN_LOCK_COUNT_SIZE, int32_t, kThinLockCountSize) |
| 33 | DEFINE_LOCK_WORD_EXPR(THIN_LOCK_COUNT_SHIFT, int32_t, kThinLockCountShift) |
| 34 | DEFINE_LOCK_WORD_EXPR(THIN_LOCK_COUNT_MASK_SHIFTED, uint32_t, kThinLockCountMaskShifted) |
| 35 | DEFINE_LOCK_WORD_EXPR(THIN_LOCK_COUNT_ONE, uint32_t, kThinLockCountOne) |
| 36 | DEFINE_LOCK_WORD_EXPR(THIN_LOCK_OWNER_MASK_SHIFTED, uint32_t, kThinLockOwnerMaskShifted) |
Igor Murashkin | 311fdf5 | 2016-07-22 15:59:16 -0700 | [diff] [blame] | 37 | |
Vladimir Marko | c8b1d5e | 2018-05-15 16:07:12 +0100 | [diff] [blame] | 38 | DEFINE_LOCK_WORD_EXPR(STATE_FORWARDING_ADDRESS, uint32_t, kStateForwardingAddress) |
Mathieu Chartier | 1cf194f | 2016-11-01 20:13:24 -0700 | [diff] [blame] | 39 | DEFINE_LOCK_WORD_EXPR(STATE_FORWARDING_ADDRESS_OVERFLOW, uint32_t, kStateForwardingAddressOverflow) |
| 40 | DEFINE_LOCK_WORD_EXPR(STATE_FORWARDING_ADDRESS_SHIFT, uint32_t, kForwardingAddressShift) |
| 41 | |
Vladimir Marko | c8b1d5e | 2018-05-15 16:07:12 +0100 | [diff] [blame] | 42 | DEFINE_LOCK_WORD_EXPR(GC_STATE_MASK_SHIFTED, uint32_t, kGCStateMaskShifted) |
Mathieu Chartier | 36a270a | 2016-07-28 18:08:51 -0700 | [diff] [blame] | 43 | DEFINE_LOCK_WORD_EXPR(GC_STATE_MASK_SHIFTED_TOGGLED, uint32_t, kGCStateMaskShiftedToggled) |
Vladimir Marko | c8b1d5e | 2018-05-15 16:07:12 +0100 | [diff] [blame] | 44 | DEFINE_LOCK_WORD_EXPR(GC_STATE_SIZE, int32_t, kGCStateSize) |
| 45 | DEFINE_LOCK_WORD_EXPR(GC_STATE_SHIFT, int32_t, kGCStateShift) |
Mathieu Chartier | 36a270a | 2016-07-28 18:08:51 -0700 | [diff] [blame] | 46 | |
Vladimir Marko | c8b1d5e | 2018-05-15 16:07:12 +0100 | [diff] [blame] | 47 | DEFINE_LOCK_WORD_EXPR(MARK_BIT_SHIFT, int32_t, kMarkBitStateShift) |
| 48 | DEFINE_LOCK_WORD_EXPR(MARK_BIT_MASK_SHIFTED, uint32_t, kMarkBitStateMaskShifted) |
Mathieu Chartier | 36a270a | 2016-07-28 18:08:51 -0700 | [diff] [blame] | 49 | |
Igor Murashkin | 311fdf5 | 2016-07-22 15:59:16 -0700 | [diff] [blame] | 50 | #undef DEFINE_LOCK_WORD_EXPR |
| 51 | |