text
stringlengths
4
6.14k
/* GStreamer dmabuf allocator * Copyright (C) 2013 Linaro SA * Author: Benjamin Gaignard <benjamin.gaignard@linaro.org> for Linaro. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef __GST_DMABUF_H__ #define __GST_DMABUF_H__ #include <gst/gst.h> G_BEGIN_DECLS #define GST_ALLOCATOR_DMABUF "dmabuf" GstAllocator * gst_dmabuf_allocator_new (void); GstMemory * gst_dmabuf_allocator_alloc (GstAllocator * allocator, gint fd, gsize size); gint gst_dmabuf_memory_get_fd (GstMemory * mem); gboolean gst_is_dmabuf_memory (GstMemory * mem); G_END_DECLS #endif /* __GST_DMABUF_H__ */
/* * Copyright (c) 2002-2003, Intel Corporation. All rights reserved. * Created by: rusty.lynch REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. Test case for assertion #4 of the sigaction system call that shows that attempting to add SIGSTOP to the signal mask of SIGTTIN will not result in sigaction returning -1 */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <sys/wait.h> #include <unistd.h> #include "posixtest.h" void handler(int signo) { } int main(void) { struct sigaction act; act.sa_handler = handler; act.sa_flags = 0; sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, SIGSTOP); if (sigaction(SIGTTIN, &act, 0) == -1) { printf("Test FAILED\n"); return PTS_FAIL; } printf("Test PASSED\n"); return PTS_PASS; }
/* GStreamer * Copyright (C) 2008 David Schleef <ds@entropywave.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef _GST_CMS_H_ #define _GST_CMS_H_ #include <gst/gst.h> G_BEGIN_DECLS typedef struct _Color Color; typedef struct _ColorMatrix ColorMatrix; struct _Color { double v[3]; }; struct _ColorMatrix { double m[4][4]; }; void color_xyY_to_XYZ (Color * c); void color_XYZ_to_xyY (Color * c); void color_set (Color * c, double x, double y, double z); void color_matrix_set_identity (ColorMatrix * m); void color_matrix_dump (ColorMatrix * m); void color_matrix_multiply (ColorMatrix * dst, ColorMatrix * a, ColorMatrix * b); void color_matrix_apply (ColorMatrix * m, Color * dest, Color * src); void color_matrix_offset_components (ColorMatrix * m, double a1, double a2, double a3); void color_matrix_scale_components (ColorMatrix * m, double a1, double a2, double a3); void color_matrix_YCbCr_to_RGB (ColorMatrix * m, double Kr, double Kb); void color_matrix_RGB_to_YCbCr (ColorMatrix * m, double Kr, double Kb); void color_matrix_build_yuv_to_rgb_601 (ColorMatrix * dst); void color_matrix_build_bt709_to_bt601 (ColorMatrix * dst); void color_matrix_build_rgb_to_yuv_601 (ColorMatrix * dst); void color_matrix_invert (ColorMatrix * m); void color_matrix_copy (ColorMatrix * dest, ColorMatrix * src); void color_matrix_transpose (ColorMatrix * m); void color_matrix_build_XYZ (ColorMatrix * dst, double rx, double ry, double gx, double gy, double bx, double by, double wx, double wy); void color_matrix_build_rgb_to_XYZ_601 (ColorMatrix * dst); void color_matrix_build_XYZ_to_rgb_709 (ColorMatrix * dst); void color_matrix_build_XYZ_to_rgb_dell (ColorMatrix * dst); void color_transfer_function_apply (Color * dest, Color * src); void color_transfer_function_unapply (Color * dest, Color * src); void color_gamut_clamp (Color * dest, Color * src); G_END_DECLS #endif
/*========================================================================= Program: Visualization Toolkit Module: TaskParallelismWithPorts.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ #ifndef __TASKPARA_H #define __TASKPARA_H #include "vtkMultiProcessController.h" #include "vtkRTAnalyticSource.h" #include "vtkFieldDataToAttributeDataFilter.h" #include "vtkAttributeDataToFieldDataFilter.h" #include "vtkImageShrink3D.h" #include "vtkGlyph3D.h" #include "vtkGlyphSource2D.h" #include "vtkImageGradient.h" #include "vtkImageGradientMagnitude.h" #include "vtkImageGaussianSmooth.h" #include "vtkProbeFilter.h" #include "vtkDataSetMapper.h" #include "vtkContourFilter.h" #include "vtkActor.h" #include "vtkRenderWindow.h" #include "vtkRenderer.h" #include "vtkAssignAttribute.h" typedef void (*taskFunction)(double data); void task3(double data); void task4(double data); static const double EXTENT = 20; static const int WINDOW_WIDTH = 400; static const int WINDOW_HEIGHT = 300; #endif
/* Update additional symbol information in symbol table at the given index. Copyright (C) 2000, 2001, 2002 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2000. Red Hat elfutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. Red Hat elfutils is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Red Hat elfutils; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. In addition, as a special exception, Red Hat, Inc. gives You the additional right to link the code of Red Hat elfutils with code licensed under any Open Source Initiative certified open source license (http://www.opensource.org/licenses/index.php) which requires the distribution of source code with any binary distribution and to distribute linked combinations of the two. Non-GPL Code permitted under this exception must only link to the code of Red Hat elfutils through those well defined interfaces identified in the file named EXCEPTION found in the source code files (the "Approved Interfaces"). The files of Non-GPL Code may instantiate templates or use macros or inline functions from the Approved Interfaces without causing the resulting work to be covered by the GNU General Public License. Only Red Hat, Inc. may make changes or additions to the list of Approved Interfaces. Red Hat's grant of this exception is conditioned upon your not adding any new exceptions. If you wish to add a new Approved Interface or exception, please contact Red Hat. You must obey the GNU General Public License in all respects for all of the Red Hat elfutils code and other code used in conjunction with Red Hat elfutils except the Non-GPL Code covered by this exception. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to provide this exception without modification, you must delete this exception statement from your version and license this file solely under the GPL without exception. Red Hat elfutils is an included package of the Open Invention Network. An included package of the Open Invention Network is a package for which Open Invention Network licensees cross-license their patents. No patent license is granted, either expressly or impliedly, by designation as an included package. Should you wish to participate in the Open Invention Network licensing program, please visit www.openinventionnetwork.com <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <assert.h> #include <gelf.h> #include <stdlib.h> #include "libelfP.h" int gelf_update_syminfo (data, ndx, src) Elf_Data *data; int ndx; GElf_Syminfo *src; { Elf_Data_Scn *data_scn = (Elf_Data_Scn *) data; Elf_Scn *scn; int result = 0; if (data == NULL) return 0; if (unlikely (ndx < 0)) { __libelf_seterrno (ELF_E_INVALID_INDEX); return 0; } if (unlikely (data_scn->d.d_type != ELF_T_SYMINFO)) { /* The type of the data better should match. */ __libelf_seterrno (ELF_E_DATA_MISMATCH); return 0; } /* The types for 32 and 64 bit are the same. Lucky us. */ assert (sizeof (GElf_Syminfo) == sizeof (Elf32_Syminfo)); assert (sizeof (GElf_Syminfo) == sizeof (Elf64_Syminfo)); scn = data_scn->s; rwlock_wrlock (scn->elf->lock); /* Check whether we have to resize the data buffer. */ if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data_scn->d.d_size)) { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; } ((GElf_Syminfo *) data_scn->d.d_buf)[ndx] = *src; result = 1; /* Mark the section as modified. */ scn->flags |= ELF_F_DIRTY; out: rwlock_unlock (scn->elf->lock); return result; }
//===-- DWARFCompileUnit.h --------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_LIB_DEBUGINFO_DWARFCOMPILEUNIT_H #define LLVM_LIB_DEBUGINFO_DWARFCOMPILEUNIT_H #include "llvm/DebugInfo/DWARF/DWARFUnit.h" namespace llvm { class DWARFCompileUnit : public DWARFUnit { public: DWARFCompileUnit(DWARFContext &Context, const DWARFSection &Section, const DWARFDebugAbbrev *DA, StringRef RS, StringRef SS, StringRef SOS, StringRef AOS, bool LE, const DWARFUnitSectionBase &UnitSection) : DWARFUnit(Context, Section, DA, RS, SS, SOS, AOS, LE, UnitSection) {} void dump(raw_ostream &OS); // VTable anchor. ~DWARFCompileUnit() override; }; } #endif
/* * Copyright 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved. */ /* * The code contained herein is licensed under the GNU General Public * License. You may obtain a copy of the GNU General Public License * Version 2 or later at the following locations: * * http://www.opensource.org/licenses/gpl-license.html * http://www.gnu.org/copyleft/gpl.html */ #include <linux/module.h> static __init int opl_init(void) { return 0; } static void __exit opl_exit(void) { } module_init(opl_init); module_exit(opl_exit); MODULE_AUTHOR("Freescale Semiconductor, Inc."); MODULE_DESCRIPTION("OPL Software Rotation/Mirroring"); MODULE_LICENSE("GPL");
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_QUIC_QUIC_DATA_WRITER_H_ #define NET_QUIC_QUIC_DATA_WRITER_H_ #include <string> #include "base/basictypes.h" #include "base/logging.h" #include "base/port.h" #include "base/strings/string_piece.h" #include "net/base/int128.h" #include "net/base/net_export.h" #include "net/quic/quic_protocol.h" namespace net { // This class provides facilities for packing QUIC data. // // The QuicDataWriter supports appending primitive values (int, string, etc) // to a frame instance. The QuicDataWriter grows its internal memory buffer // dynamically to hold the sequence of primitive values. The internal memory // buffer is exposed as the "data" of the QuicDataWriter. class NET_EXPORT_PRIVATE QuicDataWriter { public: explicit QuicDataWriter(size_t length); ~QuicDataWriter(); // Returns the size of the QuicDataWriter's data. size_t length() const { return length_; } // Takes the buffer from the QuicDataWriter. char* take(); // Methods for adding to the payload. These values are appended to the end // of the QuicDataWriter payload. Note - binary integers are written in // host byte order (little endian) not network byte order (big endian). bool WriteUInt8(uint8 value); bool WriteUInt16(uint16 value); bool WriteUInt32(uint32 value); bool WriteUInt48(uint64 value); bool WriteUInt64(uint64 value); bool WriteUInt128(uint128 value); bool WriteStringPiece16(base::StringPiece val); bool WriteBytes(const void* data, size_t data_len); bool WriteRepeatedByte(uint8 byte, size_t count); // Fills the remaining buffer with null characters. void WritePadding(); // Methods for editing the payload at a specific offset, where the // offset must be within the writer's capacity. // Return true if there is enough space at that offset, false otherwise. bool WriteUInt8ToOffset(uint8 value, size_t offset); bool WriteUInt32ToOffset(uint32 value, size_t offset); bool WriteUInt48ToOffset(uint64 value, size_t offset); size_t capacity() const { return capacity_; } protected: const char* end_of_payload() const { return buffer_ + length_; } private: // Returns the location that the data should be written at, or NULL if there // is not enough room. Call EndWrite with the returned offset and the given // length to pad out for the next write. char* BeginWrite(size_t length); char* buffer_; size_t capacity_; // Allocation size of payload (or -1 if buffer is const). size_t length_; // Current length of the buffer. }; } // namespace net #endif // NET_QUIC_QUIC_DATA_WRITER_H_
// Copyright 2016 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. #pragma once #include "DolphinWX/Input/InputConfigDiag.h" class WiimoteInputConfigDialog final : public InputConfigDialog { public: WiimoteInputConfigDialog(wxWindow* parent, InputConfig& config, const wxString& name, int port_num = 0); };
/* * Copyright (c) 2012, Freescale Semiconductor, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, this list * of conditions and the following disclaimer. * * o Redistributions in binary form must reproduce the above copyright notice, this * list of conditions and the following disclaimer in the documentation and/or * other materials provided with the distribution. * * o Neither the name of Freescale Semiconductor, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*---------------------------------------------------------------------------- File Includes ----------------------------------------------------------------------------*/ #include "sdk.h" #include "cpu_utility/cpu_utility.h" #include "core/cortex_a9.h" #include "core/mmu.h" #include "pmu/pmu_driver.h" #include "registers/regsccm.h" #include "registers/regsccmanalog.h" #include "registers/regspmu.h" typedef struct cpu_wp_s { uint32_t cpu_freq; // MHz uint32_t vdd_pu; //mV uint32_t vdd_soc; //mV uint32_t vdd_arm; //mV } cpu_wp_t; static cpu_wp_t mx6_cpu_wp[] = { { .cpu_freq = 1200, .vdd_pu = 1275, .vdd_soc = 1275, .vdd_arm = 1275, }, { .cpu_freq = 996, .vdd_pu = 1250, .vdd_soc = 1250, .vdd_arm = 1250, }, { .cpu_freq = 792, .vdd_pu = 1175, .vdd_soc = 1175, .vdd_arm = 1150, }, { .cpu_freq = 396, .vdd_pu = 1175, .vdd_soc = 1175, .vdd_arm = 950, }, }; uint32_t cpu_workpoint_set(cpu_wp_e cpu_wp_mode) { unsigned int div = 0; if (cpu_wp_mode >= CPU_WORKPOINT_OUTOFRANGE) { printf("CPU work point mode not exist !!\n"); return 0; } cpu_wp_t *wp = &mx6_cpu_wp[cpu_wp_mode]; pmu_init(); /* calculate the pll loop divider. target Fout = Fin * div / 2 */ div = wp->cpu_freq * 2 / 24; /* first, switch the cpu clock root to step clock */ HW_CCM_CCSR.B.PLL1_SW_CLK_SEL = 1; /* set clock to target frequency */ HW_CCM_ANALOG_PLL_ARM.B.POWERDOWN = 1; HW_CCM_ANALOG_PLL_ARM.B.DIV_SELECT = div; HW_CCM_ANALOG_PLL_ARM.B.POWERDOWN = 0; while (!HW_CCM_ANALOG_PLL_ARM.B.LOCK) ; HW_CCM_ANALOG_PLL_ARM.B.BYPASS = 0; /* set the power rail */ switch (wp->cpu_freq) { case 1200: case 996: case 792: case 396: pmu_set_property(kPMURegulator_ArmCore, kPMUProperty_OutputMillivolts, &wp->vdd_arm); pmu_set_property(kPMURegulator_Graphics, kPMUProperty_OutputMillivolts, &wp->vdd_pu); pmu_set_property(kPMURegulator_SoC, kPMUProperty_OutputMillivolts, &wp->vdd_soc); break; default: printf("Unsupported CPU workpoint mode!!\n"); return 0; } /*switch back to PLL1 */ HW_CCM_CCSR.B.PLL1_SW_CLK_SEL = 0; return wp->cpu_freq; }
/* LUFA Library Copyright (C) Dean Camera, 2014. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this permission notice and warranty disclaimer appear in supporting documentation, and that the name of the author not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaims all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall the author be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software. */ /** \file * \brief Board specific information header for the Micropendous series boards. * \copydetails Group_BoardInfo_MICROPENDOUS_32U2 * * \note This file should not be included directly. It is automatically included as needed by the Board driver * dispatch header located in LUFA/Drivers/Board/Board.h. */ /** \ingroup Group_BoardInfo * \defgroup Group_BoardInfo_MICROPENDOUS_A MICROPENDOUS_A * \brief Board specific information header for the Micropendous A (https://code.google.com/p/micropendous/wiki/MicropendousA). * * See \ref Group_BoardInfo_MICROPENDOUS_32U2 for more details. */ /** \ingroup Group_BoardInfo * \defgroup Group_BoardInfo_MICROPENDOUS_1 MICROPENDOUS_1 * \brief Board specific information header for the Micropendous 1 (https://code.google.com/p/micropendous/wiki/Micropendous1). * * See \ref Group_BoardInfo_MICROPENDOUS_32U2 for more details. */ /** \ingroup Group_BoardInfo * \defgroup Group_BoardInfo_MICROPENDOUS_2 MICROPENDOUS_2 * \brief Board specific information header for the Micropendous 2 (https://code.google.com/p/micropendous/wiki/Micropendous2). * * See \ref Group_BoardInfo_MICROPENDOUS_32U2 for more details. */ /** \ingroup Group_BoardInfo * \defgroup Group_BoardInfo_MICROPENDOUS_3 MICROPENDOUS_3 * \brief Board specific information header for the Micropendous 3 (https://code.google.com/p/micropendous/wiki/Micropendous3). * * See \ref Group_BoardInfo_MICROPENDOUS_32U2 for more details. */ /** \ingroup Group_BoardInfo * \defgroup Group_BoardInfo_MICROPENDOUS_4 MICROPENDOUS_4 * \brief Board specific information header for the Micropendous 4 (https://code.google.com/p/micropendous/wiki/Micropendous4). * * See \ref Group_BoardInfo_MICROPENDOUS_32U2 for more details. */ /** \ingroup Group_BoardInfo * \defgroup Group_BoardInfo_MICROPENDOUS_DIP MICROPENDOUS_DIP * \brief Board specific information header for the Micropendous DIP (https://code.google.com/p/micropendous/wiki/MicropendousDIP). * * See \ref Group_BoardInfo_MICROPENDOUS_32U2 for more details. */ /** \ingroup Group_BoardInfo * \defgroup Group_BoardInfo_MICROPENDOUS_REV1 MICROPENDOUS_REV1 * \brief Board specific information header for the Micropendous Arduino-like Revision 1 (https://code.google.com/p/micropendous/wiki/Micropendous). * * See \ref Group_BoardInfo_MICROPENDOUS_32U2 for more details. */ /** \ingroup Group_BoardInfo * \defgroup Group_BoardInfo_MICROPENDOUS_REV2 MICROPENDOUS_REV2 * \brief Board specific information header for the Micropendous Arduino-like Revision 2 (https://code.google.com/p/micropendous/wiki/Micropendous). * * See \ref Group_BoardInfo_MICROPENDOUS_32U2 for more details. */ /** \ingroup Group_BoardInfo * \defgroup Group_BoardInfo_MICROPENDOUS_32U2 MICROPENDOUS_32U2 * \brief Board specific information header for the Micropendous series boards. * * Board specific information header for the Micropendous series boards (https://code.google.com/p/micropendous). * * @{ */ #ifndef __BOARD_MICROPENDOUS_H__ #define __BOARD_MICROPENDOUS_H__ /* Includes: */ #include "../../../../Common/Common.h" /* Enable C linkage for C++ Compilers: */ #if defined(__cplusplus) extern "C" { #endif /* Preprocessor Checks: */ #if !defined(__INCLUDE_FROM_BOARD_H) #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. #endif /* Public Interface - May be used in end-application: */ /* Macros: */ #if ((BOARD == BOARD_MICROPENDOUS_32U2) || (BOARD == BOARD_MICROPENDOUS_A) || \ (BOARD == BOARD_MICROPENDOUS_1) || (BOARD == BOARD_MICROPENDOUS_2) || \ (BOARD == BOARD_MICROPENDOUS_3) || (BOARD == BOARD_MICROPENDOUS_4) || \ (BOARD == BOARD_MICROPENDOUS_REV1) || (BOARD == BOARD_MICROPENDOUS_REV2) || \ (BOARD == BOARD_MICROPENDOUS_DIP) || defined(__DOXYGEN__)) #include "../../Buttons.h" /** Indicates the board has hardware Buttons mounted. */ #define BOARD_HAS_BUTTONS #endif #if ((BOARD == BOARD_MICROPENDOUS_REV1) || (BOARD == BOARD_MICROPENDOUS_REV2) || \ (BOARD == BOARD_MICROPENDOUS_32U2) || defined(__DOXYGEN__)) #include "../../LEDs.h" /** Indicates the board has hardware LEDs mounted. */ #define BOARD_HAS_LEDS #endif /* Disable C linkage for C++ Compilers: */ #if defined(__cplusplus) } #endif #endif /** @} */
/* ========================================================================== */ /* === ldlsymbolmex.c: LDLSYMBOL mexFunction =============================== */ /* ========================================================================== */ /* MATLAB interface for symbolic LDL' factorization using the LDL sparse matrix * package. This mexFunction is not required by the LDL mexFunction. * * MATLAB calling syntax is: * * [Lnz, Parent, flopcount] = ldlsymbol (A) * [Lnz, Parent, flopcount] = ldlsymbol (A, P) * * P is a permutation of 1:n, an output of AMD, SYMAMD, or SYMRCM, for example. * Only the diagonal and upper triangular part of A or A(P,P) is accessed; the * lower triangular part is ignored. * * The elimination tree is returned in the Parent array. The number of nonzeros * in each column of L is returned in Lnz. This mexFunction replicates the * following MATLAB computations, using ldl_l_symbolic: * * Lnz = symbfact (A) - 1 ; * Parent = etree (A) ; * flopcount = sum (Lnz .* (Lnz + 2)) ; * * or, if P is provided, * * B = A (P,P) ; * Lnz = symbfact (B) - 1 ; * Parent = etree (B) ; * flopcount = sum (Lnz .* (Lnz + 2)) ; * * This code is faster than the above MATLAB statements, typically by a factor * of 4 to 40 (median speedup of 9) in MATLAB 6.5 on a Pentium 4 Linux laptop * (excluding the B=A(P,P) time), on a wide range of symmetric sparse matrices. * * LDL Version 1.3, Copyright (c) 2006 by Timothy A Davis, * University of Florida. All Rights Reserved. See README for the License. */ #ifndef LDL_LONG #define LDL_LONG #endif #include "ldl.h" #include "mex.h" /* ========================================================================== */ /* === LDLSYMBOL mexFunction ================================================ */ /* ========================================================================== */ void mexFunction ( int nargout, mxArray *pargout[ ], int nargin, const mxArray *pargin[ ] ) { UF_long i, n, *Pattern, *Flag, *Lp, *Ap, *Ai, *Lnz, *Parent, *P, *Pinv, nn, k, j, permute ; double flops, *p ; /* ---------------------------------------------------------------------- */ /* get inputs and allocate workspace */ /* ---------------------------------------------------------------------- */ if (nargin == 0 || nargin > 2) { mexErrMsgTxt ("Usage:\n" " [Lnz, Parent, flopcount] = ldl (A) ;\n" " [Lnz, Parent, flopcount] = ldl (A, P) ;\n") ; } n = mxGetM (pargin [0]) ; if (!mxIsSparse (pargin [0]) || n != mxGetN (pargin [0]) || mxIsComplex (pargin [0])) { mexErrMsgTxt ("ldlsymbol: A must be sparse, square, and real") ; } nn = (n == 0) ? 1 : n ; /* get sparse matrix A */ Ap = (UF_long *) mxGetJc (pargin [0]) ; Ai = (UF_long *) mxGetIr (pargin [0]) ; /* get fill-reducing ordering, if present */ permute = ((nargin > 1) && !mxIsEmpty (pargin [1])) ; if (permute) { if (mxGetM (pargin [1]) * mxGetN (pargin [1]) != n || mxIsSparse (pargin [1])) { mexErrMsgTxt ("ldlsymbol: invalid input permutation\n") ; } P = (UF_long *) mxMalloc (nn * sizeof (UF_long)) ; Pinv = (UF_long *) mxMalloc (nn * sizeof (UF_long)) ; p = mxGetPr (pargin [1]) ; for (k = 0 ; k < n ; k++) { P [k] = p [k] - 1 ; /* convert to 0-based */ } } else { P = (UF_long *) NULL ; Pinv = (UF_long *) NULL ; } /* allocate first part of L */ Lp = (UF_long *) mxMalloc ((n+1) * sizeof (UF_long)) ; Parent = (UF_long *) mxMalloc (nn * sizeof (UF_long)) ; /* get workspace */ Flag = (UF_long *) mxMalloc (nn * sizeof (UF_long)) ; Pattern = (UF_long *) mxMalloc (nn * sizeof (UF_long)) ; Lnz = (UF_long *) mxMalloc (nn * sizeof (UF_long)) ; /* make sure the input P is valid */ if (permute && !ldl_l_valid_perm (n, P, Flag)) { mexErrMsgTxt ("ldlsymbol: invalid input permutation\n") ; } /* note that we assume that the input matrix is valid */ /* ---------------------------------------------------------------------- */ /* symbolic factorization to get Lp, Parent, Lnz, and optionally Pinv */ /* ---------------------------------------------------------------------- */ ldl_l_symbolic (n, Ap, Ai, Lp, Parent, Lnz, Flag, P, Pinv) ; /* ---------------------------------------------------------------------- */ /* create outputs */ /* ---------------------------------------------------------------------- */ /* create the output Lnz vector */ pargout [0] = mxCreateDoubleMatrix (1, n, mxREAL) ; p = mxGetPr (pargout [0]) ; for (j = 0 ; j < n ; j++) { p [j] = Lnz [j] ; } /* return elimination tree (add 1 to change from 0-based to 1-based) */ if (nargout > 1) { pargout [1] = mxCreateDoubleMatrix (1, n, mxREAL) ; p = mxGetPr (pargout [1]) ; for (i = 0 ; i < n ; i++) { p [i] = Parent [i] + 1 ; } } if (nargout > 2) { /* find flop count for ldl_l_numeric */ flops = 0 ; for (k = 0 ; k < n ; k++) { flops += ((double) Lnz [k]) * (Lnz [k] + 2) ; } pargout [2] = mxCreateDoubleMatrix (1, 1, mxREAL) ; p = mxGetPr (pargout [2]) ; p [0] = flops ; } if (permute) { mxFree (P) ; mxFree (Pinv) ; } mxFree (Lp) ; mxFree (Parent) ; mxFree (Flag) ; mxFree (Pattern) ; mxFree (Lnz) ; }
#include <errno.h> #include <stdlib.h> /* static void (*__CTOR_LIST__[1]) __P((void)) __attribute__((__unused__)) __attribute__((section(".ctors"))) = { (void *)0 }; static void (*__DTOR_LIST__[1]) __P((void)) __attribute__((section(".dtors"))) = { (void *)-1 }; */ extern void (*__DTOR_LIST__[]) __P((void)); static void __do_global_dtors_aux __P((void)); static void __do_global_dtors_aux() { void (**p)(void) = __DTOR_LIST__ + 1; while (*p) (**p++)(); } static void dummy_fini(void) __attribute__((section(".trash"))); void dummy_fini(void) { static void (* volatile call__dtors)(void) = __do_global_dtors_aux; /* * Call global destructors. */ /* prevent function pointer constant propagation */ __asm__ __volatile__ (".section .fini"); (*call__dtors)(); __asm__ __volatile__ (".section .trash"); }
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_WEBUI_OMNIBOX_OMNIBOX_UI_HANDLER_H_ #define CHROME_BROWSER_UI_WEBUI_OMNIBOX_OMNIBOX_UI_HANDLER_H_ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "chrome/browser/autocomplete/autocomplete_controller_delegate.h" #include "chrome/browser/ui/webui/mojo_web_ui_handler.h" #include "chrome/browser/ui/webui/omnibox/omnibox.mojom.h" #include "components/omnibox/autocomplete_input.h" #include "components/omnibox/autocomplete_match.h" class AutocompleteController; class Profile; // Implementation of OmniboxUIHandlerMojo. StartOmniboxQuery() calls to a // private AutocompleteController. It also listens for updates from the // AutocompleteController to OnResultChanged() and passes those results to // the OmniboxPage. class OmniboxUIHandler : public AutocompleteControllerDelegate, public mojo::InterfaceImpl<OmniboxUIHandlerMojo>, public MojoWebUIHandler { public: explicit OmniboxUIHandler(Profile* profile); virtual ~OmniboxUIHandler(); // AutocompleteControllerDelegate overrides: virtual void OnResultChanged(bool default_match_changed) OVERRIDE; // ErrorHandler overrides: virtual void OnConnectionError() OVERRIDE { // TODO(darin): How should we handle connection error? } // OmniboxUIHandlerMojo overrides: virtual void StartOmniboxQuery(const mojo::String& input_string, int32_t cursor_position, bool prevent_inline_autocomplete, bool prefer_keyword, int32_t page_classification) OVERRIDE; private: // Looks up whether the hostname is a typed host (i.e., has received // typed visits). Return true if the lookup succeeded; if so, the // value of |is_typed_host| is set appropriately. bool LookupIsTypedHost(const base::string16& host, bool* is_typed_host) const; // Re-initializes the AutocompleteController in preparation for the // next query. void ResetController(); // The omnibox AutocompleteController that collects/sorts/dup- // eliminates the results as they come in. scoped_ptr<AutocompleteController> controller_; // Time the user's input was sent to the omnibox to start searching. // Needed because we also pass timing information in the object we // hand back to the javascript. base::Time time_omnibox_started_; // The input used when starting the AutocompleteController. AutocompleteInput input_; // The Profile* handed to us in our constructor. Profile* profile_; DISALLOW_COPY_AND_ASSIGN(OmniboxUIHandler); }; #endif // CHROME_BROWSER_UI_WEBUI_OMNIBOX_OMNIBOX_UI_HANDLER_H_
/* * TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY * * FILE: dat_towctrans.c * * TOWCTRANS: wint_t towctrans (wint_t wc, wctrans_t charclass); */ #include <errno.h> #include <stdlib.h> #include <wctype.h> #include "tst_types.h" #include "tgn_locdef.h" /* * NOTE: * Set ret_flg = 1, when a return value is expected to be 0 (FALSE). * Set ret_flg = 0, when a return value is expected to be non-zero (TRUE). * * Since the functions return *non*-zero value for TRUE, can't * compare an actual return value with an expected return value. * Set the ret_flg=0 for TRUE cases and the tst_isw*() will check * the non-zero value. * * { { WEOF }, { 0,0,1,0 } }, * | | * | ret_val: an expected return value * ret_flg: if 1, compare an actual return value with the * ret_val; if 0, the test program checks * the actual return value. * * CAUTION: if a charclass is invalid, the test function gives * towctrans() an invalid wctrans object instead of a return value * from wctrans() which is supposed to be 0. */ TST_TOWCTRANS tst_towctrans_loc [] = { { { Ttowctrans, TST_LOC_C }, { #ifdef SHOJI_IS_RIGHT { { 0x0010, "xxxxxxx" }, { EINVAL,1,0x0010 } }, #else { { 0x0010, "xxxxxxx" }, { 0, 1,0x0010 } }, #endif { { 0x007F, "tolower" }, { 0, 1,0x007F } }, { { 0x0061, "toupper" }, { 0, 1,0x0041 } }, { { 0x0041, "tolower" }, { 0, 1,0x0061 } }, { .is_last = 1 } } }, { { Ttowctrans, TST_LOC_de }, { #ifdef SHOJI_IS_RIGHT { { 0x0010, "tojkata" }, { EINVAL,1,0x0010 } }, #else { { 0x0010, "tojkata" }, { 0, 1,0x0010 } }, #endif { { 0x0080, "tolower" }, { 0, 1,0x0080 } }, { { 0x00EC, "toupper" }, { 0, 1,0x00CC } }, { { 0x00CC, "tolower" }, { 0, 1,0x00EC } }, { .is_last = 1 } } }, { { Ttowctrans, TST_LOC_enUS }, { #ifdef SHOJI_IS_RIGHT { { 0x0010, "xxxxxxx" }, { EINVAL,1,0x0010 } }, #else { { 0x0010, "xxxxxxx" }, { 0, 1,0x0010 } }, #endif { { 0x007F, "tolower" }, { 0, 1,0x007F } }, { { 0x0061, "toupper" }, { 0, 1,0x0041 } }, { { 0x0041, "tolower" }, { 0, 1,0x0061 } }, { .is_last = 1 } } }, { { Ttowctrans, TST_LOC_eucJP }, { { { 0xFF21, "tolower" }, { 0, 1,0xFF41 } }, { { 0xFF41, "toupper" }, { 0, 1,0xFF21 } }, { { 0x30A1, "tojhira" }, { 0, 1,0x3041 } }, { { 0x3041, "tojkata" }, { 0, 1,0x30A1 } }, { .is_last = 1 } } }, { { Ttowctrans, TST_LOC_end } } };
/* * Copyright (C) 1999, 2000, 2004 MIPS Technologies, Inc. * All rights reserved. * Authors: Carsten Langgaard <carstenl@mips.com> * Maciej W. Rozycki <macro@mips.com> * * This program is free software; you can distribute it and/or modify it * under the terms of the GNU General Public License (Version 2) as * published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. */ #include <linux/types.h> #include <linux/pci.h> #include <linux/kernel.h> #include <asm/gt64120.h> #define PCI_ACCESS_READ 0 #define PCI_ACCESS_WRITE 1 #define PCI_CFG_TYPE0_REG_SHF 0 #define PCI_CFG_TYPE0_FUNC_SHF 8 #define PCI_CFG_TYPE1_REG_SHF 0 #define PCI_CFG_TYPE1_FUNC_SHF 8 #define PCI_CFG_TYPE1_DEV_SHF 11 #define PCI_CFG_TYPE1_BUS_SHF 16 static int gt64xxx_pci0_pcibios_config_access(unsigned char access_type, struct pci_bus *bus, unsigned int devfn, int where, u32 * data) { unsigned char busnum = bus->number; u32 intr; if ((busnum == 0) && (devfn >= PCI_DEVFN(31, 0))) return -1; GT_WRITE(GT_INTRCAUSE_OFS, ~(GT_INTRCAUSE_MASABORT0_BIT | GT_INTRCAUSE_TARABORT0_BIT)); GT_WRITE(GT_PCI0_CFGADDR_OFS, (busnum << GT_PCI0_CFGADDR_BUSNUM_SHF) | (devfn << GT_PCI0_CFGADDR_FUNCTNUM_SHF) | ((where / 4) << GT_PCI0_CFGADDR_REGNUM_SHF) | GT_PCI0_CFGADDR_CONFIGEN_BIT); if (access_type == PCI_ACCESS_WRITE) { if (busnum == 0 && PCI_SLOT(devfn) == 0) { GT_WRITE(GT_PCI0_CFGDATA_OFS, *data); } else __GT_WRITE(GT_PCI0_CFGDATA_OFS, *data); } else { if (busnum == 0 && PCI_SLOT(devfn) == 0) { *data = GT_READ(GT_PCI0_CFGDATA_OFS); } else *data = __GT_READ(GT_PCI0_CFGDATA_OFS); } intr = GT_READ(GT_INTRCAUSE_OFS); if (intr & (GT_INTRCAUSE_MASABORT0_BIT | GT_INTRCAUSE_TARABORT0_BIT)) { GT_WRITE(GT_INTRCAUSE_OFS, ~(GT_INTRCAUSE_MASABORT0_BIT | GT_INTRCAUSE_TARABORT0_BIT)); return -1; } return 0; } static int gt64xxx_pci0_pcibios_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 * val) { u32 data = 0; if (gt64xxx_pci0_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, where, &data)) return PCIBIOS_DEVICE_NOT_FOUND; if (size == 1) *val = (data >> ((where & 3) << 3)) & 0xff; else if (size == 2) *val = (data >> ((where & 3) << 3)) & 0xffff; else *val = data; return PCIBIOS_SUCCESSFUL; } static int gt64xxx_pci0_pcibios_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val) { u32 data = 0; if (size == 4) data = val; else { if (gt64xxx_pci0_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, where, &data)) return PCIBIOS_DEVICE_NOT_FOUND; if (size == 1) data = (data & ~(0xff << ((where & 3) << 3))) | (val << ((where & 3) << 3)); else if (size == 2) data = (data & ~(0xffff << ((where & 3) << 3))) | (val << ((where & 3) << 3)); } if (gt64xxx_pci0_pcibios_config_access(PCI_ACCESS_WRITE, bus, devfn, where, &data)) return PCIBIOS_DEVICE_NOT_FOUND; return PCIBIOS_SUCCESSFUL; } struct pci_ops gt64xxx_pci0_ops = { .read = gt64xxx_pci0_pcibios_read, .write = gt64xxx_pci0_pcibios_write };
#ifndef MSP3400_DRIVER_H #define MSP3400_DRIVER_H #include <media/msp3400.h> #include <media/v4l2-device.h> #include <media/v4l2-ctrls.h> #define MSP_CARRIER(freq) ((int)((float)(freq / 18.432) * (1 << 24))) #define MSP_MODE_AM_DETECT 0 #define MSP_MODE_FM_RADIO 2 #define MSP_MODE_FM_TERRA 3 #define MSP_MODE_FM_SAT 4 #define MSP_MODE_FM_NICAM1 5 #define MSP_MODE_FM_NICAM2 6 #define MSP_MODE_AM_NICAM 7 #define MSP_MODE_BTSC 8 #define MSP_MODE_EXTERN 9 #define SCART_IN1 0 #define SCART_IN2 1 #define SCART_IN3 2 #define SCART_IN4 3 #define SCART_IN1_DA 4 #define SCART_IN2_DA 5 #define SCART_MONO 6 #define SCART_MUTE 7 #define SCART_DSP_IN 0 #define SCART1_OUT 1 #define SCART2_OUT 2 #define OPMODE_AUTO -1 #define OPMODE_MANUAL 0 #define OPMODE_AUTODETECT 1 #define OPMODE_AUTOSELECT 2 extern int msp_debug; extern bool msp_once; extern bool msp_amsound; extern int msp_standard; extern bool msp_dolby; extern int msp_stereo_thresh; struct msp_state { struct v4l2_subdev sd; struct v4l2_ctrl_handler hdl; int rev1, rev2; int ident; u8 has_nicam; u8 has_radio; u8 has_headphones; u8 has_ntsc_jp_d_k3; u8 has_scart2; u8 has_scart3; u8 has_scart4; u8 has_scart2_out; u8 has_scart2_out_volume; u8 has_i2s_conf; u8 has_subwoofer; u8 has_sound_processing; u8 has_virtual_dolby_surround; u8 has_dolby_pro_logic; u8 force_btsc; int radio; int opmode; int std; int mode; v4l2_std_id v4l2_std, detected_std; int nicam_on; int acb; int in_scart; int i2s_mode; int main, second; int input; u32 route_in; u32 route_out; int audmode; int rxsubchans; struct { struct v4l2_ctrl *volume; struct v4l2_ctrl *muted; }; int scan_in_progress; struct task_struct *kthread; wait_queue_head_t wq; unsigned int restart:1; unsigned int watch_stereo:1; }; static inline struct msp_state *to_state(struct v4l2_subdev *sd) { return container_of(sd, struct msp_state, sd); } static inline struct msp_state *ctrl_to_state(struct v4l2_ctrl *ctrl) { return container_of(ctrl->handler, struct msp_state, hdl); } int msp_write_dem(struct i2c_client *client, int addr, int val); int msp_write_dsp(struct i2c_client *client, int addr, int val); int msp_read_dem(struct i2c_client *client, int addr); int msp_read_dsp(struct i2c_client *client, int addr); int msp_reset(struct i2c_client *client); void msp_set_scart(struct i2c_client *client, int in, int out); void msp_update_volume(struct msp_state *state); int msp_sleep(struct msp_state *state, int timeout); const char *msp_standard_std_name(int std); void msp_set_audmode(struct i2c_client *client); int msp_detect_stereo(struct i2c_client *client); int msp3400c_thread(void *data); int msp3410d_thread(void *data); int msp34xxg_thread(void *data); void msp3400c_set_mode(struct i2c_client *client, int mode); void msp3400c_set_carrier(struct i2c_client *client, int cdo1, int cdo2); #endif
#ifndef _IP6T_LOG_H #define _IP6T_LOG_H #warning "Please update iptables, this file will be removed soon!" #define IP6T_LOG_TCPSEQ 0x01 #define IP6T_LOG_TCPOPT 0x02 #define IP6T_LOG_IPOPT 0x04 #define IP6T_LOG_UID 0x08 #define IP6T_LOG_NFLOG 0x10 #define IP6T_LOG_MACDECODE 0x20 #define IP6T_LOG_MASK 0x2f struct ip6t_log_info { unsigned char level; unsigned char logflags; char prefix[30]; }; #endif
#ifndef LINUX_SSB_EMBEDDED_H_ #define LINUX_SSB_EMBEDDED_H_ #include <linux/types.h> #include <linux/ssb/ssb.h> extern int ssb_watchdog_timer_set(struct ssb_bus *bus, u32 ticks); u32 ssb_gpio_in(struct ssb_bus *bus, u32 mask); u32 ssb_gpio_out(struct ssb_bus *bus, u32 mask, u32 value); u32 ssb_gpio_outen(struct ssb_bus *bus, u32 mask, u32 value); u32 ssb_gpio_control(struct ssb_bus *bus, u32 mask, u32 value); u32 ssb_gpio_intmask(struct ssb_bus *bus, u32 mask, u32 value); u32 ssb_gpio_polarity(struct ssb_bus *bus, u32 mask, u32 value); #endif
#ifndef _SPARC_PGALLOC_H #define _SPARC_PGALLOC_H #include <linux/kernel.h> #include <linux/sched.h> #include <asm/page.h> #include <asm/btfixup.h> struct page; extern struct pgtable_cache_struct { unsigned long *pgd_cache; unsigned long *pte_cache; unsigned long pgtable_cache_sz; unsigned long pgd_cache_sz; } pgt_quicklists; #define pgd_quicklist (pgt_quicklists.pgd_cache) #define pmd_quicklist ((unsigned long *)0) #define pte_quicklist (pgt_quicklists.pte_cache) #define pgtable_cache_size (pgt_quicklists.pgtable_cache_sz) #define pgd_cache_size (pgt_quicklists.pgd_cache_sz) extern void check_pgt_cache(void); BTFIXUPDEF_CALL(void, do_check_pgt_cache, int, int) #define do_check_pgt_cache(low,high) BTFIXUP_CALL(do_check_pgt_cache)(low,high) BTFIXUPDEF_CALL(pgd_t *, get_pgd_fast, void) #define get_pgd_fast() BTFIXUP_CALL(get_pgd_fast)() BTFIXUPDEF_CALL(void, free_pgd_fast, pgd_t *) #define free_pgd_fast(pgd) BTFIXUP_CALL(free_pgd_fast)(pgd) #define pgd_free(mm, pgd) free_pgd_fast(pgd) #define pgd_alloc(mm) get_pgd_fast() BTFIXUPDEF_CALL(void, pgd_set, pgd_t *, pmd_t *) #define pgd_set(pgdp,pmdp) BTFIXUP_CALL(pgd_set)(pgdp,pmdp) #define pgd_populate(MM, PGD, PMD) pgd_set(PGD, PMD) BTFIXUPDEF_CALL(pmd_t *, pmd_alloc_one, struct mm_struct *, unsigned long) #define pmd_alloc_one(mm, address) BTFIXUP_CALL(pmd_alloc_one)(mm, address) BTFIXUPDEF_CALL(void, free_pmd_fast, pmd_t *) #define free_pmd_fast(pmd) BTFIXUP_CALL(free_pmd_fast)(pmd) #define pmd_free(mm, pmd) free_pmd_fast(pmd) #define __pmd_free_tlb(tlb, pmd, addr) pmd_free((tlb)->mm, pmd) BTFIXUPDEF_CALL(void, pmd_populate, pmd_t *, struct page *) #define pmd_populate(MM, PMD, PTE) BTFIXUP_CALL(pmd_populate)(PMD, PTE) #define pmd_pgtable(pmd) pmd_page(pmd) BTFIXUPDEF_CALL(void, pmd_set, pmd_t *, pte_t *) #define pmd_populate_kernel(MM, PMD, PTE) BTFIXUP_CALL(pmd_set)(PMD, PTE) BTFIXUPDEF_CALL(pgtable_t , pte_alloc_one, struct mm_struct *, unsigned long) #define pte_alloc_one(mm, address) BTFIXUP_CALL(pte_alloc_one)(mm, address) BTFIXUPDEF_CALL(pte_t *, pte_alloc_one_kernel, struct mm_struct *, unsigned long) #define pte_alloc_one_kernel(mm, addr) BTFIXUP_CALL(pte_alloc_one_kernel)(mm, addr) BTFIXUPDEF_CALL(void, free_pte_fast, pte_t *) #define pte_free_kernel(mm, pte) BTFIXUP_CALL(free_pte_fast)(pte) BTFIXUPDEF_CALL(void, pte_free, pgtable_t ) #define pte_free(mm, pte) BTFIXUP_CALL(pte_free)(pte) #define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, pte) #endif
#ifndef __ARCH_ORION5X_MPP_H #define __ARCH_ORION5X_MPP_H #define MPP(_num, _sel, _in, _out, _F5181l, _F5182, _F5281) ( \ ((_num) & 0xff) | \ (((_sel) & 0xf) << 8) | \ ((!!(_in)) << 12) | \ ((!!(_out)) << 13) | \ ((!!(_F5181l)) << 14) | \ ((!!(_F5182)) << 15) | \ ((!!(_F5281)) << 16)) #define MPP_F5181_MASK MPP(0, 0x0, 0, 0, 1, 0, 0) #define MPP_F5182_MASK MPP(0, 0x0, 0, 0, 0, 1, 0) #define MPP_F5281_MASK MPP(0, 0x0, 0, 0, 0, 0, 1) #define MPP0_UNUSED MPP(0, 0x3, 0, 0, 1, 1, 1) #define MPP0_GPIO MPP(0, 0x3, 1, 1, 1, 1, 1) #define MPP0_PCIE_RST_OUTn MPP(0, 0x0, 0, 0, 1, 1, 1) #define MPP0_PCI_ARB MPP(0, 0x2, 0, 0, 1, 1, 1) #define MPP1_UNUSED MPP(1, 0x0, 0, 0, 1, 1, 1) #define MPP1_GPIO MPP(1, 0x0, 1, 1, 1, 1, 1) #define MPP1_PCI_ARB MPP(1, 0x2, 0, 0, 1, 1, 1) #define MPP2_UNUSED MPP(2, 0x0, 0, 0, 1, 1, 1) #define MPP2_GPIO MPP(2, 0x0, 1, 1, 1, 1, 1) #define MPP2_PCI_ARB MPP(2, 0x2, 0, 0, 1, 1, 1) #define MPP2_PCI_PMEn MPP(2, 0x3, 0, 0, 1, 1, 1) #define MPP3_UNUSED MPP(3, 0x0, 0, 0, 1, 1, 1) #define MPP3_GPIO MPP(3, 0x0, 1, 1, 1, 1, 1) #define MPP3_PCI_ARB MPP(3, 0x2, 0, 0, 1, 1, 1) #define MPP4_UNUSED MPP(4, 0x0, 0, 0, 1, 1, 1) #define MPP4_GPIO MPP(4, 0x0, 1, 1, 1, 1, 1) #define MPP4_PCI_ARB MPP(4, 0x2, 0, 0, 1, 1, 1) #define MPP4_NAND MPP(4, 0x4, 0, 0, 0, 1, 1) #define MPP4_SATA_LED MPP(4, 0x5, 0, 0, 0, 1, 0) #define MPP5_UNUSED MPP(5, 0x0, 0, 0, 1, 1, 1) #define MPP5_GPIO MPP(5, 0x0, 1, 1, 1, 1, 1) #define MPP5_PCI_ARB MPP(5, 0x2, 0, 0, 1, 1, 1) #define MPP5_NAND MPP(5, 0x4, 0, 0, 0, 1, 1) #define MPP5_SATA_LED MPP(5, 0x5, 0, 0, 0, 1, 0) #define MPP6_UNUSED MPP(6, 0x0, 0, 0, 1, 1, 1) #define MPP6_GPIO MPP(6, 0x0, 1, 1, 1, 1, 1) #define MPP6_PCI_ARB MPP(6, 0x2, 0, 0, 1, 1, 1) #define MPP6_NAND MPP(6, 0x4, 0, 0, 0, 1, 1) #define MPP6_PCI_CLK MPP(6, 0x5, 0, 0, 1, 0, 0) #define MPP6_SATA_LED MPP(6, 0x5, 0, 0, 0, 1, 0) #define MPP7_UNUSED MPP(7, 0x0, 0, 0, 1, 1, 1) #define MPP7_GPIO MPP(7, 0x0, 1, 1, 1, 1, 1) #define MPP7_PCI_ARB MPP(7, 0x2, 0, 0, 1, 1, 1) #define MPP7_NAND MPP(7, 0x4, 0, 0, 0, 1, 1) #define MPP7_PCI_CLK MPP(7, 0x5, 0, 0, 1, 0, 0) #define MPP7_SATA_LED MPP(7, 0x5, 0, 0, 0, 1, 0) #define MPP8_UNUSED MPP(8, 0x0, 0, 0, 1, 1, 1) #define MPP8_GPIO MPP(8, 0x0, 1, 1, 1, 1, 1) #define MPP8_GIGE MPP(8, 0x1, 0, 0, 1, 1, 1) #define MPP9_UNUSED MPP(9, 0x0, 0, 0, 1, 1, 1) #define MPP9_GPIO MPP(9, 0x0, 1, 1, 1, 1, 1) #define MPP9_GIGE MPP(9, 0x1, 0, 0, 1, 1, 1) #define MPP10_UNUSED MPP(10, 0x0, 0, 0, 1, 1, 1) #define MPP10_GPIO MPP(10, 0x0, 1, 1, 1, 1, 1) #define MPP10_GIGE MPP(10, 0x1, 0, 0, 1, 1, 1) #define MPP11_UNUSED MPP(11, 0x0, 0, 0, 1, 1, 1) #define MPP11_GPIO MPP(11, 0x0, 1, 1, 1, 1, 1) #define MPP11_GIGE MPP(11, 0x1, 0, 0, 1, 1, 1) #define MPP12_UNUSED MPP(12, 0x0, 0, 0, 1, 1, 1) #define MPP12_GPIO MPP(12, 0x0, 1, 1, 1, 1, 1) #define MPP12_GIGE MPP(12, 0x1, 0, 0, 1, 1, 1) #define MPP12_NAND MPP(12, 0x4, 0, 0, 0, 1, 1) #define MPP12_SATA_LED MPP(12, 0x5, 0, 0, 0, 1, 0) #define MPP13_UNUSED MPP(13, 0x0, 0, 0, 1, 1, 1) #define MPP13_GPIO MPP(13, 0x0, 1, 1, 1, 1, 1) #define MPP13_GIGE MPP(13, 0x1, 0, 0, 1, 1, 1) #define MPP13_NAND MPP(13, 0x4, 0, 0, 0, 1, 1) #define MPP13_SATA_LED MPP(13, 0x5, 0, 0, 0, 1, 0) #define MPP14_UNUSED MPP(14, 0x0, 0, 0, 1, 1, 1) #define MPP14_GPIO MPP(14, 0x0, 1, 1, 1, 1, 1) #define MPP14_GIGE MPP(14, 0x1, 0, 0, 1, 1, 1) #define MPP14_NAND MPP(14, 0x4, 0, 0, 0, 1, 1) #define MPP14_SATA_LED MPP(14, 0x5, 0, 0, 0, 1, 0) #define MPP15_UNUSED MPP(15, 0x0, 0, 0, 1, 1, 1) #define MPP15_GPIO MPP(15, 0x0, 1, 1, 1, 1, 1) #define MPP15_GIGE MPP(15, 0x1, 0, 0, 1, 1, 1) #define MPP15_NAND MPP(15, 0x4, 0, 0, 0, 1, 1) #define MPP15_SATA_LED MPP(15, 0x5, 0, 0, 0, 1, 0) #define MPP16_UNUSED MPP(16, 0x0, 0, 0, 1, 1, 1) #define MPP16_GPIO MPP(16, 0x5, 1, 1, 0, 1, 0) #define MPP16_GIGE MPP(16, 0x1, 0, 0, 1, 1, 1) #define MPP16_NAND MPP(16, 0x4, 0, 0, 0, 1, 1) #define MPP16_UART MPP(16, 0x0, 0, 0, 0, 1, 1) #define MPP17_UNUSED MPP(17, 0x0, 0, 0, 1, 1, 1) #define MPP17_GPIO MPP(17, 0x5, 1, 1, 0, 1, 0) #define MPP17_GIGE MPP(17, 0x1, 0, 0, 1, 1, 1) #define MPP17_NAND MPP(17, 0x4, 0, 0, 0, 1, 1) #define MPP17_UART MPP(17, 0x0, 0, 0, 0, 1, 1) #define MPP18_UNUSED MPP(18, 0x0, 0, 0, 1, 1, 1) #define MPP18_GPIO MPP(18, 0x5, 1, 1, 0, 1, 0) #define MPP18_GIGE MPP(18, 0x1, 0, 0, 1, 1, 1) #define MPP18_UART MPP(18, 0x0, 0, 0, 0, 1, 1) #define MPP19_UNUSED MPP(19, 0x0, 0, 0, 1, 1, 1) #define MPP19_GPIO MPP(19, 0x5, 1, 1, 0, 1, 0) #define MPP19_GIGE MPP(19, 0x1, 0, 0, 1, 1, 1) #define MPP19_UART MPP(19, 0x0, 0, 0, 0, 1, 1) #define MPP_MAX 19 void orion5x_mpp_conf(unsigned int *mpp_list); #endif
#include <linux/buffer_head.h> #include <linux/hdreg.h> #include <linux/slab.h> #include <asm/dasd.h> #include <asm/ebcdic.h> #include <asm/uaccess.h> #include <asm/vtoc.h> #include "check.h" #include "ibm.h" static sector_t cchh2blk (struct vtoc_cchh *ptr, struct hd_geometry *geo) { sector_t cyl; __u16 head; cyl = ptr->hh & 0xFFF0; cyl <<= 12; cyl |= ptr->cc; head = ptr->hh & 0x000F; return cyl * geo->heads * geo->sectors + head * geo->sectors; } static sector_t cchhb2blk (struct vtoc_cchhb *ptr, struct hd_geometry *geo) { sector_t cyl; __u16 head; cyl = ptr->hh & 0xFFF0; cyl <<= 12; cyl |= ptr->cc; head = ptr->hh & 0x000F; return cyl * geo->heads * geo->sectors + head * geo->sectors + ptr->b; } int ibm_partition(struct parsed_partitions *state) { struct block_device *bdev = state->bdev; int blocksize, res; loff_t i_size, offset, size, fmt_size; dasd_information2_t *info; struct hd_geometry *geo; char type[5] = {0,}; char name[7] = {0,}; union label_t { struct vtoc_volume_label_cdl vol; struct vtoc_volume_label_ldl lnx; struct vtoc_cms_label cms; } *label; unsigned char *data; Sector sect; sector_t labelsect; char tmp[64]; res = 0; blocksize = bdev_logical_block_size(bdev); if (blocksize <= 0) goto out_exit; i_size = i_size_read(bdev->bd_inode); if (i_size == 0) goto out_exit; info = kmalloc(sizeof(dasd_information2_t), GFP_KERNEL); if (info == NULL) goto out_exit; geo = kmalloc(sizeof(struct hd_geometry), GFP_KERNEL); if (geo == NULL) goto out_nogeo; label = kmalloc(sizeof(union label_t), GFP_KERNEL); if (label == NULL) goto out_nolab; if (ioctl_by_bdev(bdev, BIODASDINFO2, (unsigned long)info) != 0 || ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo) != 0) goto out_freeall; if ((info->cu_type == 0x6310 && info->dev_type == 0x9336) || (info->cu_type == 0x3880 && info->dev_type == 0x3370)) labelsect = info->label_block; else labelsect = info->label_block * (blocksize >> 9); data = read_part_sector(state, labelsect, &sect); if (data == NULL) goto out_readerr; memcpy(label, data, sizeof(union label_t)); put_dev_sector(sect); if ((!info->FBA_layout) && (!strcmp(info->type, "ECKD"))) { strncpy(type, label->vol.vollbl, 4); strncpy(name, label->vol.volid, 6); } else { strncpy(type, label->lnx.vollbl, 4); strncpy(name, label->lnx.volid, 6); } EBCASC(type, 4); EBCASC(name, 6); res = 1; if (info->format == DASD_FORMAT_LDL) { if (strncmp(type, "CMS1", 4) == 0) { blocksize = label->cms.block_size; if (label->cms.disk_offset != 0) { snprintf(tmp, sizeof(tmp), "CMS1/%8s(MDSK):", name); strlcat(state->pp_buf, tmp, PAGE_SIZE); offset = label->cms.disk_offset; size = (label->cms.block_count - 1) * (blocksize >> 9); } else { snprintf(tmp, sizeof(tmp), "CMS1/%8s:", name); strlcat(state->pp_buf, tmp, PAGE_SIZE); offset = (info->label_block + 1); size = label->cms.block_count * (blocksize >> 9); } put_partition(state, 1, offset*(blocksize >> 9), size-offset*(blocksize >> 9)); } else { if (strncmp(type, "LNX1", 4) == 0) { snprintf(tmp, sizeof(tmp), "LNX1/%8s:", name); strlcat(state->pp_buf, tmp, PAGE_SIZE); if (label->lnx.ldl_version == 0xf2) { fmt_size = label->lnx.formatted_blocks * (blocksize >> 9); } else if (!strcmp(info->type, "ECKD")) { fmt_size = geo->cylinders * geo->heads * geo->sectors * (blocksize >> 9); } else { fmt_size = i_size >> 9; } size = i_size >> 9; if (fmt_size < size) size = fmt_size; offset = (info->label_block + 1); } else { strlcat(state->pp_buf, "(nonl)", PAGE_SIZE); size = i_size >> 9; offset = (info->label_block + 1); } put_partition(state, 1, offset*(blocksize >> 9), size-offset*(blocksize >> 9)); } } else if (info->format == DASD_FORMAT_CDL) { sector_t blk; int counter; if (strncmp(type, "VOL1", 4) == 0) { snprintf(tmp, sizeof(tmp), "VOL1/%8s:", name); strlcat(state->pp_buf, tmp, PAGE_SIZE); blk = cchhb2blk(&label->vol.vtoc, geo) + 1; counter = 0; data = read_part_sector(state, blk * (blocksize/512), &sect); while (data != NULL) { struct vtoc_format1_label f1; memcpy(&f1, data, sizeof(struct vtoc_format1_label)); put_dev_sector(sect); if (f1.DS1FMTID == _ascebc['4'] || f1.DS1FMTID == _ascebc['5'] || f1.DS1FMTID == _ascebc['7'] || f1.DS1FMTID == _ascebc['9']) { blk++; data = read_part_sector(state, blk * (blocksize/512), &sect); continue; } if (f1.DS1FMTID != _ascebc['1'] && f1.DS1FMTID != _ascebc['8']) break; offset = cchh2blk(&f1.DS1EXT1.llimit, geo); size = cchh2blk(&f1.DS1EXT1.ulimit, geo) - offset + geo->sectors; if (counter >= state->limit) break; put_partition(state, counter + 1, offset * (blocksize >> 9), size * (blocksize >> 9)); counter++; blk++; data = read_part_sector(state, blk * (blocksize/512), &sect); } if (!data) goto out_readerr; } else printk(KERN_WARNING "Warning, expected Label VOL1 not " "found, treating as CDL formated Disk"); } strlcat(state->pp_buf, "\n", PAGE_SIZE); goto out_freeall; out_readerr: res = -1; out_freeall: kfree(label); out_nolab: kfree(geo); out_nogeo: kfree(info); out_exit: return res; }
/* * OpenRISC Linux * * Linux architectural port borrowing liberally from similar works of * others. All original copyrights apply as per the original source * declaration. * * OpenRISC implementation: * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com> * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se> * et al. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #ifndef __ASM_OPENRISC_LINKAGE_H #define __ASM_OPENRISC_LINKAGE_H #define __ALIGN .align 0 #define __ALIGN_STR ".align 0" #endif
/* Copyright (c) 2012, 2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef __MSM_MEMORY_DUMP_H #define __MSM_MEMORY_DUMP_H #include <linux/types.h> enum dump_client_type { MSM_CPU_CTXT = 0, MSM_L1_CACHE, MSM_L2_CACHE, MSM_OCMEM, MSM_TMC_ETFETB, MSM_ETM0_REG, MSM_ETM1_REG, MSM_ETM2_REG, MSM_ETM3_REG, MSM_TMC0_REG, /* TMC_ETR */ MSM_TMC1_REG, /* TMC_ETF */ MSM_LOG_BUF, MSM_LOG_BUF_FIRST_IDX, MAX_NUM_CLIENTS, }; struct msm_client_dump { enum dump_client_type id; unsigned long start_addr; unsigned long end_addr; }; #ifdef CONFIG_MSM_MEMORY_DUMP extern int msm_dump_tbl_register(struct msm_client_dump *client_entry); #else static inline int msm_dump_tbl_register(struct msm_client_dump *entry) { return -EIO; } #endif #if defined(CONFIG_MSM_MEMORY_DUMP) || defined(CONFIG_MSM_MEMORY_DUMP_V2) extern uint32_t msm_dump_table_version(void); #else static inline uint32_t msm_dump_table_version(void) { return 0; } #endif #define MSM_DUMP_MAKE_VERSION(ma, mi) ((ma << 20) | mi) #define MSM_DUMP_MAJOR(val) (val >> 20) #define MSM_DUMP_MINOR(val) (val & 0xFFFFF) #define MAX_NUM_ENTRIES 0x120 enum msm_dump_data_ids { MSM_DUMP_DATA_CPU_CTX = 0x00, MSM_DUMP_DATA_L1_INST_CACHE = 0x60, MSM_DUMP_DATA_L1_DATA_CACHE = 0x80, MSM_DUMP_DATA_ETM_REG = 0xA0, MSM_DUMP_DATA_L2_CACHE = 0xC0, MSM_DUMP_DATA_L3_CACHE = 0xD0, MSM_DUMP_DATA_OCMEM = 0xE0, MSM_DUMP_DATA_MISC = 0xE8, MSM_DUMP_DATA_TMC_ETF = 0xF0, MSM_DUMP_DATA_TMC_REG = 0x100, MSM_DUMP_DATA_LOG_BUF = 0x110, MSM_DUMP_DATA_LOG_BUF_FIRST_IDX = 0x111, MSM_DUMP_DATA_MAX = MAX_NUM_ENTRIES, }; enum msm_dump_table_ids { MSM_DUMP_TABLE_APPS, MSM_DUMP_TABLE_MAX = MAX_NUM_ENTRIES, }; enum msm_dump_type { MSM_DUMP_TYPE_DATA, MSM_DUMP_TYPE_TABLE, }; struct msm_dump_data { uint32_t version; uint32_t magic; char name[32]; uint64_t addr; uint64_t len; uint32_t reserved; }; struct msm_dump_entry { uint32_t id; char name[32]; uint32_t type; uint64_t addr; }; #ifdef CONFIG_MSM_MEMORY_DUMP_V2 extern int msm_dump_data_register(enum msm_dump_table_ids id, struct msm_dump_entry *entry); #else static inline int msm_dump_data_register(enum msm_dump_table_ids id, struct msm_dump_entry *entry) { return -ENOSYS; } #endif #endif
/* { dg-do compile } */ /* { dg-options "-mavx512f -O2" } */ /* { dg-final { scan-assembler-times "vpmovzxbq\[ \\t\]+\[^\n\]*%xmm\[0-9\]\[^\n\]*%zmm\[0-9\]\[^\{\]" 1 } } */ /* { dg-final { scan-assembler-times "vpmovzxbq\[ \\t\]+\[^\n\]*%xmm\[0-9\]\[^\n\]*%zmm\[0-9\]\{%k\[1-7\]\}\[^\{\]" 1 } } */ /* { dg-final { scan-assembler-times "vpmovzxbq\[ \\t\]+\[^\n\]*%xmm\[0-9\]\[^\n\]*%zmm\[0-9\]\{%k\[1-7\]\}\{z\}" 1 } } */ #include <immintrin.h> volatile __m128i s; volatile __m512i res; volatile __mmask8 m; void extern avx512f_test (void) { res = _mm512_cvtepu8_epi64 (s); res = _mm512_mask_cvtepu8_epi64 (res, m, s); res = _mm512_maskz_cvtepu8_epi64 (m, s); }
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the qmake spec of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef Q_POSIX_QPLATFORMDEFS_H #define Q_POSIX_QPLATFORMDEFS_H #include <signal.h> #include <sys/types.h> #ifndef QT_NO_SOCKET_H # include <sys/socket.h> #endif #include <sys/stat.h> #if defined(QT_USE_XOPEN_LFS_EXTENSIONS) && defined(QT_LARGEFILE_SUPPORT) #define QT_STATBUF struct stat64 #define QT_FPOS_T fpos64_t #define QT_OFF_T off64_t #define QT_STAT ::stat64 #define QT_LSTAT ::lstat64 #define QT_TRUNCATE ::truncate64 // File I/O #define QT_OPEN ::open64 #define QT_LSEEK ::lseek64 #define QT_FSTAT ::fstat64 #define QT_FTRUNCATE ::ftruncate64 // Standard C89 #define QT_FOPEN ::fopen64 #define QT_FSEEK ::fseeko64 #define QT_FTELL ::ftello64 #define QT_FGETPOS ::fgetpos64 #define QT_FSETPOS ::fsetpos64 #define QT_MMAP ::mmap64 #else // !defined(QT_USE_XOPEN_LFS_EXTENSIONS) || !defined(QT_LARGEFILE_SUPPORT) #include "../c89/qplatformdefs.h" #define QT_STATBUF struct stat #define QT_STAT ::stat #define QT_LSTAT ::lstat #define QT_TRUNCATE ::truncate // File I/O #define QT_OPEN ::open #define QT_LSEEK ::lseek #define QT_FSTAT ::fstat #define QT_FTRUNCATE ::ftruncate // Posix extensions to C89 #if !defined(QT_USE_XOPEN_LFS_EXTENSIONS) && !defined(QT_NO_USE_FSEEKO) #undef QT_OFF_T #undef QT_FSEEK #undef QT_FTELL #define QT_OFF_T off_t #define QT_FSEEK ::fseeko #define QT_FTELL ::ftello #endif #define QT_MMAP ::mmap #endif // !defined (QT_USE_XOPEN_LFS_EXTENSIONS) || !defined(QT_LARGEFILE_SUPPORT) #define QT_STAT_MASK S_IFMT #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR #define QT_STAT_LNK S_IFLNK #define QT_ACCESS ::access #define QT_GETCWD ::getcwd #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir // File I/O #define QT_CLOSE ::close #define QT_READ ::read #define QT_WRITE ::write #define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR #define QT_OPEN_CREAT O_CREAT #define QT_OPEN_TRUNC O_TRUNC #define QT_OPEN_APPEND O_APPEND // Posix extensions to C89 #define QT_FILENO fileno // Directory iteration #define QT_DIR DIR #define QT_OPENDIR ::opendir #define QT_CLOSEDIR ::closedir #if defined(QT_LARGEFILE_SUPPORT) \ && defined(QT_USE_XOPEN_LFS_EXTENSIONS) \ && !defined(QT_NO_READDIR64) #define QT_DIRENT struct dirent64 #define QT_READDIR ::readdir64 #define QT_READDIR_R ::readdir64_r #else #define QT_DIRENT struct dirent #define QT_READDIR ::readdir #define QT_READDIR_R ::readdir_r #endif #define QT_SOCKLEN_T socklen_t #define QT_SOCKET_CONNECT ::connect #define QT_SOCKET_BIND ::bind #define QT_SIGNAL_RETTYPE void #define QT_SIGNAL_ARGS int #define QT_SIGNAL_IGNORE SIG_IGN #endif // include guard
#ifndef _ASM_X86_PGTABLE_64_H #define _ASM_X86_PGTABLE_64_H #include <linux/const.h> #include <asm/pgtable_64_types.h> #ifndef __ASSEMBLY__ /* * This file contains the functions and defines necessary to modify and use * the x86-64 page table tree. */ #include <asm/processor.h> #include <linux/bitops.h> #include <linux/threads.h> extern pud_t level3_kernel_pgt[512]; extern pud_t level3_ident_pgt[512]; extern pmd_t level2_kernel_pgt[512]; extern pmd_t level2_fixmap_pgt[512]; extern pmd_t level2_ident_pgt[512]; extern pte_t level1_fixmap_pgt[512]; extern pgd_t init_level4_pgt[]; #define swapper_pg_dir init_level4_pgt extern void paging_init(void); #define pte_ERROR(e) \ pr_err("%s:%d: bad pte %p(%016lx)\n", \ __FILE__, __LINE__, &(e), pte_val(e)) #define pmd_ERROR(e) \ pr_err("%s:%d: bad pmd %p(%016lx)\n", \ __FILE__, __LINE__, &(e), pmd_val(e)) #define pud_ERROR(e) \ pr_err("%s:%d: bad pud %p(%016lx)\n", \ __FILE__, __LINE__, &(e), pud_val(e)) #define pgd_ERROR(e) \ pr_err("%s:%d: bad pgd %p(%016lx)\n", \ __FILE__, __LINE__, &(e), pgd_val(e)) struct mm_struct; void set_pte_vaddr_pud(pud_t *pud_page, unsigned long vaddr, pte_t new_pte); static inline void native_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { *ptep = native_make_pte(0); } static inline void native_set_pte(pte_t *ptep, pte_t pte) { *ptep = pte; } static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte) { native_set_pte(ptep, pte); } static inline void native_set_pmd(pmd_t *pmdp, pmd_t pmd) { *pmdp = pmd; } static inline void native_pmd_clear(pmd_t *pmd) { native_set_pmd(pmd, native_make_pmd(0)); } static inline pte_t native_ptep_get_and_clear(pte_t *xp) { #ifdef CONFIG_SMP return native_make_pte(xchg(&xp->pte, 0)); #else /* native_local_ptep_get_and_clear, but duplicated because of cyclic dependency */ pte_t ret = *xp; native_pte_clear(NULL, 0, xp); return ret; #endif } static inline pmd_t native_pmdp_get_and_clear(pmd_t *xp) { #ifdef CONFIG_SMP return native_make_pmd(xchg(&xp->pmd, 0)); #else /* native_local_pmdp_get_and_clear, but duplicated because of cyclic dependency */ pmd_t ret = *xp; native_pmd_clear(xp); return ret; #endif } static inline void native_set_pud(pud_t *pudp, pud_t pud) { *pudp = pud; } static inline void native_pud_clear(pud_t *pud) { native_set_pud(pud, native_make_pud(0)); } static inline void native_set_pgd(pgd_t *pgdp, pgd_t pgd) { *pgdp = pgd; } static inline void native_pgd_clear(pgd_t *pgd) { native_set_pgd(pgd, native_make_pgd(0)); } extern void sync_global_pgds(unsigned long start, unsigned long end); /* * Conversion functions: convert a page and protection to a page entry, * and a page entry and page directory to the page they refer to. */ /* * Level 4 access. */ static inline int pgd_large(pgd_t pgd) { return 0; } #define mk_kernel_pgd(address) __pgd((address) | _KERNPG_TABLE) /* PUD - Level3 access */ /* PMD - Level 2 access */ /* PTE - Level 1 access. */ /* x86-64 always has all page tables mapped. */ #define pte_offset_map(dir, address) pte_offset_kernel((dir), (address)) #define pte_unmap(pte) ((void)(pte))/* NOP */ /* * Encode and de-code a swap entry * * | ... | 11| 10| 9|8|7|6|5| 4| 3|2|1|0| <- bit number * | ... |SW3|SW2|SW1|G|L|D|A|CD|WT|U|W|P| <- bit names * | OFFSET (14->63) | TYPE (9-13) |0|X|X|X| X| X|X|X|0| <- swp entry * * G (8) is aliased and used as a PROT_NONE indicator for * !present ptes. We need to start storing swap entries above * there. We also need to avoid using A and D because of an * erratum where they can be incorrectly set by hardware on * non-present PTEs. */ #define SWP_TYPE_FIRST_BIT (_PAGE_BIT_PROTNONE + 1) #define SWP_TYPE_BITS 5 /* Place the offset above the type: */ #define SWP_OFFSET_FIRST_BIT (SWP_TYPE_FIRST_BIT + SWP_TYPE_BITS) #define MAX_SWAPFILES_CHECK() BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > SWP_TYPE_BITS) #define __swp_type(x) (((x).val >> (SWP_TYPE_FIRST_BIT)) \ & ((1U << SWP_TYPE_BITS) - 1)) #define __swp_offset(x) ((x).val >> SWP_OFFSET_FIRST_BIT) #define __swp_entry(type, offset) ((swp_entry_t) { \ ((type) << (SWP_TYPE_FIRST_BIT)) \ | ((offset) << SWP_OFFSET_FIRST_BIT) }) #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val((pte)) }) #define __swp_entry_to_pte(x) ((pte_t) { .pte = (x).val }) extern int kern_addr_valid(unsigned long addr); extern void cleanup_highmap(void); #define HAVE_ARCH_UNMAPPED_AREA #define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN #define pgtable_cache_init() do { } while (0) #define check_pgt_cache() do { } while (0) #define PAGE_AGP PAGE_KERNEL_NOCACHE #define HAVE_PAGE_AGP 1 /* fs/proc/kcore.c */ #define kc_vaddr_to_offset(v) ((v) & __VIRTUAL_MASK) #define kc_offset_to_vaddr(o) ((o) | ~__VIRTUAL_MASK) #define __HAVE_ARCH_PTE_SAME #define vmemmap ((struct page *)VMEMMAP_START) extern void init_extra_mapping_uc(unsigned long phys, unsigned long size); extern void init_extra_mapping_wb(unsigned long phys, unsigned long size); #endif /* !__ASSEMBLY__ */ #endif /* _ASM_X86_PGTABLE_64_H */
/* * Copyright (C) 2000-2003 Axis Communications AB * * Authors: Bjorn Wesen (bjornw@axis.com) * Mikael Starvik (starvik@axis.com) * Tobias Anderberg (tobiasa@axis.com), CRISv32 port. * * This file handles the architecture-dependent parts of process handling.. */ #include <linux/sched.h> #include <linux/sched/debug.h> #include <linux/sched/task.h> #include <linux/sched/task_stack.h> #include <linux/slab.h> #include <linux/err.h> #include <linux/fs.h> #include <hwregs/reg_rdwr.h> #include <hwregs/reg_map.h> #include <hwregs/timer_defs.h> #include <hwregs/intr_vect_defs.h> #include <linux/ptrace.h> extern void stop_watchdog(void); /* We use this if we don't have any better idle routine. */ void default_idle(void) { local_irq_enable(); /* Halt until exception. */ __asm__ volatile("halt"); } /* * Free current thread data structures etc.. */ extern void deconfigure_bp(long pid); void exit_thread(struct task_struct *tsk) { deconfigure_bp(tsk->pid); } /* * If the watchdog is enabled, disable interrupts and enter an infinite loop. * The watchdog will reset the CPU after 0.1s. If the watchdog isn't enabled * then enable it and wait. */ extern void arch_enable_nmi(void); void hard_reset_now(void) { /* * Don't declare this variable elsewhere. We don't want any other * code to know about it than the watchdog handler in entry.S and * this code, implementing hard reset through the watchdog. */ #if defined(CONFIG_ETRAX_WATCHDOG) extern int cause_of_death; #endif printk("*** HARD RESET ***\n"); local_irq_disable(); #if defined(CONFIG_ETRAX_WATCHDOG) cause_of_death = 0xbedead; #else { reg_timer_rw_wd_ctrl wd_ctrl = {0}; stop_watchdog(); wd_ctrl.key = 16; /* Arbitrary key. */ wd_ctrl.cnt = 1; /* Minimum time. */ wd_ctrl.cmd = regk_timer_start; arch_enable_nmi(); REG_WR(timer, regi_timer0, rw_wd_ctrl, wd_ctrl); } #endif while (1) ; /* Wait for reset. */ } /* * Return saved PC of a blocked thread. */ unsigned long thread_saved_pc(struct task_struct *t) { return task_pt_regs(t)->erp; } /* * Setup the child's kernel stack with a pt_regs and call switch_stack() on it. * It will be unnested during _resume and _ret_from_sys_call when the new thread * is scheduled. * * Also setup the thread switching structure which is used to keep * thread-specific data during _resumes. */ extern asmlinkage void ret_from_fork(void); extern asmlinkage void ret_from_kernel_thread(void); int copy_thread(unsigned long clone_flags, unsigned long usp, unsigned long arg, struct task_struct *p) { struct pt_regs *childregs = task_pt_regs(p); struct switch_stack *swstack = ((struct switch_stack *) childregs) - 1; /* * Put the pt_regs structure at the end of the new kernel stack page and * fix it up. Note: the task_struct doubles as the kernel stack for the * task. */ if (unlikely(p->flags & PF_KTHREAD)) { memset(swstack, 0, sizeof(struct switch_stack) + sizeof(struct pt_regs)); swstack->r1 = usp; swstack->r2 = arg; childregs->ccs = 1 << (I_CCS_BITNR + CCS_SHIFT); swstack->return_ip = (unsigned long) ret_from_kernel_thread; p->thread.ksp = (unsigned long) swstack; p->thread.usp = 0; return 0; } *childregs = *current_pt_regs(); /* Struct copy of pt_regs. */ childregs->r10 = 0; /* Child returns 0 after a fork/clone. */ /* Set a new TLS ? * The TLS is in $mof because it is the 5th argument to sys_clone. */ if (p->mm && (clone_flags & CLONE_SETTLS)) { task_thread_info(p)->tls = childregs->mof; } /* Put the switch stack right below the pt_regs. */ /* Parameter to ret_from_sys_call. 0 is don't restart the syscall. */ swstack->r9 = 0; /* * We want to return into ret_from_sys_call after the _resume. * ret_from_fork will call ret_from_sys_call. */ swstack->return_ip = (unsigned long) ret_from_fork; /* Fix the user-mode and kernel-mode stackpointer. */ p->thread.usp = usp ?: rdusp(); p->thread.ksp = (unsigned long) swstack; return 0; } unsigned long get_wchan(struct task_struct *p) { /* TODO */ return 0; } #undef last_sched #undef first_sched void show_regs(struct pt_regs * regs) { unsigned long usp = rdusp(); show_regs_print_info(KERN_DEFAULT); printk("ERP: %08lx SRP: %08lx CCS: %08lx USP: %08lx MOF: %08lx\n", regs->erp, regs->srp, regs->ccs, usp, regs->mof); printk(" r0: %08lx r1: %08lx r2: %08lx r3: %08lx\n", regs->r0, regs->r1, regs->r2, regs->r3); printk(" r4: %08lx r5: %08lx r6: %08lx r7: %08lx\n", regs->r4, regs->r5, regs->r6, regs->r7); printk(" r8: %08lx r9: %08lx r10: %08lx r11: %08lx\n", regs->r8, regs->r9, regs->r10, regs->r11); printk("r12: %08lx r13: %08lx oR10: %08lx\n", regs->r12, regs->r13, regs->orig_r10); }
#include "debug.h" #include <stdarg.h> #include <windows.h> #include <stdio.h> /* vsprintf */ #define DPRINTF_BUF_SZ 1024 void OutputDebugStringf(char *fmt, ...) { #ifdef _DEBUG va_list args; char buf[DPRINTF_BUF_SZ]; va_start(args, fmt); vsprintf(buf, fmt, args); OutputDebugString(buf); #endif }
#include <sys/mman.h> #include "syscall.h" int mlockall(int flags) { return syscall(SYS_mlockall, flags); }
/* * Copyright (C) 2012-2018 Team Kodi * This file is part of Kodi - https://kodi.tv * * SPDX-License-Identifier: GPL-2.0-or-later * See LICENSES/README.md for more information. */ #pragma once #include "FileItem.h" #include <string> #include <Neptune/Source/Core/NptReferences.h> #include <Neptune/Source/Core/NptStrings.h> #include <Neptune/Source/Core/NptTypes.h> class CUPnPServer; class CFileItem; class CThumbLoader; class PLT_DeviceData; class PLT_HttpRequestContext; class PLT_MediaItemResource; class PLT_MediaObject; class NPT_String; namespace MUSIC_INFO { class CMusicInfoTag; } class CVideoInfoTag; namespace UPNP { enum UPnPService { UPnPServiceNone = 0, UPnPClient, UPnPContentDirectory, UPnPPlayer, UPnPRenderer }; class CResourceFinder { public: CResourceFinder(const char* protocol, const char* content = NULL); bool operator()(const PLT_MediaItemResource& resource) const; private: NPT_String m_Protocol; NPT_String m_Content; }; enum EClientQuirks { ECLIENTQUIRKS_NONE = 0x0 /* Client requires folder's to be marked as storageFolders as vendor type (360)*/ , ECLIENTQUIRKS_ONLYSTORAGEFOLDER = 0x01 /* Client can't handle subtypes for videoItems (360) */ , ECLIENTQUIRKS_BASICVIDEOCLASS = 0x02 /* Client requires album to be set to [Unknown Series] to show title (WMP) */ , ECLIENTQUIRKS_UNKNOWNSERIES = 0x04 }; EClientQuirks GetClientQuirks(const PLT_HttpRequestContext* context); enum EMediaControllerQuirks { EMEDIACONTROLLERQUIRKS_NONE = 0x00 /* Media Controller expects MIME type video/x-mkv instead of video/x-matroska (Samsung) */ , EMEDIACONTROLLERQUIRKS_X_MKV = 0x01 }; EMediaControllerQuirks GetMediaControllerQuirks(const PLT_DeviceData *device); const char* GetMimeTypeFromExtension(const char* extension, const PLT_HttpRequestContext* context = NULL); NPT_String GetMimeType(const CFileItem& item, const PLT_HttpRequestContext* context = NULL); NPT_String GetMimeType(const char* filename, const PLT_HttpRequestContext* context = NULL); const NPT_String GetProtocolInfo(const CFileItem& item, const char* protocol, const PLT_HttpRequestContext* context = NULL); const std::string& CorrectAllItemsSortHack(const std::string &item); NPT_Result PopulateTagFromObject(MUSIC_INFO::CMusicInfoTag& tag, PLT_MediaObject& object, PLT_MediaItemResource* resource = NULL, UPnPService service = UPnPServiceNone); NPT_Result PopulateTagFromObject(CVideoInfoTag& tag, PLT_MediaObject& object, PLT_MediaItemResource* resource = NULL, UPnPService service = UPnPServiceNone); NPT_Result PopulateObjectFromTag(MUSIC_INFO::CMusicInfoTag& tag, PLT_MediaObject& object, NPT_String* file_path, PLT_MediaItemResource* resource, EClientQuirks quirks, UPnPService service = UPnPServiceNone); NPT_Result PopulateObjectFromTag(CVideoInfoTag& tag, PLT_MediaObject& object, NPT_String* file_path, PLT_MediaItemResource* resource, EClientQuirks quirks, UPnPService service = UPnPServiceNone); PLT_MediaObject* BuildObject(CFileItem& item, NPT_String& file_path, bool with_count, NPT_Reference<CThumbLoader>& thumb_loader, const PLT_HttpRequestContext* context = NULL, CUPnPServer* upnp_server = NULL, UPnPService upnp_service = UPnPServiceNone); CFileItemPtr BuildObject(PLT_MediaObject* entry, UPnPService upnp_service = UPnPServiceNone); bool GetResource(const PLT_MediaObject* entry, CFileItem& item); CFileItemPtr GetFileItem(const NPT_String& uri, const NPT_String& meta); }
/* * carlu - userspace testing utility for ar9170 devices * * Firmware parsers * * Copyright 2009-2011 Christian Lamparter <chunkeey@googlemail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <stdio.h> #include <stdbool.h> #include <stdlib.h> #include <errno.h> #include <string.h> #include <stdlib.h> #include "libusb.h" #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include "carlu.h" #include "usb.h" #include "debug.h" int carlu_fw_check(struct carlu *ar) { struct carl9170fw_otus_desc *otus_desc; otus_desc = carlfw_find_desc(ar->fw, (uint8_t *) OTUS_MAGIC, sizeof(*otus_desc), CARL9170FW_OTUS_DESC_CUR_VER); if (!otus_desc) { err("No valid OTUS descriptor found.\n"); return -EINVAL; } if (!carl9170fw_supports(otus_desc->feature_set, CARL9170FW_DUMMY_FEATURE)) { err("Invalid Firmware Descriptor.\n"); return -EIO; } if (carl9170fw_supports(otus_desc->feature_set, CARL9170FW_UNUSABLE)) dbg("Firmware is marked as unuseable.\n"); info("Firmware Version: %d.\n", otus_desc->api_ver); return 0; } int carlusb_fw_check(struct carlu *ar) { struct carl9170fw_otus_desc *otus_desc; otus_desc = carlfw_find_desc(ar->fw, (uint8_t *) OTUS_MAGIC, sizeof(*otus_desc), CARL9170FW_OTUS_DESC_CUR_VER); if (!otus_desc) { err("No valid USB descriptor found.\n"); return -ENODATA; } if (!carl9170fw_supports(otus_desc->feature_set, CARL9170FW_DUMMY_FEATURE)) { err("Invalid Firmware Descriptor.\n"); return -EINVAL; } if (!carl9170fw_supports(otus_desc->feature_set, CARL9170FW_USB_INIT_FIRMWARE)) { err("Firmware does not know how to initialize USB core.\n"); return -EOPNOTSUPP; } if (carl9170fw_supports(otus_desc->feature_set, CARL9170FW_USB_DOWN_STREAM)) { dbg("Enabled tx stream mode.\n"); ar->tx_stream = true; ar->extra_headroom = sizeof(struct ar9170_stream); } if (carl9170fw_supports(otus_desc->feature_set, CARL9170FW_USB_UP_STREAM)) { dbg("Enabled rx stream mode.\n"); ar->rx_stream = true; } if (carl9170fw_supports(otus_desc->feature_set, CARL9170FW_USB_RESP_EP2)) dbg("Firmware sends traps over EP2.\n"); ar->dma_chunk_size = le16_to_cpu(otus_desc->tx_frag_len); ar->dma_chunks = otus_desc->tx_descs; ar->rx_max = le16_to_cpu(otus_desc->rx_max_frame_len); if (carl9170fw_supports(otus_desc->feature_set, CARL9170FW_MINIBOOT)) ar->miniboot_size = le16_to_cpu(otus_desc->miniboot_size); return 0; } void carlu_fw_info(struct carlu *ar) { struct carl9170fw_motd_desc *motd_desc; unsigned int fw_date; motd_desc = carlfw_find_desc(ar->fw, (uint8_t *) MOTD_MAGIC, sizeof(*motd_desc), CARL9170FW_MOTD_DESC_CUR_VER); if (motd_desc) { fw_date = le32_to_cpu(motd_desc->fw_year_month_day); info("Firmware Date: 2%.3d-%.2d-%.2d\n", CARL9170FW_GET_YEAR(fw_date), CARL9170FW_GET_MONTH(fw_date), CARL9170FW_GET_DAY(fw_date)); } }
// Copyright 2009 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. #pragma once #include <memory> #include "AudioCommon/Mixer.h" #include "Common/CommonTypes.h" class SoundStream { protected: std::unique_ptr<Mixer> m_mixer; public: SoundStream() : m_mixer(new Mixer(48000)) {} virtual ~SoundStream() {} static bool isValid() { return false; } Mixer* GetMixer() const { return m_mixer.get(); } virtual bool Init() { return false; } virtual void SetVolume(int) {} virtual void SoundLoop() {} virtual void Update() {} virtual bool SetRunning(bool running) { return false; } };
/* * Copyright (C) 2013 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #include <stdbool.h> #include <stddef.h> #include <string.h> #include "hal-log.h" #include "hal.h" #include "hal-msg.h" #include "hal-ipc.h" static const btav_callbacks_t *cbs = NULL; static bool interface_ready(void) { return cbs != NULL; } static void handle_conn_state(void *buf, uint16_t len, int fd) { struct hal_ev_a2dp_conn_state *ev = buf; if (cbs->connection_state_cb) cbs->connection_state_cb(ev->state, (bt_bdaddr_t *) (ev->bdaddr)); } static void handle_audio_state(void *buf, uint16_t len, int fd) { struct hal_ev_a2dp_audio_state *ev = buf; if (cbs->audio_state_cb) cbs->audio_state_cb(ev->state, (bt_bdaddr_t *)(ev->bdaddr)); } static void handle_audio_config(void *buf, uint16_t len, int fd) { #if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0) struct hal_ev_a2dp_audio_config *ev = buf; if (cbs->audio_config_cb) cbs->audio_config_cb((bt_bdaddr_t *)(ev->bdaddr), ev->sample_rate, ev->channel_count); #endif } /* * handlers will be called from notification thread context, * index in table equals to 'opcode - HAL_MINIMUM_EVENT' */ static const struct hal_ipc_handler ev_handlers[] = { /* HAL_EV_A2DP_CONN_STATE */ { handle_conn_state, false, sizeof(struct hal_ev_a2dp_conn_state) }, /* HAL_EV_A2DP_AUDIO_STATE */ { handle_audio_state, false, sizeof(struct hal_ev_a2dp_audio_state) }, /* HAL_EV_A2DP_AUDIO_CONFIG */ { handle_audio_config, false, sizeof(struct hal_ev_a2dp_audio_config) }, }; static bt_status_t a2dp_connect(bt_bdaddr_t *bd_addr) { struct hal_cmd_a2dp_connect cmd; DBG(""); if (!interface_ready()) return BT_STATUS_NOT_READY; memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); return hal_ipc_cmd(HAL_SERVICE_ID_A2DP, HAL_OP_A2DP_CONNECT, sizeof(cmd), &cmd, NULL, NULL, NULL); } static bt_status_t disconnect(bt_bdaddr_t *bd_addr) { struct hal_cmd_a2dp_disconnect cmd; DBG(""); if (!interface_ready()) return BT_STATUS_NOT_READY; memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); return hal_ipc_cmd(HAL_SERVICE_ID_A2DP, HAL_OP_A2DP_DISCONNECT, sizeof(cmd), &cmd, NULL, NULL, NULL); } static bt_status_t init(btav_callbacks_t *callbacks) { struct hal_cmd_register_module cmd; int ret; DBG(""); if (interface_ready()) return BT_STATUS_DONE; cbs = callbacks; hal_ipc_register(HAL_SERVICE_ID_A2DP, ev_handlers, sizeof(ev_handlers)/sizeof(ev_handlers[0])); cmd.service_id = HAL_SERVICE_ID_A2DP; cmd.mode = HAL_MODE_DEFAULT; cmd.max_clients = 1; ret = hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_REGISTER_MODULE, sizeof(cmd), &cmd, NULL, NULL, NULL); if (ret != BT_STATUS_SUCCESS) { cbs = NULL; hal_ipc_unregister(HAL_SERVICE_ID_A2DP); } return ret; } static void cleanup(void) { struct hal_cmd_unregister_module cmd; DBG(""); if (!interface_ready()) return; cmd.service_id = HAL_SERVICE_ID_A2DP; hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_UNREGISTER_MODULE, sizeof(cmd), &cmd, NULL, NULL, NULL); hal_ipc_unregister(HAL_SERVICE_ID_A2DP); cbs = NULL; } static btav_interface_t iface = { .size = sizeof(iface), .init = init, .connect = a2dp_connect, .disconnect = disconnect, .cleanup = cleanup }; btav_interface_t *bt_get_a2dp_interface(void) { return &iface; }
@import Foundation; @interface NSEntityDescription : NSObject @end @interface NSManagedObjectContext : NSObject @end @interface NSManagedObject : NSObject - (__kindof NSManagedObject *)initWithEntity:(NSEntityDescription *)entity insertIntoManagedObjectContext:(NSManagedObjectContext *)context; @property(nonatomic, readonly, strong) NSEntityDescription *entity; + (NSEntityDescription *)entity; @end
/* * Copyright (C) 2008 Google, Inc. * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include <linux/kernel.h> #include <linux/platform_device.h> #include <linux/dma-mapping.h> #include <mach/irqs.h> #include <mach/msm_iomap.h> #include <mach/dma.h> #include <mach/board.h> #include "devices.h" #include <asm/mach/flash.h> #include <mach/mmc.h> static struct resource resources_uart3[] = { { .start = INT_UART3, .end = INT_UART3, .flags = IORESOURCE_IRQ, }, { .start = MSM_UART3_PHYS, .end = MSM_UART3_PHYS + MSM_UART3_SIZE - 1, .flags = IORESOURCE_MEM, }, }; struct platform_device msm_device_uart3 = { .name = "msm_serial", .id = 2, .num_resources = ARRAY_SIZE(resources_uart3), .resource = resources_uart3, }; struct clk msm_clocks_8x50[] = { CLK_PCOM("adm_clk", ADM_CLK, NULL, 0), CLK_PCOM("ebi1_clk", EBI1_CLK, NULL, CLK_MIN), CLK_PCOM("ebi2_clk", EBI2_CLK, NULL, 0), CLK_PCOM("ecodec_clk", ECODEC_CLK, NULL, 0), CLK_PCOM("emdh_clk", EMDH_CLK, NULL, OFF | CLK_MINMAX), CLK_PCOM("gp_clk", GP_CLK, NULL, 0), CLK_PCOM("grp_clk", GRP_3D_CLK, NULL, 0), CLK_PCOM("icodec_rx_clk", ICODEC_RX_CLK, NULL, 0), CLK_PCOM("icodec_tx_clk", ICODEC_TX_CLK, NULL, 0), CLK_PCOM("imem_clk", IMEM_CLK, NULL, OFF), CLK_PCOM("mdc_clk", MDC_CLK, NULL, 0), CLK_PCOM("mddi_clk", PMDH_CLK, NULL, OFF | CLK_MINMAX), CLK_PCOM("mdp_clk", MDP_CLK, NULL, OFF), CLK_PCOM("mdp_lcdc_pclk_clk", MDP_LCDC_PCLK_CLK, NULL, 0), CLK_PCOM("mdp_lcdc_pad_pclk_clk", MDP_LCDC_PAD_PCLK_CLK, NULL, 0), CLK_PCOM("mdp_vsync_clk", MDP_VSYNC_CLK, NULL, 0), CLK_PCOM("pbus_clk", PBUS_CLK, NULL, CLK_MIN), CLK_PCOM("pcm_clk", PCM_CLK, NULL, 0), CLK_PCOM("sdac_clk", SDAC_CLK, NULL, OFF), CLK_PCOM("spi_clk", SPI_CLK, NULL, 0), CLK_PCOM("tsif_clk", TSIF_CLK, NULL, 0), CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0), CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), CLK_PCOM("uart_clk", UART3_CLK, &msm_device_uart3.dev, OFF), CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF), CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, NULL, OFF), CLK_PCOM("usb_otg_clk", USB_OTG_CLK, NULL, 0), CLK_PCOM("vdc_clk", VDC_CLK, NULL, OFF | CLK_MIN), CLK_PCOM("vfe_clk", VFE_CLK, NULL, OFF), CLK_PCOM("vfe_mdc_clk", VFE_MDC_CLK, NULL, OFF), CLK_PCOM("vfe_axi_clk", VFE_AXI_CLK, NULL, OFF), CLK_PCOM("usb_hs2_clk", USB_HS2_CLK, NULL, OFF), CLK_PCOM("usb_hs2_pclk", USB_HS2_P_CLK, NULL, OFF), CLK_PCOM("usb_hs3_clk", USB_HS3_CLK, NULL, OFF), CLK_PCOM("usb_hs3_pclk", USB_HS3_P_CLK, NULL, OFF), CLK_PCOM("usb_phy_clk", USB_PHY_CLK, NULL, 0), }; unsigned msm_num_clocks_8x50 = ARRAY_SIZE(msm_clocks_8x50);
/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * arch/sh64/kernel/sh_ksyms.c * * Copyright (C) 2000, 2001 Paolo Alberelli * */ #include <linux/rwsem.h> #include <linux/module.h> #include <linux/smp.h> #include <linux/user.h> #include <linux/elfcore.h> #include <linux/sched.h> #include <linux/in6.h> #include <linux/interrupt.h> #include <linux/screen_info.h> #include <asm/semaphore.h> #include <asm/processor.h> #include <asm/uaccess.h> #include <asm/checksum.h> #include <asm/io.h> #include <asm/delay.h> #include <asm/irq.h> extern int dump_fpu(struct pt_regs *, elf_fpregset_t *); /* platform dependent support */ EXPORT_SYMBOL(dump_fpu); EXPORT_SYMBOL(iounmap); EXPORT_SYMBOL(enable_irq); EXPORT_SYMBOL(disable_irq); EXPORT_SYMBOL(kernel_thread); /* Networking helper routines. */ EXPORT_SYMBOL(csum_partial_copy_nocheck); EXPORT_SYMBOL(strstr); #ifdef CONFIG_VT EXPORT_SYMBOL(screen_info); #endif EXPORT_SYMBOL(__down); EXPORT_SYMBOL(__down_trylock); EXPORT_SYMBOL(__up); EXPORT_SYMBOL(__put_user_asm_l); EXPORT_SYMBOL(__get_user_asm_l); EXPORT_SYMBOL(memcmp); EXPORT_SYMBOL(memcpy); EXPORT_SYMBOL(memset); EXPORT_SYMBOL(memscan); EXPORT_SYMBOL(strchr); EXPORT_SYMBOL(strlen); EXPORT_SYMBOL(flush_dcache_page); /* For ext3 */ EXPORT_SYMBOL(sh64_page_clear); /* Ugh. These come in from libgcc.a at link time. */ extern void __sdivsi3(void); extern void __muldi3(void); extern void __udivsi3(void); extern char __div_table; EXPORT_SYMBOL(__sdivsi3); EXPORT_SYMBOL(__muldi3); EXPORT_SYMBOL(__udivsi3); EXPORT_SYMBOL(__div_table);
#include <stdio.h> #include <assert.h> #include <time.h> #include <stdlib.h> #include <stdint.h> #include <string.h> typedef const char *str_t; #include "kbtree.h" KBTREE_INIT(int, uint32_t, kb_generic_cmp) KBTREE_INIT(str, str_t, kb_str_cmp) static int data_size = 5000000; static unsigned *int_data; static char **str_data; void ht_init_data() { int i; char buf[256]; printf("--- generating data... "); srand48(11); int_data = (unsigned*)calloc(data_size, sizeof(unsigned)); str_data = (char**)calloc(data_size, sizeof(char*)); for (i = 0; i < data_size; ++i) { int_data[i] = (unsigned)(data_size * drand48() / 4) * 271828183u; sprintf(buf, "%x", int_data[i]); str_data[i] = strdup(buf); } printf("done!\n"); } void ht_destroy_data() { int i; for (i = 0; i < data_size; ++i) free(str_data[i]); free(str_data); free(int_data); } void ht_khash_int() { int i; unsigned *data = int_data; uint32_t *l, *u; kbtree_t(int) *h; h = kb_init(int, KB_DEFAULT_SIZE); for (i = 0; i < data_size; ++i) { if (kb_get(int, h, data[i]) == 0) kb_put(int, h, data[i]); else kb_del(int, h, data[i]); } printf("[ht_khash_int] size: %d\n", kb_size(h)); if (1) { int cnt = 0; uint32_t x, y; kb_interval(int, h, 2174625464u, &l, &u); printf("interval for 2174625464: (%u, %u)\n", l? *l : 0, u? *u : 0); #define traverse_f(p) { if (cnt == 0) y = *p; ++cnt; } __kb_traverse(uint32_t, h, traverse_f); __kb_get_first(uint32_t, h, x); printf("# of elements from traversal: %d\n", cnt); printf("first element: %d == %d\n", x, y); } __kb_destroy(h); } void ht_khash_str() { int i; char **data = str_data; kbtree_t(str) *h; h = kb_init(str, KB_DEFAULT_SIZE); for (i = 0; i < data_size; ++i) { if (kb_get(str, h, data[i]) == 0) kb_put(str, h, data[i]); else kb_del(str, h, data[i]); } printf("[ht_khash_int] size: %d\n", kb_size(h)); __kb_destroy(h); } void ht_timing(void (*f)(void)) { clock_t t = clock(); (*f)(); printf("[ht_timing] %.3lf sec\n", (double)(clock() - t) / CLOCKS_PER_SEC); } int main(int argc, char *argv[]) { if (argc > 1) data_size = atoi(argv[1]); ht_init_data(); ht_timing(ht_khash_int); ht_timing(ht_khash_str); ht_destroy_data(); return 0; }
//------------------------------------------------------------------------------ // <copyright file="dl_list.h" company="Atheros"> // Copyright (c) 2004-2008 Atheros Corporation. All rights reserved. // // The software source and binaries included in this development package are // licensed, not sold. You, or your company, received the package under one // or more license agreements. The rights granted to you are specifically // listed in these license agreement(s). All other rights remain with Atheros // Communications, Inc., its subsidiaries, or the respective owner including // those listed on the included copyright notices. Distribution of any // portion of this package must be in strict compliance with the license // agreement(s) terms. // </copyright> // // <summary> // Wifi driver for AR6002 // </summary> // //------------------------------------------------------------------------------ //============================================================================== // Double-link list definitions (adapted from Atheros SDIO stack) // // Author(s): ="Atheros" //============================================================================== #ifndef __DL_LIST_H___ #define __DL_LIST_H___ #include "a_osapi.h" #define A_CONTAINING_STRUCT(address, struct_type, field_name)\ ((struct_type *)((A_UINT32)(address) - (A_UINT32)(&((struct_type *)0)->field_name))) /* list functions */ /* pointers for the list */ typedef struct _DL_LIST { struct _DL_LIST *pPrev; struct _DL_LIST *pNext; }DL_LIST, *PDL_LIST; /* * DL_LIST_INIT , initialize doubly linked list */ #define DL_LIST_INIT(pList)\ {(pList)->pPrev = pList; (pList)->pNext = pList;} /* faster macro to init list and add a single item */ #define DL_LIST_INIT_AND_ADD(pList,pItem) \ { (pList)->pPrev = (pItem); \ (pList)->pNext = (pItem); \ (pItem)->pNext = (pList); \ (pItem)->pPrev = (pList); \ } #define DL_LIST_IS_EMPTY(pList) (((pList)->pPrev == (pList)) && ((pList)->pNext == (pList))) #define DL_LIST_GET_ITEM_AT_HEAD(pList) (pList)->pNext #define DL_LIST_GET_ITEM_AT_TAIL(pList) (pList)->pPrev /* * ITERATE_OVER_LIST pStart is the list, pTemp is a temp list member * NOT: do not use this function if the items in the list are deleted inside the * iteration loop */ #define ITERATE_OVER_LIST(pStart, pTemp) \ for((pTemp) =(pStart)->pNext; pTemp != (pStart); (pTemp) = (pTemp)->pNext) /* safe iterate macro that allows the item to be removed from the list * the iteration continues to the next item in the list */ #define ITERATE_OVER_LIST_ALLOW_REMOVE(pStart,pItem,st,offset) \ { \ PDL_LIST pTemp; \ pTemp = (pStart)->pNext; \ while (pTemp != (pStart)) { \ (pItem) = A_CONTAINING_STRUCT(pTemp,st,offset); \ pTemp = pTemp->pNext; \ #define ITERATE_END }} /* * DL_ListInsertTail - insert pAdd to the end of the list */ static INLINE PDL_LIST DL_ListInsertTail(PDL_LIST pList, PDL_LIST pAdd) { /* insert at tail */ pAdd->pPrev = pList->pPrev; pAdd->pNext = pList; pList->pPrev->pNext = pAdd; pList->pPrev = pAdd; return pAdd; } /* * DL_ListInsertHead - insert pAdd into the head of the list */ static INLINE PDL_LIST DL_ListInsertHead(PDL_LIST pList, PDL_LIST pAdd) { /* insert at head */ pAdd->pPrev = pList; pAdd->pNext = pList->pNext; pList->pNext->pPrev = pAdd; pList->pNext = pAdd; return pAdd; } #define DL_ListAdd(pList,pItem) DL_ListInsertHead((pList),(pItem)) /* * DL_ListRemove - remove pDel from list */ static INLINE PDL_LIST DL_ListRemove(PDL_LIST pDel) { pDel->pNext->pPrev = pDel->pPrev; pDel->pPrev->pNext = pDel->pNext; /* point back to itself just to be safe, incase remove is called again */ pDel->pNext = pDel; pDel->pPrev = pDel; return pDel; } /* * DL_ListRemoveItemFromHead - get a list item from the head */ static INLINE PDL_LIST DL_ListRemoveItemFromHead(PDL_LIST pList) { PDL_LIST pItem = NULL; if (pList->pNext != pList) { pItem = pList->pNext; /* remove the first item from head */ DL_ListRemove(pItem); } return pItem; } static INLINE PDL_LIST DL_ListRemoveItemFromTail(PDL_LIST pList) { PDL_LIST pItem = NULL; if (pList->pPrev != pList) { pItem = pList->pPrev; /* remove the item from tail */ DL_ListRemove(pItem); } return pItem; } /* transfer src list items to the tail of the destination list */ static INLINE void DL_ListTransferItemsToTail(PDL_LIST pDest, PDL_LIST pSrc) { /* only concatenate if src is not empty */ if (!DL_LIST_IS_EMPTY(pSrc)) { /* cut out circular list in src and re-attach to end of dest */ pSrc->pPrev->pNext = pDest; pSrc->pNext->pPrev = pDest->pPrev; pDest->pPrev->pNext = pSrc->pNext; pDest->pPrev = pSrc->pPrev; /* terminate src list, it is now empty */ pSrc->pPrev = pSrc; pSrc->pNext = pSrc; } } #endif /* __DL_LIST_H___ */
/* * TI ADC081C/ADC101C/ADC121C 8/10/12-bit ADC driver * * Copyright (C) 2012 Avionic Design GmbH * Copyright (C) 2016 Intel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Datasheets: * http://www.ti.com/lit/ds/symlink/adc081c021.pdf * http://www.ti.com/lit/ds/symlink/adc101c021.pdf * http://www.ti.com/lit/ds/symlink/adc121c021.pdf * * The devices have a very similar interface and differ mostly in the number of * bits handled. For the 8-bit and 10-bit models the least-significant 4 or 2 * bits of value registers are reserved. */ #include <linux/err.h> #include <linux/i2c.h> #include <linux/module.h> #include <linux/of.h> #include <linux/iio/iio.h> #include <linux/iio/buffer.h> #include <linux/iio/trigger_consumer.h> #include <linux/iio/triggered_buffer.h> #include <linux/regulator/consumer.h> struct adc081c { struct i2c_client *i2c; struct regulator *ref; /* 8, 10 or 12 */ int bits; }; #define REG_CONV_RES 0x00 static int adc081c_read_raw(struct iio_dev *iio, struct iio_chan_spec const *channel, int *value, int *shift, long mask) { struct adc081c *adc = iio_priv(iio); int err; switch (mask) { case IIO_CHAN_INFO_RAW: err = i2c_smbus_read_word_swapped(adc->i2c, REG_CONV_RES); if (err < 0) return err; *value = (err & 0xFFF) >> (12 - adc->bits); return IIO_VAL_INT; case IIO_CHAN_INFO_SCALE: err = regulator_get_voltage(adc->ref); if (err < 0) return err; *value = err / 1000; *shift = adc->bits; return IIO_VAL_FRACTIONAL_LOG2; default: break; } return -EINVAL; } #define ADCxx1C_CHAN(_bits) { \ .type = IIO_VOLTAGE, \ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ .scan_type = { \ .sign = 'u', \ .realbits = (_bits), \ .storagebits = 16, \ .shift = 12 - (_bits), \ .endianness = IIO_CPU, \ }, \ } #define DEFINE_ADCxx1C_CHANNELS(_name, _bits) \ static const struct iio_chan_spec _name ## _channels[] = { \ ADCxx1C_CHAN((_bits)), \ IIO_CHAN_SOFT_TIMESTAMP(1), \ }; \ #define ADC081C_NUM_CHANNELS 2 struct adcxx1c_model { const struct iio_chan_spec* channels; int bits; }; #define ADCxx1C_MODEL(_name, _bits) \ { \ .channels = _name ## _channels, \ .bits = (_bits), \ } DEFINE_ADCxx1C_CHANNELS(adc081c, 8); DEFINE_ADCxx1C_CHANNELS(adc101c, 10); DEFINE_ADCxx1C_CHANNELS(adc121c, 12); /* Model ids are indexes in _models array */ enum adcxx1c_model_id { ADC081C = 0, ADC101C = 1, ADC121C = 2, }; static struct adcxx1c_model adcxx1c_models[] = { ADCxx1C_MODEL(adc081c, 8), ADCxx1C_MODEL(adc101c, 10), ADCxx1C_MODEL(adc121c, 12), }; static const struct iio_info adc081c_info = { .read_raw = adc081c_read_raw, .driver_module = THIS_MODULE, }; static irqreturn_t adc081c_trigger_handler(int irq, void *p) { struct iio_poll_func *pf = p; struct iio_dev *indio_dev = pf->indio_dev; struct adc081c *data = iio_priv(indio_dev); u16 buf[8]; /* 2 bytes data + 6 bytes padding + 8 bytes timestamp */ int ret; ret = i2c_smbus_read_word_swapped(data->i2c, REG_CONV_RES); if (ret < 0) goto out; buf[0] = ret; iio_push_to_buffers_with_timestamp(indio_dev, buf, iio_get_time_ns()); out: iio_trigger_notify_done(indio_dev->trig); return IRQ_HANDLED; } static int adc081c_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct iio_dev *iio; struct adc081c *adc; struct adcxx1c_model *model = &adcxx1c_models[id->driver_data]; int err; if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA)) return -EOPNOTSUPP; iio = devm_iio_device_alloc(&client->dev, sizeof(*adc)); if (!iio) return -ENOMEM; adc = iio_priv(iio); adc->i2c = client; adc->bits = model->bits; adc->ref = devm_regulator_get(&client->dev, "vref"); if (IS_ERR(adc->ref)) return PTR_ERR(adc->ref); err = regulator_enable(adc->ref); if (err < 0) return err; iio->dev.parent = &client->dev; iio->name = dev_name(&client->dev); iio->modes = INDIO_DIRECT_MODE; iio->info = &adc081c_info; iio->channels = model->channels; iio->num_channels = ADC081C_NUM_CHANNELS; err = iio_triggered_buffer_setup(iio, NULL, adc081c_trigger_handler, NULL); if (err < 0) { dev_err(&client->dev, "iio triggered buffer setup failed\n"); goto err_regulator_disable; } err = iio_device_register(iio); if (err < 0) goto err_buffer_cleanup; i2c_set_clientdata(client, iio); return 0; err_buffer_cleanup: iio_triggered_buffer_cleanup(iio); err_regulator_disable: regulator_disable(adc->ref); return err; } static int adc081c_remove(struct i2c_client *client) { struct iio_dev *iio = i2c_get_clientdata(client); struct adc081c *adc = iio_priv(iio); iio_device_unregister(iio); iio_triggered_buffer_cleanup(iio); regulator_disable(adc->ref); return 0; } static const struct i2c_device_id adc081c_id[] = { { "adc081c", ADC081C }, { "adc101c", ADC101C }, { "adc121c", ADC121C }, { } }; MODULE_DEVICE_TABLE(i2c, adc081c_id); #ifdef CONFIG_OF static const struct of_device_id adc081c_of_match[] = { { .compatible = "ti,adc081c" }, { .compatible = "ti,adc101c" }, { .compatible = "ti,adc121c" }, { } }; MODULE_DEVICE_TABLE(of, adc081c_of_match); #endif static struct i2c_driver adc081c_driver = { .driver = { .name = "adc081c", .of_match_table = of_match_ptr(adc081c_of_match), }, .probe = adc081c_probe, .remove = adc081c_remove, .id_table = adc081c_id, }; module_i2c_driver(adc081c_driver); MODULE_AUTHOR("Thierry Reding <thierry.reding@avionic-design.de>"); MODULE_DESCRIPTION("Texas Instruments ADC081C/ADC101C/ADC121C driver"); MODULE_LICENSE("GPL v2");
/************************************************************************************ This source file is part of the Theora Video Playback Library For latest info, see http://libtheoraplayer.googlecode.com ************************************************************************************* Copyright (c) 2008-2014 Kresimir Spes (kspes@cateia.com) This program is free software; you can redistribute it and/or modify it under the terms of the BSD license: http://opensource.org/licenses/BSD-3-Clause *************************************************************************************/ #ifndef _YUV_LIBYUV_h #define _YUV_LIBYUV_h #include "TheoraPixelTransform.h" #endif
/* * Marvell PATA driver. * * For the moment we drive the PATA port in legacy mode. That * isn't making full use of the device functionality but it is * easy to get working. * * (c) 2006 Red Hat */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/init.h> #include <linux/blkdev.h> #include <linux/delay.h> #include <linux/device.h> #include <scsi/scsi_host.h> #include <linux/libata.h> #include <linux/ata.h> #define DRV_NAME "pata_marvell" #define DRV_VERSION "0.1.6" /** * marvell_pata_active - check if PATA is active * @pdev: PCI device * * Returns 1 if the PATA port may be active. We know how to check this * for the 6145 but not the other devices */ static int marvell_pata_active(struct pci_dev *pdev) { int i; u32 devices; void __iomem *barp; /* We don't yet know how to do this for other devices */ if (pdev->device != 0x6145) return 1; barp = pci_iomap(pdev, 5, 0x10); if (barp == NULL) return -ENOMEM; printk("BAR5:"); for(i = 0; i <= 0x0F; i++) printk("%02X:%02X ", i, ioread8(barp + i)); printk("\n"); devices = ioread32(barp + 0x0C); pci_iounmap(pdev, barp); if (devices & 0x10) return 1; return 0; } /** * marvell_pre_reset - check for 40/80 pin * @link: link * @deadline: deadline jiffies for the operation * * Perform the PATA port setup we need. */ static int marvell_pre_reset(struct ata_link *link, unsigned long deadline) { struct ata_port *ap = link->ap; struct pci_dev *pdev = to_pci_dev(ap->host->dev); if (pdev->device == 0x6145 && ap->port_no == 0 && !marvell_pata_active(pdev)) /* PATA enable ? */ return -ENOENT; return ata_sff_prereset(link, deadline); } static int marvell_cable_detect(struct ata_port *ap) { /* Cable type */ switch(ap->port_no) { case 0: if (ioread8(ap->ioaddr.bmdma_addr + 1) & 1) return ATA_CBL_PATA40; return ATA_CBL_PATA80; case 1: /* Legacy SATA port */ return ATA_CBL_SATA; } BUG(); return 0; /* Our BUG macro needs the right markup */ } /* No PIO or DMA methods needed for this device */ static struct scsi_host_template marvell_sht = { ATA_BMDMA_SHT(DRV_NAME), }; static struct ata_port_operations marvell_ops = { .inherits = &ata_bmdma_port_ops, .cable_detect = marvell_cable_detect, .prereset = marvell_pre_reset, }; /** * marvell_init_one - Register Marvell ATA PCI device with kernel services * @pdev: PCI device to register * @ent: Entry in marvell_pci_tbl matching with @pdev * * Called from kernel PCI layer. * * LOCKING: * Inherited from PCI layer (may sleep). * * RETURNS: * Zero on success, or -ERRNO value. */ static int marvell_init_one (struct pci_dev *pdev, const struct pci_device_id *id) { static const struct ata_port_info info = { .flags = ATA_FLAG_SLAVE_POSS, .pio_mask = ATA_PIO4, .mwdma_mask = ATA_MWDMA2, .udma_mask = ATA_UDMA5, .port_ops = &marvell_ops, }; static const struct ata_port_info info_sata = { /* Slave possible as its magically mapped not real */ .flags = ATA_FLAG_SLAVE_POSS, .pio_mask = ATA_PIO4, .mwdma_mask = ATA_MWDMA2, .udma_mask = ATA_UDMA6, .port_ops = &marvell_ops, }; const struct ata_port_info *ppi[] = { &info, &info_sata }; if (pdev->device == 0x6101) ppi[1] = &ata_dummy_port_info; #if defined(CONFIG_SATA_AHCI) || defined(CONFIG_SATA_AHCI_MODULE) if (!marvell_pata_active(pdev)) { printk(KERN_INFO DRV_NAME ": PATA port not active, deferring to AHCI driver.\n"); return -ENODEV; } #endif return ata_pci_sff_init_one(pdev, ppi, &marvell_sht, NULL); } static const struct pci_device_id marvell_pci_tbl[] = { { PCI_DEVICE(0x11AB, 0x6101), }, { PCI_DEVICE(0x11AB, 0x6121), }, { PCI_DEVICE(0x11AB, 0x6123), }, { PCI_DEVICE(0x11AB, 0x6145), }, { } /* terminate list */ }; static struct pci_driver marvell_pci_driver = { .name = DRV_NAME, .id_table = marvell_pci_tbl, .probe = marvell_init_one, .remove = ata_pci_remove_one, #ifdef CONFIG_PM .suspend = ata_pci_device_suspend, .resume = ata_pci_device_resume, #endif }; static int __init marvell_init(void) { return pci_register_driver(&marvell_pci_driver); } static void __exit marvell_exit(void) { pci_unregister_driver(&marvell_pci_driver); } module_init(marvell_init); module_exit(marvell_exit); MODULE_AUTHOR("Alan Cox"); MODULE_DESCRIPTION("SCSI low-level driver for Marvell ATA in legacy mode"); MODULE_LICENSE("GPL"); MODULE_DEVICE_TABLE(pci, marvell_pci_tbl); MODULE_VERSION(DRV_VERSION);
// @(#)root/matrix:$Id$ // Authors: Fons Rademakers, Eddy Offermann Nov 2003 /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TMatrixFBase #define ROOT_TMatrixFBase ////////////////////////////////////////////////////////////////////////// // // // TMatrixFBase // // // // Instantation of TMatrixTBase<Float_t> // // // ////////////////////////////////////////////////////////////////////////// #ifndef ROOT_TMatrixTBase #include "TMatrixTBase.h" #endif #ifndef ROOT_TMatrixFBase #include "TMatrixFBase.h" #endif #endif
/* Area: ffi_call, closure_call Purpose: Check structure alignment of uint16. Limitations: none. PR: none. Originator: <hos@tamanegi.org> 20031203 */ /* { dg-do run } */ #include "ffitest.h" typedef struct cls_struct_align { unsigned char a; unsigned short b; unsigned char c; } cls_struct_align; cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); return result; } static void cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__) { struct cls_struct_align a1, a2; a1 = *(struct cls_struct_align*)(args[0]); a2 = *(struct cls_struct_align*)(args[1]); *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_align g_dbl = { 12, 4951, 127 }; struct cls_struct_align f_dbl = { 1, 9320, 13 }; struct cls_struct_align res_dbl; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_ushort; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl); /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ exit(0); }
/* * Copyright (C) 2010 ENAC * * This file is part of paparazzi. * * paparazzi is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * paparazzi is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with paparazzi; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * */ /* driver for the ADC ads1114 (16 bits I2C 860SpS max) from Texas instruments * Navarro & Gorraz & Hattenberger */ #ifndef ADS_1114_H #define ADS_1114_H #include "std.h" #include "mcu_periph/i2c.h" /* I2C slave address */ #ifndef ADS1114_1_I2C_ADDR #define ADS1114_1_I2C_ADDR 0x90 // slave address byte (I2c address(7bits) + R/W @ 0) #endif #ifndef ADS1114_2_I2C_ADDR #define ADS1114_2_I2C_ADDR 0x92 // slave address byte (I2c address(7bits) + R/W @ 0) #endif /* I2C conf register */ #define ADS1114_POINTER_CONV_REG 0x00 // access to the Conversion register (16bits) #define ADS1114_POINTER_CONFIG_REG 0x01 // access to the Configuration register (16bits) /* ADS1114_1 default conf */ #ifndef ADS1114_1_OS #define ADS1114_1_OS 0x0 // Operational status #endif #ifndef ADS1114_1_MUX #define ADS1114_1_MUX 0x0 // Input multiplexer #endif #ifndef ADS1114_1_PGA #define ADS1114_1_PGA 0x3 // Programable gain amplifier (= 4 with a Full Scale of +/- 1.024V) #endif #ifndef ADS1114_1_MODE #define ADS1114_1_MODE 0x0 // Continuous conversion mode #endif #ifndef ADS1114_1_DR #define ADS1114_1_DR 0x4 // Data rate (128 SPS) #endif #ifndef ADS1114_1_COMP_MODE #define ADS1114_1_COMP_MODE 0x0 // Comparator mode #endif #ifndef ADS1114_1_COMP_POL #define ADS1114_1_COMP_POL 0x0 // Comparator polarity #endif #ifndef ADS1114_1_COMP_LAT #define ADS1114_1_COMP_LAT 0x0 // Latching comparator #endif #ifndef ADS1114_1_COMP_QUE #define ADS1114_1_COMP_QUE 0x3 // Comparator queue (disable) #endif #define ADS1114_1_CONFIG_MSB ((ADS1114_1_OS<<7)|(ADS1114_1_MUX<<4)|(ADS1114_1_PGA<<1)|(ADS1114_1_MODE)) #define ADS1114_1_CONFIG_LSB ((ADS1114_1_DR<<5)|(ADS1114_1_COMP_MODE<<4)|(ADS1114_1_COMP_POL<<3)|(ADS1114_1_COMP_LAT<<2)|(ADS1114_1_COMP_QUE)) /* ADS1114_1 default conf */ #ifndef ADS1114_2_OS #define ADS1114_2_OS 0x0 // Operational status #endif #ifndef ADS1114_2_MUX #define ADS1114_2_MUX 0x0 // Input multiplexer #endif #ifndef ADS1114_2_PGA #define ADS1114_2_PGA 0x3 // Programable gain amplifier (= 4 with a Full Scale of +/- 1.024V) #endif #ifndef ADS1114_2_MODE #define ADS1114_2_MODE 0x0 // Continuous conversion mode #endif #ifndef ADS1114_2_DR #define ADS1114_2_DR 0x4 // Data rate (128 SPS) #endif #ifndef ADS1114_2_COMP_MODE #define ADS1114_2_COMP_MODE 0x0 // Comparator mode #endif #ifndef ADS1114_2_COMP_POL #define ADS1114_2_COMP_POL 0x0 // Comparator polarity #endif #ifndef ADS1114_2_COMP_LAT #define ADS1114_2_COMP_LAT 0x0 // Latching comparator #endif #ifndef ADS1114_2_COMP_QUE #define ADS1114_2_COMP_QUE 0x3 // Comparator queue (disable) #endif #define ADS1114_2_CONFIG_MSB ((ADS1114_2_OS<<7)|(ADS1114_2_MUX<<4)|(ADS1114_2_PGA<<1)|(ADS1114_2_MODE)) #define ADS1114_2_CONFIG_LSB ((ADS1114_2_DR<<5)|(ADS1114_2_COMP_MODE<<4)|(ADS1114_2_COMP_POL<<3)|(ADS1114_2_COMP_LAT<<2)|(ADS1114_2_COMP_QUE)) /* Default I2C device */ // FIXME all ads on the same device for now #ifndef ADS1114_I2C_DEV #define ADS1114_I2C_DEV i2c1 #endif struct ads1114_periph { struct i2c_transaction trans; uint8_t i2c_addr; bool_t config_done; bool_t data_available; }; #if USE_ADS1114_1 extern struct ads1114_periph ads1114_1; #endif #if USE_ADS1114_2 extern struct ads1114_periph ads1114_2; #endif extern void ads1114_init(void); extern void ads1114_read(struct ads1114_periph *p); // Generic Event Macro #define _Ads1114Event(_p) {\ if (!_p.config_done) { \ if (_p.trans.status == I2CTransSuccess) { _p.config_done = TRUE; _p.trans.status = I2CTransDone; } \ if (_p.trans.status == I2CTransFailed) { _p.trans.status = I2CTransDone; } \ } else { \ if (_p.trans.status == I2CTransSuccess) { _p.data_available = TRUE; _p.trans.status = I2CTransDone; } \ if (_p.trans.status == I2CTransFailed) { _p.trans.status = I2CTransDone; } \ } \ } #if USE_ADS1114_1 #define Ads1114_1Event() _Ads1114Event(ads1114_1) #else #define Ads1114_1Event() {} #endif #if USE_ADS1114_2 #define Ads1114_2Event() _Ads1114Event(ads1114_2) #else #define Ads1114_2Event() {} #endif // Final event macro #define Ads1114Event() { \ Ads1114_1Event(); \ Ads1114_2Event(); \ } // Get value macro // @param ads1114 periph #define Ads1114GetValue(_p) ((int16_t)(((int16_t)_p.trans.buf[0]<<8)|_p.trans.buf[1])) #endif // ADS_1114_H
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ARCH_POWERPC_LOCAL_H #define _ARCH_POWERPC_LOCAL_H #include <linux/percpu.h> #include <linux/atomic.h> typedef struct { atomic_long_t a; } local_t; #define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) } #define local_read(l) atomic_long_read(&(l)->a) #define local_set(l,i) atomic_long_set(&(l)->a, (i)) #define local_add(i,l) atomic_long_add((i),(&(l)->a)) #define local_sub(i,l) atomic_long_sub((i),(&(l)->a)) #define local_inc(l) atomic_long_inc(&(l)->a) #define local_dec(l) atomic_long_dec(&(l)->a) static __inline__ long local_add_return(long a, local_t *l) { long t; __asm__ __volatile__( "1:" PPC_LLARX(%0,0,%2,0) " # local_add_return\n\ add %0,%1,%0\n" PPC405_ERR77(0,%2) PPC_STLCX "%0,0,%2 \n\ bne- 1b" : "=&r" (t) : "r" (a), "r" (&(l->a.counter)) : "cc", "memory"); return t; } #define local_add_negative(a, l) (local_add_return((a), (l)) < 0) static __inline__ long local_sub_return(long a, local_t *l) { long t; __asm__ __volatile__( "1:" PPC_LLARX(%0,0,%2,0) " # local_sub_return\n\ subf %0,%1,%0\n" PPC405_ERR77(0,%2) PPC_STLCX "%0,0,%2 \n\ bne- 1b" : "=&r" (t) : "r" (a), "r" (&(l->a.counter)) : "cc", "memory"); return t; } static __inline__ long local_inc_return(local_t *l) { long t; __asm__ __volatile__( "1:" PPC_LLARX(%0,0,%1,0) " # local_inc_return\n\ addic %0,%0,1\n" PPC405_ERR77(0,%1) PPC_STLCX "%0,0,%1 \n\ bne- 1b" : "=&r" (t) : "r" (&(l->a.counter)) : "cc", "xer", "memory"); return t; } /* * local_inc_and_test - increment and test * @l: pointer of type local_t * * Atomically increments @l by 1 * and returns true if the result is zero, or false for all * other cases. */ #define local_inc_and_test(l) (local_inc_return(l) == 0) static __inline__ long local_dec_return(local_t *l) { long t; __asm__ __volatile__( "1:" PPC_LLARX(%0,0,%1,0) " # local_dec_return\n\ addic %0,%0,-1\n" PPC405_ERR77(0,%1) PPC_STLCX "%0,0,%1\n\ bne- 1b" : "=&r" (t) : "r" (&(l->a.counter)) : "cc", "xer", "memory"); return t; } #define local_cmpxchg(l, o, n) \ (cmpxchg_local(&((l)->a.counter), (o), (n))) #define local_xchg(l, n) (xchg_local(&((l)->a.counter), (n))) /** * local_add_unless - add unless the number is a given value * @l: pointer of type local_t * @a: the amount to add to v... * @u: ...unless v is equal to u. * * Atomically adds @a to @l, so long as it was not @u. * Returns non-zero if @l was not @u, and zero otherwise. */ static __inline__ int local_add_unless(local_t *l, long a, long u) { long t; __asm__ __volatile__ ( "1:" PPC_LLARX(%0,0,%1,0) " # local_add_unless\n\ cmpw 0,%0,%3 \n\ beq- 2f \n\ add %0,%2,%0 \n" PPC405_ERR77(0,%2) PPC_STLCX "%0,0,%1 \n\ bne- 1b \n" " subf %0,%2,%0 \n\ 2:" : "=&r" (t) : "r" (&(l->a.counter)), "r" (a), "r" (u) : "cc", "memory"); return t != u; } #define local_inc_not_zero(l) local_add_unless((l), 1, 0) #define local_sub_and_test(a, l) (local_sub_return((a), (l)) == 0) #define local_dec_and_test(l) (local_dec_return((l)) == 0) /* * Atomically test *l and decrement if it is greater than 0. * The function returns the old value of *l minus 1. */ static __inline__ long local_dec_if_positive(local_t *l) { long t; __asm__ __volatile__( "1:" PPC_LLARX(%0,0,%1,0) " # local_dec_if_positive\n\ cmpwi %0,1\n\ addi %0,%0,-1\n\ blt- 2f\n" PPC405_ERR77(0,%1) PPC_STLCX "%0,0,%1\n\ bne- 1b" "\n\ 2:" : "=&b" (t) : "r" (&(l->a.counter)) : "cc", "memory"); return t; } /* Use these for per-cpu local_t variables: on some archs they are * much more efficient than these naive implementations. Note they take * a variable, not an address. */ #define __local_inc(l) ((l)->a.counter++) #define __local_dec(l) ((l)->a.counter++) #define __local_add(i,l) ((l)->a.counter+=(i)) #define __local_sub(i,l) ((l)->a.counter-=(i)) #endif /* _ARCH_POWERPC_LOCAL_H */
/* * GRUB -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * GRUB is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GRUB. If not, see <http://www.gnu.org/licenses/>. */ #ifndef GRUB_COMMAND_HEADER #define GRUB_COMMAND_HEADER 1 #include <grub/symbol.h> #include <grub/err.h> #include <grub/list.h> #include <grub/misc.h> typedef enum grub_command_flags { /* This is an extended command. */ GRUB_COMMAND_FLAG_EXTCMD = 0x10, /* This is an dynamic command. */ GRUB_COMMAND_FLAG_DYNCMD = 0x20, /* This command accepts block arguments. */ GRUB_COMMAND_FLAG_BLOCKS = 0x40, /* This command accepts unknown arguments as direct parameters. */ GRUB_COMMAND_ACCEPT_DASH = 0x80, /* This command accepts only options preceding direct arguments. */ GRUB_COMMAND_OPTIONS_AT_START = 0x100, /* Can be executed in an entries extractor. */ GRUB_COMMAND_FLAG_EXTRACTOR = 0x200 } grub_command_flags_t; struct grub_command; typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd, int argc, char **argv); #define GRUB_COMMAND_PRIO_MASK 0xff #define GRUB_COMMAND_FLAG_ACTIVE 0x100 /* The command description. */ struct grub_command { /* The next element. */ struct grub_command *next; struct grub_command **prev; /* The name. */ const char *name; /* The priority. */ int prio; /* The callback function. */ grub_command_func_t func; /* The flags. */ grub_command_flags_t flags; /* The summary of the command usage. */ const char *summary; /* The description of the command. */ const char *description; /* Arbitrary data. */ void *data; }; typedef struct grub_command *grub_command_t; extern grub_command_t EXPORT_VAR(grub_command_list); grub_command_t EXPORT_FUNC(grub_register_command_prio) (const char *name, grub_command_func_t func, const char *summary, const char *description, int prio); void EXPORT_FUNC(grub_unregister_command) (grub_command_t cmd); static inline grub_command_t grub_register_command (const char *name, grub_command_func_t func, const char *summary, const char *description) { return grub_register_command_prio (name, func, summary, description, 0); } static inline grub_command_t grub_register_command_p1 (const char *name, grub_command_func_t func, const char *summary, const char *description) { return grub_register_command_prio (name, func, summary, description, 1); } static inline grub_command_t grub_command_find (const char *name) { return grub_named_list_find (GRUB_AS_NAMED_LIST (grub_command_list), name); } static inline grub_err_t grub_command_execute (const char *name, int argc, char **argv) { grub_command_t cmd; cmd = grub_command_find (name); return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND; } #define FOR_COMMANDS(var) FOR_LIST_ELEMENTS((var), grub_command_list) #define FOR_COMMANDS_SAFE(var, next) FOR_LIST_ELEMENTS_SAFE((var), (next), grub_command_list) void grub_register_core_commands (void); #endif /* ! GRUB_COMMAND_HEADER */
/* Definitions for option handling for OpenVMS. Copyright (C) 2012-2015 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ #ifndef VMS_OPTS_H #define VMS_OPTS_H enum vms_pointer_size { VMS_POINTER_SIZE_NONE, VMS_POINTER_SIZE_32, VMS_POINTER_SIZE_64 }; #endif
/* * multibytecodec.h: Common Multibyte Codec Implementation * * Written by Hye-Shik Chang <perky@FreeBSD.org> */ #ifndef _PYTHON_MULTIBYTECODEC_H_ #define _PYTHON_MULTIBYTECODEC_H_ #ifdef __cplusplus extern "C" { #endif #ifdef uint16_t typedef uint16_t ucs2_t, DBCHAR; #else typedef unsigned short ucs2_t, DBCHAR; #endif typedef union { void *p; int i; unsigned char c[8]; ucs2_t u2[4]; Py_UCS4 u4[2]; } MultibyteCodec_State; typedef int (*mbcodec_init)(const void *config); typedef Py_ssize_t (*mbencode_func)(MultibyteCodec_State *state, const void *config, int kind, void *data, Py_ssize_t *inpos, Py_ssize_t inlen, unsigned char **outbuf, Py_ssize_t outleft, int flags); typedef int (*mbencodeinit_func)(MultibyteCodec_State *state, const void *config); typedef Py_ssize_t (*mbencodereset_func)(MultibyteCodec_State *state, const void *config, unsigned char **outbuf, Py_ssize_t outleft); typedef Py_ssize_t (*mbdecode_func)(MultibyteCodec_State *state, const void *config, const unsigned char **inbuf, Py_ssize_t inleft, _PyUnicodeWriter *writer); typedef int (*mbdecodeinit_func)(MultibyteCodec_State *state, const void *config); typedef Py_ssize_t (*mbdecodereset_func)(MultibyteCodec_State *state, const void *config); typedef struct { const char *encoding; const void *config; mbcodec_init codecinit; mbencode_func encode; mbencodeinit_func encinit; mbencodereset_func encreset; mbdecode_func decode; mbdecodeinit_func decinit; mbdecodereset_func decreset; } MultibyteCodec; typedef struct { PyObject_HEAD MultibyteCodec *codec; } MultibyteCodecObject; #define MultibyteCodec_Check(op) ((op)->ob_type == &MultibyteCodec_Type) #define _MultibyteStatefulCodec_HEAD \ PyObject_HEAD \ MultibyteCodec *codec; \ MultibyteCodec_State state; \ PyObject *errors; typedef struct { _MultibyteStatefulCodec_HEAD } MultibyteStatefulCodecContext; #define MAXENCPENDING 2 #define _MultibyteStatefulEncoder_HEAD \ _MultibyteStatefulCodec_HEAD \ PyObject *pending; typedef struct { _MultibyteStatefulEncoder_HEAD } MultibyteStatefulEncoderContext; #define MAXDECPENDING 8 #define _MultibyteStatefulDecoder_HEAD \ _MultibyteStatefulCodec_HEAD \ unsigned char pending[MAXDECPENDING]; \ Py_ssize_t pendingsize; typedef struct { _MultibyteStatefulDecoder_HEAD } MultibyteStatefulDecoderContext; typedef struct { _MultibyteStatefulEncoder_HEAD } MultibyteIncrementalEncoderObject; typedef struct { _MultibyteStatefulDecoder_HEAD } MultibyteIncrementalDecoderObject; typedef struct { _MultibyteStatefulDecoder_HEAD PyObject *stream; } MultibyteStreamReaderObject; typedef struct { _MultibyteStatefulEncoder_HEAD PyObject *stream; } MultibyteStreamWriterObject; /* positive values for illegal sequences */ #define MBERR_TOOSMALL (-1) /* insufficient output buffer space */ #define MBERR_TOOFEW (-2) /* incomplete input buffer */ #define MBERR_INTERNAL (-3) /* internal runtime error */ #define MBERR_EXCEPTION (-4) /* an exception has been raised */ #define ERROR_STRICT (PyObject *)(1) #define ERROR_IGNORE (PyObject *)(2) #define ERROR_REPLACE (PyObject *)(3) #define ERROR_ISCUSTOM(p) ((p) < ERROR_STRICT || ERROR_REPLACE < (p)) #define ERROR_DECREF(p) \ do { \ if (p != NULL && ERROR_ISCUSTOM(p)) \ Py_DECREF(p); \ } while (0); #define MBENC_FLUSH 0x0001 /* encode all characters encodable */ #define MBENC_MAX MBENC_FLUSH #define PyMultibyteCodec_CAPSULE_NAME "multibytecodec.__map_*" #ifdef __cplusplus } #endif #endif
// BrowseDialog.h #ifndef __BROWSE_DIALOG_H #define __BROWSE_DIALOG_H #include "../../../Common/MyString.h" bool MyBrowseForFolder(HWND owner, LPCWSTR title, LPCWSTR path, UString &resultPath); bool MyBrowseForFile(HWND owner, LPCWSTR title, LPCWSTR path, LPCWSTR filterDescription, LPCWSTR filter, UString &resultPath); /* CorrectFsPath removes undesirable characters in names (dots and spaces at the end of file) But it doesn't change "bad" name in any of the following cases: - path is Super Path (with \\?\ prefix) - path is relative and relBase is Super Path - there is file or dir in filesystem with specified "bad" name */ bool CorrectFsPath(const UString &relBase, const UString &path, UString &result); bool Dlg_CreateFolder(HWND wnd, UString &destName); #endif
/* linux/arch/arm/plat-samsung/include/plat/dma-s3c24xx.h * * Copyright (C) 2006 Simtec Electronics * Ben Dooks <ben@simtec.co.uk> * * Samsung S3C24XX DMA support - per SoC functions * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <plat/dma-core.h> extern struct bus_type dma_subsys; extern struct s3c2410_dma_chan s3c2410_chans[S3C_DMA_CHANNELS]; #define DMA_CH_VALID (1<<31) #define DMA_CH_NEVER (1<<30) /* struct s3c24xx_dma_map * * this holds the mapping information for the channel selected * to be connected to the specified device */ struct s3c24xx_dma_map { const char *name; unsigned long channels[S3C_DMA_CHANNELS]; }; struct s3c24xx_dma_selection { struct s3c24xx_dma_map *map; unsigned long map_size; unsigned long dcon_mask; void (*select)(struct s3c2410_dma_chan *chan, struct s3c24xx_dma_map *map); }; extern int s3c24xx_dma_init_map(struct s3c24xx_dma_selection *sel); /* struct s3c24xx_dma_order_ch * * channel map for one of the `enum dma_ch` dma channels. the list * entry contains a set of low-level channel numbers, orred with * DMA_CH_VALID, which are checked in the order in the array. */ struct s3c24xx_dma_order_ch { unsigned int list[S3C_DMA_CHANNELS]; /* list of channels */ unsigned int flags; /* flags */ }; /* struct s3c24xx_dma_order * * information provided by either the core or the board to give the * dma system a hint on how to allocate channels */ struct s3c24xx_dma_order { struct s3c24xx_dma_order_ch channels[DMACH_MAX]; }; extern int s3c24xx_dma_order_set(struct s3c24xx_dma_order *map); /* DMA init code, called from the cpu support code */ extern int s3c2410_dma_init(void); extern int s3c24xx_dma_init(unsigned int channels, unsigned int irq, unsigned int stride);
/**************************************************************************** Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #ifndef __cocos2d_libs__CCCustomEventListener__ #define __cocos2d_libs__CCCustomEventListener__ #include "base/CCEventListener.h" /** * @addtogroup base * @{ */ NS_CC_BEGIN class EventCustom; /** @class EventListenerCustom * @brief Custom event listener. * @code Usage: * auto dispatcher = Director::getInstance()->getEventDispatcher(); * Adds a listener: * * auto callback = [](EventCustom* event){ do_some_thing(); }; * auto listener = EventListenerCustom::create(callback); * dispatcher->addEventListenerWithSceneGraphPriority(listener, one_node); * * Dispatchs a custom event: * * EventCustom event("your_event_type"); * dispatcher->dispatchEvent(&event); * * Removes a listener * * dispatcher->removeEventListener(listener); * \endcode * @js cc._EventListenerCustom */ class CC_DLL EventListenerCustom : public EventListener { public: /** Creates an event listener with type and callback. * @param eventName The type of the event. * @param callback The callback function when the specified event was emitted. * @return An autoreleased EventListenerCustom object. */ static EventListenerCustom* create(const std::string& eventName, const std::function<void(EventCustom*)>& callback); /// Overrides virtual bool checkAvailable() override; virtual EventListenerCustom* clone() override; CC_CONSTRUCTOR_ACCESS: /** Constructor */ EventListenerCustom(); /** Initializes event with type and callback function */ bool init(const ListenerID& listenerId, const std::function<void(EventCustom*)>& callback); protected: std::function<void(EventCustom*)> _onCustomEvent; friend class LuaEventListenerCustom; }; NS_CC_END // end of base group /// @} #endif /* defined(__cocos2d_libs__CCCustomEventListener__) */
/* -*- c++ -*- */ /* * Copyright 2004,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifndef INCLUDED_FILTER_HILBERT_FC_H #define INCLUDED_FILTER_HILBERT_FC_H #include <gnuradio/filter/api.h> #include <gnuradio/filter/firdes.h> #include <gnuradio/sync_block.h> #include <gnuradio/types.h> namespace gr { namespace filter { /*! * \brief Hilbert transformer. * \ingroup filter_blk * * \details * real output is input appropriately delayed. * imaginary output is hilbert filtered (90 degree phase shift) * version of input. */ class FILTER_API hilbert_fc : virtual public sync_block { public: // gr::filter::hilbert_fc::sptr typedef boost::shared_ptr<hilbert_fc> sptr; /*! * Build a Hilbert transformer filter block. * * \param ntaps The number of taps for the filter. * \param window Window type (see firdes::win_type) to use. * \param beta Beta value for a Kaiser window. */ static sptr make(unsigned int ntaps, firdes::win_type window=firdes::WIN_HAMMING, double beta=6.76); }; } /* namespace filter */ } /* namespace gr */ #endif /* INCLUDED_FILTER_HILBERT_FC_H */
// SPDX-License-Identifier: GPL-2.0-only /* * QLogic iSCSI Offload Driver * Copyright (c) 2016 Cavium Inc. */ #include "qedi.h" #include "qedi_dbg.h" #include <linux/uaccess.h> #include <linux/debugfs.h> #include <linux/module.h> int qedi_do_not_recover; static struct dentry *qedi_dbg_root; void qedi_dbg_host_init(struct qedi_dbg_ctx *qedi, const struct qedi_debugfs_ops *dops, const struct file_operations *fops) { char host_dirname[32]; sprintf(host_dirname, "host%u", qedi->host_no); qedi->bdf_dentry = debugfs_create_dir(host_dirname, qedi_dbg_root); while (dops) { if (!(dops->name)) break; debugfs_create_file(dops->name, 0600, qedi->bdf_dentry, qedi, fops); dops++; fops++; } } void qedi_dbg_host_exit(struct qedi_dbg_ctx *qedi) { debugfs_remove_recursive(qedi->bdf_dentry); qedi->bdf_dentry = NULL; } void qedi_dbg_init(char *drv_name) { qedi_dbg_root = debugfs_create_dir(drv_name, NULL); } void qedi_dbg_exit(void) { debugfs_remove_recursive(qedi_dbg_root); qedi_dbg_root = NULL; } static ssize_t qedi_dbg_do_not_recover_enable(struct qedi_dbg_ctx *qedi_dbg) { if (!qedi_do_not_recover) qedi_do_not_recover = 1; QEDI_INFO(qedi_dbg, QEDI_LOG_DEBUGFS, "do_not_recover=%d\n", qedi_do_not_recover); return 0; } static ssize_t qedi_dbg_do_not_recover_disable(struct qedi_dbg_ctx *qedi_dbg) { if (qedi_do_not_recover) qedi_do_not_recover = 0; QEDI_INFO(qedi_dbg, QEDI_LOG_DEBUGFS, "do_not_recover=%d\n", qedi_do_not_recover); return 0; } static struct qedi_list_of_funcs qedi_dbg_do_not_recover_ops[] = { { "enable", qedi_dbg_do_not_recover_enable }, { "disable", qedi_dbg_do_not_recover_disable }, { NULL, NULL } }; const struct qedi_debugfs_ops qedi_debugfs_ops[] = { { "gbl_ctx", NULL }, { "do_not_recover", qedi_dbg_do_not_recover_ops}, { "io_trace", NULL }, { NULL, NULL } }; static ssize_t qedi_dbg_do_not_recover_cmd_write(struct file *filp, const char __user *buffer, size_t count, loff_t *ppos) { size_t cnt = 0; struct qedi_dbg_ctx *qedi_dbg = (struct qedi_dbg_ctx *)filp->private_data; struct qedi_list_of_funcs *lof = qedi_dbg_do_not_recover_ops; if (*ppos) return 0; while (lof) { if (!(lof->oper_str)) break; if (!strncmp(lof->oper_str, buffer, strlen(lof->oper_str))) { cnt = lof->oper_func(qedi_dbg); break; } lof++; } return (count - cnt); } static ssize_t qedi_dbg_do_not_recover_cmd_read(struct file *filp, char __user *buffer, size_t count, loff_t *ppos) { size_t cnt = 0; if (*ppos) return 0; cnt = sprintf(buffer, "do_not_recover=%d\n", qedi_do_not_recover); cnt = min_t(int, count, cnt - *ppos); *ppos += cnt; return cnt; } static int qedi_gbl_ctx_show(struct seq_file *s, void *unused) { struct qedi_fastpath *fp = NULL; struct qed_sb_info *sb_info = NULL; struct status_block_e4 *sb = NULL; struct global_queue *que = NULL; int id; u16 prod_idx; struct qedi_ctx *qedi = s->private; unsigned long flags; seq_puts(s, " DUMP CQ CONTEXT:\n"); for (id = 0; id < MIN_NUM_CPUS_MSIX(qedi); id++) { spin_lock_irqsave(&qedi->hba_lock, flags); seq_printf(s, "=========FAST CQ PATH [%d] ==========\n", id); fp = &qedi->fp_array[id]; sb_info = fp->sb_info; sb = sb_info->sb_virt; prod_idx = (sb->pi_array[QEDI_PROTO_CQ_PROD_IDX] & STATUS_BLOCK_E4_PROD_INDEX_MASK); seq_printf(s, "SB PROD IDX: %d\n", prod_idx); que = qedi->global_queues[fp->sb_id]; seq_printf(s, "DRV CONS IDX: %d\n", que->cq_cons_idx); seq_printf(s, "CQ complete host memory: %d\n", fp->sb_id); seq_puts(s, "=========== END ==================\n\n\n"); spin_unlock_irqrestore(&qedi->hba_lock, flags); } return 0; } static int qedi_dbg_gbl_ctx_open(struct inode *inode, struct file *file) { struct qedi_dbg_ctx *qedi_dbg = inode->i_private; struct qedi_ctx *qedi = container_of(qedi_dbg, struct qedi_ctx, dbg_ctx); return single_open(file, qedi_gbl_ctx_show, qedi); } static int qedi_io_trace_show(struct seq_file *s, void *unused) { int id, idx = 0; struct qedi_ctx *qedi = s->private; struct qedi_io_log *io_log; unsigned long flags; seq_puts(s, " DUMP IO LOGS:\n"); spin_lock_irqsave(&qedi->io_trace_lock, flags); idx = qedi->io_trace_idx; for (id = 0; id < QEDI_IO_TRACE_SIZE; id++) { io_log = &qedi->io_trace_buf[idx]; seq_printf(s, "iodir-%d:", io_log->direction); seq_printf(s, "tid-0x%x:", io_log->task_id); seq_printf(s, "cid-0x%x:", io_log->cid); seq_printf(s, "lun-%d:", io_log->lun); seq_printf(s, "op-0x%02x:", io_log->op); seq_printf(s, "0x%02x%02x%02x%02x:", io_log->lba[0], io_log->lba[1], io_log->lba[2], io_log->lba[3]); seq_printf(s, "buflen-%d:", io_log->bufflen); seq_printf(s, "sgcnt-%d:", io_log->sg_count); seq_printf(s, "res-0x%08x:", io_log->result); seq_printf(s, "jif-%lu:", io_log->jiffies); seq_printf(s, "blk_req_cpu-%d:", io_log->blk_req_cpu); seq_printf(s, "req_cpu-%d:", io_log->req_cpu); seq_printf(s, "intr_cpu-%d:", io_log->intr_cpu); seq_printf(s, "blk_rsp_cpu-%d\n", io_log->blk_rsp_cpu); idx++; if (idx == QEDI_IO_TRACE_SIZE) idx = 0; } spin_unlock_irqrestore(&qedi->io_trace_lock, flags); return 0; } static int qedi_dbg_io_trace_open(struct inode *inode, struct file *file) { struct qedi_dbg_ctx *qedi_dbg = inode->i_private; struct qedi_ctx *qedi = container_of(qedi_dbg, struct qedi_ctx, dbg_ctx); return single_open(file, qedi_io_trace_show, qedi); } const struct file_operations qedi_dbg_fops[] = { qedi_dbg_fileops_seq(qedi, gbl_ctx), qedi_dbg_fileops(qedi, do_not_recover), qedi_dbg_fileops_seq(qedi, io_trace), { }, };
/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Audio Codec driver supporting: * AD1835A, AD1836, AD1837A, AD1838A, AD1839A * * Copyright 2009-2011 Analog Devices Inc. */ #ifndef __AD1836_H__ #define __AD1836_H__ #define AD1836_DAC_CTRL1 0 #define AD1836_DAC_POWERDOWN 2 #define AD1836_DAC_SERFMT_MASK 0xE0 #define AD1836_DAC_SERFMT_PCK256 (0x4 << 5) #define AD1836_DAC_SERFMT_PCK128 (0x5 << 5) #define AD1836_DAC_WORD_LEN_MASK 0x18 #define AD1836_DAC_WORD_LEN_OFFSET 3 #define AD1836_DAC_CTRL2 1 /* These macros are one-based. So AD183X_MUTE_LEFT(1) will return the mute bit * for the first ADC/DAC */ #define AD1836_MUTE_LEFT(x) (((x) * 2) - 2) #define AD1836_MUTE_RIGHT(x) (((x) * 2) - 1) #define AD1836_DAC_L_VOL(x) ((x) * 2) #define AD1836_DAC_R_VOL(x) (1 + ((x) * 2)) #define AD1836_ADC_CTRL1 12 #define AD1836_ADC_POWERDOWN 7 #define AD1836_ADC_HIGHPASS_FILTER 8 #define AD1836_ADC_CTRL2 13 #define AD1836_ADC_WORD_LEN_MASK 0x30 #define AD1836_ADC_WORD_OFFSET 4 #define AD1836_ADC_SERFMT_MASK (7 << 6) #define AD1836_ADC_SERFMT_PCK256 (0x4 << 6) #define AD1836_ADC_SERFMT_PCK128 (0x5 << 6) #define AD1836_ADC_AUX (0x6 << 6) #define AD1836_ADC_CTRL3 14 #define AD1836_NUM_REGS 16 #define AD1836_WORD_LEN_24 0x0 #define AD1836_WORD_LEN_20 0x1 #define AD1836_WORD_LEN_16 0x2 #endif
/* * Copyright (C) 2012 - Virtual Open Systems and Columbia University * Author: Christoffer Dall <c.dall@virtualopensystems.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <linux/kvm_host.h> #include <asm/kvm_mmio.h> #include <asm/kvm_emulate.h> #include <trace/events/kvm.h> #include "trace.h" static void mmio_write_buf(char *buf, unsigned int len, unsigned long data) { void *datap = NULL; union { u8 byte; u16 hword; u32 word; u64 dword; } tmp; switch (len) { case 1: tmp.byte = data; datap = &tmp.byte; break; case 2: tmp.hword = data; datap = &tmp.hword; break; case 4: tmp.word = data; datap = &tmp.word; break; case 8: tmp.dword = data; datap = &tmp.dword; break; } memcpy(buf, datap, len); } static unsigned long mmio_read_buf(char *buf, unsigned int len) { unsigned long data = 0; union { u16 hword; u32 word; u64 dword; } tmp; switch (len) { case 1: data = buf[0]; break; case 2: memcpy(&tmp.hword, buf, len); data = tmp.hword; break; case 4: memcpy(&tmp.word, buf, len); data = tmp.word; break; case 8: memcpy(&tmp.dword, buf, len); data = tmp.dword; break; } return data; } /** * kvm_handle_mmio_return -- Handle MMIO loads after user space emulation * @vcpu: The VCPU pointer * @run: The VCPU run struct containing the mmio data * * This should only be called after returning from userspace for MMIO load * emulation. */ int kvm_handle_mmio_return(struct kvm_vcpu *vcpu, struct kvm_run *run) { unsigned long data; unsigned int len; int mask; if (!run->mmio.is_write) { len = run->mmio.len; if (len > sizeof(unsigned long)) return -EINVAL; data = mmio_read_buf(run->mmio.data, len); if (vcpu->arch.mmio_decode.sign_extend && len < sizeof(unsigned long)) { mask = 1U << ((len * 8) - 1); data = (data ^ mask) - mask; } trace_kvm_mmio(KVM_TRACE_MMIO_READ, len, run->mmio.phys_addr, data); data = vcpu_data_host_to_guest(vcpu, data, len); vcpu_set_reg(vcpu, vcpu->arch.mmio_decode.rt, data); } return 0; } static int decode_hsr(struct kvm_vcpu *vcpu, bool *is_write, int *len) { unsigned long rt; int access_size; bool sign_extend; if (kvm_vcpu_dabt_isextabt(vcpu)) { /* cache operation on I/O addr, tell guest unsupported */ kvm_inject_dabt(vcpu, kvm_vcpu_get_hfar(vcpu)); return 1; } if (kvm_vcpu_dabt_iss1tw(vcpu)) { /* page table accesses IO mem: tell guest to fix its TTBR */ kvm_inject_dabt(vcpu, kvm_vcpu_get_hfar(vcpu)); return 1; } access_size = kvm_vcpu_dabt_get_as(vcpu); if (unlikely(access_size < 0)) return access_size; *is_write = kvm_vcpu_dabt_iswrite(vcpu); sign_extend = kvm_vcpu_dabt_issext(vcpu); rt = kvm_vcpu_dabt_get_rd(vcpu); *len = access_size; vcpu->arch.mmio_decode.sign_extend = sign_extend; vcpu->arch.mmio_decode.rt = rt; /* * The MMIO instruction is emulated and should not be re-executed * in the guest. */ kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu)); return 0; } int io_mem_abort(struct kvm_vcpu *vcpu, struct kvm_run *run, phys_addr_t fault_ipa) { unsigned long data; unsigned long rt; int ret; bool is_write; int len; u8 data_buf[8]; /* * Prepare MMIO operation. First decode the syndrome data we get * from the CPU. Then try if some in-kernel emulation feels * responsible, otherwise let user space do its magic. */ if (kvm_vcpu_dabt_isvalid(vcpu)) { ret = decode_hsr(vcpu, &is_write, &len); if (ret) return ret; } else { kvm_err("load/store instruction decoding not implemented\n"); return -ENOSYS; } rt = vcpu->arch.mmio_decode.rt; if (is_write) { data = vcpu_data_guest_to_host(vcpu, vcpu_get_reg(vcpu, rt), len); trace_kvm_mmio(KVM_TRACE_MMIO_WRITE, len, fault_ipa, data); mmio_write_buf(data_buf, len, data); ret = kvm_io_bus_write(vcpu, KVM_MMIO_BUS, fault_ipa, len, data_buf); } else { trace_kvm_mmio(KVM_TRACE_MMIO_READ_UNSATISFIED, len, fault_ipa, 0); ret = kvm_io_bus_read(vcpu, KVM_MMIO_BUS, fault_ipa, len, data_buf); } /* Now prepare kvm_run for the potential return to userland. */ run->mmio.is_write = is_write; run->mmio.phys_addr = fault_ipa; run->mmio.len = len; if (is_write) memcpy(run->mmio.data, data_buf, len); if (!ret) { /* We handled the access successfully in the kernel. */ vcpu->stat.mmio_exit_kernel++; kvm_handle_mmio_return(vcpu, run); return 1; } else { vcpu->stat.mmio_exit_user++; } run->exit_reason = KVM_EXIT_MMIO; return 0; }
// Copyright 2004-2009 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ======================================================================== // TODO(omaha): this code should be updated according to code published by // Microsoft at http://msdn.microsoft.com/en-us/library/ms724429(VS.85).aspx. // We need a more rigorous clasification of versions. #ifndef OMAHA_BASE_SYSTEM_INFO_H_ #define OMAHA_BASE_SYSTEM_INFO_H_ #include <windows.h> #include <tchar.h> namespace omaha { // TODO(omaha): refactor to use a namespace. class SystemInfo { public: // Find out if the OS is at least Windows 2000 // Service pack 4. If OS version is less than that // will return false, all other cases true. static bool OSWin2KSP4OrLater() { // Use GetVersionEx to get OS and Service Pack information. OSVERSIONINFOEX osviex; ::ZeroMemory(&osviex, sizeof(osviex)); osviex.dwOSVersionInfoSize = sizeof(osviex); BOOL success = ::GetVersionEx(reinterpret_cast<OSVERSIONINFO*>(&osviex)); // If this failed we're on Win9X or a pre NT4SP6 OS. if (!success) { return false; } if (osviex.dwMajorVersion < 5) { return false; } if (osviex.dwMajorVersion > 5) { return true; // way beyond Windows XP. } if (osviex.dwMinorVersion >= 1) { return true; // Windows XP or better. } if (osviex.wServicePackMajor >= 4) { return true; // Windows 2000 SP4. } return false; // Windows 2000, < SP4. } // Returns true if the OS is at least XP SP2. static bool OSWinXPSP2OrLater(); // CategorizeOS returns a categorization of what operating system is running, // and the service pack level. // NOTE: Please keep this in the order of increasing OS versions enum OSVersionType { OS_WINDOWS_UNKNOWN = 1, OS_WINDOWS_9X_OR_NT, OS_WINDOWS_2000, OS_WINDOWS_XP, OS_WINDOWS_SERVER_2003, OS_WINDOWS_VISTA, OS_WINDOWS_7 }; static HRESULT CategorizeOS(OSVersionType* os_version, DWORD* service_pack); static const wchar_t* OSVersionTypeAsString(OSVersionType t); // Returns true if the current operating system is Windows 2000. static bool IsRunningOnW2K(); // Are we running on Windows XP or later. static bool IsRunningOnXPOrLater(); // Are we running on Windows XP SP1 or later. static bool IsRunningOnXPSP1OrLater(); // Are we running on Windows Vista or later. static bool IsRunningOnVistaOrLater(); static bool IsRunningOnVistaRTM(); // Returns the version and the name of the operating system. static bool GetSystemVersion(int* major_version, int* minor_version, int* service_pack_major, int* service_pack_minor, TCHAR* name_buf, size_t name_buf_len); // Returns the processor architecture. We use wProcessorArchitecture in // SYSTEM_INFO returned by ::GetNativeSystemInfo() to detect the processor // architecture of the installed operating system. Note the "Native" in the // function name - this is important. See // http://msdn.microsoft.com/en-us/library/ms724340.aspx. static DWORD GetProcessorArchitecture(); // Returns whether this is a 64-bit Windows system. static bool Is64BitWindows(); }; } // namespace omaha #endif // OMAHA_BASE_SYSTEM_INFO_H_
/* FUNCTION <<strcasestr>>---case-insensitive character string search INDEX strcasestr ANSI_SYNOPSIS #include <string.h> char *strcasestr(const char *<[s]>, const char *<[find]>); TRAD_SYNOPSIS #include <string.h> int strcasecmp(<[s]>, <[find]>) char *<[s]>; char *<[find]>; DESCRIPTION <<strcasestr>> searchs the string <[s]> for the first occurrence of the sequence <[find]>. <<strcasestr>> is identical to <<strstr>> except the search is case-insensitive. RETURNS A pointer to the first case-insensitive occurrence of the sequence <[find]> or <<NULL>> if no match was found. PORTABILITY <<strcasestr>> is in the Berkeley Software Distribution. <<strcasestr>> requires no supporting OS subroutines. It uses tolower() from elsewhere in this library. QUICKREF strcasestr */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * The quadratic code is derived from software contributed to Berkeley by * Chris Torek. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* Linear algorithm Copyright (C) 2008 Eric Blake * Permission to use, copy, modify, and distribute the linear portion of * software is freely granted, provided that this notice is preserved. */ #include <sys/cdefs.h> #include <ctype.h> #include <string.h> #include <strings.h> #if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) # define RETURN_TYPE char * # define AVAILABLE(h, h_l, j, n_l) \ (!memchr ((h) + (h_l), '\0', (j) + (n_l) - (h_l)) \ && ((h_l) = (j) + (n_l))) # define CANON_ELEMENT(c) tolower (c) #if __GNUC_PREREQ (4, 2) /* strncasecmp uses signed char, CMP_FUNC is expected to use unsigned char. */ #pragma GCC diagnostic ignored "-Wpointer-sign" #endif # define CMP_FUNC strncasecmp # include "str-two-way.h" #endif /* * Find the first occurrence of find in s, ignore case. */ char * _DEFUN (strcasestr, (s, find), _CONST char *s _AND _CONST char *find) { #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) /* Less code size, but quadratic performance in the worst case. */ char c, sc; size_t len; if ((c = *find++) != 0) { c = tolower((unsigned char)c); len = strlen(find); do { do { if ((sc = *s++) == 0) return (NULL); } while ((char)tolower((unsigned char)sc) != c); } while (strncasecmp(s, find, len) != 0); s--; } return ((char *)s); #else /* compilation for speed */ /* Larger code size, but guaranteed linear performance. */ const char *haystack = s; const char *needle = find; size_t needle_len; /* Length of NEEDLE. */ size_t haystack_len; /* Known minimum length of HAYSTACK. */ int ok = 1; /* True if NEEDLE is prefix of HAYSTACK. */ /* Determine length of NEEDLE, and in the process, make sure HAYSTACK is at least as long (no point processing all of a long NEEDLE if HAYSTACK is too short). */ while (*haystack && *needle) ok &= (tolower ((unsigned char) *haystack++) == tolower ((unsigned char) *needle++)); if (*needle) return NULL; if (ok) return (char *) s; needle_len = needle - find; haystack = s + 1; haystack_len = needle_len - 1; /* Perform the search. */ if (needle_len < LONG_NEEDLE_THRESHOLD) return two_way_short_needle ((const unsigned char *) haystack, haystack_len, (const unsigned char *) find, needle_len); return two_way_long_needle ((const unsigned char *) haystack, haystack_len, (const unsigned char *) find, needle_len); #endif /* compilation for speed */ }
/****************************************************************************** * * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * * ******************************************************************************/ #ifndef __RTL8188E_RECV_H__ #define __RTL8188E_RECV_H__ #include <rtl8192c_recv.h> #define TX_RPT1_PKT_LEN 8 typedef struct rxreport_8188e { //Offset 0 u32 pktlen:14; u32 crc32:1; u32 icverr:1; u32 drvinfosize:4; u32 security:3; u32 qos:1; u32 shift:2; u32 physt:1; u32 swdec:1; u32 ls:1; u32 fs:1; u32 eor:1; u32 own:1; //Offset 4 u32 macid:5; u32 tid:4; u32 hwrsvd:4; u32 amsdu:1; u32 paggr:1; u32 faggr:1; u32 a1fit:4; u32 a2fit:4; u32 pam:1; u32 pwr:1; u32 md:1; u32 mf:1; u32 type:2; u32 mc:1; u32 bc:1; //Offset 8 u32 seq:12; u32 frag:4; u32 nextpktlen:14; u32 nextind:1; u32 rsvd0831:1; //Offset 12 u32 rxmcs:6; u32 rxht:1; u32 gf:1; u32 splcp:1; u32 bw:1; u32 htc:1; u32 eosp:1; u32 bssidfit:2; u32 rpt_sel:2; u32 rsvd1216:13; u32 pattern_match:1; u32 unicastwake:1; u32 magicwake:1; //Offset 16 /* u32 pattern0match:1; u32 pattern1match:1; u32 pattern2match:1; u32 pattern3match:1; u32 pattern4match:1; u32 pattern5match:1; u32 pattern6match:1; u32 pattern7match:1; u32 pattern8match:1; u32 pattern9match:1; u32 patternamatch:1; u32 patternbmatch:1; u32 patterncmatch:1; u32 rsvd1613:19; */ u32 rsvd16; //Offset 20 u32 tsfl; //Offset 24 u32 bassn:12; u32 bavld:1; u32 rsvd2413:19; } RXREPORT, *PRXREPORT; #ifdef CONFIG_SDIO_HCI s32 rtl8188es_init_recv_priv(PADAPTER padapter); void rtl8188es_free_recv_priv(PADAPTER padapter); void rtl8188es_recv_hdl(PADAPTER padapter, struct recv_buf *precvbuf); #endif #ifdef CONFIG_USB_HCI #define INTERRUPT_MSG_FORMAT_LEN 60 void rtl8188eu_init_recvbuf(_adapter *padapter, struct recv_buf *precvbuf); s32 rtl8188eu_init_recv_priv(PADAPTER padapter); void rtl8188eu_free_recv_priv(PADAPTER padapter); void rtl8188eu_recv_hdl(PADAPTER padapter, struct recv_buf *precvbuf); void rtl8188eu_recv_tasklet(void *priv); #endif #ifdef CONFIG_PCI_HCI s32 rtl8188ee_init_recv_priv(PADAPTER padapter); void rtl8188ee_free_recv_priv(PADAPTER padapter); #endif void rtl8188e_query_rx_phy_status(union recv_frame *prframe, struct phy_stat *pphy_stat); void rtl8188e_process_phy_info(PADAPTER padapter, void *prframe); void update_recvframe_phyinfo_88e(union recv_frame *precvframe,struct phy_stat *pphy_status); void update_recvframe_attrib_88e( union recv_frame *precvframe, struct recv_stat *prxstat); #endif
// SPDX-License-Identifier: GPL-2.0 /* * camss-csiphy-2ph-1-0.c * * Qualcomm MSM Camera Subsystem - CSIPHY Module 2phase v1.0 * * Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. * Copyright (C) 2016-2018 Linaro Ltd. */ #include "camss-csiphy.h" #include <linux/delay.h> #include <linux/interrupt.h> #include <linux/io.h> #define CAMSS_CSI_PHY_LNn_CFG2(n) (0x004 + 0x40 * (n)) #define CAMSS_CSI_PHY_LNn_CFG3(n) (0x008 + 0x40 * (n)) #define CAMSS_CSI_PHY_GLBL_RESET 0x140 #define CAMSS_CSI_PHY_GLBL_PWR_CFG 0x144 #define CAMSS_CSI_PHY_GLBL_IRQ_CMD 0x164 #define CAMSS_CSI_PHY_HW_VERSION 0x188 #define CAMSS_CSI_PHY_INTERRUPT_STATUSn(n) (0x18c + 0x4 * (n)) #define CAMSS_CSI_PHY_INTERRUPT_MASKn(n) (0x1ac + 0x4 * (n)) #define CAMSS_CSI_PHY_INTERRUPT_CLEARn(n) (0x1cc + 0x4 * (n)) #define CAMSS_CSI_PHY_GLBL_T_INIT_CFG0 0x1ec #define CAMSS_CSI_PHY_T_WAKEUP_CFG0 0x1f4 static void csiphy_hw_version_read(struct csiphy_device *csiphy, struct device *dev) { u8 hw_version = readl_relaxed(csiphy->base + CAMSS_CSI_PHY_HW_VERSION); dev_dbg(dev, "CSIPHY HW Version = 0x%02x\n", hw_version); } /* * csiphy_reset - Perform software reset on CSIPHY module * @csiphy: CSIPHY device */ static void csiphy_reset(struct csiphy_device *csiphy) { writel_relaxed(0x1, csiphy->base + CAMSS_CSI_PHY_GLBL_RESET); usleep_range(5000, 8000); writel_relaxed(0x0, csiphy->base + CAMSS_CSI_PHY_GLBL_RESET); } /* * csiphy_settle_cnt_calc - Calculate settle count value * * Helper function to calculate settle count value. This is * based on the CSI2 T_hs_settle parameter which in turn * is calculated based on the CSI2 transmitter link frequency. * * Return settle count value or 0 if the CSI2 link frequency * is not available */ static u8 csiphy_settle_cnt_calc(s64 link_freq, u32 timer_clk_rate) { u32 ui; /* ps */ u32 timer_period; /* ps */ u32 t_hs_prepare_max; /* ps */ u32 t_hs_prepare_zero_min; /* ps */ u32 t_hs_settle; /* ps */ u8 settle_cnt; if (link_freq <= 0) return 0; ui = div_u64(1000000000000LL, link_freq); ui /= 2; t_hs_prepare_max = 85000 + 6 * ui; t_hs_prepare_zero_min = 145000 + 10 * ui; t_hs_settle = (t_hs_prepare_max + t_hs_prepare_zero_min) / 2; timer_period = div_u64(1000000000000LL, timer_clk_rate); settle_cnt = t_hs_settle / timer_period - 1; return settle_cnt; } static void csiphy_lanes_enable(struct csiphy_device *csiphy, struct csiphy_config *cfg, s64 link_freq, u8 lane_mask) { struct csiphy_lanes_cfg *c = &cfg->csi2->lane_cfg; u8 settle_cnt; u8 val, l = 0; int i = 0; settle_cnt = csiphy_settle_cnt_calc(link_freq, csiphy->timer_clk_rate); writel_relaxed(0x1, csiphy->base + CAMSS_CSI_PHY_GLBL_T_INIT_CFG0); writel_relaxed(0x1, csiphy->base + CAMSS_CSI_PHY_T_WAKEUP_CFG0); val = 0x1; val |= lane_mask << 1; writel_relaxed(val, csiphy->base + CAMSS_CSI_PHY_GLBL_PWR_CFG); val = cfg->combo_mode << 4; writel_relaxed(val, csiphy->base + CAMSS_CSI_PHY_GLBL_RESET); for (i = 0; i <= c->num_data; i++) { if (i == c->num_data) l = c->clk.pos; else l = c->data[i].pos; writel_relaxed(0x10, csiphy->base + CAMSS_CSI_PHY_LNn_CFG2(l)); writel_relaxed(settle_cnt, csiphy->base + CAMSS_CSI_PHY_LNn_CFG3(l)); writel_relaxed(0x3f, csiphy->base + CAMSS_CSI_PHY_INTERRUPT_MASKn(l)); writel_relaxed(0x3f, csiphy->base + CAMSS_CSI_PHY_INTERRUPT_CLEARn(l)); } } static void csiphy_lanes_disable(struct csiphy_device *csiphy, struct csiphy_config *cfg) { struct csiphy_lanes_cfg *c = &cfg->csi2->lane_cfg; u8 l = 0; int i = 0; for (i = 0; i <= c->num_data; i++) { if (i == c->num_data) l = c->clk.pos; else l = c->data[i].pos; writel_relaxed(0x0, csiphy->base + CAMSS_CSI_PHY_LNn_CFG2(l)); } writel_relaxed(0x0, csiphy->base + CAMSS_CSI_PHY_GLBL_PWR_CFG); } /* * csiphy_isr - CSIPHY module interrupt handler * @irq: Interrupt line * @dev: CSIPHY device * * Return IRQ_HANDLED on success */ static irqreturn_t csiphy_isr(int irq, void *dev) { struct csiphy_device *csiphy = dev; u8 i; for (i = 0; i < 8; i++) { u8 val = readl_relaxed(csiphy->base + CAMSS_CSI_PHY_INTERRUPT_STATUSn(i)); writel_relaxed(val, csiphy->base + CAMSS_CSI_PHY_INTERRUPT_CLEARn(i)); writel_relaxed(0x1, csiphy->base + CAMSS_CSI_PHY_GLBL_IRQ_CMD); writel_relaxed(0x0, csiphy->base + CAMSS_CSI_PHY_GLBL_IRQ_CMD); writel_relaxed(0x0, csiphy->base + CAMSS_CSI_PHY_INTERRUPT_CLEARn(i)); } return IRQ_HANDLED; } const struct csiphy_hw_ops csiphy_ops_2ph_1_0 = { .hw_version_read = csiphy_hw_version_read, .reset = csiphy_reset, .lanes_enable = csiphy_lanes_enable, .lanes_disable = csiphy_lanes_disable, .isr = csiphy_isr, };
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_SYNC_GLUE_PREFERENCE_CHANGE_PROCESSOR_H_ #define CHROME_BROWSER_SYNC_GLUE_PREFERENCE_CHANGE_PROCESSOR_H_ #pragma once #include <string> #include "chrome/browser/prefs/pref_change_registrar.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/sync/engine/syncapi.h" #include "chrome/browser/sync/glue/change_processor.h" #include "chrome/browser/sync/glue/sync_backend_host.h" #include "content/common/notification_observer.h" namespace browser_sync { class PreferenceModelAssociator; class UnrecoverableErrorHandler; // This class is responsible for taking changes from the PrefService and // applying them to the sync_api 'syncable' model, and vice versa. All // operations and use of this class are from the UI thread. class PreferenceChangeProcessor : public ChangeProcessor, public NotificationObserver { public: PreferenceChangeProcessor(PreferenceModelAssociator* model_associator, UnrecoverableErrorHandler* error_handler); virtual ~PreferenceChangeProcessor(); // NotificationObserver implementation. // PrefService -> sync_api model change application. virtual void Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details); // sync_api model -> PrefService change application. virtual void ApplyChangesFromSyncModel( const sync_api::BaseTransaction* trans, const sync_api::SyncManager::ChangeRecord* changes, int change_count); protected: virtual void StartImpl(Profile* profile); virtual void StopImpl(); private: Value* ReadPreference(sync_api::ReadNode* node, std::string* name); void StartObserving(); void StopObserving(); // The model we are processing changes from. Non-NULL when |running_| is true. PrefService* pref_service_; // The two models should be associated according to this ModelAssociator. PreferenceModelAssociator* model_associator_; // Whether we are currently processing a preference change notification. bool processing_pref_change_; PrefChangeRegistrar registrar_; DISALLOW_COPY_AND_ASSIGN(PreferenceChangeProcessor); }; } // namespace browser_sync #endif // CHROME_BROWSER_SYNC_GLUE_PREFERENCE_CHANGE_PROCESSOR_H_
/* { dg-do compile } */ /* { dg-require-effective-target ia32 } */ /* { dg-require-effective-target fpic } */ /* { dg-skip-if "" { *-*-* } { "-march=*" } { "-march=atom" } } */ /* { dg-skip-if "No Windows PIC" { *-*-mingw* *-*-cygwin } { "*" } { "" } } */ /* { dg-options "-O2 -fomit-frame-pointer -march=atom -fPIC" } */ /* { dg-final { scan-assembler-times "nop" 8 } } */ /* { dg-final { scan-assembler-not "rep" } } */ extern int bar; int foo () { asm volatile (""); return bar; }
/* SPDX-License-Identifier: GPL-2.0 */ /****************************************************************************** * * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved. * * Modifications for inclusion into the Linux staging tree are * Copyright(c) 2010 Larry Finger. All rights reserved. * * Contact information: * WLAN FAE <wlanfae@realtek.com> * Larry Finger <Larry.Finger@lwfinger.net> * ******************************************************************************/ #ifndef __STA_INFO_H_ #define __STA_INFO_H_ #include "osdep_service.h" #include "drv_types.h" #include "wifi.h" #define NUM_STA 32 #define NUM_ACL 64 /* if mode ==0, then the sta is allowed once the addr is hit. * if mode ==1, then the sta is rejected once the addr is non-hit. */ struct wlan_acl_node { struct list_head list; u8 addr[ETH_ALEN]; u8 mode; }; struct wlan_acl_pool { struct wlan_acl_node aclnode[NUM_ACL]; }; struct stainfo_stats { uint rx_pkts; uint rx_bytes; u64 tx_pkts; uint tx_bytes; }; struct sta_info { spinlock_t lock; struct list_head list; /*free_sta_queue*/ struct list_head hash_list; /*sta_hash*/ struct sta_xmit_priv sta_xmitpriv; struct sta_recv_priv sta_recvpriv; uint state; uint aid; uint mac_id; uint qos_option; u8 hwaddr[ETH_ALEN]; uint ieee8021x_blocked; /*0: allowed, 1:blocked */ uint XPrivacy; /*aes, tkip...*/ union Keytype tkiptxmickey; union Keytype tkiprxmickey; union Keytype x_UncstKey; union pn48 txpn; /* PN48 used for Unicast xmit.*/ union pn48 rxpn; /* PN48 used for Unicast recv.*/ u8 bssrateset[16]; uint bssratelen; s32 rssi; s32 signal_quality; struct stainfo_stats sta_stats; /*for A-MPDU Rx reordering buffer control */ struct recv_reorder_ctrl recvreorder_ctrl[16]; struct ht_priv htpriv; /* Notes: * STA_Mode: * curr_network(mlme_priv/security_priv/qos/ht) * + sta_info: (STA & AP) CAP/INFO * scan_q: AP CAP/INFO * AP_Mode: * curr_network(mlme_priv/security_priv/qos/ht) : AP CAP/INFO * sta_info: (AP & STA) CAP/INFO */ struct list_head asoc_list; struct list_head auth_list; unsigned int expire_to; unsigned int auth_seq; unsigned int authalg; unsigned char chg_txt[128]; unsigned int tx_ra_bitmap; }; struct sta_priv { u8 *pallocated_stainfo_buf; u8 *pstainfo_buf; struct __queue free_sta_queue; spinlock_t sta_hash_lock; struct list_head sta_hash[NUM_STA]; int asoc_sta_count; struct __queue sleep_q; struct __queue wakeup_q; struct _adapter *padapter; struct list_head asoc_list; struct list_head auth_list; unsigned int auth_to; /* sec, time to expire in authenticating. */ unsigned int assoc_to; /* sec, time to expire before associating. */ unsigned int expire_to; /* sec , time to expire after associated. */ }; static inline u32 wifi_mac_hash(u8 *mac) { u32 x; x = mac[0]; x = (x << 2) ^ mac[1]; x = (x << 2) ^ mac[2]; x = (x << 2) ^ mac[3]; x = (x << 2) ^ mac[4]; x = (x << 2) ^ mac[5]; x ^= x >> 8; x = x & (NUM_STA - 1); return x; } int _r8712_init_sta_priv(struct sta_priv *pstapriv); void _r8712_free_sta_priv(struct sta_priv *pstapriv); struct sta_info *r8712_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr); void r8712_free_stainfo(struct _adapter *padapter, struct sta_info *psta); void r8712_free_all_stainfo(struct _adapter *padapter); struct sta_info *r8712_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr); void r8712_init_bcmc_stainfo(struct _adapter *padapter); struct sta_info *r8712_get_bcmc_stainfo(struct _adapter *padapter); u8 r8712_access_ctrl(struct wlan_acl_pool *pacl_list, u8 *mac_addr); #endif /* _STA_INFO_H_ */
/* PR target/8340 */ /* { dg-do compile } */ /* { dg-require-effective-target ia32 } */ /* { dg-require-effective-target fpic } */ /* { dg-skip-if "No Windows PIC" { *-*-mingw* *-*-cygwin } { "*" } { "" } } */ /* { dg-options "-fPIC" } */ /* Test verifies that %ebx is no longer fixed when generating PIC code on i686. */ int foo () { static int a; __asm__ __volatile__ ( "xorl %%ebx, %%ebx\n" "movl %%ebx, %0\n" : "=m" (a) : : "%ebx" ); return a; }
/* Public domain. */ #ifndef CDB_H #define CDB_H #include <string.h> #include "types.h" #define KVLSZ 4 #define CDB_MAX_KEY 0xff #define CDB_MAX_VALUE 0xffffff #define CDB_HASHSTART 5381 struct cdb { char *map; /* 0 if no map is available */ int fd; /* filedescriptor */ ut32 size; /* initialized if map is nonzero */ ut32 loop; /* number of hash slots searched under this key */ ut32 khash; /* initialized if loop is nonzero */ ut32 kpos; /* initialized if loop is nonzero */ ut32 hpos; /* initialized if loop is nonzero */ ut32 hslots; /* initialized if loop is nonzero */ ut32 dpos; /* initialized if cdb_findnext() returns 1 */ ut32 dlen; /* initialized if cdb_findnext() returns 1 */ }; /* TODO THIS MUST GTFO! */ bool cdb_getkvlen(struct cdb *db, ut32 *klen, ut32 *vlen, ut32 pos); void cdb_free(struct cdb *); bool cdb_init(struct cdb *, int fd); void cdb_findstart(struct cdb *); bool cdb_read(struct cdb *, char *, unsigned int, ut32); int cdb_findnext(struct cdb *, ut32 u, const char *, ut32); #define cdb_datapos(c) ((c)->dpos) #define cdb_datalen(c) ((c)->dlen) #endif
// SPDX-License-Identifier: GPL-2.0-only /* Tom Kelly's Scalable TCP * * See http://www.deneholme.net/tom/scalable/ * * John Heffner <jheffner@sc.edu> */ #include <linux/module.h> #include <net/tcp.h> /* These factors derived from the recommended values in the aer: * .01 and and 7/8. */ #define TCP_SCALABLE_AI_CNT 100U #define TCP_SCALABLE_MD_SCALE 3 static void tcp_scalable_cong_avoid(struct sock *sk, u32 ack, u32 acked) { struct tcp_sock *tp = tcp_sk(sk); if (!tcp_is_cwnd_limited(sk)) return; if (tcp_in_slow_start(tp)) { acked = tcp_slow_start(tp, acked); if (!acked) return; } tcp_cong_avoid_ai(tp, min(tp->snd_cwnd, TCP_SCALABLE_AI_CNT), acked); } static u32 tcp_scalable_ssthresh(struct sock *sk) { const struct tcp_sock *tp = tcp_sk(sk); return max(tp->snd_cwnd - (tp->snd_cwnd>>TCP_SCALABLE_MD_SCALE), 2U); } static struct tcp_congestion_ops tcp_scalable __read_mostly = { .ssthresh = tcp_scalable_ssthresh, .undo_cwnd = tcp_reno_undo_cwnd, .cong_avoid = tcp_scalable_cong_avoid, .owner = THIS_MODULE, .name = "scalable", }; static int __init tcp_scalable_register(void) { return tcp_register_congestion_control(&tcp_scalable); } static void __exit tcp_scalable_unregister(void) { tcp_unregister_congestion_control(&tcp_scalable); } module_init(tcp_scalable_register); module_exit(tcp_scalable_unregister); MODULE_AUTHOR("John Heffner"); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Scalable TCP");
/** * Copyright (c) 2011 Trusted Logic S.A. * All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ /* * This header file contains extensions to the TEE Client API that are * specific to the Trusted Foundations implementations */ #ifndef __TEE_CLIENT_API_EX_H__ #define __TEE_CLIENT_API_EX_H__ #include <linux/types.h> /* Implementation-defined login types */ #define TEEC_LOGIN_AUTHENTICATION 0x80000000 #define TEEC_LOGIN_PRIVILEGED 0x80000002 #define TEEC_LOGIN_PRIVILEGED_KERNEL 0x80000002 /* Type definitions */ typedef u64 TEEC_TimeLimit; void TEEC_EXPORT TEEC_GetTimeLimit( TEEC_Context * context, uint32_t timeout, TEEC_TimeLimit *timeLimit); TEEC_Result TEEC_EXPORT TEEC_OpenSessionEx( TEEC_Context * context, TEEC_Session * session, const TEEC_TimeLimit *timeLimit, const TEEC_UUID * destination, uint32_t connectionMethod, void *connectionData, TEEC_Operation * operation, uint32_t *errorOrigin); TEEC_Result TEEC_EXPORT TEEC_InvokeCommandEx( TEEC_Session * session, const TEEC_TimeLimit *timeLimit, uint32_t commandID, TEEC_Operation * operation, uint32_t *errorOrigin); #endif /* __TEE_CLIENT_API_EX_H__ */
/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QCUPSPRINTENGINE_P_H #define QCUPSPRINTENGINE_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include "QtPrintSupport/qprintengine.h" #ifndef QT_NO_PRINTER #include <QtCore/qstring.h> #include <QtGui/qpaintengine.h> #include <private/qpaintengine_p.h> #include <private/qprintdevice_p.h> #include <private/qprintengine_pdf_p.h> QT_BEGIN_NAMESPACE class QCupsPrintEnginePrivate; class QCupsPrintEngine : public QPdfPrintEngine { Q_DECLARE_PRIVATE(QCupsPrintEngine) public: QCupsPrintEngine(QPrinter::PrinterMode m); virtual ~QCupsPrintEngine(); // reimplementations QPdfPrintEngine void setProperty(PrintEnginePropertyKey key, const QVariant &value); QVariant property(PrintEnginePropertyKey key) const; // end reimplementations QPdfPrintEngine private: Q_DISABLE_COPY(QCupsPrintEngine) }; class QCupsPrintEnginePrivate : public QPdfPrintEnginePrivate { Q_DECLARE_PUBLIC(QCupsPrintEngine) public: QCupsPrintEnginePrivate(QPrinter::PrinterMode m); ~QCupsPrintEnginePrivate(); bool openPrintDevice(); void closePrintDevice(); private: Q_DISABLE_COPY(QCupsPrintEnginePrivate) void setupDefaultPrinter(); void changePrinter(const QString &newPrinter); void setPageSize(const QPageSize &pageSize); QPrintDevice m_printDevice; QStringList cupsOptions; QString cupsTempFile; }; QT_END_NAMESPACE #endif // QT_NO_PRINTER #endif // QCUPSPRINTENGINE_P_H
/* SPDX-License-Identifier: GPL-2.0 */ #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/mman.h> #include <fcntl.h> #include <unistd.h> #include <elf.h> #include "elfconfig.h" /* On BSD-alike OSes elf.h defines these according to host's word size */ #undef ELF_ST_BIND #undef ELF_ST_TYPE #undef ELF_R_SYM #undef ELF_R_TYPE #if KERNEL_ELFCLASS == ELFCLASS32 #define Elf_Ehdr Elf32_Ehdr #define Elf_Shdr Elf32_Shdr #define Elf_Sym Elf32_Sym #define Elf_Addr Elf32_Addr #define Elf_Sword Elf64_Sword #define Elf_Section Elf32_Half #define ELF_ST_BIND ELF32_ST_BIND #define ELF_ST_TYPE ELF32_ST_TYPE #define Elf_Rel Elf32_Rel #define Elf_Rela Elf32_Rela #define ELF_R_SYM ELF32_R_SYM #define ELF_R_TYPE ELF32_R_TYPE #else #define Elf_Ehdr Elf64_Ehdr #define Elf_Shdr Elf64_Shdr #define Elf_Sym Elf64_Sym #define Elf_Addr Elf64_Addr #define Elf_Sword Elf64_Sxword #define Elf_Section Elf64_Half #define ELF_ST_BIND ELF64_ST_BIND #define ELF_ST_TYPE ELF64_ST_TYPE #define Elf_Rel Elf64_Rel #define Elf_Rela Elf64_Rela #define ELF_R_SYM ELF64_R_SYM #define ELF_R_TYPE ELF64_R_TYPE #endif /* The 64-bit MIPS ELF ABI uses an unusual reloc format. */ typedef struct { Elf32_Word r_sym; /* Symbol index */ unsigned char r_ssym; /* Special symbol for 2nd relocation */ unsigned char r_type3; /* 3rd relocation type */ unsigned char r_type2; /* 2nd relocation type */ unsigned char r_type1; /* 1st relocation type */ } _Elf64_Mips_R_Info; typedef union { Elf64_Xword r_info_number; _Elf64_Mips_R_Info r_info_fields; } _Elf64_Mips_R_Info_union; #define ELF64_MIPS_R_SYM(i) \ ((__extension__ (_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_sym) #define ELF64_MIPS_R_TYPE(i) \ ((__extension__ (_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_type1) #if KERNEL_ELFDATA != HOST_ELFDATA static inline void __endian(const void *src, void *dest, unsigned int size) { unsigned int i; for (i = 0; i < size; i++) ((unsigned char*)dest)[i] = ((unsigned char*)src)[size - i-1]; } #define TO_NATIVE(x) \ ({ \ typeof(x) __x; \ __endian(&(x), &(__x), sizeof(__x)); \ __x; \ }) #else /* endianness matches */ #define TO_NATIVE(x) (x) #endif #define NOFAIL(ptr) do_nofail((ptr), #ptr) void *do_nofail(void *ptr, const char *expr); struct buffer { char *p; int pos; int size; }; void __attribute__((format(printf, 2, 3))) buf_printf(struct buffer *buf, const char *fmt, ...); void buf_write(struct buffer *buf, const char *s, int len); struct namespace_list { struct namespace_list *next; char namespace[]; }; struct module { struct module *next; int gpl_compatible; struct symbol *unres; int from_dump; /* 1 if module was loaded from *.symvers */ int is_vmlinux; int seen; int has_init; int has_cleanup; struct buffer dev_table_buf; char srcversion[25]; // Missing namespace dependencies struct namespace_list *missing_namespaces; // Actual imported namespaces struct namespace_list *imported_namespaces; char name[]; }; struct elf_info { size_t size; Elf_Ehdr *hdr; Elf_Shdr *sechdrs; Elf_Sym *symtab_start; Elf_Sym *symtab_stop; Elf_Section export_sec; Elf_Section export_unused_sec; Elf_Section export_gpl_sec; Elf_Section export_unused_gpl_sec; Elf_Section export_gpl_future_sec; char *strtab; char *modinfo; unsigned int modinfo_len; /* support for 32bit section numbers */ unsigned int num_sections; /* max_secindex + 1 */ unsigned int secindex_strings; /* if Nth symbol table entry has .st_shndx = SHN_XINDEX, * take shndx from symtab_shndx_start[N] instead */ Elf32_Word *symtab_shndx_start; Elf32_Word *symtab_shndx_stop; }; static inline int is_shndx_special(unsigned int i) { return i != SHN_XINDEX && i >= SHN_LORESERVE && i <= SHN_HIRESERVE; } /* * Move reserved section indices SHN_LORESERVE..SHN_HIRESERVE out of * the way to -256..-1, to avoid conflicting with real section * indices. */ #define SPECIAL(i) ((i) - (SHN_HIRESERVE + 1)) /* Accessor for sym->st_shndx, hides ugliness of "64k sections" */ static inline unsigned int get_secindex(const struct elf_info *info, const Elf_Sym *sym) { if (is_shndx_special(sym->st_shndx)) return SPECIAL(sym->st_shndx); if (sym->st_shndx != SHN_XINDEX) return sym->st_shndx; return info->symtab_shndx_start[sym - info->symtab_start]; } /* file2alias.c */ extern unsigned int cross_build; void handle_moddevtable(struct module *mod, struct elf_info *info, Elf_Sym *sym, const char *symname); void add_moddevtable(struct buffer *buf, struct module *mod); /* sumversion.c */ void get_src_version(const char *modname, char sum[], unsigned sumlen); /* from modpost.c */ char *read_text_file(const char *filename); char *get_line(char **stringp); enum loglevel { LOG_WARN, LOG_ERROR, LOG_FATAL }; void modpost_log(enum loglevel loglevel, const char *fmt, ...); #define warn(fmt, args...) modpost_log(LOG_WARN, fmt, ##args) #define merror(fmt, args...) modpost_log(LOG_ERROR, fmt, ##args) #define fatal(fmt, args...) modpost_log(LOG_FATAL, fmt, ##args)
/* * Copyright (C) 2011-2012, LG Eletronics,Inc. All rights reserved. * LGIT LCD device driver * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. * */ #include <linux/gpio.h> #include "msm_fb.h" #include "mipi_dsi.h" #include "mipi_lgit.h" #include "mdp4.h" static struct msm_panel_common_pdata *mipi_lgit_pdata; static struct dsi_buf lgit_tx_buf; static struct dsi_buf lgit_rx_buf; static int skip_init; #define DSV_ONBST 57 static int lgit_external_dsv_onoff(uint8_t on_off) { int ret =0; static int init_done=0; if (!init_done) { ret = gpio_request(DSV_ONBST,"DSV_ONBST_en"); if (ret) { pr_err("%s: failed to request DSV_ONBST gpio \n", __func__); goto out; } ret = gpio_direction_output(DSV_ONBST, 1); if (ret) { pr_err("%s: failed to set DSV_ONBST direction\n", __func__); goto err_gpio; } init_done = 1; } gpio_set_value(DSV_ONBST, on_off); mdelay(20); goto out; err_gpio: gpio_free(DSV_ONBST); out: return ret; } static int mipi_lgit_lcd_on(struct platform_device *pdev) { struct msm_fb_data_type *mfd; int ret = 0; pr_info("%s started\n", __func__); mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x10000000); ret = mipi_dsi_cmds_tx(&lgit_tx_buf, mipi_lgit_pdata->power_on_set_1, mipi_lgit_pdata->power_on_set_size_1); MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x14000000); if (ret < 0) { pr_err("%s: failed to transmit power_on_set_1 cmds\n", __func__); return ret; } if(!skip_init){ MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x10000000); ret = mipi_dsi_cmds_tx(&lgit_tx_buf, mipi_lgit_pdata->power_on_set_2, mipi_lgit_pdata->power_on_set_size_2); MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x14000000); if (ret < 0) { pr_err("%s: failed to transmit power_on_set_2 cmds\n", __func__); return ret; } } skip_init = false; ret = lgit_external_dsv_onoff(1); if (ret < 0) { pr_err("%s: failed to turn on external dsv\n", __func__); return ret; } MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x10000000); ret = mipi_dsi_cmds_tx(&lgit_tx_buf, mipi_lgit_pdata->power_on_set_3, mipi_lgit_pdata->power_on_set_size_3); MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x14000000); if (ret < 0) { pr_err("%s: failed to transmit power_on_set_3 cmds\n", __func__); return ret; } pr_info("%s finished\n", __func__); return 0; } static int mipi_lgit_lcd_off(struct platform_device *pdev) { struct msm_fb_data_type *mfd; int ret = 0; pr_info("%s started\n", __func__); if (mipi_lgit_pdata->bl_pwm_disable) mipi_lgit_pdata->bl_pwm_disable(); mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x10000000); ret = mipi_dsi_cmds_tx(&lgit_tx_buf, mipi_lgit_pdata->power_off_set_1, mipi_lgit_pdata->power_off_set_size_1); MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x14000000); if (ret < 0) { pr_err("%s: failed to transmit power_off_set_1 cmds\n", __func__); return ret; } ret = lgit_external_dsv_onoff(0); if (ret < 0) { pr_err("%s: failed to turn off external dsv\n", __func__); return ret; } MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x10000000); ret = mipi_dsi_cmds_tx(&lgit_tx_buf, mipi_lgit_pdata->power_off_set_2, mipi_lgit_pdata->power_off_set_size_2); MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x14000000); if (ret < 0) { pr_err("%s: failed to transmit power_off_set_2 cmds\n", __func__); return ret; } pr_info("%s finished\n", __func__); return 0; } static int mipi_lgit_backlight_on_status(void) { return (mipi_lgit_pdata->bl_on_status()); } static void mipi_lgit_set_backlight_board(struct msm_fb_data_type *mfd) { int level; level = (int)mfd->bl_level; mipi_lgit_pdata->backlight_level(level, 0, 0); } static int mipi_lgit_lcd_probe(struct platform_device *pdev) { if (pdev->id == 0) { mipi_lgit_pdata = pdev->dev.platform_data; return 0; } pr_info("%s start\n", __func__); skip_init = true; msm_fb_add_device(pdev); return 0; } static struct platform_driver this_driver = { .probe = mipi_lgit_lcd_probe, .driver = { .name = "mipi_lgit", }, }; static struct msm_fb_panel_data lgit_panel_data = { .on = mipi_lgit_lcd_on, .off = mipi_lgit_lcd_off, .set_backlight = mipi_lgit_set_backlight_board, .get_backlight_on_status = mipi_lgit_backlight_on_status, }; static int ch_used[3]; int mipi_lgit_device_register(struct msm_panel_info *pinfo, u32 channel, u32 panel) { struct platform_device *pdev = NULL; int ret; if ((channel >= 3) || ch_used[channel]) return -ENODEV; ch_used[channel] = TRUE; pdev = platform_device_alloc("mipi_lgit", (panel << 8)|channel); if (!pdev) return -ENOMEM; lgit_panel_data.panel_info = *pinfo; ret = platform_device_add_data(pdev, &lgit_panel_data, sizeof(lgit_panel_data)); if (ret) { pr_err("%s: platform_device_add_data failed!\n", __func__); goto err_device_put; } ret = platform_device_add(pdev); if (ret) { pr_err("%s: platform_device_register failed!\n", __func__); goto err_device_put; } return 0; err_device_put: platform_device_put(pdev); return ret; } static int __init mipi_lgit_lcd_init(void) { mipi_dsi_buf_alloc(&lgit_tx_buf, DSI_BUF_SIZE); mipi_dsi_buf_alloc(&lgit_rx_buf, DSI_BUF_SIZE); return platform_driver_register(&this_driver); } module_init(mipi_lgit_lcd_init);
/* * TI OMAP2 32kHz sync timer emulation. * * Copyright (C) 2007-2008 Nokia Corporation * Written by Andrzej Zaborowski <andrew@openedhand.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 or * (at your option) any later version of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, see <http://www.gnu.org/licenses/>. */ #include "hw.h" #include "qemu-timer.h" #include "omap.h" struct omap_synctimer_s { MemoryRegion iomem; uint32_t val; uint16_t readh; }; /* 32-kHz Sync Timer of the OMAP2 */ static uint32_t omap_synctimer_read(struct omap_synctimer_s *s) { return muldiv64(qemu_get_clock_ns(vm_clock), 0x8000, get_ticks_per_sec()); } void omap_synctimer_reset(struct omap_synctimer_s *s) { s->val = omap_synctimer_read(s); } static uint32_t omap_synctimer_readw(void *opaque, target_phys_addr_t addr) { struct omap_synctimer_s *s = (struct omap_synctimer_s *) opaque; switch (addr) { case 0x00: /* 32KSYNCNT_REV */ return 0x21; case 0x10: /* CR */ return omap_synctimer_read(s) - s->val; } OMAP_BAD_REG(addr); return 0; } static uint32_t omap_synctimer_readh(void *opaque, target_phys_addr_t addr) { struct omap_synctimer_s *s = (struct omap_synctimer_s *) opaque; uint32_t ret; if (addr & 2) return s->readh; else { ret = omap_synctimer_readw(opaque, addr); s->readh = ret >> 16; return ret & 0xffff; } } static void omap_synctimer_write(void *opaque, target_phys_addr_t addr, uint32_t value) { OMAP_BAD_REG(addr); } static const MemoryRegionOps omap_synctimer_ops = { .old_mmio = { .read = { omap_badwidth_read32, omap_synctimer_readh, omap_synctimer_readw, }, .write = { omap_badwidth_write32, omap_synctimer_write, omap_synctimer_write, }, }, .endianness = DEVICE_NATIVE_ENDIAN, }; struct omap_synctimer_s *omap_synctimer_init(struct omap_target_agent_s *ta, struct omap_mpu_state_s *mpu, omap_clk fclk, omap_clk iclk) { struct omap_synctimer_s *s = g_malloc0(sizeof(*s)); omap_synctimer_reset(s); memory_region_init_io(&s->iomem, &omap_synctimer_ops, s, "omap.synctimer", omap_l4_region_size(ta, 0)); omap_l4_attach(ta, 0, &s->iomem); return s; }
/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifndef DIXGRABS_H #define DIXGRABS_H 1 struct _GrabParameters; extern GrabPtr CreateGrab( int /* client */, DeviceIntPtr /* device */, DeviceIntPtr /* modDevice */, WindowPtr /* window */, GrabType /* grabtype */, GrabMask * /* mask */, struct _GrabParameters * /* param */, int /* type */, KeyCode /* keybut */, WindowPtr /* confineTo */, CursorPtr /* cursor */); extern _X_EXPORT int DeletePassiveGrab( pointer /* value */, XID /* id */); extern _X_EXPORT Bool GrabMatchesSecond( GrabPtr /* pFirstGrab */, GrabPtr /* pSecondGrab */, Bool /*ignoreDevice*/); extern _X_EXPORT int AddPassiveGrabToList( ClientPtr /* client */, GrabPtr /* pGrab */); extern _X_EXPORT Bool DeletePassiveGrabFromList( GrabPtr /* pMinuendGrab */); #endif /* DIXGRABS_H */
/* * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef __ADSP_ERR__ #define __ADSP_ERR__ int adsp_err_get_lnx_err_code(u32 adsp_error); char *adsp_err_get_err_str(u32 adsp_error); #endif
/* { dg-do compile } */ /* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } {"-mfloat-abi=softfp" } } */ /* { dg-options "-O2 -fno-omit-frame-pointer -mabi=apcs-gnu -mfloat-abi=softfp" } */ struct super_block { int s_blocksize_bits; }; struct btrfs_fs_info { struct super_block *sb; }; struct btrfs_root { struct btrfs_fs_info *fs_info; } *b; int a, c, d; long long e; extern int foo1 (struct btrfs_root *, int, int, int); extern int foo2 (struct btrfs_root *, int, int); int truncate_one_csum (struct btrfs_root *p1, long long p2, long long p3) { int f, g, i = p1->fs_info->sb->s_blocksize_bits; g = a; long long h = p2 + p3; f = foo1 (b, 0, c, 0); e = f / g; e <<= p1->fs_info->sb->s_blocksize_bits; if (d < p2) { int j = e - h >> i; foo2 (p1, 0, j); } else { asm ("1\t.long "); __builtin_unreachable (); } }
/* * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <stdint.h> #include "libavutil/attributes.h" #include "libavcodec/vp8dsp.h" #include "vp8dsp.h" void ff_vp8_luma_dc_wht_neon(int16_t block[4][4][16], int16_t dc[16]); void ff_vp8_idct_add_neon(uint8_t *dst, int16_t block[16], ptrdiff_t stride); void ff_vp8_idct_dc_add_neon(uint8_t *dst, int16_t block[16], ptrdiff_t stride); void ff_vp8_idct_dc_add4y_neon(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride); void ff_vp8_idct_dc_add4uv_neon(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride); VP8_LF(neon); VP8_EPEL(16, neon); VP8_EPEL(8, neon); VP8_EPEL(4, neon); VP8_BILIN(16, neon); VP8_BILIN(8, neon); VP8_BILIN(4, neon); av_cold void ff_vp78dsp_init_neon(VP8DSPContext *dsp) { dsp->put_vp8_epel_pixels_tab[0][0][0] = ff_put_vp8_pixels16_neon; dsp->put_vp8_epel_pixels_tab[0][0][2] = ff_put_vp8_epel16_h6_neon; dsp->put_vp8_epel_pixels_tab[0][2][0] = ff_put_vp8_epel16_v6_neon; dsp->put_vp8_epel_pixels_tab[0][2][2] = ff_put_vp8_epel16_h6v6_neon; dsp->put_vp8_epel_pixels_tab[1][0][0] = ff_put_vp8_pixels8_neon; dsp->put_vp8_epel_pixels_tab[1][0][1] = ff_put_vp8_epel8_h4_neon; dsp->put_vp8_epel_pixels_tab[1][0][2] = ff_put_vp8_epel8_h6_neon; dsp->put_vp8_epel_pixels_tab[1][1][0] = ff_put_vp8_epel8_v4_neon; dsp->put_vp8_epel_pixels_tab[1][1][1] = ff_put_vp8_epel8_h4v4_neon; dsp->put_vp8_epel_pixels_tab[1][1][2] = ff_put_vp8_epel8_h6v4_neon; dsp->put_vp8_epel_pixels_tab[1][2][0] = ff_put_vp8_epel8_v6_neon; dsp->put_vp8_epel_pixels_tab[1][2][1] = ff_put_vp8_epel8_h4v6_neon; dsp->put_vp8_epel_pixels_tab[1][2][2] = ff_put_vp8_epel8_h6v6_neon; dsp->put_vp8_epel_pixels_tab[2][0][1] = ff_put_vp8_epel4_h4_neon; dsp->put_vp8_epel_pixels_tab[2][0][2] = ff_put_vp8_epel4_h6_neon; dsp->put_vp8_epel_pixels_tab[2][1][0] = ff_put_vp8_epel4_v4_neon; dsp->put_vp8_epel_pixels_tab[2][1][1] = ff_put_vp8_epel4_h4v4_neon; dsp->put_vp8_epel_pixels_tab[2][1][2] = ff_put_vp8_epel4_h6v4_neon; dsp->put_vp8_epel_pixels_tab[2][2][0] = ff_put_vp8_epel4_v6_neon; dsp->put_vp8_epel_pixels_tab[2][2][1] = ff_put_vp8_epel4_h4v6_neon; dsp->put_vp8_epel_pixels_tab[2][2][2] = ff_put_vp8_epel4_h6v6_neon; dsp->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_neon; dsp->put_vp8_bilinear_pixels_tab[0][0][1] = ff_put_vp8_bilin16_h_neon; dsp->put_vp8_bilinear_pixels_tab[0][0][2] = ff_put_vp8_bilin16_h_neon; dsp->put_vp8_bilinear_pixels_tab[0][1][0] = ff_put_vp8_bilin16_v_neon; dsp->put_vp8_bilinear_pixels_tab[0][1][1] = ff_put_vp8_bilin16_hv_neon; dsp->put_vp8_bilinear_pixels_tab[0][1][2] = ff_put_vp8_bilin16_hv_neon; dsp->put_vp8_bilinear_pixels_tab[0][2][0] = ff_put_vp8_bilin16_v_neon; dsp->put_vp8_bilinear_pixels_tab[0][2][1] = ff_put_vp8_bilin16_hv_neon; dsp->put_vp8_bilinear_pixels_tab[0][2][2] = ff_put_vp8_bilin16_hv_neon; dsp->put_vp8_bilinear_pixels_tab[1][0][0] = ff_put_vp8_pixels8_neon; dsp->put_vp8_bilinear_pixels_tab[1][0][1] = ff_put_vp8_bilin8_h_neon; dsp->put_vp8_bilinear_pixels_tab[1][0][2] = ff_put_vp8_bilin8_h_neon; dsp->put_vp8_bilinear_pixels_tab[1][1][0] = ff_put_vp8_bilin8_v_neon; dsp->put_vp8_bilinear_pixels_tab[1][1][1] = ff_put_vp8_bilin8_hv_neon; dsp->put_vp8_bilinear_pixels_tab[1][1][2] = ff_put_vp8_bilin8_hv_neon; dsp->put_vp8_bilinear_pixels_tab[1][2][0] = ff_put_vp8_bilin8_v_neon; dsp->put_vp8_bilinear_pixels_tab[1][2][1] = ff_put_vp8_bilin8_hv_neon; dsp->put_vp8_bilinear_pixels_tab[1][2][2] = ff_put_vp8_bilin8_hv_neon; dsp->put_vp8_bilinear_pixels_tab[2][0][1] = ff_put_vp8_bilin4_h_neon; dsp->put_vp8_bilinear_pixels_tab[2][0][2] = ff_put_vp8_bilin4_h_neon; dsp->put_vp8_bilinear_pixels_tab[2][1][0] = ff_put_vp8_bilin4_v_neon; dsp->put_vp8_bilinear_pixels_tab[2][1][1] = ff_put_vp8_bilin4_hv_neon; dsp->put_vp8_bilinear_pixels_tab[2][1][2] = ff_put_vp8_bilin4_hv_neon; dsp->put_vp8_bilinear_pixels_tab[2][2][0] = ff_put_vp8_bilin4_v_neon; dsp->put_vp8_bilinear_pixels_tab[2][2][1] = ff_put_vp8_bilin4_hv_neon; dsp->put_vp8_bilinear_pixels_tab[2][2][2] = ff_put_vp8_bilin4_hv_neon; } av_cold void ff_vp8dsp_init_neon(VP8DSPContext *dsp) { dsp->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_neon; dsp->vp8_idct_add = ff_vp8_idct_add_neon; dsp->vp8_idct_dc_add = ff_vp8_idct_dc_add_neon; dsp->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_neon; dsp->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_neon; dsp->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_neon; dsp->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_neon; dsp->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_neon; dsp->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_neon; dsp->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_neon; dsp->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_neon; dsp->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_neon; dsp->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_neon; dsp->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter16_simple_neon; dsp->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter16_simple_neon; }
/* * Copyright (c) 2004,2012 Kustaa Nyholm / SpareTimeLabs * * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list * of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this * list of conditions and the following disclaimer in the documentation and/or other * materials provided with the distribution. * * Neither the name of the Kustaa Nyholm or SpareTimeLabs nor the names of its * contributors may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. */ #include <stdbool.h> #include <stdint.h> #include <stdarg.h> #include <stdlib.h> #include "platform.h" #include "build_config.h" #include "drivers/serial.h" #include "io/serial.h" #include "build_config.h" #include "printf.h" #ifdef REQUIRE_PRINTF_LONG_SUPPORT #include "typeconversion.h" #endif static serialPort_t *printfSerialPort; #ifdef REQUIRE_CC_ARM_PRINTF_SUPPORT typedef void (*putcf) (void *, char); static putcf stdout_putf; static void *stdout_putp; // print bf, padded from left to at least n characters. // padding is zero ('0') if z!=0, space (' ') otherwise static int putchw(void *putp, putcf putf, int n, char z, char *bf) { int written = 0; char fc = z ? '0' : ' '; char ch; char *p = bf; while (*p++ && n > 0) n--; while (n-- > 0) { putf(putp, fc); written++; } while ((ch = *bf++)) { putf(putp, ch); written++; } return written; } // retrun number of bytes written int tfp_format(void *putp, putcf putf, const char *fmt, va_list va) { char bf[12]; int written = 0; char ch; while ((ch = *(fmt++))) { if (ch != '%') { putf(putp, ch); written++; } else { char lz = 0; #ifdef REQUIRE_PRINTF_LONG_SUPPORT char lng = 0; #endif int w = 0; ch = *(fmt++); if (ch == '0') { ch = *(fmt++); lz = 1; } if (ch >= '0' && ch <= '9') { ch = a2i(ch, &fmt, 10, &w); } #ifdef REQUIRE_PRINTF_LONG_SUPPORT if (ch == 'l') { ch = *(fmt++); lng = 1; } #endif switch (ch) { case 0: goto abort; case 'u':{ #ifdef REQUIRE_PRINTF_LONG_SUPPORT if (lng) uli2a(va_arg(va, unsigned long int), 10, 0, bf); else #endif ui2a(va_arg(va, unsigned int), 10, 0, bf); written += putchw(putp, putf, w, lz, bf); break; } case 'd':{ #ifdef REQUIRE_PRINTF_LONG_SUPPORT if (lng) li2a(va_arg(va, unsigned long int), bf); else #endif i2a(va_arg(va, int), bf); written += putchw(putp, putf, w, lz, bf); break; } case 'x': case 'X': #ifdef REQUIRE_PRINTF_LONG_SUPPORT if (lng) uli2a(va_arg(va, unsigned long int), 16, (ch == 'X'), bf); else #endif ui2a(va_arg(va, unsigned int), 16, (ch == 'X'), bf); written += putchw(putp, putf, w, lz, bf); break; case 'c': putf(putp, (char) (va_arg(va, int))); written++; break; case 's': written += putchw(putp, putf, w, 0, va_arg(va, char *)); break; case '%': putf(putp, ch); written++; break; case 'n': *va_arg(va, int*) = written; break; default: break; } } } abort: return written; } void init_printf(void *putp, void (*putf) (void *, char)) { stdout_putf = putf; stdout_putp = putp; } int tfp_printf(const char *fmt, ...) { va_list va; va_start(va, fmt); int written = tfp_format(stdout_putp, stdout_putf, fmt, va); va_end(va); while (!isSerialTransmitBufferEmpty(printfSerialPort)); return written; } static void putcp(void *p, char c) { *(*((char **) p))++ = c; } int tfp_sprintf(char *s, const char *fmt, ...) { va_list va; va_start(va, fmt); int written = tfp_format(&s, putcp, fmt, va); putcp(&s, 0); va_end(va); return written; } static void _putc(void *p, char c) { UNUSED(p); serialWrite(printfSerialPort, c); } void printfSupportInit(void) { init_printf(NULL, _putc); } #else // keil/armcc version int fputc(int c, FILE *f) { // let DMA catch up a bit when using set or dump, we're too fast. while (!isSerialTransmitBufferEmpty(printfSerialPort)); serialWrite(printfSerialPort, c); return c; } void printfSupportInit(void) { // Nothing to do } #endif void setPrintfSerialPort(serialPort_t *serialPort) { printfSerialPort = serialPort; }
/* mbed Microcontroller Library * Copyright (c) 2006-2015 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef MBED_DEVICE_H #define MBED_DEVICE_H #define DEVICE_PORTIN 1 #define DEVICE_PORTOUT 1 #define DEVICE_PORTINOUT 1 #define DEVICE_INTERRUPTIN 1 #define DEVICE_ANALOGIN 1 #define DEVICE_ANALOGOUT 0 #define DEVICE_SERIAL 1 #define DEVICE_I2C 1 #define DEVICE_I2CSLAVE 1 #define DEVICE_SPI 1 #define DEVICE_SPISLAVE 1 #define DEVICE_CAN 0 #define DEVICE_RTC 0 #define DEVICE_ETHERNET 0 #define DEVICE_PWMOUT 1 #define DEVICE_SEMIHOST 0 #define DEVICE_LOCALFILESYSTEM 0 #define DEVICE_ID_LENGTH 32 #define DEVICE_MAC_OFFSET 20 #define DEVICE_SLEEP 1 #define DEVICE_DEBUG_AWARENESS 0 #define DEVICE_STDIO_MESSAGES 0 #define DEVICE_ERROR_PATTERN 1 #include "objects.h" #endif
/* * File: private/randompatch.h * --------------------------- * This file patches the implementation of the random number library * to avoid some serious bugs in standard implementations of rand, * particularly on Mac OS X. It also includes a hack to set the * seed from the RANDOM_SEED environment variable, which makes it * possible to produce repeatable figures. */ /* * Implementation notes: rand, srand * --------------------------------- * To ensure that this package works the same way on all platforms, * this file completely reimplements the rand and srand methods. The * algorithm is a conventional linear congruential generator with the * parameters used in GNU's gclib. RAND_MAX for this implementation * is 2147483647 (2^31 - 1). */ #define MULTIPLIER 1103515245 #define OFFSET 12345 static int _seed = 1; #undef rand #define rand() ((_seed = MULTIPLIER * _seed + OFFSET) & 0x7FFFFFFF) #undef srand #define srand(seed) (_seed = int(seed), _seed = (_seed <= 0) ? 1 : _seed) #undef RAND_MAX #define RAND_MAX 2147483647 /* * Implementation notes: Windows patch * ----------------------------------- * On some versions of Windows, the time function is too coarse to use * as a random seed. On those versions, this definition substitutes the * GetTickCount function. */ #if defined (_MSC_VER) && (_MSC_VER >= 1200) # include <windows.h> # define time(dummy) (GetTickCount()) #endif #ifdef __APPLE__ # include <cstdlib> static time_t patchedTime(time_t *) { char *str = getenv("RANDOM_SEED"); if (str == NULL) { return time(NULL); } else { return atoi(str); } } # define time(dummy) patchedTime(dummy) #endif
/* * Copyright 2011 Freescale Semiconductor, Inc. * Copyright 2011 Linaro Ltd. * * The code contained herein is licensed under the GNU General Public * License. You may obtain a copy of the GNU General Public License * Version 2 or later at the following locations: * * http://www.opensource.org/licenses/gpl-license.html * http://www.gnu.org/copyleft/gpl.html */ #include <linux/init.h> #include <asm/page.h> #include <asm/sizes.h> #include <asm/mach/map.h> #include "hardware.h" #define IMX6Q_UART1_BASE_ADDR 0x02020000 #define IMX6Q_UART2_BASE_ADDR 0x021e8000 #define IMX6Q_UART3_BASE_ADDR 0x021ec000 #define IMX6Q_UART4_BASE_ADDR 0x021f0000 #define IMX6Q_UART5_BASE_ADDR 0x021f4000 /* * IMX6Q_UART_BASE_ADDR is put in the middle to force the expansion * of IMX6Q_UART##n##_BASE_ADDR. */ #define IMX6Q_UART_BASE_ADDR(n) IMX6Q_UART##n##_BASE_ADDR #define IMX6Q_UART_BASE(n) IMX6Q_UART_BASE_ADDR(n) #define IMX6Q_DEBUG_UART_BASE IMX6Q_UART_BASE(CONFIG_DEBUG_IMX6Q_UART_PORT) static struct map_desc imx_lluart_desc = { #ifdef CONFIG_DEBUG_IMX6Q_UART .virtual = IMX_IO_P2V(IMX6Q_DEBUG_UART_BASE), .pfn = __phys_to_pfn(IMX6Q_DEBUG_UART_BASE), .length = 0x4000, .type = MT_DEVICE, #endif }; void __init imx_lluart_map_io(void) { if (imx_lluart_desc.virtual) iotable_init(&imx_lluart_desc, 1); }
/* * Copyright (C) 2000 Harri Porten (porten@kde.org) * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reseved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef JSDOMWindowBase_h #define JSDOMWindowBase_h #include "JSDOMBinding.h" #include "JSDOMGlobalObject.h" #include <wtf/Forward.h> namespace WebCore { class DOMWindow; class Frame; class DOMWrapperWorld; class JSDOMWindow; class JSDOMWindowShell; class JSDOMWindowBasePrivate; class JSDOMWindowBase : public JSDOMGlobalObject { typedef JSDOMGlobalObject Base; protected: JSDOMWindowBase(JSC::VM&, JSC::Structure*, PassRefPtr<DOMWindow>, JSDOMWindowShell*); void finishCreation(JSC::VM&, JSDOMWindowShell*); static void destroy(JSCell*); public: void updateDocument(); DOMWindow* impl() const { return m_impl.get(); } ScriptExecutionContext* scriptExecutionContext() const; // Called just before removing this window from the JSDOMWindowShell. void willRemoveFromWindowShell(); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSValue prototype) { return JSC::Structure::create(vm, 0, prototype, JSC::TypeInfo(JSC::GlobalObjectType, StructureFlags), &s_info); } static const JSC::GlobalObjectMethodTable s_globalObjectMethodTable; static bool supportsProfiling(const JSC::JSGlobalObject*); static bool supportsRichSourceInfo(const JSC::JSGlobalObject*); static bool shouldInterruptScript(const JSC::JSGlobalObject*); static bool javaScriptExperimentsEnabled(const JSC::JSGlobalObject*); void printErrorMessage(const String&) const; JSDOMWindowShell* shell() const; static JSC::VM* commonVM(); private: RefPtr<DOMWindow> m_impl; JSDOMWindowShell* m_shell; }; // Returns a JSDOMWindow or jsNull() // JSDOMGlobalObject* is ignored, accessing a window in any context will // use that DOMWindow's prototype chain. JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, DOMWindow*); JSC::JSValue toJS(JSC::ExecState*, DOMWindow*); // Returns JSDOMWindow or 0 JSDOMWindow* toJSDOMWindow(Frame*, DOMWrapperWorld*); JSDOMWindow* toJSDOMWindow(JSC::JSValue); } // namespace WebCore #endif // JSDOMWindowBase_h
/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/platform_device.h> #include <mach/board.h> #include <linux/fs.h> #include <linux/slab.h> #include <linux/device.h> #include <linux/uaccess.h> #include <media/msm_gemini.h> #include "msm_gemini_sync.h" #include "msm_gemini_common.h" #define MSM_GEMINI_NAME "gemini" static int msm_gemini_open(struct inode *inode, struct file *filp) { int rc; struct msm_gemini_device *pgmn_dev = container_of(inode->i_cdev, struct msm_gemini_device, cdev); filp->private_data = pgmn_dev; GMN_DBG("%s:%d]\n", __func__, __LINE__); rc = __msm_gemini_open(pgmn_dev); GMN_DBG(KERN_INFO "%s:%d] %s open_count = %d\n", __func__, __LINE__, filp->f_path.dentry->d_name.name, pgmn_dev->open_count); return rc; } static int msm_gemini_release(struct inode *inode, struct file *filp) { int rc; struct msm_gemini_device *pgmn_dev = filp->private_data; GMN_DBG(KERN_INFO "%s:%d]\n", __func__, __LINE__); rc = __msm_gemini_release(pgmn_dev); GMN_DBG(KERN_INFO "%s:%d] %s open_count = %d\n", __func__, __LINE__, filp->f_path.dentry->d_name.name, pgmn_dev->open_count); return rc; } static long msm_gemini_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { int rc; struct msm_gemini_device *pgmn_dev = filp->private_data; GMN_DBG(KERN_INFO "%s:%d] cmd = %d\n", __func__, __LINE__, _IOC_NR(cmd)); rc = __msm_gemini_ioctl(pgmn_dev, cmd, arg); GMN_DBG("%s:%d]\n", __func__, __LINE__); return rc; } static const struct file_operations msm_gemini_fops = { .owner = THIS_MODULE, .open = msm_gemini_open, .release = msm_gemini_release, .unlocked_ioctl = msm_gemini_ioctl, }; static struct class *msm_gemini_class; static dev_t msm_gemini_devno; static struct msm_gemini_device *msm_gemini_device_p; static int msm_gemini_init(struct platform_device *pdev) { int rc = -1; struct device *dev; GMN_DBG("%s:%d]\n", __func__, __LINE__); msm_gemini_device_p = __msm_gemini_init(pdev); if (msm_gemini_device_p == NULL) { GMN_PR_ERR("%s: initialization failed\n", __func__); goto fail; } rc = alloc_chrdev_region(&msm_gemini_devno, 0, 1, MSM_GEMINI_NAME); if (rc < 0) { GMN_PR_ERR("%s: failed to allocate chrdev\n", __func__); goto fail_1; } if (!msm_gemini_class) { msm_gemini_class = class_create(THIS_MODULE, MSM_GEMINI_NAME); if (IS_ERR(msm_gemini_class)) { rc = PTR_ERR(msm_gemini_class); GMN_PR_ERR("%s: create device class failed\n", __func__); goto fail_2; } } dev = device_create(msm_gemini_class, NULL, MKDEV(MAJOR(msm_gemini_devno), MINOR(msm_gemini_devno)), NULL, "%s%d", MSM_GEMINI_NAME, 0); if (IS_ERR(dev)) { GMN_PR_ERR("%s: error creating device\n", __func__); rc = -ENODEV; goto fail_3; } cdev_init(&msm_gemini_device_p->cdev, &msm_gemini_fops); msm_gemini_device_p->cdev.owner = THIS_MODULE; msm_gemini_device_p->cdev.ops = (const struct file_operations *) &msm_gemini_fops; rc = cdev_add(&msm_gemini_device_p->cdev, msm_gemini_devno, 1); if (rc < 0) { GMN_PR_ERR("%s: error adding cdev\n", __func__); rc = -ENODEV; goto fail_4; } GMN_DBG("%s %s: success\n", __func__, MSM_GEMINI_NAME); return rc; fail_4: device_destroy(msm_gemini_class, msm_gemini_devno); fail_3: class_destroy(msm_gemini_class); fail_2: unregister_chrdev_region(msm_gemini_devno, 1); fail_1: __msm_gemini_exit(msm_gemini_device_p); fail: return rc; } static void msm_gemini_exit(void) { cdev_del(&msm_gemini_device_p->cdev); device_destroy(msm_gemini_class, msm_gemini_devno); class_destroy(msm_gemini_class); unregister_chrdev_region(msm_gemini_devno, 1); __msm_gemini_exit(msm_gemini_device_p); } static int __msm_gemini_probe(struct platform_device *pdev) { int rc; rc = msm_gemini_init(pdev); return rc; } static int __msm_gemini_remove(struct platform_device *pdev) { msm_gemini_exit(); return 0; } static struct platform_driver msm_gemini_driver = { .probe = __msm_gemini_probe, .remove = __msm_gemini_remove, .driver = { .name = "msm_gemini", .owner = THIS_MODULE, }, }; static int __init msm_gemini_driver_init(void) { int rc; rc = platform_driver_register(&msm_gemini_driver); return rc; } static void __exit msm_gemini_driver_exit(void) { platform_driver_unregister(&msm_gemini_driver); } MODULE_DESCRIPTION("msm gemini jpeg driver"); MODULE_VERSION("msm gemini 0.1"); module_init(msm_gemini_driver_init); module_exit(msm_gemini_driver_exit);
/****************************************************************************** * * Copyright(c) 2009-2014 Realtek Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * The full GNU General Public License is included in this distribution in the * file called LICENSE. * * Contact Information: * wlanfae <wlanfae@realtek.com> * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, * Hsinchu 300, Taiwan. * * Larry Finger <Larry.Finger@lwfinger.net> * *****************************************************************************/ #ifndef __RTL92E_HW_H__ #define __RTL92E_HW_H__ void rtl92ee_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); void rtl92ee_read_eeprom_info(struct ieee80211_hw *hw); void rtl92ee_interrupt_recognized(struct ieee80211_hw *hw, struct rtl_int *int_vec); int rtl92ee_hw_init(struct ieee80211_hw *hw); void rtl92ee_card_disable(struct ieee80211_hw *hw); void rtl92ee_enable_interrupt(struct ieee80211_hw *hw); void rtl92ee_disable_interrupt(struct ieee80211_hw *hw); int rtl92ee_set_network_type(struct ieee80211_hw *hw, enum nl80211_iftype type); void rtl92ee_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid); void rtl92ee_set_qos(struct ieee80211_hw *hw, int aci); void rtl92ee_set_beacon_related_registers(struct ieee80211_hw *hw); void rtl92ee_set_beacon_interval(struct ieee80211_hw *hw); void rtl92ee_update_interrupt_mask(struct ieee80211_hw *hw, u32 add_msr, u32 rm_msr); void rtl92ee_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); void rtl92ee_update_hal_rate_tbl(struct ieee80211_hw *hw, struct ieee80211_sta *sta, u8 rssi_level, bool update_bw); void rtl92ee_update_channel_access_setting(struct ieee80211_hw *hw); bool rtl92ee_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid); void rtl92ee_enable_hw_security_config(struct ieee80211_hw *hw); void rtl92ee_set_key(struct ieee80211_hw *hw, u32 key_index, u8 *p_macaddr, bool is_group, u8 enc_algo, bool is_wepkey, bool clear_all); void rtl92ee_read_bt_coexist_info_from_hwpg(struct ieee80211_hw *hw, bool autoload_fail, u8 *hwinfo); void rtl92ee_bt_reg_init(struct ieee80211_hw *hw); void rtl92ee_bt_hw_init(struct ieee80211_hw *hw); void rtl92ee_suspend(struct ieee80211_hw *hw); void rtl92ee_resume(struct ieee80211_hw *hw); void rtl92ee_allow_all_destaddr(struct ieee80211_hw *hw, bool allow_all_da, bool write_into_reg); void rtl92ee_fw_clk_off_timer_callback(unsigned long data); #endif
/* * Some debug functions * * MIPS floating point support * * Copyright (C) 1994-2000 Algorithmics Ltd. * http://www.algor.co.uk * * This program is free software; you can distribute it and/or modify it * under the terms of the GNU General Public License (Version 2) as * published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. * * Nov 7, 2000 * Modified to build and operate in Linux kernel environment. * * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. */ #include <linux/kernel.h> #include "ieee754.h" #define DP_EBIAS 1023 #define DP_EMIN (-1022) #define DP_EMAX 1023 #define DP_FBITS 52 #define SP_EBIAS 127 #define SP_EMIN (-126) #define SP_EMAX 127 #define SP_FBITS 23 #define DP_MBIT(x) ((u64)1 << (x)) #define DP_HIDDEN_BIT DP_MBIT(DP_FBITS) #define DP_SIGN_BIT DP_MBIT(63) #define SP_MBIT(x) ((u32)1 << (x)) #define SP_HIDDEN_BIT SP_MBIT(SP_FBITS) #define SP_SIGN_BIT SP_MBIT(31) #define SPSIGN(sp) (sp.parts.sign) #define SPBEXP(sp) (sp.parts.bexp) #define SPMANT(sp) (sp.parts.mant) #define DPSIGN(dp) (dp.parts.sign) #define DPBEXP(dp) (dp.parts.bexp) #define DPMANT(dp) (dp.parts.mant) ieee754dp ieee754dp_dump(char *m, ieee754dp x) { int i; printk("%s", m); printk("<%08x,%08x>\n", (unsigned) (x.bits >> 32), (unsigned) x.bits); printk("\t="); switch (ieee754dp_class(x)) { case IEEE754_CLASS_QNAN: case IEEE754_CLASS_SNAN: printk("Nan %c", DPSIGN(x) ? '-' : '+'); for (i = DP_FBITS - 1; i >= 0; i--) printk("%c", DPMANT(x) & DP_MBIT(i) ? '1' : '0'); break; case IEEE754_CLASS_INF: printk("%cInfinity", DPSIGN(x) ? '-' : '+'); break; case IEEE754_CLASS_ZERO: printk("%cZero", DPSIGN(x) ? '-' : '+'); break; case IEEE754_CLASS_DNORM: printk("%c0.", DPSIGN(x) ? '-' : '+'); for (i = DP_FBITS - 1; i >= 0; i--) printk("%c", DPMANT(x) & DP_MBIT(i) ? '1' : '0'); printk("e%d", DPBEXP(x) - DP_EBIAS); break; case IEEE754_CLASS_NORM: printk("%c1.", DPSIGN(x) ? '-' : '+'); for (i = DP_FBITS - 1; i >= 0; i--) printk("%c", DPMANT(x) & DP_MBIT(i) ? '1' : '0'); printk("e%d", DPBEXP(x) - DP_EBIAS); break; default: printk("Illegal/Unknown IEEE754 value class"); } printk("\n"); return x; } ieee754sp ieee754sp_dump(char *m, ieee754sp x) { int i; printk("%s=", m); printk("<%08x>\n", (unsigned) x.bits); printk("\t="); switch (ieee754sp_class(x)) { case IEEE754_CLASS_QNAN: case IEEE754_CLASS_SNAN: printk("Nan %c", SPSIGN(x) ? '-' : '+'); for (i = SP_FBITS - 1; i >= 0; i--) printk("%c", SPMANT(x) & SP_MBIT(i) ? '1' : '0'); break; case IEEE754_CLASS_INF: printk("%cInfinity", SPSIGN(x) ? '-' : '+'); break; case IEEE754_CLASS_ZERO: printk("%cZero", SPSIGN(x) ? '-' : '+'); break; case IEEE754_CLASS_DNORM: printk("%c0.", SPSIGN(x) ? '-' : '+'); for (i = SP_FBITS - 1; i >= 0; i--) printk("%c", SPMANT(x) & SP_MBIT(i) ? '1' : '0'); printk("e%d", SPBEXP(x) - SP_EBIAS); break; case IEEE754_CLASS_NORM: printk("%c1.", SPSIGN(x) ? '-' : '+'); for (i = SP_FBITS - 1; i >= 0; i--) printk("%c", SPMANT(x) & SP_MBIT(i) ? '1' : '0'); printk("e%d", SPBEXP(x) - SP_EBIAS); break; default: printk("Illegal/Unknown IEEE754 value class"); } printk("\n"); return x; }
/* orig : i386 init_task.c */ #include <linux/mm.h> #include <linux/module.h> #include <linux/sched.h> #include <linux/init.h> #include <linux/init_task.h> #include <linux/fs.h> #include <linux/mqueue.h> #include <asm/uaccess.h> #include <asm/pgtable.h> static struct fs_struct init_fs = INIT_FS; static struct files_struct init_files = INIT_FILES; static struct signal_struct init_signals = INIT_SIGNALS(init_signals); static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); struct mm_struct init_mm = INIT_MM(init_mm); EXPORT_SYMBOL(init_mm); /* * Initial thread structure. * * We need to make sure that this is 8192-byte aligned due to the * way process stacks are handled. This is done by having a special * "init_task" linker map entry.. */ union thread_union init_thread_union __attribute__((__section__(".data.init_task"))) = { INIT_THREAD_INFO(init_task) }; /* * Initial task structure. * * All other task structs will be allocated on slabs in fork.c */ struct task_struct init_task = INIT_TASK(init_task); EXPORT_SYMBOL(init_task);
/* Byte-wise substring search, using the Two-Way algorithm. * Copyright (C) 2008 Eric Blake * Permission to use, copy, modify, and distribute this software * is freely granted, provided that this notice is preserved. */ /* FUNCTION <<memmem>>---find memory segment INDEX memmem ANSI_SYNOPSIS #include <string.h> char *memmem(const void *<[s1]>, size_t <[l1]>, const void *<[s2]>, size_t <[l2]>); DESCRIPTION Locates the first occurrence in the memory region pointed to by <[s1]> with length <[l1]> of the sequence of bytes pointed to by <[s2]> of length <[l2]>. If you already know the lengths of your haystack and needle, <<memmem>> can be much faster than <<strstr>>. RETURNS Returns a pointer to the located segment, or a null pointer if <[s2]> is not found. If <[l2]> is 0, <[s1]> is returned. PORTABILITY <<memmem>> is a newlib extension. <<memmem>> requires no supporting OS subroutines. QUICKREF memmem pure */ #include <string.h> #if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) # define RETURN_TYPE void * # define AVAILABLE(h, h_l, j, n_l) ((j) <= (h_l) - (n_l)) # include "str-two-way.h" #endif void * _DEFUN (memmem, (haystack_start, haystack_len, needle_start, needle_len), const void *haystack_start _AND size_t haystack_len _AND const void *needle_start _AND size_t needle_len) { /* Abstract memory is considered to be an array of 'unsigned char' values, not an array of 'char' values. See ISO C 99 section 6.2.6.1. */ const unsigned char *haystack = (const unsigned char *) haystack_start; const unsigned char *needle = (const unsigned char *) needle_start; if (needle_len == 0) /* The first occurrence of the empty string is deemed to occur at the beginning of the string. */ return (void *) haystack; #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) /* Less code size, but quadratic performance in the worst case. */ while (needle_len <= haystack_len) { if (!memcmp (haystack, needle, needle_len)) return (void *) haystack; haystack++; haystack_len--; } return NULL; #else /* compilation for speed */ /* Larger code size, but guaranteed linear performance. */ /* Sanity check, otherwise the loop might search through the whole memory. */ if (haystack_len < needle_len) return NULL; /* Use optimizations in memchr when possible, to reduce the search size of haystack using a linear algorithm with a smaller coefficient. However, avoid memchr for long needles, since we can often achieve sublinear performance. */ if (needle_len < LONG_NEEDLE_THRESHOLD) { haystack = memchr (haystack, *needle, haystack_len); if (!haystack || needle_len == 1) return (void *) haystack; haystack_len -= haystack - (const unsigned char *) haystack_start; if (haystack_len < needle_len) return NULL; return two_way_short_needle (haystack, haystack_len, needle, needle_len); } return two_way_long_needle (haystack, haystack_len, needle, needle_len); #endif /* compilation for speed */ }
/* * File: pn_dev.c * * Phonet network device * * Copyright (C) 2008 Nokia Corporation. * * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com> * Original author: Sakari Ailus <sakari.ailus@nokia.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA */ #include <linux/kernel.h> #include <linux/net.h> #include <linux/netdevice.h> #include <linux/phonet.h> #include <net/sock.h> #include <net/phonet/pn_dev.h> /* when accessing, remember to lock with spin_lock(&pndevs.lock); */ struct phonet_device_list pndevs = { .list = LIST_HEAD_INIT(pndevs.list), .lock = __SPIN_LOCK_UNLOCKED(pndevs.lock), }; /* Allocate new Phonet device. */ static struct phonet_device *__phonet_device_alloc(struct net_device *dev) { struct phonet_device *pnd = kmalloc(sizeof(*pnd), GFP_ATOMIC); if (pnd == NULL) return NULL; pnd->netdev = dev; bitmap_zero(pnd->addrs, 64); list_add(&pnd->list, &pndevs.list); return pnd; } static struct phonet_device *__phonet_get(struct net_device *dev) { struct phonet_device *pnd; list_for_each_entry(pnd, &pndevs.list, list) { if (pnd->netdev == dev) return pnd; } return NULL; } static void __phonet_device_free(struct phonet_device *pnd) { list_del(&pnd->list); kfree(pnd); } struct net_device *phonet_device_get(struct net *net) { struct phonet_device *pnd; struct net_device *dev; spin_lock_bh(&pndevs.lock); list_for_each_entry(pnd, &pndevs.list, list) { dev = pnd->netdev; BUG_ON(!dev); if (net_eq(dev_net(dev), net) && (dev->reg_state == NETREG_REGISTERED) && ((pnd->netdev->flags & IFF_UP)) == IFF_UP) break; dev = NULL; } if (dev) dev_hold(dev); spin_unlock_bh(&pndevs.lock); return dev; } int phonet_address_add(struct net_device *dev, u8 addr) { struct phonet_device *pnd; int err = 0; spin_lock_bh(&pndevs.lock); /* Find or create Phonet-specific device data */ pnd = __phonet_get(dev); if (pnd == NULL) pnd = __phonet_device_alloc(dev); if (unlikely(pnd == NULL)) err = -ENOMEM; else if (test_and_set_bit(addr >> 2, pnd->addrs)) err = -EEXIST; spin_unlock_bh(&pndevs.lock); return err; } int phonet_address_del(struct net_device *dev, u8 addr) { struct phonet_device *pnd; int err = 0; spin_lock_bh(&pndevs.lock); pnd = __phonet_get(dev); if (!pnd || !test_and_clear_bit(addr >> 2, pnd->addrs)) err = -EADDRNOTAVAIL; else if (bitmap_empty(pnd->addrs, 64)) __phonet_device_free(pnd); spin_unlock_bh(&pndevs.lock); return err; } /* Gets a source address toward a destination, through a interface. */ u8 phonet_address_get(struct net_device *dev, u8 addr) { struct phonet_device *pnd; spin_lock_bh(&pndevs.lock); pnd = __phonet_get(dev); if (pnd) { BUG_ON(bitmap_empty(pnd->addrs, 64)); /* Use same source address as destination, if possible */ if (!test_bit(addr >> 2, pnd->addrs)) addr = find_first_bit(pnd->addrs, 64) << 2; } else addr = PN_NO_ADDR; spin_unlock_bh(&pndevs.lock); return addr; } int phonet_address_lookup(struct net *net, u8 addr) { struct phonet_device *pnd; spin_lock_bh(&pndevs.lock); list_for_each_entry(pnd, &pndevs.list, list) { if (!net_eq(dev_net(pnd->netdev), net)) continue; /* Don't allow unregistering devices! */ if ((pnd->netdev->reg_state != NETREG_REGISTERED) || ((pnd->netdev->flags & IFF_UP)) != IFF_UP) continue; if (test_bit(addr >> 2, pnd->addrs)) { spin_unlock_bh(&pndevs.lock); return 0; } } spin_unlock_bh(&pndevs.lock); return -EADDRNOTAVAIL; } /* notify Phonet of device events */ static int phonet_device_notify(struct notifier_block *me, unsigned long what, void *arg) { struct net_device *dev = arg; if (what == NETDEV_UNREGISTER) { struct phonet_device *pnd; /* Destroy phonet-specific device data */ spin_lock_bh(&pndevs.lock); pnd = __phonet_get(dev); if (pnd) __phonet_device_free(pnd); spin_unlock_bh(&pndevs.lock); } return 0; } static struct notifier_block phonet_device_notifier = { .notifier_call = phonet_device_notify, .priority = 0, }; /* Initialize Phonet devices list */ void phonet_device_init(void) { register_netdevice_notifier(&phonet_device_notifier); } void phonet_device_exit(void) { struct phonet_device *pnd, *n; rtnl_unregister_all(PF_PHONET); rtnl_lock(); spin_lock_bh(&pndevs.lock); list_for_each_entry_safe(pnd, n, &pndevs.list, list) __phonet_device_free(pnd); spin_unlock_bh(&pndevs.lock); rtnl_unlock(); unregister_netdevice_notifier(&phonet_device_notifier); }
/* SPDX-License-Identifier: BSD-3-Clause-Clear */ /* * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. */ #ifndef ATH11K_AHB_H #define ATH11K_AHB_H #include "core.h" #define ATH11K_AHB_RECOVERY_TIMEOUT (3 * HZ) struct ath11k_base; struct ath11k_ahb { struct rproc *tgt_rproc; }; static inline struct ath11k_ahb *ath11k_ahb_priv(struct ath11k_base *ab) { return (struct ath11k_ahb *)ab->drv_priv; } #endif
/* ** 2006 Oct 10 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This header file is used by programs that want to link against the ** FTS2 library. All it does is declare the sqlite3Fts2Init() interface. */ #include "sqlite3.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ int sqlite3Fts2Init(sqlite3 *db); #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */
/* * drivers/video/tegra/host/nvhost_intr.h * * Tegra Graphics Host Interrupt Management * * Copyright (c) 2010-2012, NVIDIA Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __NVHOST_INTR_H #define __NVHOST_INTR_H #include <linux/kthread.h> #include <linux/semaphore.h> #include <linux/interrupt.h> struct nvhost_channel; enum nvhost_intr_action { /** * Perform cleanup after a submit has completed. * 'data' points to a channel */ NVHOST_INTR_ACTION_SUBMIT_COMPLETE = 0, /** * Save a HW context. * 'data' points to a context */ NVHOST_INTR_ACTION_CTXSAVE, /** * Wake up a task. * 'data' points to a wait_queue_head_t */ NVHOST_INTR_ACTION_WAKEUP, /** * Wake up a interruptible task. * 'data' points to a wait_queue_head_t */ NVHOST_INTR_ACTION_WAKEUP_INTERRUPTIBLE, NVHOST_INTR_ACTION_COUNT }; struct nvhost_intr; struct nvhost_intr_syncpt { struct nvhost_intr *intr; u8 id; u8 irq_requested; u16 irq; spinlock_t lock; struct list_head wait_head; char thresh_irq_name[12]; }; struct nvhost_intr { struct nvhost_intr_syncpt *syncpt; struct mutex mutex; int host_general_irq; bool host_general_irq_requested; }; #define intr_to_dev(x) container_of(x, struct nvhost_master, intr) #define intr_op(intr) (intr_to_dev(intr)->op.intr) #define intr_syncpt_to_intr(is) (is->intr) /** * Schedule an action to be taken when a sync point reaches the given threshold. * * @id the sync point * @thresh the threshold * @action the action to take * @data a pointer to extra data depending on action, see above * @waiter waiter allocated with nvhost_intr_alloc_waiter - assumes ownership * @ref must be passed if cancellation is possible, else NULL * * This is a non-blocking api. */ int nvhost_intr_add_action(struct nvhost_intr *intr, u32 id, u32 thresh, enum nvhost_intr_action action, void *data, void *waiter, void **ref); /** * Allocate a waiter. */ void *nvhost_intr_alloc_waiter(void); /** * Unreference an action submitted to nvhost_intr_add_action(). * You must call this if you passed non-NULL as ref. * @ref the ref returned from nvhost_intr_add_action() */ void nvhost_intr_put_ref(struct nvhost_intr *intr, void *ref); int nvhost_intr_init(struct nvhost_intr *intr, u32 irq_gen, u32 irq_sync); void nvhost_intr_deinit(struct nvhost_intr *intr); void nvhost_intr_start(struct nvhost_intr *intr, u32 hz); void nvhost_intr_stop(struct nvhost_intr *intr); irqreturn_t nvhost_syncpt_thresh_fn(int irq, void *dev_id); #endif
/* * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include <linux/kernel.h> #include <linux/init.h> #include <linux/irq.h> #include <linux/irqdomain.h> #include <linux/io.h> #include <linux/of.h> #include <linux/of_address.h> #include <linux/of_irq.h> #include <linux/stmp_device.h> #include <asm/exception.h> #include "irqchip.h" #define HW_ICOLL_VECTOR 0x0000 #define HW_ICOLL_LEVELACK 0x0010 #define HW_ICOLL_CTRL 0x0020 #define HW_ICOLL_STAT_OFFSET 0x0070 #define HW_ICOLL_INTERRUPTn_SET(n) (0x0124 + (n) * 0x10) #define HW_ICOLL_INTERRUPTn_CLR(n) (0x0128 + (n) * 0x10) #define BM_ICOLL_INTERRUPTn_ENABLE 0x00000004 #define BV_ICOLL_LEVELACK_IRQLEVELACK__LEVEL0 0x1 #define ICOLL_NUM_IRQS 128 static void __iomem *icoll_base; static struct irq_domain *icoll_domain; static void icoll_ack_irq(struct irq_data *d) { /* * The Interrupt Collector is able to prioritize irqs. * Currently only level 0 is used. So acking can use * BV_ICOLL_LEVELACK_IRQLEVELACK__LEVEL0 unconditionally. */ __raw_writel(BV_ICOLL_LEVELACK_IRQLEVELACK__LEVEL0, icoll_base + HW_ICOLL_LEVELACK); } static void icoll_mask_irq(struct irq_data *d) { __raw_writel(BM_ICOLL_INTERRUPTn_ENABLE, icoll_base + HW_ICOLL_INTERRUPTn_CLR(d->hwirq)); } static void icoll_unmask_irq(struct irq_data *d) { __raw_writel(BM_ICOLL_INTERRUPTn_ENABLE, icoll_base + HW_ICOLL_INTERRUPTn_SET(d->hwirq)); } static struct irq_chip mxs_icoll_chip = { .irq_ack = icoll_ack_irq, .irq_mask = icoll_mask_irq, .irq_unmask = icoll_unmask_irq, }; asmlinkage void __exception_irq_entry icoll_handle_irq(struct pt_regs *regs) { u32 irqnr; irqnr = __raw_readl(icoll_base + HW_ICOLL_STAT_OFFSET); __raw_writel(irqnr, icoll_base + HW_ICOLL_VECTOR); irqnr = irq_find_mapping(icoll_domain, irqnr); handle_IRQ(irqnr, regs); } static int icoll_irq_domain_map(struct irq_domain *d, unsigned int virq, irq_hw_number_t hw) { irq_set_chip_and_handler(virq, &mxs_icoll_chip, handle_level_irq); set_irq_flags(virq, IRQF_VALID); return 0; } static struct irq_domain_ops icoll_irq_domain_ops = { .map = icoll_irq_domain_map, .xlate = irq_domain_xlate_onecell, }; static int __init icoll_of_init(struct device_node *np, struct device_node *interrupt_parent) { icoll_base = of_iomap(np, 0); WARN_ON(!icoll_base); /* * Interrupt Collector reset, which initializes the priority * for each irq to level 0. */ stmp_reset_block(icoll_base + HW_ICOLL_CTRL); icoll_domain = irq_domain_add_linear(np, ICOLL_NUM_IRQS, &icoll_irq_domain_ops, NULL); return icoll_domain ? 0 : -ENODEV; } IRQCHIP_DECLARE(mxs, "fsl,icoll", icoll_of_init);
#include "reiserfs.h" #include <linux/errno.h> #include <linux/fs.h> #include <linux/pagemap.h> #include <linux/xattr.h> #include <linux/slab.h> #include "xattr.h" #include <linux/security.h> #include <asm/uaccess.h> static int security_get(struct dentry *dentry, const char *name, void *buffer, size_t size, int handler_flags) { if (strlen(name) < sizeof(XATTR_SECURITY_PREFIX)) return -EINVAL; if (IS_PRIVATE(dentry->d_inode)) return -EPERM; return reiserfs_xattr_get(dentry->d_inode, name, buffer, size); } static int security_set(struct dentry *dentry, const char *name, const void *buffer, size_t size, int flags, int handler_flags) { if (strlen(name) < sizeof(XATTR_SECURITY_PREFIX)) return -EINVAL; if (IS_PRIVATE(dentry->d_inode)) return -EPERM; return reiserfs_xattr_set(dentry->d_inode, name, buffer, size, flags); } static size_t security_list(struct dentry *dentry, char *list, size_t list_len, const char *name, size_t namelen, int handler_flags) { const size_t len = namelen + 1; if (IS_PRIVATE(dentry->d_inode)) return 0; if (list && len <= list_len) { memcpy(list, name, namelen); list[namelen] = '\0'; } return len; } /* Initializes the security context for a new inode and returns the number * of blocks needed for the transaction. If successful, reiserfs_security * must be released using reiserfs_security_free when the caller is done. */ int reiserfs_security_init(struct inode *dir, struct inode *inode, const struct qstr *qstr, struct reiserfs_security_handle *sec) { int blocks = 0; int error; sec->name = NULL; /* Don't add selinux attributes on xattrs - they'll never get used */ if (IS_PRIVATE(dir)) return 0; error = security_old_inode_init_security(inode, dir, qstr, &sec->name, &sec->value, &sec->length); if (error) { if (error == -EOPNOTSUPP) error = 0; sec->name = NULL; sec->value = NULL; sec->length = 0; return error; } if (sec->length && reiserfs_xattrs_initialized(inode->i_sb)) { blocks = reiserfs_xattr_jcreate_nblocks(inode) + reiserfs_xattr_nblocks(inode, sec->length); /* We don't want to count the directories twice if we have * a default ACL. */ REISERFS_I(inode)->i_flags |= i_has_xattr_dir; } return blocks; } int reiserfs_security_write(struct reiserfs_transaction_handle *th, struct inode *inode, struct reiserfs_security_handle *sec) { int error; if (strlen(sec->name) < sizeof(XATTR_SECURITY_PREFIX)) return -EINVAL; error = reiserfs_xattr_set_handle(th, inode, sec->name, sec->value, sec->length, XATTR_CREATE); if (error == -ENODATA || error == -EOPNOTSUPP) error = 0; return error; } void reiserfs_security_free(struct reiserfs_security_handle *sec) { kfree(sec->name); kfree(sec->value); sec->name = NULL; sec->value = NULL; } const struct xattr_handler reiserfs_xattr_security_handler = { .prefix = XATTR_SECURITY_PREFIX, .get = security_get, .set = security_set, .list = security_list, };
/* * Linux Guest Relocation (LGR) detection * * Copyright IBM Corp. 2012 * Author(s): Michael Holzheu <holzheu@linux.vnet.ibm.com> */ #include <linux/init.h> #include <linux/export.h> #include <linux/timer.h> #include <linux/slab.h> #include <asm/facility.h> #include <asm/sysinfo.h> #include <asm/ebcdic.h> #include <asm/debug.h> #include <asm/ipl.h> #define LGR_TIMER_INTERVAL_SECS (30 * 60) #define VM_LEVEL_MAX 2 /* Maximum is 8, but we only record two levels */ /* * LGR info: Contains stfle and stsi data */ struct lgr_info { /* Bit field with facility information: 4 DWORDs are stored */ u64 stfle_fac_list[4]; /* Level of system (1 = CEC, 2 = LPAR, 3 = z/VM */ u32 level; /* Level 1: CEC info (stsi 1.1.1) */ char manufacturer[16]; char type[4]; char sequence[16]; char plant[4]; char model[16]; /* Level 2: LPAR info (stsi 2.2.2) */ u16 lpar_number; char name[8]; /* Level 3: VM info (stsi 3.2.2) */ u8 vm_count; struct { char name[8]; char cpi[16]; } vm[VM_LEVEL_MAX]; } __packed __aligned(8); /* * LGR globals */ static char lgr_page[PAGE_SIZE] __aligned(PAGE_SIZE); static struct lgr_info lgr_info_last; static struct lgr_info lgr_info_cur; static struct debug_info *lgr_dbf; /* * Copy buffer and then convert it to ASCII */ static void cpascii(char *dst, char *src, int size) { memcpy(dst, src, size); EBCASC(dst, size); } /* * Fill LGR info with 1.1.1 stsi data */ static void lgr_stsi_1_1_1(struct lgr_info *lgr_info) { struct sysinfo_1_1_1 *si = (void *) lgr_page; if (stsi(si, 1, 1, 1)) return; cpascii(lgr_info->manufacturer, si->manufacturer, sizeof(si->manufacturer)); cpascii(lgr_info->type, si->type, sizeof(si->type)); cpascii(lgr_info->model, si->model, sizeof(si->model)); cpascii(lgr_info->sequence, si->sequence, sizeof(si->sequence)); cpascii(lgr_info->plant, si->plant, sizeof(si->plant)); } /* * Fill LGR info with 2.2.2 stsi data */ static void lgr_stsi_2_2_2(struct lgr_info *lgr_info) { struct sysinfo_2_2_2 *si = (void *) lgr_page; if (stsi(si, 2, 2, 2)) return; cpascii(lgr_info->name, si->name, sizeof(si->name)); memcpy(&lgr_info->lpar_number, &si->lpar_number, sizeof(lgr_info->lpar_number)); } /* * Fill LGR info with 3.2.2 stsi data */ static void lgr_stsi_3_2_2(struct lgr_info *lgr_info) { struct sysinfo_3_2_2 *si = (void *) lgr_page; int i; if (stsi(si, 3, 2, 2)) return; for (i = 0; i < min_t(u8, si->count, VM_LEVEL_MAX); i++) { cpascii(lgr_info->vm[i].name, si->vm[i].name, sizeof(si->vm[i].name)); cpascii(lgr_info->vm[i].cpi, si->vm[i].cpi, sizeof(si->vm[i].cpi)); } lgr_info->vm_count = si->count; } /* * Fill LGR info with current data */ static void lgr_info_get(struct lgr_info *lgr_info) { int level; memset(lgr_info, 0, sizeof(*lgr_info)); stfle(lgr_info->stfle_fac_list, ARRAY_SIZE(lgr_info->stfle_fac_list)); level = stsi(NULL, 0, 0, 0); lgr_info->level = level; if (level >= 1) lgr_stsi_1_1_1(lgr_info); if (level >= 2) lgr_stsi_2_2_2(lgr_info); if (level >= 3) lgr_stsi_3_2_2(lgr_info); } /* * Check if LGR info has changed and if yes log new LGR info to s390dbf */ void lgr_info_log(void) { static DEFINE_SPINLOCK(lgr_info_lock); unsigned long flags; if (!spin_trylock_irqsave(&lgr_info_lock, flags)) return; lgr_info_get(&lgr_info_cur); if (memcmp(&lgr_info_last, &lgr_info_cur, sizeof(lgr_info_cur)) != 0) { debug_event(lgr_dbf, 1, &lgr_info_cur, sizeof(lgr_info_cur)); lgr_info_last = lgr_info_cur; } spin_unlock_irqrestore(&lgr_info_lock, flags); } EXPORT_SYMBOL_GPL(lgr_info_log); static void lgr_timer_set(void); /* * LGR timer callback */ static void lgr_timer_fn(unsigned long ignored) { lgr_info_log(); lgr_timer_set(); } static struct timer_list lgr_timer = TIMER_DEFERRED_INITIALIZER(lgr_timer_fn, 0, 0); /* * Setup next LGR timer */ static void lgr_timer_set(void) { mod_timer(&lgr_timer, jiffies + LGR_TIMER_INTERVAL_SECS * HZ); } /* * Initialize LGR: Add s390dbf, write initial lgr_info and setup timer */ static int __init lgr_init(void) { lgr_dbf = debug_register("lgr", 1, 1, sizeof(struct lgr_info)); if (!lgr_dbf) return -ENOMEM; debug_register_view(lgr_dbf, &debug_hex_ascii_view); lgr_info_get(&lgr_info_last); debug_event(lgr_dbf, 1, &lgr_info_last, sizeof(lgr_info_last)); lgr_timer_set(); return 0; } device_initcall(lgr_init);
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- #ifndef __gnu_xml_validation_relaxng_InterleavePattern__ #define __gnu_xml_validation_relaxng_InterleavePattern__ #pragma interface #include <gnu/xml/validation/relaxng/Pattern.h> extern "Java" { namespace gnu { namespace xml { namespace validation { namespace relaxng { class InterleavePattern; class Pattern; } } } } } class gnu::xml::validation::relaxng::InterleavePattern : public ::gnu::xml::validation::relaxng::Pattern { public: // actually package-private InterleavePattern(); ::gnu::xml::validation::relaxng::Pattern * __attribute__((aligned(__alignof__( ::gnu::xml::validation::relaxng::Pattern)))) pattern1; ::gnu::xml::validation::relaxng::Pattern * pattern2; public: static ::java::lang::Class class$; }; #endif // __gnu_xml_validation_relaxng_InterleavePattern__
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- #ifndef __javax_swing_plaf_metal_MetalBorders$RolloverMarginBorder__ #define __javax_swing_plaf_metal_MetalBorders$RolloverMarginBorder__ #pragma interface #include <javax/swing/border/AbstractBorder.h> extern "Java" { namespace java { namespace awt { class Component; class Insets; } } namespace javax { namespace swing { namespace plaf { namespace metal { class MetalBorders$RolloverMarginBorder; } } } } } class javax::swing::plaf::metal::MetalBorders$RolloverMarginBorder : public ::javax::swing::border::AbstractBorder { public: MetalBorders$RolloverMarginBorder(); virtual ::java::awt::Insets * getBorderInsets(::java::awt::Component *); virtual ::java::awt::Insets * getBorderInsets(::java::awt::Component *, ::java::awt::Insets *); public: // actually protected static ::java::awt::Insets * borderInsets; public: static ::java::lang::Class class$; }; #endif // __javax_swing_plaf_metal_MetalBorders$RolloverMarginBorder__
/* * Copyright (C) 2004 IBM Corporation * * Author: Serge Hallyn <serue@us.ibm.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation, version 2 of the * License. */ #include <linux/export.h> #include <linux/uts.h> #include <linux/utsname.h> #include <linux/err.h> #include <linux/slab.h> #include <linux/cred.h> #include <linux/user_namespace.h> #include <linux/proc_ns.h> #include <linux/sched/task.h> static struct ucounts *inc_uts_namespaces(struct user_namespace *ns) { return inc_ucount(ns, current_euid(), UCOUNT_UTS_NAMESPACES); } static void dec_uts_namespaces(struct ucounts *ucounts) { dec_ucount(ucounts, UCOUNT_UTS_NAMESPACES); } static struct uts_namespace *create_uts_ns(void) { struct uts_namespace *uts_ns; uts_ns = kmalloc(sizeof(struct uts_namespace), GFP_KERNEL); if (uts_ns) kref_init(&uts_ns->kref); return uts_ns; } /* * Clone a new ns copying an original utsname, setting refcount to 1 * @old_ns: namespace to clone * Return ERR_PTR(-ENOMEM) on error (failure to kmalloc), new ns otherwise */ static struct uts_namespace *clone_uts_ns(struct user_namespace *user_ns, struct uts_namespace *old_ns) { struct uts_namespace *ns; struct ucounts *ucounts; int err; err = -ENOSPC; ucounts = inc_uts_namespaces(user_ns); if (!ucounts) goto fail; err = -ENOMEM; ns = create_uts_ns(); if (!ns) goto fail_dec; err = ns_alloc_inum(&ns->ns); if (err) goto fail_free; ns->ucounts = ucounts; ns->ns.ops = &utsns_operations; down_read(&uts_sem); memcpy(&ns->name, &old_ns->name, sizeof(ns->name)); ns->user_ns = get_user_ns(user_ns); up_read(&uts_sem); return ns; fail_free: kfree(ns); fail_dec: dec_uts_namespaces(ucounts); fail: return ERR_PTR(err); } /* * Copy task tsk's utsname namespace, or clone it if flags * specifies CLONE_NEWUTS. In latter case, changes to the * utsname of this process won't be seen by parent, and vice * versa. */ struct uts_namespace *copy_utsname(unsigned long flags, struct user_namespace *user_ns, struct uts_namespace *old_ns) { struct uts_namespace *new_ns; BUG_ON(!old_ns); get_uts_ns(old_ns); if (!(flags & CLONE_NEWUTS)) return old_ns; new_ns = clone_uts_ns(user_ns, old_ns); put_uts_ns(old_ns); return new_ns; } void free_uts_ns(struct kref *kref) { struct uts_namespace *ns; ns = container_of(kref, struct uts_namespace, kref); dec_uts_namespaces(ns->ucounts); put_user_ns(ns->user_ns); ns_free_inum(&ns->ns); kfree(ns); } static inline struct uts_namespace *to_uts_ns(struct ns_common *ns) { return container_of(ns, struct uts_namespace, ns); } static struct ns_common *utsns_get(struct task_struct *task) { struct uts_namespace *ns = NULL; struct nsproxy *nsproxy; task_lock(task); nsproxy = task->nsproxy; if (nsproxy) { ns = nsproxy->uts_ns; get_uts_ns(ns); } task_unlock(task); return ns ? &ns->ns : NULL; } static void utsns_put(struct ns_common *ns) { put_uts_ns(to_uts_ns(ns)); } static int utsns_install(struct nsproxy *nsproxy, struct ns_common *new) { struct uts_namespace *ns = to_uts_ns(new); if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) || !ns_capable(current_user_ns(), CAP_SYS_ADMIN)) return -EPERM; get_uts_ns(ns); put_uts_ns(nsproxy->uts_ns); nsproxy->uts_ns = ns; return 0; } static struct user_namespace *utsns_owner(struct ns_common *ns) { return to_uts_ns(ns)->user_ns; } const struct proc_ns_operations utsns_operations = { .name = "uts", .type = CLONE_NEWUTS, .get = utsns_get, .put = utsns_put, .install = utsns_install, .owner = utsns_owner, };
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- #ifndef __javax_swing_JRadioButton__ #define __javax_swing_JRadioButton__ #pragma interface #include <javax/swing/JToggleButton.h> extern "Java" { namespace javax { namespace accessibility { class AccessibleContext; } namespace swing { class Action; class Icon; class JRadioButton; } } } class javax::swing::JRadioButton : public ::javax::swing::JToggleButton { public: JRadioButton(); JRadioButton(::javax::swing::Action *); JRadioButton(::javax::swing::Icon *); JRadioButton(::javax::swing::Icon *, jboolean); JRadioButton(::java::lang::String *); JRadioButton(::java::lang::String *, jboolean); JRadioButton(::java::lang::String *, ::javax::swing::Icon *); JRadioButton(::java::lang::String *, ::javax::swing::Icon *, jboolean); virtual ::javax::accessibility::AccessibleContext * getAccessibleContext(); virtual ::java::lang::String * getUIClassID(); public: // actually protected virtual ::java::lang::String * paramString(); public: virtual void updateUI(); private: static const jlong serialVersionUID = 7751949583255506856LL; public: static ::java::lang::Class class$; }; #endif // __javax_swing_JRadioButton__
/* SPDX-License-Identifier: MIT */ /* * Copyright © 2019 Intel Corporation */ #ifndef __I915_SUSPEND_H__ #define __I915_SUSPEND_H__ struct drm_i915_private; int i915_save_state(struct drm_i915_private *i915); int i915_restore_state(struct drm_i915_private *i915); #endif /* __I915_SUSPEND_H__ */
/* Copyright (C) 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #define DATABASE_NAME publickey #define DEFAULT_CONFIG "nis nisplus" #include "XXX-lookup.c"
#import "GPUImage.h" #import <UIKit/UIKit.h> @interface RawDataTestAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
#ifndef __ARCH_MACH_COMMON_H #define __ARCH_MACH_COMMON_H extern struct sys_timer shmobile_timer; extern void shmobile_setup_console(void); struct clk; extern int clk_init(void); extern void sh7367_init_irq(void); extern void sh7367_add_early_devices(void); extern void sh7367_add_standard_devices(void); extern void sh7367_clock_init(void); extern void sh7367_pinmux_init(void); extern struct clk sh7367_extalb1_clk; extern struct clk sh7367_extal2_clk; extern void sh7377_init_irq(void); extern void sh7377_add_early_devices(void); extern void sh7377_add_standard_devices(void); extern void sh7377_clock_init(void); extern void sh7377_pinmux_init(void); extern struct clk sh7377_extalc1_clk; extern struct clk sh7377_extal2_clk; extern void sh7372_init_irq(void); extern void sh7372_add_early_devices(void); extern void sh7372_add_standard_devices(void); extern void sh7372_clock_init(void); extern void sh7372_pinmux_init(void); extern struct clk sh7372_extal1_clk; extern struct clk sh7372_extal2_clk; #endif /* __ARCH_MACH_COMMON_H */