1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-12-27 12:46:03 +00:00

Fix flow controller set functions

This commit is contained in:
Michael Scire 2018-03-09 14:56:16 -08:00
parent 3f627798e7
commit 88c4dfd444
3 changed files with 6 additions and 5 deletions

View file

@ -109,7 +109,7 @@ uint32_t cpu_on(uint32_t core, uintptr_t entrypoint_addr, uint64_t argument) {
void power_down_current_core(void) {
unsigned int current_core = get_core_id();
flow_set_csr(current_core, 0);
flow_set_halt_events(current_core, 0);
flow_set_halt_events(current_core, false);
flow_set_cc4_ctrl(current_core, 0);
save_current_core_context();
g_cpu_contexts[current_core].is_active = 0;

View file

@ -2,6 +2,7 @@
#define EXOSPHERE_FLOW_CTLR_H
#include <stdint.h>
#include <stdbool.h>
#include "cpu_context.h"
#include "memory_map.h"
@ -36,12 +37,12 @@ static inline void flow_set_cc4_ctrl(uint32_t core, uint32_t cc4_ctrl) {
MAKE_FLOW_REG(g_flow_core_offsets[core].CC4_COREN_CTRL_OFS) = cc4_ctrl;
}
static inline void flow_set_halt_events(uint32_t core, uint32_t halt_events) {
MAKE_FLOW_REG(g_flow_core_offsets[core].HALT_CPUN_EVENTS_OFS) = halt_events;
static inline void flow_set_halt_events(uint32_t core, bool halt_events) {
MAKE_FLOW_REG(g_flow_core_offsets[core].HALT_CPUN_EVENTS_OFS) = (halt_events ? 0x40000F00 : 0x40000000);
}
static inline void flow_set_csr(uint32_t core, uint32_t csr) {
MAKE_FLOW_REG(g_flow_core_offsets[core].CPUN_CSR_OFS) = csr;
MAKE_FLOW_REG(g_flow_core_offsets[core].CPUN_CSR_OFS) = (0x100 << core) | (csr << 12) | 0xC001;
}
static inline void flow_clear_csr0_and_events(uint32_t core) {

View file

@ -172,7 +172,7 @@ uint32_t cpu_suspend(uint64_t power_state, uint64_t entrypoint, uint64_t argumen
FLOW_CTLR_HALT_COP_EVENTS_0 = 0;
/* Prepare the current core for sleep. */
flow_set_cc4_ctrl(current_core, 0);
flow_set_halt_events(current_core, 0);
flow_set_halt_events(current_core, false);
FLOW_CTLR_L2FLUSH_CONTROL_0 = 0;
flow_set_csr(current_core, 2);