/*
 * Copyright (C) 2000-2003 ASANO Masahiro
 */

#ifndef MPERCPU_H
#define	MPERCPU_H

#ifdef CONFIG_SMP

extern addr_t __per_cpu_offset_addr;	/*long*/
#define	PER_CPU_NAME(var)	per_cpu__##var
#define	IMPORT_PER_CPU(var)	addr_t per_cpu__##var##_addr
#define	PER_CPU_ADDR(var,cpu)	(per_cpu__##var##_addr + __per_cpu_offset[cpu])
extern addr_t __per_cpu_offset_addr;
extern unsigned long __per_cpu_offset[];

#else /*CONFIG_SMP*/

#define	PER_CPU_NAME(var)	per_cpu__##var
#define	IMPORT_PER_CPU(var)	addr_t per_cpu__#var##_addr
#define	PER_CPU_ADDR(var,cpu)	per_cpu__##var##_addr
extern unsigned long __per_cpu_offset[];

#endif /*CONFIG_SMP*/

#endif /*MPERCPU_H*/
