systemsw.h revision 1.10
11.10Sriastrad/* $NetBSD: systemsw.h,v 1.10 2023/09/25 14:56:56 riastradh Exp $ */
21.1Ssimonb
31.1Ssimonb/*
41.1Ssimonb * Copyright 2000, 2001
51.1Ssimonb * Broadcom Corporation. All rights reserved.
61.1Ssimonb *
71.1Ssimonb * This software is furnished under license and may be used and copied only
81.1Ssimonb * in accordance with the following terms and conditions.  Subject to these
91.1Ssimonb * conditions, you may download, copy, install, use, modify and distribute
101.1Ssimonb * modified or unmodified copies of this software in source and/or binary
111.1Ssimonb * form. No title or ownership is transferred hereby.
121.1Ssimonb *
131.1Ssimonb * 1) Any source code used, modified or distributed must reproduce and
141.1Ssimonb *    retain this copyright notice and list of conditions as they appear in
151.1Ssimonb *    the source file.
161.1Ssimonb *
171.1Ssimonb * 2) No right is granted to use any trade name, trademark, or logo of
181.4Scgd *    Broadcom Corporation.  The "Broadcom Corporation" name may not be
191.4Scgd *    used to endorse or promote products derived from this software
201.4Scgd *    without the prior written permission of Broadcom Corporation.
211.1Ssimonb *
221.1Ssimonb * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR IMPLIED
231.1Ssimonb *    WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF
241.1Ssimonb *    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
251.1Ssimonb *    NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM BE LIABLE
261.1Ssimonb *    FOR ANY DAMAGES WHATSOEVER, AND IN PARTICULAR, BROADCOM SHALL NOT BE
271.1Ssimonb *    LIABLE FOR DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
281.1Ssimonb *    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
291.1Ssimonb *    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
301.1Ssimonb *    BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
311.1Ssimonb *    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
321.1Ssimonb *    OR OTHERWISE), EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
331.1Ssimonb */
341.1Ssimonb
351.1Ssimonb#ifndef _SBMIPS_SYSTEMSW_H_
361.1Ssimonb#define	_SBMIPS_SYSTEMSW_H_
371.1Ssimonb
381.1Ssimonb#include <sys/types.h>
391.1Ssimonb
401.10Sriastrad#include <sys/stdbool.h>
411.10Sriastrad
421.1Ssimonbstruct systemsw {
431.1Ssimonb	/* ordered to match likely locality. */
441.9Smatt	void	(*s_cpu_intr)(int, vaddr_t, uint32_t);
451.1Ssimonb
461.1Ssimonb	void	*s_clock_arg;
471.1Ssimonb	void	(*s_clock_init)(void *);
481.1Ssimonb
491.3Ssimonb	void	*s_statclock_arg;
501.1Ssimonb	void	(*s_statclock_init)(void *);
511.1Ssimonb	void	(*s_statclock_setrate)(void *, int);
521.1Ssimonb
531.1Ssimonb	void	*(*s_intr_establish)(u_int, u_int,
541.8Smatt		    void (*fun)(void *, uint32_t, vaddr_t), void *);
551.1Ssimonb};
561.1Ssimonbextern struct systemsw systemsw;
571.1Ssimonb
581.9Smattbool	system_set_clockfns(void *, void (*)(void *));
591.9Smatt
601.9Smattvoid	sb1250_icu_init(void);
611.9Smattstruct cpu_softc;
621.9Smattvoid	sb1250_cpu_init(struct cpu_softc *);
631.9Smattvoid	sb1250_ipl_map_init(void);
641.1Ssimonb
651.1Ssimonb#define	cpu_intr_establish(n,s,f,a)	((*systemsw.s_intr_establish)(n,s,f,a))
661.1Ssimonb
671.1Ssimonb#endif /* _SBMIPS_SYSTEMSW_H_ */
68