Commit 143a1dec authored by Paul Mackerras's avatar Paul Mackerras
Browse files

powerpc: Merge machdep.h



A few things change for consistency between ppc32 and ppc64:
idle functions return void; *_get_boot_time functions return
unsigned long (i.e. time_t) rather than filling in a struct rtc_time
(since that's useful to the callers and easier for pmac to
generate); *_get_rtc_time and *_set_rtc_time functions take
a struct rtc_time; irq_canonicalize is gone; nvram_sync returns
void.

Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 7ed476d1
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@
#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/bcd.h>
#include <linux/rtc.h>

#include <asm/time.h>
#include <asm/uaccess.h>
@@ -1307,11 +1308,14 @@ int iSeries_set_rtc_time(struct rtc_time *tm)
	return 0;
}

void iSeries_get_boot_time(struct rtc_time *tm)
unsigned long iSeries_get_boot_time(void)
{
	struct rtc_time tm;

	if (piranha_simulator)
		return;
		return 0;

	mf_get_boot_rtc(tm);
	tm->tm_mon  -= 1;
	mf_get_boot_rtc(&tm);
	return mktime(tm.tm_year + 1900, tm.tm_mon, tm.tm_mday,
		      tm.tm_hour, tm.tm_min, tm.tm_sec);
}
+4 −8
Original line number Diff line number Diff line
@@ -73,8 +73,8 @@ extern void hvlog(char *fmt, ...);
extern void ppcdbg_initialize(void);

static void build_iSeries_Memory_Map(void);
static int iseries_shared_idle(void);
static int iseries_dedicated_idle(void);
static void iseries_shared_idle(void);
static void iseries_dedicated_idle(void);
#ifdef CONFIG_PCI
extern void iSeries_pci_final_fixup(void);
#else
@@ -693,7 +693,7 @@ static void yield_shared_processor(void)
	process_iSeries_events();
}

static int iseries_shared_idle(void)
static void iseries_shared_idle(void)
{
	while (1) {
		while (!need_resched() && !hvlpevent_is_pending()) {
@@ -715,11 +715,9 @@ static int iseries_shared_idle(void)

		schedule();
	}

	return 0;
}

static int iseries_dedicated_idle(void)
static void iseries_dedicated_idle(void)
{
	long oldval;

@@ -749,8 +747,6 @@ static int iseries_dedicated_idle(void)
		ppc64_runlatch_on();
		schedule();
	}

	return 0;
}

#ifndef CONFIG_PCI
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
#ifndef	__ISERIES_SETUP_H__
#define	__ISERIES_SETUP_H__

extern void iSeries_get_boot_time(struct rtc_time *tm);
extern unsigned long iSeries_get_boot_time(void);
extern int iSeries_set_rtc_time(struct rtc_time *tm);
extern void iSeries_get_rtc_time(struct rtc_time *tm);

+5 −2
Original line number Diff line number Diff line
@@ -10,9 +10,12 @@
 * pmac_* files. Mostly for use by pmac_setup
 */

struct rtc_time;

extern long pmac_time_init(void);
extern unsigned long pmac_get_rtc_time(void);
extern int pmac_set_rtc_time(unsigned long nowtime);
extern unsigned long pmac_get_boot_time(void);
extern void pmac_get_rtc_time(struct rtc_time *);
extern int pmac_set_rtc_time(struct rtc_time *);
extern void pmac_read_rtc_time(void);
extern void pmac_calibrate_decr(void);
extern void pmac_pcibios_fixup(void);
+1 −1
Original line number Diff line number Diff line
@@ -562,7 +562,6 @@ void __init pmac_init(void)
	ppc_md.setup_arch     = pmac_setup_arch;
	ppc_md.show_cpuinfo   = pmac_show_cpuinfo;
	ppc_md.show_percpuinfo = pmac_show_percpuinfo;
	ppc_md.irq_canonicalize = NULL;
	ppc_md.init_IRQ       = pmac_pic_init;
	ppc_md.get_irq        = pmac_get_irq; /* Changed later on ... */

@@ -578,6 +577,7 @@ void __init pmac_init(void)
	ppc_md.time_init      = pmac_time_init;
	ppc_md.set_rtc_time   = pmac_set_rtc_time;
	ppc_md.get_rtc_time   = pmac_get_rtc_time;
	ppc_md.get_boot_time  = pmac_get_boot_time;
	ppc_md.calibrate_decr = pmac_calibrate_decr;

	ppc_md.feature_call   = pmac_do_feature_call;
Loading