systemsw.h revision 1.3
11.3Ssimonb/* $NetBSD: systemsw.h,v 1.3 2002/06/01 14:38:27 simonb 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.1Ssimonb * Broadcom Corporation. Neither the "Broadcom Corporation" name nor any 191.1Ssimonb * trademark or logo of Broadcom Corporation may be used to endorse or 201.1Ssimonb * promote products derived from this software without the prior written 211.1Ssimonb * permission of Broadcom Corporation. 221.1Ssimonb * 231.1Ssimonb * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR IMPLIED 241.1Ssimonb * WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF 251.1Ssimonb * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR 261.1Ssimonb * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM BE LIABLE 271.1Ssimonb * FOR ANY DAMAGES WHATSOEVER, AND IN PARTICULAR, BROADCOM SHALL NOT BE 281.1Ssimonb * LIABLE FOR DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 291.1Ssimonb * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 301.1Ssimonb * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 311.1Ssimonb * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 321.1Ssimonb * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 331.1Ssimonb * OR OTHERWISE), EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 341.1Ssimonb */ 351.1Ssimonb 361.1Ssimonb#ifndef _SBMIPS_SYSTEMSW_H_ 371.1Ssimonb#define _SBMIPS_SYSTEMSW_H_ 381.1Ssimonb 391.1Ssimonb#include <sys/types.h> 401.1Ssimonb 411.1Ssimonbstruct systemsw { 421.1Ssimonb /* ordered to match likely locality. */ 431.1Ssimonb void (*s_cpu_intr)(uint32_t, uint32_t, uint32_t, uint32_t); 441.1Ssimonb void (*s_cpu_setsoftintr)(void); 451.1Ssimonb void (*s_microtime)(struct timeval *); 461.2Ssimonb uint32_t (*s_clkread)(void); 471.1Ssimonb void (*s_delay)(u_long); 481.1Ssimonb 491.1Ssimonb void *s_clock_arg; 501.1Ssimonb void (*s_clock_init)(void *); 511.1Ssimonb 521.3Ssimonb void *s_statclock_arg; 531.1Ssimonb void (*s_statclock_init)(void *); 541.1Ssimonb void (*s_statclock_setrate)(void *, int); 551.1Ssimonb 561.3Ssimonb void *s_todr_arg; 571.1Ssimonb void (*s_inittodr)(void *, time_t); 581.1Ssimonb void (*s_resettodr)(void *); 591.1Ssimonb 601.1Ssimonb void *(*s_intr_establish)(u_int, u_int, 611.1Ssimonb void (*fun)(void *, uint32_t, uint32_t), void *); 621.1Ssimonb}; 631.1Ssimonbextern struct systemsw systemsw; 641.1Ssimonb 651.3Ssimonbint system_set_clockfns(void *, void (*)(void *)); 661.3Ssimonbint system_set_todrfns(void *, void (*)(void *, time_t), void (*)(void *)); 671.1Ssimonb 681.1Ssimonb#define delay(n) ((*systemsw.s_delay)(n)) 691.1Ssimonb#define DELAY(n) ((*systemsw.s_delay)(n)) 701.1Ssimonb 711.1Ssimonb#define cpu_setsoftintr() ((*systemsw.s_cpu_setsoftintr)()) 721.1Ssimonb#define cpu_intr_establish(n,s,f,a) ((*systemsw.s_intr_establish)(n,s,f,a)) 731.1Ssimonb 741.1Ssimonbvoid sb1250_icu_init(void); 751.1Ssimonb 761.1Ssimonb#endif /* _SBMIPS_SYSTEMSW_H_ */ 77