diff options
author | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
---|---|---|
committer | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/opensbi/include/sbi/sbi_hsm.h | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/opensbi/include/sbi/sbi_hsm.h')
-rw-r--r-- | roms/opensbi/include/sbi/sbi_hsm.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/roms/opensbi/include/sbi/sbi_hsm.h b/roms/opensbi/include/sbi/sbi_hsm.h new file mode 100644 index 000000000..482338309 --- /dev/null +++ b/roms/opensbi/include/sbi/sbi_hsm.h @@ -0,0 +1,38 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 Western Digital Corporation or its affiliates. + * + * Authors: + * Atish Patra <atish.patra@wdc.com> + */ + +#ifndef __SBI_HSM_H__ +#define __SBI_HSM_H__ + +#include <sbi/sbi_types.h> + +/** Hart state values **/ +#define SBI_HART_STOPPED 0 +#define SBI_HART_STOPPING 1 +#define SBI_HART_STARTING 2 +#define SBI_HART_STARTED 3 +#define SBI_HART_UNKNOWN 4 + +struct sbi_domain; +struct sbi_scratch; + +int sbi_hsm_init(struct sbi_scratch *scratch, u32 hartid, bool cold_boot); +void __noreturn sbi_hsm_exit(struct sbi_scratch *scratch); + +int sbi_hsm_hart_start(struct sbi_scratch *scratch, + const struct sbi_domain *dom, + u32 hartid, ulong saddr, ulong smode, ulong priv); +int sbi_hsm_hart_stop(struct sbi_scratch *scratch, bool exitnow); +int sbi_hsm_hart_get_state(const struct sbi_domain *dom, u32 hartid); +int sbi_hsm_hart_state_to_status(int state); +int sbi_hsm_hart_started_mask(const struct sbi_domain *dom, + ulong hbase, ulong *out_hmask); +void sbi_hsm_prepare_next_jump(struct sbi_scratch *scratch, u32 hartid); + +#endif |