Commit f18d92a3 authored by Jes Sorensen's avatar Jes Sorensen Committed by David Mosberger

[PATCH] cpu_idle() cleanup

parent 14076de1
......@@ -33,16 +33,15 @@
#include <asm/unwind.h>
#include <asm/user.h>
#ifdef CONFIG_IA64_SGI_SN
#include <asm/sn/idle.h>
#endif
#ifdef CONFIG_PERFMON
# include <asm/perfmon.h>
#endif
#include "sigframe.h"
void (*ia64_mark_idle)(int);
void
ia64_do_show_stack (struct unw_frame_info *info, void *arg)
{
......@@ -175,6 +174,8 @@ default_idle (void)
void __attribute__((noreturn))
cpu_idle (void *unused)
{
void (*mark_idle)(int) = ia64_mark_idle;
/* endless idle loop with no priority at all */
while (1) {
void (*idle)(void) = pm_idle;
......@@ -187,15 +188,13 @@ cpu_idle (void *unused)
#endif
while (!need_resched()) {
#ifdef CONFIG_IA64_SGI_SN
snidle();
#endif
if (mark_idle)
(*mark_idle)(1);
(*idle)();
}
#ifdef CONFIG_IA64_SGI_SN
snidleoff();
#endif
if (mark_idle)
(*mark_idle)(0);
#ifdef CONFIG_SMP
normal_xtp();
......
#ifndef _ASM_IA64_SN_IDLE_H
#define _ASM_IA64_SN_IDLE_H
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (c) 2001-2002 Silicon Graphics, Inc. All rights reserved.
* Copyright (c) 2001-2003 Silicon Graphics, Inc. All rights reserved.
*/
#include <linux/config.h>
#include <asm/sn/leds.h>
#include <asm/sn/simulator.h>
static __inline__ void
snidle(void) {
#if 0
#ifdef CONFIG_IA64_SGI_AUTOTEST
{
extern int autotest_enabled;
if (autotest_enabled) {
extern void llsc_main(int);
llsc_main(smp_processor_id());
void snidle(int state) {
if (state) {
if (pda.idle_flag == 0) {
/*
* Turn the activity LED off.
*/
set_led_bits(0, LED_CPU_ACTIVITY);
}
}
#endif
if (pda.idle_flag == 0) {
/*
* Turn the activity LED off.
*/
set_led_bits(0, LED_CPU_ACTIVITY);
}
#ifdef CONFIG_IA64_SGI_SN_SIM
if (IS_RUNNING_ON_SIMULATOR())
SIMULATOR_SLEEP();
#endif
pda.idle_flag = 1;
if (IS_RUNNING_ON_SIMULATOR())
SIMULATOR_SLEEP();
#endif
}
static __inline__ void
snidleoff(void) {
#if 0
/*
* Turn the activity LED on.
*/
set_led_bits(LED_CPU_ACTIVITY, LED_CPU_ACTIVITY);
pda.idle_flag = 1;
} else {
/*
* Turn the activity LED on.
*/
set_led_bits(LED_CPU_ACTIVITY, LED_CPU_ACTIVITY);
pda.idle_flag = 0;
#endif
pda.idle_flag = 0;
}
}
#endif /* _ASM_IA64_SN_IDLE_H */
/*
* Copyright (C) 1999,2001-2002 Silicon Graphics, Inc. All rights reserved.
* Copyright (C) 1999,2001-2003 Silicon Graphics, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License
......@@ -79,6 +79,8 @@ DEFINE_PER_CPU(struct pda_s, pda_percpu);
extern void bte_init_node (nodepda_t *, cnodeid_t);
extern void bte_init_cpu (void);
extern void sn_timer_init (void);
extern void (*ia64_mark_idle)(int);
extern void snidle(int);
unsigned long sn_rtc_cycles_per_second;
......@@ -304,6 +306,8 @@ sn_setup(char **cmdline_p)
current->thread.flags |= IA64_THREAD_FPEMU_NOPRINT;
sn_timer_init();
ia64_mark_idle = &snidle;
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment