1*cbab9cadSchs /* $NetBSD: sysconf.h,v 1.3 2012/10/27 17:17:46 chs Exp $ */ 25f7e80a8Spooka 35f7e80a8Spooka /* 45f7e80a8Spooka * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. 55f7e80a8Spooka * 65f7e80a8Spooka * Redistribution and use in source and binary forms, with or without 75f7e80a8Spooka * modification, are permitted provided that the following conditions 85f7e80a8Spooka * are met: 95f7e80a8Spooka * 1. Redistributions of source code must retain the above copyright 105f7e80a8Spooka * notice, this list of conditions and the following disclaimer. 115f7e80a8Spooka * 2. Redistributions in binary form must reproduce the above copyright 125f7e80a8Spooka * notice, this list of conditions and the following disclaimer in the 135f7e80a8Spooka * documentation and/or other materials provided with the distribution. 145f7e80a8Spooka * 3. All advertising materials mentioning features or use of this software 155f7e80a8Spooka * must display the following acknowledgement: 165f7e80a8Spooka * This product includes software developed by Christopher G. Demetriou 175f7e80a8Spooka * for the NetBSD Project. 185f7e80a8Spooka * 4. The name of the author may not be used to endorse or promote products 195f7e80a8Spooka * derived from this software without specific prior written permission 205f7e80a8Spooka * 215f7e80a8Spooka * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 225f7e80a8Spooka * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 235f7e80a8Spooka * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 245f7e80a8Spooka * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 255f7e80a8Spooka * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 265f7e80a8Spooka * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 275f7e80a8Spooka * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 285f7e80a8Spooka * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 295f7e80a8Spooka * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 305f7e80a8Spooka * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 315f7e80a8Spooka */ 325f7e80a8Spooka 335f7e80a8Spooka /* 345f7e80a8Spooka * Additional reworking by Matthew Jacob for NASA/Ames Research Center. 355f7e80a8Spooka * Copyright (c) 1997 365f7e80a8Spooka */ 375f7e80a8Spooka 385f7e80a8Spooka /* 395f7e80a8Spooka * Copyright (c) 1998 Jonathan Stone. All rights reserved. 405f7e80a8Spooka * Additional reworking for emipses. 415f7e80a8Spooka * Since emips mboard support different CPU daughterboards, 425f7e80a8Spooka * and others are mmultiprocessors, rename from cpu_* to sys_*. 435f7e80a8Spooka */ 445f7e80a8Spooka 455f7e80a8Spooka #ifndef _EMIPS_SYSCONF_H_ 465f7e80a8Spooka #define _EMIPS_SYSCONF_H_ 475f7e80a8Spooka 485f7e80a8Spooka #ifdef _KERNEL 495f7e80a8Spooka /* 505f7e80a8Spooka * Platform Specific Information and Function Hooks. 515f7e80a8Spooka */ 525f7e80a8Spooka 535f7e80a8Spooka struct platform { 545f7e80a8Spooka const char *iobus; /* Primary iobus name */ 555f7e80a8Spooka 565f7e80a8Spooka /* 575f7e80a8Spooka * Platform Specific Function Hooks 585f7e80a8Spooka * bus_reset - clear memory error condition 595f7e80a8Spooka * cons_init - console initialization 605f7e80a8Spooka * iointr - I/O interrupt handler 615f7e80a8Spooka * intr_establish - establish interrupt handler 625f7e80a8Spooka * memsize - find out how much memory we have 635f7e80a8Spooka */ 645f7e80a8Spooka void (*bus_reset) (void); 655f7e80a8Spooka void (*cons_init) (void); 66701ad559Smatt void (*iointr) (uint32_t, vaddr_t, uint32_t); 67*cbab9cadSchs void (*intr_establish) (device_t, void *, int, 685f7e80a8Spooka int (*)(void *, void *), void *); 695f7e80a8Spooka int (*memsize) (void *); 705f7e80a8Spooka }; 715f7e80a8Spooka 725f7e80a8Spooka /* 735f7e80a8Spooka * An array of functions to initialize the platform structure. 745f7e80a8Spooka */ 755f7e80a8Spooka struct sysinit { 765f7e80a8Spooka void (*init) (void); 775f7e80a8Spooka const char *option; 785f7e80a8Spooka }; 795f7e80a8Spooka 805f7e80a8Spooka #define sys_notsupp(st) { platform_not_supported, st } 815f7e80a8Spooka #define sys_init(fn, opt) { fn, opt } 825f7e80a8Spooka 835f7e80a8Spooka extern struct platform platform; 845f7e80a8Spooka extern struct sysinit sysinit[]; 855f7e80a8Spooka extern int nsysinit; 865f7e80a8Spooka 875f7e80a8Spooka int memsize_scan (void *); 885f7e80a8Spooka int memsize_pmt (void *); 895f7e80a8Spooka void platform_not_configured (void); 905f7e80a8Spooka void platform_not_supported (void); 915f7e80a8Spooka 925f7e80a8Spooka /* defaults */ 935f7e80a8Spooka void noop(void); 94*cbab9cadSchs void emips_intr_establish(device_t, void *, int, 955f7e80a8Spooka int (*)(void *, void *), void *); 96701ad559Smatt void emips_aic_intr(uint32_t, vaddr_t, uint32_t); 975f7e80a8Spooka #endif /* _KERNEL */ 985f7e80a8Spooka 995f7e80a8Spooka #endif /* !_EMIPS_SYSCONF_H_ */ 100