blob: fe21e1fee0e985721d384ba1bb2eed48d8d50e7a [file] [log] [blame]
Jose Marinhofc0b2b62019-06-06 11:18:45 +01001/*
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
Andrew Walbran475c1452020-02-07 13:22:22 +000019#include <stdint.h>
Jose Marinho75509b42019-04-09 09:34:59 +010020
21#include "vmapi/hf/spci.h"
22
Jose Marinhofc0b2b62019-06-06 11:18:45 +010023#define SPCI_VERSION_MAJOR 0x0
24#define SPCI_VERSION_MINOR 0x9
25
26#define SPCI_VERSION_MAJOR_OFFSET 16
Jose Marinho75509b42019-04-09 09:34:59 +010027
Andrew Walbrand4d2fa12019-10-01 16:47:25 +010028static inline struct spci_value spci_error(uint64_t error_code)
29{
Andrew Walbran9b19b752019-10-10 13:49:25 +010030 return (struct spci_value){.func = SPCI_ERROR_32, .arg2 = error_code};
Andrew Walbrand4d2fa12019-10-01 16:47:25 +010031}