blob: 9ee07546d8cc4564ddaa3e16fd82569b6fd9306a [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 Rogersbdb03912011-09-14 00:55:44 -070016
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
23namespace art {
24namespace arm {
25
26class 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 Rogersd6b1f612011-09-27 13:38:14 -070041 virtual uintptr_t GetGPR(uint32_t reg) {
42 CHECK_GE(reg, 0u);
43 CHECK_LT(reg, 16u);
44 return gprs_[reg];
45 }
46
Ian Rogersbdb03912011-09-14 00:55:44 -070047 virtual void DoLongJump();
48
49 private:
50 uintptr_t gprs_[16];
Ian Rogers15fdb8c2011-09-25 15:45:07 -070051 uint32_t fprs_[32];
Ian Rogersbdb03912011-09-14 00:55:44 -070052};
53
54} // namespace arm
55} // namespace art
56
57#endif // ART_SRC_CONTEXT_ARM_H_