Home | History | Annotate | Line # | Download | only in pic
ipivar.h revision 1.6.12.2
      1  1.6.12.1       tls /* $NetBSD: ipivar.h,v 1.6.12.2 2017/12/03 11:36:37 jdolecek Exp $ */
      2       1.2   garbled /*-
      3       1.2   garbled  * Copyright (c) 2007 The NetBSD Foundation, Inc.
      4       1.2   garbled  * All rights reserved.
      5       1.2   garbled  *
      6       1.2   garbled  * This code is derived from software contributed to The NetBSD Foundation
      7       1.2   garbled  * by Tim Rightnour
      8       1.2   garbled  *
      9       1.2   garbled  * Redistribution and use in source and binary forms, with or without
     10       1.2   garbled  * modification, are permitted provided that the following conditions
     11       1.2   garbled  * are met:
     12       1.2   garbled  * 1. Redistributions of source code must retain the above copyright
     13       1.2   garbled  *    notice, this list of conditions and the following disclaimer.
     14       1.2   garbled  * 2. Redistributions in binary form must reproduce the above copyright
     15       1.2   garbled  *    notice, this list of conditions and the following disclaimer in the
     16       1.2   garbled  *    documentation and/or other materials provided with the distribution.
     17       1.2   garbled  *
     18       1.2   garbled  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     19       1.2   garbled  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     20       1.2   garbled  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     21       1.2   garbled  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     22       1.2   garbled  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     23       1.2   garbled  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     24       1.2   garbled  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     25       1.2   garbled  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     26       1.2   garbled  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     27       1.2   garbled  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     28       1.2   garbled  * POSSIBILITY OF SUCH DAMAGE.
     29       1.2   garbled  */
     30       1.2   garbled 
     31       1.2   garbled #include <sys/cdefs.h>
     32  1.6.12.1       tls __KERNEL_RCSID(0, "$NetBSD: ipivar.h,v 1.6.12.2 2017/12/03 11:36:37 jdolecek Exp $");
     33       1.2   garbled 
     34       1.2   garbled #ifndef _IPI_VAR_H_
     35       1.2   garbled #define _IPI_VAR_H_
     36       1.2   garbled 
     37       1.6      matt #ifdef _KERNEL_OPT
     38       1.6      matt #include "opt_ppcarch.h"
     39       1.6      matt #endif
     40       1.6      matt 
     41       1.6      matt #if defined(_KERNEL) && !defined(PPC_BOOKE)
     42       1.2   garbled struct ipi_ops {
     43       1.5      matt 	void (*ppc_send_ipi)(cpuid_t, uint32_t);
     44       1.2   garbled 	/* type, level, arg */
     45       1.2   garbled 	void (*ppc_establish_ipi)(int, int, void *);
     46       1.2   garbled 	int ppc_ipi_vector;
     47       1.2   garbled };
     48       1.2   garbled 
     49       1.2   garbled /* target macros, 0+ are real cpu numbers */
     50       1.5      matt #define IPI_DST_ALL	((cpuid_t) -2)
     51       1.5      matt #define IPI_DST_NOTME	((cpuid_t) -1)
     52       1.2   garbled 
     53       1.5      matt #define IPI_NOMESG		0x0000
     54       1.5      matt #define IPI_HALT		0x0001
     55       1.5      matt #define IPI_XCALL		0x0002
     56       1.5      matt #define IPI_KPREEMPT		0x0004
     57  1.6.12.1       tls #define IPI_GENERIC		0x0008
     58  1.6.12.2  jdolecek #define IPI_SUSPEND		0x0010
     59       1.2   garbled 
     60       1.2   garbled /* OpenPIC */
     61       1.2   garbled void setup_openpic_ipi(void);
     62       1.2   garbled 
     63       1.2   garbled /* IPI Handler */
     64       1.5      matt int ipi_intr(void *);
     65       1.2   garbled 
     66       1.2   garbled /* convenience */
     67       1.2   garbled extern struct ipi_ops ipiops;
     68       1.2   garbled 
     69       1.2   garbled static inline void
     70       1.5      matt cpu_send_ipi(cpuid_t cpuid, uint32_t msg)
     71       1.2   garbled {
     72       1.5      matt 	(*ipiops.ppc_send_ipi)(cpuid, msg);
     73       1.2   garbled }
     74       1.6      matt #endif
     75       1.2   garbled 
     76       1.2   garbled #endif /*_IPI_VAR_H_*/
     77