@@ -58,7 +58,7 @@ bool smp_cpu_stopped(uint16_t addr)
return !!(status & (SIGP_STATUS_CHECK_STOP|SIGP_STATUS_STOPPED));
}
-bool smp_cpu_running(uint16_t addr)
+bool smp_sense_running_status(uint16_t addr)
{
if (sigp(addr, SIGP_SENSE_RUNNING, 0, NULL) != SIGP_CC_STATUS_STORED)
return true;
@@ -40,7 +40,7 @@ struct cpu_status {
int smp_query_num_cpus(void);
struct cpu *smp_cpu_from_addr(uint16_t addr);
bool smp_cpu_stopped(uint16_t addr);
-bool smp_cpu_running(uint16_t addr);
+bool smp_sense_running_status(uint16_t addr);
int smp_cpu_restart(uint16_t addr);
int smp_cpu_start(uint16_t addr, struct psw psw);
int smp_cpu_stop(uint16_t addr);
@@ -182,6 +182,19 @@ static void test_emcall(void)
report_prefix_pop();
}
+static void test_sense_running(void)
+{
+ report_prefix_push("sense_running");
+ /* we (CPU0) are running */
+ report(smp_sense_running_status(0), "CPU0 sense claims running");
+ /* stop the target CPU (CPU1) to speed up the not running case */
+ smp_cpu_stop(1);
+ /* Make sure to have at least one time with a not running indication */
+ while(smp_sense_running_status(1));
+ report(true, "CPU1 sense claims not running");
+ report_prefix_pop();
+}
+
static void test_reset_initial(void)
{
struct cpu_status *status = alloc_pages(0);
@@ -251,6 +264,7 @@ int main(void)
test_store_status();
test_ecall();
test_emcall();
+ test_sense_running();
test_reset();
test_reset_initial();
smp_cpu_destroy(1);