Skip to content

Commit 05fc8db

Browse files
philmdbonzini
authored andcommitted
hw/i386/sgx: Have sgx_epc_get_section() return a boolean
Signed-off-by: Philippe Mathieu-Daudé <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent a821186 commit 05fc8db

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

hw/i386/sgx-stub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ void pc_machine_init_sgx_epc(PCMachineState *pcms)
2020
memset(&pcms->sgx_epc, 0, sizeof(SGXEPCState));
2121
}
2222

23-
int sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size)
23+
bool sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size)
2424
{
2525
g_assert_not_reached();
2626
}

hw/i386/sgx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,21 +115,21 @@ SGXInfo *sgx_get_info(Error **errp)
115115
return info;
116116
}
117117

118-
int sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size)
118+
bool sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size)
119119
{
120120
PCMachineState *pcms = PC_MACHINE(qdev_get_machine());
121121
SGXEPCDevice *epc;
122122

123123
if (pcms->sgx_epc.size == 0 || pcms->sgx_epc.nr_sections <= section_nr) {
124-
return 1;
124+
return true;
125125
}
126126

127127
epc = pcms->sgx_epc.sections[section_nr];
128128

129129
*addr = epc->addr;
130130
*size = memory_device_get_region_size(MEMORY_DEVICE(epc), &error_fatal);
131131

132-
return 0;
132+
return false;
133133
}
134134

135135
void pc_machine_init_sgx_epc(PCMachineState *pcms)

include/hw/i386/sgx-epc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ typedef struct SGXEPCState {
5555
int nr_sections;
5656
} SGXEPCState;
5757

58-
int sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size);
58+
bool sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size);
5959

6060
static inline uint64_t sgx_epc_above_4g_end(SGXEPCState *sgx_epc)
6161
{

0 commit comments

Comments
 (0)