At the moment, read_persistent_clock is implemented at the platform level, which makes it impossible to compile these platforms in a single kernel. Implement these two functions at the architecture level, and provide a thin registration interface for both read_boot_clock and read_persistent_clock. The two affected platforms (OMAP and Tegra) are converted at the same time. Reported-by: Jeff Ohlstein <johlstei@codeaurora.org> Tested-by: Stephen Warren <swarren@wwwdotorg.org> Tested-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
		
			
				
	
	
		
			50 lines
		
	
	
	
		
			1.6 KiB
			
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			50 lines
		
	
	
	
		
			1.6 KiB
			
		
	
	
	
		
			C
		
	
	
	
	
	
/*
 | 
						|
 * arch/arm/include/asm/mach/time.h
 | 
						|
 *
 | 
						|
 * Copyright (C) 2004 MontaVista Software, Inc.
 | 
						|
 *
 | 
						|
 * This program is free software; you can redistribute it and/or modify
 | 
						|
 * it under the terms of the GNU General Public License version 2 as
 | 
						|
 * published by the Free Software Foundation.
 | 
						|
 */
 | 
						|
#ifndef __ASM_ARM_MACH_TIME_H
 | 
						|
#define __ASM_ARM_MACH_TIME_H
 | 
						|
 | 
						|
/*
 | 
						|
 * This is our kernel timer structure.
 | 
						|
 *
 | 
						|
 * - init
 | 
						|
 *   Initialise the kernels jiffy timer source, claim interrupt
 | 
						|
 *   using setup_irq.  This is called early on during initialisation
 | 
						|
 *   while interrupts are still disabled on the local CPU.
 | 
						|
 * - suspend
 | 
						|
 *   Suspend the kernel jiffy timer source, if necessary.  This
 | 
						|
 *   is called with interrupts disabled, after all normal devices
 | 
						|
 *   have been suspended.  If no action is required, set this to
 | 
						|
 *   NULL.
 | 
						|
 * - resume
 | 
						|
 *   Resume the kernel jiffy timer source, if necessary.  This
 | 
						|
 *   is called with interrupts disabled before any normal devices
 | 
						|
 *   are resumed.  If no action is required, set this to NULL.
 | 
						|
 * - offset
 | 
						|
 *   Return the timer offset in microseconds since the last timer
 | 
						|
 *   interrupt.  Note: this must take account of any unprocessed
 | 
						|
 *   timer interrupt which may be pending.
 | 
						|
 */
 | 
						|
struct sys_timer {
 | 
						|
	void			(*init)(void);
 | 
						|
	void			(*suspend)(void);
 | 
						|
	void			(*resume)(void);
 | 
						|
#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
 | 
						|
	unsigned long		(*offset)(void);
 | 
						|
#endif
 | 
						|
};
 | 
						|
 | 
						|
extern void timer_tick(void);
 | 
						|
 | 
						|
struct timespec;
 | 
						|
typedef void (*clock_access_fn)(struct timespec *);
 | 
						|
extern int register_persistent_clock(clock_access_fn read_boot,
 | 
						|
				     clock_access_fn read_persistent);
 | 
						|
 | 
						|
#endif
 |