Combined cleanups to bring Fusion ppc64 support inline with other archs.
Should go into 0.9.
-- Heikki Lindholm
diff -Nru cvs-versions/fusion/arch/ppc64/hal/ppc64.c
fusion-cvs-ppc64-devel/arch/ppc64/hal/ppc64.c
--- cvs-versions/fusion/arch/ppc64/hal/ppc64.c 2005-08-19 12:42:42.000000000
+0300
+++ fusion-cvs-ppc64-devel/arch/ppc64/hal/ppc64.c 2005-09-02
20:44:35.000000000 +0300
@@ -166,11 +166,9 @@
{
if (rthal_cpufreq_arg == 0)
{
- adsysinfo_t sysinfo;
- rthal_get_sysinfo(&sysinfo);
/* The CPU frequency is expressed as the timebase frequency
for this port. */
- rthal_cpufreq_arg = (unsigned long)sysinfo.cpufreq;
+ rthal_cpufreq_arg = (unsigned long)rthal_get_cpufreq();
}
if (rthal_timerfreq_arg == 0)
diff -Nru cvs-versions/fusion/include/nucleus/asm-ppc64/hal.h
fusion-cvs-ppc64-devel/include/nucleus/asm-ppc64/hal.h
--- cvs-versions/fusion/include/nucleus/asm-ppc64/hal.h 2005-07-22
10:52:12.000000000 +0300
+++ fusion-cvs-ppc64-devel/include/nucleus/asm-ppc64/hal.h 2005-09-02
20:55:48.000000000 +0300
@@ -108,7 +108,7 @@
#define RTHAL_TIMER_IRQ ADEOS_TIMER_VIRQ
-#define rthal_irq_descp(irq) (irq_desc + irq)
+#define rthal_irq_descp(irq) (&irq_desc[(irq)])
static inline unsigned long long rthal_rdtsc (void) {
unsigned long long t;
diff -Nru cvs-versions/fusion/include/nucleus/asm-ppc64/system.h
fusion-cvs-ppc64-devel/include/nucleus/asm-ppc64/system.h
--- cvs-versions/fusion/include/nucleus/asm-ppc64/system.h 2005-07-22
10:52:12.000000000 +0300
+++ fusion-cvs-ppc64-devel/include/nucleus/asm-ppc64/system.h 2005-09-03
09:16:31.520910000 +0300
@@ -102,13 +102,17 @@
#define xnarch_fault_pc(fi) ((fi)->regs->nip)
/* FIXME: FPU faults ignored by the nanokernel on PPC. */
#define xnarch_fault_fpu_p(fi) (0)
-/* The following predicate is guaranteed to be called over a regular
- Linux stack context. */
+
+/* The following predicates are only usable over a regular Linux stack
+ * context. */
#define xnarch_fault_pf_p(fi) ((fi)->exception == ADEOS_ACCESS_TRAP)
-#define xnarch_fault_notify(fi) (!(current->ptrace & PT_PTRACED) || \
- ((fi)->exception != ADEOS_IABR_TRAP && \
- (fi)->exception != ADEOS_SSTEP_TRAP && \
- (fi)->exception != ADEOS_PERFMON_TRAP))
+#define xnarch_fault_bp_p(fi) ((current->ptrace & PT_PTRACED) && \
+ ((fi)->exception == ADEOS_IABR_TRAP || \
+ (fi)->exception == ADEOS_SSTEP_TRAP || \
+ (fi)->exception == ADEOS_PERFMON_TRAP))
+
+#define xnarch_fault_notify(fi) (!xnarch_fault_bp_p(fi))
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -138,7 +142,7 @@
static inline void xnarch_relay_tick (void)
{
- rthal_irq_host_pend(ADEOS_TIMER_VIRQ);
+ rthal_irq_host_pend(RTHAL_TIMER_IRQ);
}
#ifdef XENO_POD_MODULE
@@ -421,13 +425,13 @@
individually. */
rthal_virtualize_irq(rthal_current_domain,
- ADEOS_TIMER_VIRQ,
+ RTHAL_TIMER_IRQ,
handler,
NULL,
IPIPE_DYNAMIC_MASK);
}
-static inline void xnarch_lock_xirqs (adomain_t *adp, int cpuid)
+static inline void xnarch_lock_xirqs (rthal_pipeline_stage_t *ipd, int cpuid)
{
unsigned irq;
@@ -437,7 +441,7 @@
switch (irq)
{
#ifdef CONFIG_SMP
- case ADEOS_CRITICAL_IPI:
+ case RTHAL_CRITICAL_IPI:
/* Never lock out this one. */
continue;
@@ -445,14 +449,14 @@
default:
- rthal_lock_irq(adp,cpuid,irq);
+ rthal_lock_irq(ipd,cpuid,irq);
}
}
- rthal_lock_irq(adp,cpuid,ADEOS_TIMER_VIRQ);
+ rthal_lock_irq(ipd,cpuid,RTHAL_TIMER_IRQ);
}
-static inline void xnarch_unlock_xirqs (adomain_t *adp, int cpuid)
+static inline void xnarch_unlock_xirqs (rthal_pipeline_stage_t *ipd, int cpuid)
{
unsigned irq;
@@ -462,18 +466,18 @@
switch (irq)
{
#ifdef CONFIG_SMP
- case ADEOS_CRITICAL_IPI:
+ case RTHAL_CRITICAL_IPI:
continue;
#endif /* CONFIG_SMP */
default:
- rthal_unlock_irq(adp,irq);
+ rthal_unlock_irq(ipd,irq);
}
}
- rthal_unlock_irq(adp,ADEOS_TIMER_VIRQ);
+ rthal_unlock_irq(ipd,RTHAL_TIMER_IRQ);
}
#endif /* XENO_SHADOW_MODULE */