Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6bd74fa authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Michael Ellerman
Browse files

powerpc: xmon: use ktime_get_coarse_boottime64



get_monotonic_boottime() is deprecated, and may not be safe to call in
every context, as it has to read a hardware clocksource.

This changes xmon to print the time using ktime_get_coarse_boottime64()
instead, which avoids the old timespec type and the HW access.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarBalbir Singh <bsingharora@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent ee8c446f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -918,13 +918,13 @@ static void remove_cpu_bpts(void)
static void
show_uptime(void)
{
	struct timespec uptime;
	struct timespec64 uptime;

	if (setjmp(bus_error_jmp) == 0) {
		catch_memory_errors = 1;
		sync();

		get_monotonic_boottime(&uptime);
		ktime_get_coarse_boottime_ts64(&uptime);
		printf("Uptime: %lu.%.2lu seconds\n", (unsigned long)uptime.tv_sec,
			((unsigned long)uptime.tv_nsec / (NSEC_PER_SEC/100)));