systemsw.h revision 1.4
11.4Scgd/* $NetBSD: systemsw.h,v 1.4 2003/02/07 17:46:12 cgd 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.1Ssimonbstruct systemsw { 411.1Ssimonb /* ordered to match likely locality. */ 421.1Ssimonb void (*s_cpu_intr)(uint32_t, uint32_t, uint32_t, uint32_t); 431.1Ssimonb void (*s_cpu_setsoftintr)(void); 441.1Ssimonb void (*s_microtime)(struct timeval *); 451.2Ssimonb uint32_t (*s_clkread)(void); 461.1Ssimonb void (*s_delay)(u_long); 471.1Ssimonb 481.1Ssimonb void *s_clock_arg; 491.1Ssimonb void (*s_clock_init)(void *); 501.1Ssimonb 511.3Ssimonb void *s_statclock_arg; 521.1Ssimonb void (*s_statclock_init)(void *); 531.1Ssimonb void (*s_statclock_setrate)(void *, int); 541.1Ssimonb 551.3Ssimonb void *s_todr_arg; 561.1Ssimonb void (*s_inittodr)(void *, time_t); 571.1Ssimonb void (*s_resettodr)(void *); 581.1Ssimonb 591.1Ssimonb void *(*s_intr_establish)(u_int, u_int, 601.1Ssimonb void (*fun)(void *, uint32_t, uint32_t), void *); 611.1Ssimonb}; 621.1Ssimonbextern struct systemsw systemsw; 631.1Ssimonb 641.3Ssimonbint system_set_clockfns(void *, void (*)(void *)); 651.3Ssimonbint system_set_todrfns(void *, void (*)(void *, time_t), void (*)(void *)); 661.1Ssimonb 671.1Ssimonb#define delay(n) ((*systemsw.s_delay)(n)) 681.1Ssimonb#define DELAY(n) ((*systemsw.s_delay)(n)) 691.1Ssimonb 701.1Ssimonb#define cpu_setsoftintr() ((*systemsw.s_cpu_setsoftintr)()) 711.1Ssimonb#define cpu_intr_establish(n,s,f,a) ((*systemsw.s_intr_establish)(n,s,f,a)) 721.1Ssimonb 731.1Ssimonbvoid sb1250_icu_init(void); 741.1Ssimonb 751.1Ssimonb#endif /* _SBMIPS_SYSTEMSW_H_ */ 76