blob: b2f8126ded3e6f34b2c34ab9797dcd78894c085f [file] [log] [blame]
Elliott Hughes2faa5f12012-01-30 14:42:07 -08001/*
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 Rogers9651f422011-09-19 20:26:07 -070016
17#ifndef ART_SRC_ASM_SUPPORT_H_
18#define ART_SRC_ASM_SUPPORT_H_
19
Ian Rogers4a510d82011-10-09 14:30:24 -070020#define SUSPEND_CHECK_INTERVAL (1000)
21
buzbeefc9e6fa2012-03-23 15:14:29 -070022#define STRING_VALUE_OFFSET 8
23#define STRING_COUNT_OFFSET 12
24#define STRING_OFFSET_OFFSET 20
25#define STRING_DATA_OFFSET 12
26
buzbeec1f45042011-09-21 16:03:19 -070027#if defined(__arm__)
28#define rSUSPEND r4
29#define rSELF r9
30#define rLR r14
Ian Rogers4f0d07c2011-10-06 23:38:47 -070031// Offset of field Thread::suspend_count_ verified in InitCpu
Ian Rogers474b6da2012-09-25 00:20:38 -070032#define THREAD_FLAGS_OFFSET 0
Brian Carlstrombbdb1432012-01-23 13:19:41 -080033// Offset of field Thread::exception_ verified in InitCpu
Ian Rogers474b6da2012-09-25 00:20:38 -070034#define THREAD_EXCEPTION_OFFSET 12
jeffhao7fbee072012-08-24 17:56:54 -070035#elif defined(__mips__)
36#define rSUSPEND $s0
37#define rSELF $s1
38// Offset of field Thread::suspend_count_ verified in InitCpu
Ian Rogers474b6da2012-09-25 00:20:38 -070039#define THREAD_FLAGS_OFFSET 0
jeffhao7fbee072012-08-24 17:56:54 -070040// Offset of field Thread::exception_ verified in InitCpu
Ian Rogers474b6da2012-09-25 00:20:38 -070041#define THREAD_EXCEPTION_OFFSET 12
Ian Rogersff1ed472011-09-20 13:46:24 -070042#elif defined(__i386__)
Ian Rogers9651f422011-09-19 20:26:07 -070043// Offset of field Thread::self_ verified in InitCpu
Ian Rogers474b6da2012-09-25 00:20:38 -070044#define THREAD_SELF_OFFSET 40
jeffhaod66a8752012-05-22 15:30:16 -070045// Offset of field Thread::exception_ verified in InitCpu
Ian Rogers474b6da2012-09-25 00:20:38 -070046#define THREAD_EXCEPTION_OFFSET 12
Ian Rogers9651f422011-09-19 20:26:07 -070047#endif
48
49#endif // ART_SRC_ASM_SUPPORT_H_