17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 541791439Sandrei * Common Development and Distribution License (the "License"). 641791439Sandrei * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 21ae115bc7Smrj 227c478bd9Sstevel@tonic-gate /* 23*5cd376e8SJimmy Vetayases * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate #ifndef _SYS_SMP_IMPLDEFS_H 277c478bd9Sstevel@tonic-gate #define _SYS_SMP_IMPLDEFS_H 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate #include <sys/types.h> 307c478bd9Sstevel@tonic-gate #include <sys/sunddi.h> 317c478bd9Sstevel@tonic-gate #include <sys/cpuvar.h> 32e23a7e34Slq150181 #include <sys/avintr.h> 337c478bd9Sstevel@tonic-gate #include <sys/pic.h> 347c478bd9Sstevel@tonic-gate #include <sys/xc_levels.h> 352df1fe9cSrandyf #include <sys/psm_types.h> 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gate #ifdef __cplusplus 387c478bd9Sstevel@tonic-gate extern "C" { 397c478bd9Sstevel@tonic-gate #endif 407c478bd9Sstevel@tonic-gate 417c478bd9Sstevel@tonic-gate #define WARM_RESET_VECTOR 0x467 /* the ROM/BIOS vector for */ 427c478bd9Sstevel@tonic-gate /* starting up secondary cpu's */ 437c478bd9Sstevel@tonic-gate /* timer modes for clkinitf */ 447c478bd9Sstevel@tonic-gate #define TIMER_ONESHOT 0x1 457c478bd9Sstevel@tonic-gate #define TIMER_PERIODIC 0x2 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gate /* 487c478bd9Sstevel@tonic-gate * External Reference Functions 497c478bd9Sstevel@tonic-gate */ 507c478bd9Sstevel@tonic-gate extern void (*psminitf)(); /* psm init entry point */ 517c478bd9Sstevel@tonic-gate extern void (*picinitf)(); /* pic init entry point */ 527c478bd9Sstevel@tonic-gate extern int (*clkinitf)(int, int *); /* clock init entry point */ 537c478bd9Sstevel@tonic-gate extern int (*ap_mlsetup)(); /* completes init of starting cpu */ 547c478bd9Sstevel@tonic-gate extern void (*send_dirintf)(); /* send interprocessor intr */ 557c478bd9Sstevel@tonic-gate extern hrtime_t (*gethrtimef)(); /* get high resolution timer value */ 567c478bd9Sstevel@tonic-gate extern hrtime_t (*gethrtimeunscaledf)(); /* get high res timer unscaled value */ 577c478bd9Sstevel@tonic-gate extern void (*psm_shutdownf)(int, int); /* machine dependent shutdown */ 587c478bd9Sstevel@tonic-gate extern void (*psm_preshutdownf)(int, int); /* machine dependent pre-shutdown */ 597c478bd9Sstevel@tonic-gate extern void (*psm_notifyf)(int); /* PSMI module notification */ 607c478bd9Sstevel@tonic-gate extern void (*psm_set_idle_cpuf)(processorid_t); /* cpu changed to idle */ 617c478bd9Sstevel@tonic-gate extern void (*psm_unset_idle_cpuf)(processorid_t); /* cpu out of idle */ 627c478bd9Sstevel@tonic-gate extern int (*psm_disable_intr)(processorid_t); /* disable intr to cpu */ 637c478bd9Sstevel@tonic-gate extern void (*psm_enable_intr)(processorid_t); /* enable intr to cpu */ 647c478bd9Sstevel@tonic-gate extern int (*psm_get_clockirq)(int); /* get clock vector */ 657c478bd9Sstevel@tonic-gate extern int (*psm_get_ipivect)(int, int); /* get interprocessor intr vec */ 667c478bd9Sstevel@tonic-gate extern int (*psm_clkinit)(int); /* timer init entry point */ 677c478bd9Sstevel@tonic-gate extern void (*psm_timer_reprogram)(hrtime_t); /* timer reprogram */ 687c478bd9Sstevel@tonic-gate extern void (*psm_timer_enable)(void); /* timer enable */ 697c478bd9Sstevel@tonic-gate extern void (*psm_timer_disable)(void); /* timer disable */ 707c478bd9Sstevel@tonic-gate extern void (*psm_post_cyclic_setup)(void *arg); /* psm cyclic setup */ 712df1fe9cSrandyf extern int (*psm_state)(psm_state_request_t *); /* psm state save/restore */ 727ff178cdSJimmy Vetayases extern uchar_t (*psm_get_ioapicid)(uchar_t); /* get io-apic id */ 737ff178cdSJimmy Vetayases extern uint32_t (*psm_get_localapicid)(uint32_t); /* get local-apic id */ 747ff178cdSJimmy Vetayases extern uchar_t (*psm_xlate_vector_by_irq)(uchar_t); /* get vector for an irq */ 757c478bd9Sstevel@tonic-gate 767c478bd9Sstevel@tonic-gate extern int (*slvltovect)(int); /* ipl interrupt priority level */ 777c478bd9Sstevel@tonic-gate extern int (*setlvl)(int, int *); /* set intr pri represented by vect */ 787c478bd9Sstevel@tonic-gate extern void (*setlvlx)(int, int); /* set intr pri to specified level */ 797c478bd9Sstevel@tonic-gate extern void (*setspl)(int); /* mask intr below or equal given ipl */ 807c478bd9Sstevel@tonic-gate extern int (*addspl)(int, int, int, int); /* add intr mask of vector */ 817c478bd9Sstevel@tonic-gate extern int (*delspl)(int, int, int, int); /* delete intr mask of vector */ 827ff178cdSJimmy Vetayases extern int (*get_pending_spl)(void); /* get highest pending ipl */ 837ff178cdSJimmy Vetayases extern int (*addintr)(void *, int, avfunc, char *, int, caddr_t, caddr_t, 847ff178cdSJimmy Vetayases uint64_t *, dev_info_t *); /* replacement of add_avintr */ 857ff178cdSJimmy Vetayases extern void (*remintr)(void *, int, avfunc, int); /* replace of rem_avintr */ 86e23a7e34Slq150181 87e23a7e34Slq150181 /* trigger a software intr */ 88e23a7e34Slq150181 extern void (*setsoftint)(int, struct av_softinfo *); 897c478bd9Sstevel@tonic-gate 90a1af7ba0Scwb /* kmdb private entry point */ 91a1af7ba0Scwb extern void (*kdisetsoftint)(int, struct av_softinfo *); 92a1af7ba0Scwb 937c478bd9Sstevel@tonic-gate extern uint_t xc_serv(caddr_t, caddr_t); /* cross call service routine */ 94e23a7e34Slq150181 extern void av_set_softint_pending(); /* set software interrupt pending */ 95a1af7ba0Scwb extern void kdi_av_set_softint_pending(); /* kmdb private entry point */ 967c478bd9Sstevel@tonic-gate extern void microfind(void); /* initialize tenmicrosec */ 977c478bd9Sstevel@tonic-gate 987c478bd9Sstevel@tonic-gate /* map physical address */ 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gate /* 1017c478bd9Sstevel@tonic-gate * XX64: Changing psm_map_phys() to take a paddr_t rather than a uint32_t 1027c478bd9Sstevel@tonic-gate * will be a flag day. Other drivers in the WOS use the psm_map() 1037c478bd9Sstevel@tonic-gate * interface, so we need this hack to get them to coexist for 1047c478bd9Sstevel@tonic-gate * pre-integration testing. 1057c478bd9Sstevel@tonic-gate */ 1067c478bd9Sstevel@tonic-gate extern caddr_t psm_map_phys_new(paddr_t, size_t, int); 1077c478bd9Sstevel@tonic-gate #define psm_map_phys psm_map_phys_new 1087c478bd9Sstevel@tonic-gate 1097c478bd9Sstevel@tonic-gate /* unmap the physical address given in psm_map_phys() from the addr */ 1107c478bd9Sstevel@tonic-gate extern void psm_unmap_phys(caddr_t, size_t); 1117c478bd9Sstevel@tonic-gate extern void psm_modloadonly(void); 1127c478bd9Sstevel@tonic-gate extern void psm_install(void); 1137c478bd9Sstevel@tonic-gate extern void psm_modload(void); 1147c478bd9Sstevel@tonic-gate 1157c478bd9Sstevel@tonic-gate /* 1167c478bd9Sstevel@tonic-gate * External Reference Data 1177c478bd9Sstevel@tonic-gate */ 1187c478bd9Sstevel@tonic-gate extern struct av_head autovect[]; /* array of auto intr vectors */ 1197c478bd9Sstevel@tonic-gate extern uint32_t rm_platter_pa; /* phy addr realmode startup storage */ 1207c478bd9Sstevel@tonic-gate extern caddr_t rm_platter_va; /* virt addr realmode startup storage */ 12141791439Sandrei extern cpuset_t mp_cpus; /* bit map of possible cpus found */ 1227c478bd9Sstevel@tonic-gate 123bb8220baSVikram Hegde /* 124bb8220baSVikram Hegde * virtulization support for psm 125bb8220baSVikram Hegde */ 126bb8220baSVikram Hegde extern void *psm_vt_ops; 127bb8220baSVikram Hegde 1287c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1297c478bd9Sstevel@tonic-gate } 1307c478bd9Sstevel@tonic-gate #endif 1317c478bd9Sstevel@tonic-gate 1327c478bd9Sstevel@tonic-gate #endif /* _SYS_SMP_IMPLDEFS_H */ 133