Jose Marinho | fc0b2b6 | 2019-06-06 11:18:45 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019 The Hafnium Authors. |
| 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 | * https://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 | #pragma once |
| 18 | |
Jose Marinho | 75509b4 | 2019-04-09 09:34:59 +0100 | [diff] [blame^] | 19 | #include "hf/addr.h" |
| 20 | #include "hf/vm.h" |
| 21 | |
| 22 | #include "vmapi/hf/spci.h" |
| 23 | |
Jose Marinho | fc0b2b6 | 2019-06-06 11:18:45 +0100 | [diff] [blame] | 24 | #define SPCI_VERSION_MAJOR 0x0 |
| 25 | #define SPCI_VERSION_MINOR 0x9 |
| 26 | |
| 27 | #define SPCI_VERSION_MAJOR_OFFSET 16 |
Jose Marinho | 75509b4 | 2019-04-09 09:34:59 +0100 | [diff] [blame^] | 28 | |
| 29 | struct spci_mem_transitions { |
| 30 | int orig_from_mode; |
| 31 | int orig_to_mode; |
| 32 | int from_mode; |
| 33 | int to_mode; |
| 34 | }; |
| 35 | |
| 36 | spci_return_t spci_msg_handle_architected_message( |
| 37 | struct vm_locked to_locked, struct vm_locked from_locked, |
| 38 | const struct spci_architected_message_header |
| 39 | *architected_message_replica, |
| 40 | struct spci_message *from_msg_replica, struct spci_message *to_msg); |
| 41 | |
| 42 | bool spci_msg_check_transition(struct vm *to, struct vm *from, |
| 43 | enum spci_memory_share share, |
| 44 | int *orig_from_mode, ipaddr_t begin, |
| 45 | ipaddr_t end, uint32_t memory_to_attributes, |
| 46 | int *from_mode, int *to_mode); |