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 | bdb0391 | 2011-09-14 00:55:44 -0700 | [diff] [blame] | 16 | |
| 17 | #ifndef ART_SRC_CONTEXT_ARM_H_ |
| 18 | #define ART_SRC_CONTEXT_ARM_H_ |
| 19 | |
| 20 | #include "constants_arm.h" |
| 21 | #include "context.h" |
| 22 | |
| 23 | namespace art { |
| 24 | namespace arm { |
| 25 | |
| 26 | class ArmContext : public Context { |
| 27 | public: |
| 28 | ArmContext(); |
| 29 | virtual ~ArmContext() {} |
| 30 | |
| 31 | virtual void FillCalleeSaves(const Frame& fr); |
| 32 | |
| 33 | virtual void SetSP(uintptr_t new_sp) { |
| 34 | gprs_[SP] = new_sp; |
| 35 | } |
| 36 | |
| 37 | virtual void SetPC(uintptr_t new_pc) { |
| 38 | gprs_[PC] = new_pc; |
| 39 | } |
| 40 | |
Ian Rogers | d6b1f61 | 2011-09-27 13:38:14 -0700 | [diff] [blame] | 41 | virtual uintptr_t GetGPR(uint32_t reg) { |
| 42 | CHECK_GE(reg, 0u); |
| 43 | CHECK_LT(reg, 16u); |
| 44 | return gprs_[reg]; |
| 45 | } |
| 46 | |
Ian Rogers | bdb0391 | 2011-09-14 00:55:44 -0700 | [diff] [blame] | 47 | virtual void DoLongJump(); |
| 48 | |
| 49 | private: |
| 50 | uintptr_t gprs_[16]; |
Ian Rogers | 15fdb8c | 2011-09-25 15:45:07 -0700 | [diff] [blame] | 51 | uint32_t fprs_[32]; |
Ian Rogers | bdb0391 | 2011-09-14 00:55:44 -0700 | [diff] [blame] | 52 | }; |
| 53 | |
| 54 | } // namespace arm |
| 55 | } // namespace art |
| 56 | |
| 57 | #endif // ART_SRC_CONTEXT_ARM_H_ |