Elliott Hughes | 2faa5f1 | 2012-01-30 14:42:07 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 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 | */ |
Ian Rogers | 9651f42 | 2011-09-19 20:26:07 -0700 | [diff] [blame] | 16 | |
| 17 | #ifndef ART_SRC_ASM_SUPPORT_H_ |
| 18 | #define ART_SRC_ASM_SUPPORT_H_ |
| 19 | |
Ian Rogers | 4b07f17 | 2013-02-07 08:29:42 -0800 | [diff] [blame] | 20 | // Value loaded into rSUSPEND for quick. When this value is counted down to zero we do a suspend |
| 21 | // check. |
Ian Rogers | 4a510d8 | 2011-10-09 14:30:24 -0700 | [diff] [blame] | 22 | #define SUSPEND_CHECK_INTERVAL (1000) |
| 23 | |
Ian Rogers | 4b07f17 | 2013-02-07 08:29:42 -0800 | [diff] [blame] | 24 | // Offsets within java.lang.String. |
buzbee | fc9e6fa | 2012-03-23 15:14:29 -0700 | [diff] [blame] | 25 | #define STRING_VALUE_OFFSET 8 |
| 26 | #define STRING_COUNT_OFFSET 12 |
| 27 | #define STRING_OFFSET_OFFSET 20 |
| 28 | #define STRING_DATA_OFFSET 12 |
| 29 | |
Jeff Hao | 5d91730 | 2013-02-27 17:57:33 -0800 | [diff] [blame] | 30 | // Offset of field Method::code_ |
| 31 | #define METHOD_CODE_OFFSET 32 |
| 32 | |
buzbee | c1f4504 | 2011-09-21 16:03:19 -0700 | [diff] [blame] | 33 | #if defined(__arm__) |
Ian Rogers | 4b07f17 | 2013-02-07 08:29:42 -0800 | [diff] [blame] | 34 | // Register holding suspend check count down. |
buzbee | c1f4504 | 2011-09-21 16:03:19 -0700 | [diff] [blame] | 35 | #define rSUSPEND r4 |
Ian Rogers | 4b07f17 | 2013-02-07 08:29:42 -0800 | [diff] [blame] | 36 | // Register holding Thread::Current(). |
buzbee | c1f4504 | 2011-09-21 16:03:19 -0700 | [diff] [blame] | 37 | #define rSELF r9 |
Ian Rogers | 4f0d07c | 2011-10-06 23:38:47 -0700 | [diff] [blame] | 38 | // Offset of field Thread::suspend_count_ verified in InitCpu |
Ian Rogers | 474b6da | 2012-09-25 00:20:38 -0700 | [diff] [blame] | 39 | #define THREAD_FLAGS_OFFSET 0 |
Brian Carlstrom | bbdb143 | 2012-01-23 13:19:41 -0800 | [diff] [blame] | 40 | // Offset of field Thread::exception_ verified in InitCpu |
Ian Rogers | 474b6da | 2012-09-25 00:20:38 -0700 | [diff] [blame] | 41 | #define THREAD_EXCEPTION_OFFSET 12 |
jeffhao | 7fbee07 | 2012-08-24 17:56:54 -0700 | [diff] [blame] | 42 | #elif defined(__mips__) |
Ian Rogers | 4b07f17 | 2013-02-07 08:29:42 -0800 | [diff] [blame] | 43 | // Register holding suspend check count down. |
jeffhao | 7fbee07 | 2012-08-24 17:56:54 -0700 | [diff] [blame] | 44 | #define rSUSPEND $s0 |
Ian Rogers | 4b07f17 | 2013-02-07 08:29:42 -0800 | [diff] [blame] | 45 | // Register holding Thread::Current(). |
jeffhao | 7fbee07 | 2012-08-24 17:56:54 -0700 | [diff] [blame] | 46 | #define rSELF $s1 |
| 47 | // Offset of field Thread::suspend_count_ verified in InitCpu |
Ian Rogers | 474b6da | 2012-09-25 00:20:38 -0700 | [diff] [blame] | 48 | #define THREAD_FLAGS_OFFSET 0 |
jeffhao | 7fbee07 | 2012-08-24 17:56:54 -0700 | [diff] [blame] | 49 | // Offset of field Thread::exception_ verified in InitCpu |
Ian Rogers | 474b6da | 2012-09-25 00:20:38 -0700 | [diff] [blame] | 50 | #define THREAD_EXCEPTION_OFFSET 12 |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 51 | #elif defined(__i386__) |
Ian Rogers | 9651f42 | 2011-09-19 20:26:07 -0700 | [diff] [blame] | 52 | // Offset of field Thread::self_ verified in InitCpu |
Ian Rogers | 474b6da | 2012-09-25 00:20:38 -0700 | [diff] [blame] | 53 | #define THREAD_SELF_OFFSET 40 |
jeffhao | d66a875 | 2012-05-22 15:30:16 -0700 | [diff] [blame] | 54 | // Offset of field Thread::exception_ verified in InitCpu |
Ian Rogers | 474b6da | 2012-09-25 00:20:38 -0700 | [diff] [blame] | 55 | #define THREAD_EXCEPTION_OFFSET 12 |
Ian Rogers | 9651f42 | 2011-09-19 20:26:07 -0700 | [diff] [blame] | 56 | #endif |
| 57 | |
| 58 | #endif // ART_SRC_ASM_SUPPORT_H_ |