Changeset View
Changeset View
Standalone View
Standalone View
head/sys/arm/arm/machdep.c
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
* Created : 17/09/94 | * Created : 17/09/94 | ||||
* Updated : 18/04/01 updated for new wscons | * Updated : 18/04/01 updated for new wscons | ||||
*/ | */ | ||||
#include "opt_ddb.h" | #include "opt_ddb.h" | ||||
#include "opt_kstack_pages.h" | #include "opt_kstack_pages.h" | ||||
#include "opt_platform.h" | #include "opt_platform.h" | ||||
#include "opt_sched.h" | #include "opt_sched.h" | ||||
#include "opt_timer.h" | |||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/buf.h> | #include <sys/buf.h> | ||||
#include <sys/bus.h> | #include <sys/bus.h> | ||||
#include <sys/cons.h> | #include <sys/cons.h> | ||||
▲ Show 20 Lines • Show All 239 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
void | void | ||||
cpu_idle(int busy) | cpu_idle(int busy) | ||||
{ | { | ||||
CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", busy, curcpu); | CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", busy, curcpu); | ||||
spinlock_enter(); | spinlock_enter(); | ||||
#ifndef NO_EVENTTIMERS | |||||
if (!busy) | if (!busy) | ||||
cpu_idleclock(); | cpu_idleclock(); | ||||
#endif | |||||
if (!sched_runnable()) | if (!sched_runnable()) | ||||
cpu_sleep(0); | cpu_sleep(0); | ||||
#ifndef NO_EVENTTIMERS | |||||
if (!busy) | if (!busy) | ||||
cpu_activeclock(); | cpu_activeclock(); | ||||
#endif | |||||
spinlock_exit(); | spinlock_exit(); | ||||
CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", busy, curcpu); | CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", busy, curcpu); | ||||
} | } | ||||
int | int | ||||
cpu_idle_wakeup(int cpu) | cpu_idle_wakeup(int cpu) | ||||
{ | { | ||||
return (0); | return (0); | ||||
} | } | ||||
#ifdef NO_EVENTTIMERS | |||||
/* | |||||
* Most ARM platforms don't need to do anything special to init their clocks | |||||
* (they get intialized during normal device attachment), and by not defining a | |||||
* cpu_initclocks() function they get this generic one. Any platform that needs | |||||
* to do something special can just provide their own implementation, which will | |||||
* override this one due to the weak linkage. | |||||
*/ | |||||
void | void | ||||
arm_generic_initclocks(void) | |||||
{ | |||||
} | |||||
__weak_reference(arm_generic_initclocks, cpu_initclocks); | |||||
#else | |||||
void | |||||
cpu_initclocks(void) | cpu_initclocks(void) | ||||
{ | { | ||||
#ifdef SMP | #ifdef SMP | ||||
if (PCPU_GET(cpuid) == 0) | if (PCPU_GET(cpuid) == 0) | ||||
cpu_initclocks_bsp(); | cpu_initclocks_bsp(); | ||||
else | else | ||||
cpu_initclocks_ap(); | cpu_initclocks_ap(); | ||||
#else | #else | ||||
cpu_initclocks_bsp(); | cpu_initclocks_bsp(); | ||||
#endif | #endif | ||||
} | } | ||||
#endif | |||||
#ifdef PLATFORM | #ifdef PLATFORM | ||||
void | void | ||||
arm_set_delay(delay_func *impl, void *arg) | arm_set_delay(delay_func *impl, void *arg) | ||||
{ | { | ||||
KASSERT(impl != NULL, ("No DELAY implementation")); | KASSERT(impl != NULL, ("No DELAY implementation")); | ||||
delay_impl = impl; | delay_impl = impl; | ||||
▲ Show 20 Lines • Show All 965 Lines • Show Last 20 Lines |