text
stringlengths
4
6.14k
/* Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. 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, see <http://www.gnu.org/licenses/>. */ #include <stdlib.h> #undef atoll /* Convert a string to a long long int. */ long long int atoll (const char *nptr) { return strtoll (nptr, (char **) NULL, 10); }
/* Copyright (C) 1996-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. 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, see <http://www.gnu.org/licenses/>. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <stdio.h> #include <sys/types.h> #if defined _LIBC || defined STDC_HEADERS # include <stdlib.h> # include <string.h> #else char *malloc (); #endif #undef __strndup #undef strndup #ifndef weak_alias # define __strndup strndup #endif char * __strndup (s, n) const char *s; size_t n; { size_t len = __strnlen (s, n); char *new = (char *) malloc (len + 1); if (new == NULL) return NULL; new[len] = '\0'; return (char *) memcpy (new, s, len); } #ifdef libc_hidden_def libc_hidden_def (__strndup) #endif #ifdef weak_alias weak_alias (__strndup, strndup) #endif
/* GStreamer * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu> * 2005 Wim Taymans <wim@fluendo.com> * * gstaudiosrc.h: * * 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., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef __GST_AUDIO_AUDIO_H__ #include <gst/audio/audio.h> #endif #ifndef __GST_AUDIO_SRC_H__ #define __GST_AUDIO_SRC_H__ #include <gst/gst.h> #include <gst/audio/gstaudiobasesrc.h> G_BEGIN_DECLS #define GST_TYPE_AUDIO_SRC (gst_audio_src_get_type()) #define GST_AUDIO_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_SRC,GstAudioSrc)) #define GST_AUDIO_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_SRC,GstAudioSrcClass)) #define GST_AUDIO_SRC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),GST_TYPE_AUDIO_SRC,GstAudioSrcClass)) #define GST_IS_AUDIO_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_SRC)) #define GST_IS_AUDIO_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_SRC)) typedef struct _GstAudioSrc GstAudioSrc; typedef struct _GstAudioSrcClass GstAudioSrcClass; /** * GstAudioSrc: * * Base class for simple audio sources. */ struct _GstAudioSrc { GstAudioBaseSrc element; /*< private >*/ /* with LOCK */ GThread *thread; /*< private >*/ gpointer _gst_reserved[GST_PADDING]; }; /** * GstAudioSrcClass: * @parent_class: the parent class. * @open: open the device with the specified caps * @prepare: configure device with format * @unprepare: undo the configuration * @close: close the device * @read: read samples from the audio device * @delay: the number of samples queued in the device * @reset: unblock a read to the device and reset. * * #GstAudioSrc class. Override the vmethod to implement * functionality. */ struct _GstAudioSrcClass { GstAudioBaseSrcClass parent_class; /* vtable */ /* open the device with given specs */ gboolean (*open) (GstAudioSrc *src); /* prepare resources and state to operate with the given specs */ gboolean (*prepare) (GstAudioSrc *src, GstAudioRingBufferSpec *spec); /* undo anything that was done in prepare() */ gboolean (*unprepare) (GstAudioSrc *src); /* close the device */ gboolean (*close) (GstAudioSrc *src); /* read samples from the device */ guint (*read) (GstAudioSrc *src, gpointer data, guint length, GstClockTime *timestamp); /* get number of samples queued in the device */ guint (*delay) (GstAudioSrc *src); /* reset the audio device, unblock from a write */ void (*reset) (GstAudioSrc *src); /*< private >*/ gpointer _gst_reserved[GST_PADDING]; }; GType gst_audio_src_get_type(void); G_END_DECLS #endif /* __GST_AUDIO_SRC_H__ */
/* * Copyright (C) 2007 Apple 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: * 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. * * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. */ #ifndef AuthenticationChallenge_h #define AuthenticationChallenge_h #include "AuthenticationChallengeBase.h" namespace WebCore { class AuthenticationChallenge : public AuthenticationChallengeBase { public: AuthenticationChallenge() { } AuthenticationChallenge(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error) : AuthenticationChallengeBase(protectionSpace, proposedCredential, previousFailureCount, response, error) { } }; } #endif
/* * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2013-2016 Damien P. George * * 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 MICROPY_INCLUDED_LIB_UTILS_INTERRUPT_CHAR_H #define MICROPY_INCLUDED_LIB_UTILS_INTERRUPT_CHAR_H extern int mp_interrupt_char; void mp_hal_set_interrupt_char(int c); #endif // MICROPY_INCLUDED_LIB_UTILS_INTERRUPT_CHAR_H
/* * arch/arm/mach-clps711x/include/mach/system.h * * Copyright (C) 2000 Deep Blue Solutions Ltd * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __ASM_ARCH_SYSTEM_H #define __ASM_ARCH_SYSTEM_H #include <mach/hardware.h> #include <asm/hardware/clps7111.h> #include <asm/io.h> static inline void arch_idle(void) { clps_writel(1, HALT); __asm__ __volatile__( "mov r0, r0\n\ mov r0, r0"); } static inline void arch_reset(char mode) { cpu_reset(0); } #endif
/* Copyright Statement: * * This software/firmware and related documentation ("MediaTek Software") are * protected under relevant copyright laws. The information contained herein * is confidential and proprietary to MediaTek Inc. and/or its licensors. * Without the prior written permission of MediaTek inc. and/or its licensors, * any reproduction, modification, use or disclosure of MediaTek Software, * and information contained herein, in whole or in part, shall be strictly prohibited. */ /* MediaTek Inc. (C) 2010. All rights reserved. * * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. * * The following software/firmware and/or related documentation ("MediaTek Software") * have been modified by MediaTek Inc. All revisions are subject to any receiver's * applicable license agreements with MediaTek Inc. */ /* ** ** Copyright 2008, The Android Open Source Project ** ** 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 _MTK_ASD_ERRCODE_H #define _MTK_ASD_ERRCODE_H /////////////////////////////////////////////////////////////////////////////// //! Error code formmat is: //! //! Bit 31~24 is global, each module must follow it, bit 23~0 is defined by module //! | 31(1 bit) |30-24(7 bits) | 23-0 (24 bits) | //! | Indicator | Module ID | Module-defined error Code | //! //! Example 1: //! | 31(1 bit) |30-24(7 bits) | 23-16(8 bits) | 15-0(16 bits) | //! | Indicator | Module ID | group or sub-mod | Err Code | //! //! Example 2: //! | 31(1 bit) |30-24(7 bits) | 23-12(12 bits)| 11-8(8 bits) | 7-0(16 bits) | //! | Indicator | Module ID | line number | group | Err Code | //! //! Indicator : 0 - success, 1 - error //! Module ID : module ID, defined below //! Extended : module dependent, but providee macro to add partial line info //! Err code : defined in each module's public include file, //! IF module ID is MODULE_COMMON, the errocode is //! defined here // /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// //! Error code type definition /////////////////////////////////////////////////////////////////////////// typedef MINT32 MRESULT; /////////////////////////////////////////////////////////////////////////// //! Helper macros to define error code /////////////////////////////////////////////////////////////////////////// #define ERRCODE(modid, errid) \ ((MINT32) \ ((MUINT32)(0x80000000) | \ (MUINT32)((modid & 0x7f) << 24) | \ (MUINT32)(errid & 0xffff)) \ ) #define OKCODE(modid, okid) \ ((MINT32) \ ((MUINT32)(0x00000000) | \ (MUINT32)((modid & 0x7f) << 24) | \ (MUINT32)(okid & 0xffff)) \ ) /////////////////////////////////////////////////////////////////////////// //! Helper macros to check error code /////////////////////////////////////////////////////////////////////////// #define SUCCEEDED(Status) ((MRESULT)(Status) >= 0) #define FAILED(Status) ((MRESULT)(Status) < 0) #define MODULE_MTK_ASD (0) // Temp value #define MTKASD_OKCODE(errid) OKCODE(MODULE_MTK_ASD, errid) #define MTKASD_ERRCODE(errid) ERRCODE(MODULE_MTK_ASD, errid) // Detection error code #define S_ASD_OK MTKASD_OKCODE(0x0000) #define E_ASD_NEED_OVER_WRITE MTKASD_ERRCODE(0x0001) #define E_ASD_NULL_OBJECT MTKASD_ERRCODE(0x0002) #define E_ASD_WRONG_STATE MTKASD_ERRCODE(0x0003) #define E_ASD_WRONG_CMD_ID MTKASD_ERRCODE(0x0004) #define E_ASD_WRONG_CMD_PARAM MTKASD_ERRCODE(0x0005) #define E_ASD_ERR MTKASD_ERRCODE(0x0100) #endif
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _ZFS_COMUTIL_H #define _ZFS_COMUTIL_H #include <sys/fs/zfs.h> #include <sys/types.h> #ifdef __cplusplus extern "C" { #endif extern boolean_t zfs_allocatable_devs(nvlist_t *); extern void zpool_get_rewind_policy(nvlist_t *, zpool_rewind_policy_t *); extern int zfs_zpl_version_map(int spa_version); extern int zfs_spa_version_map(int zpl_version); #define ZFS_NUM_LEGACY_HISTORY_EVENTS 41 extern const char *zfs_history_event_names[ZFS_NUM_LEGACY_HISTORY_EVENTS]; #ifdef __cplusplus } #endif #endif /* _ZFS_COMUTIL_H */
/* radare - LGPL - Copyright 2009-2014 - pancake, nibble */ #include <stdio.h> #include <string.h> #include <r_types.h> #include <r_lib.h> #include <r_asm.h> static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) { const ut8 *b; int rep = 1; /* Count repetitions of the current instruction, unless it's a trap. */ if (*buf != 0x00 && *buf != 0xff) for (b = &buf[1]; b < buf+len && *b == *buf; b++) rep++; switch (*buf) { case '[': strcpy (op->buf_asm, "while [ptr]"); break; case ']': strcpy (op->buf_asm, "loop"); // TODO: detect clause and put label name break; case '>': if (rep>1) strcpy (op->buf_asm, "add ptr"); else strcpy (op->buf_asm, "inc ptr"); break; case '<': if (rep>1) strcpy (op->buf_asm, "sub ptr"); else strcpy (op->buf_asm, "dec ptr"); break; case '+': if (rep>1) strcpy (op->buf_asm, "add [ptr]"); else strcpy (op->buf_asm, "inc [ptr]"); break; case '-': if (rep>1) strcpy (op->buf_asm, "sub [ptr]"); else strcpy (op->buf_asm, "dec [ptr]"); break; case ',': strcpy (op->buf_asm, "in [ptr]"); break; case '.': strcpy (op->buf_asm, "out [ptr]"); break; case 0xff: case 0x00: strcpy (op->buf_asm, "trap"); break; default: strcpy (op->buf_asm, "nop"); break; } if (rep>1) { /* Note: snprintf's source and destination buffers may not * overlap. */ const char *fmt = strchr (op->buf_asm, ' ')? "%s, %d":"%s %d"; char buf[sizeof (op->buf_asm)]; snprintf (buf, sizeof (buf), fmt, op->buf_asm, rep); strcpy(op->buf_asm, buf); } op->size = rep; return rep; } static int assemble(RAsm *a, RAsmOp *op, const char *buf) { const char *ref, *arg; int n = 0; if (buf[0] && buf[1]==' ') buf += 2; arg = strchr (buf, ','); ref = strchr (buf, '['); if (!strncmp (buf, "trap", 4)) { if (arg) { n = atoi (arg+1); memset (op->buf, 0xcc, n); } else { op->buf[0] = 0x90; n = 1; } } else if (!strncmp (buf, "nop", 3)) { if (arg) { n = atoi (arg+1); memset (op->buf, 0x90, n); } else { op->buf[0] = 0x90; n = 1; } } else if (!strncmp (buf, "inc", 3)) { char ch = ref? '+': '>'; op->buf[0] = ch; n = 1; } else if (!strncmp (buf, "dec", 3)) { char ch = ref? '-': '<'; op->buf[0] = ch; n = 1; } else if (!strncmp (buf, "sub", 3)) { char ch = ref? '-': '<'; if (arg) { n = atoi (arg+1); memset (op->buf, ch, n); } else { op->buf[0] = '<'; n = 1; } } else if (!strncmp (buf, "add", 3)) { char ch = ref? '+': '>'; if (arg) { n = atoi (arg+1); memset (op->buf, ch, n); } else { op->buf[0] = '<'; n = 1; } } else if (!strncmp (buf, "while", 5)) { op->buf[0] = '['; n = 1; } else if (!strncmp (buf, "loop", 4)) { op->buf[0] = ']'; n = 1; } else if (!strncmp (buf, "in", 4)) { if (arg) { n = atoi (arg+1); memset (op->buf, ',', n); } else { op->buf[0] = ','; n = 1; } } else if (!strncmp (buf, "out", 4)) { if (arg) { n = atoi (arg+1); memset (op->buf, '.', n); } else { op->buf[0] = '.'; n = 1; } } return n; } RAsmPlugin r_asm_plugin_bf = { .name = "bf", .arch = "bf", .license = "LGPL3", .bits = 16|32, .desc = "Brainfuck", .init = NULL, .fini = NULL, .disassemble = &disassemble, .assemble = &assemble }; #ifndef CORELIB struct r_lib_struct_t radare_plugin = { .type = R_LIB_TYPE_ASM, .data = &r_asm_plugin_bf, .version = R2_VERSION }; #endif
#include <string.h> #include <jni.h> #include <yuv420sp2rgb.h> #include <../preview_handler_jni.h> #ifndef max #define max(a,b) ({typeof(a) _a = (a); typeof(b) _b = (b); _a > _b ? _a : _b; }) #define min(a,b) ({typeof(a) _a = (a); typeof(b) _b = (b); _a < _b ? _a : _b; }) #endif /* * convert a yuv420 array to a rgb array */ JNIEXPORT void JNICALL Java_edu_dhbw_andar_CameraPreviewHandler_yuv420sp2rgb (JNIEnv* env, jobject object, jbyteArray pinArray, jint width, jint height, jint textureSize, jbyteArray poutArray) { jbyte *inArray; jbyte *outArray; inArray = (*env)->GetByteArrayElements(env, pinArray, JNI_FALSE); outArray = (*env)->GetByteArrayElements(env, poutArray, JNI_FALSE); //see http://java.sun.com/docs/books/jni/html/functions.html#100868 //If isCopy is not NULL, then *isCopy is set to JNI_TRUE if a copy is made; if no copy is made, it is set to JNI_FALSE. color_convert_common(inArray, inArray + width * height, width, height, textureSize, outArray, width * height * 3, 0, 0); //release arrays: (*env)->ReleaseByteArrayElements(env, pinArray, inArray, 0); (*env)->ReleaseByteArrayElements(env, poutArray, outArray, 0); } /* YUV 4:2:0 image with a plane of 8 bit Y samples followed by an interleaved U/V plane containing 8 bit 2x2 subsampled chroma samples. except the interleave order of U and V is reversed. H V Y Sample Period 1 1 U (Cb) Sample Period 2 2 V (Cr) Sample Period 2 2 */ /* size of a char: find . -name limits.h -exec grep CHAR_BIT {} \; */ const int bytes_per_pixel = 2; static inline void color_convert_common( unsigned char *pY, unsigned char *pUV, int width, int height, int texture_size, unsigned char *buffer, int size, /* buffer size in bytes */ int gray, int rotate) { int i, j; int nR, nG, nB; int nY, nU, nV; unsigned char *out = buffer; int offset = 0; // YUV 4:2:0 for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { nY = *(pY + i * width + j); nV = *(pUV + (i/2) * width + bytes_per_pixel * (j/2)); nU = *(pUV + (i/2) * width + bytes_per_pixel * (j/2) + 1); // Yuv Convert nY -= 16; nU -= 128; nV -= 128; if (nY < 0) nY = 0; // nR = (int)(1.164 * nY + 2.018 * nU); // nG = (int)(1.164 * nY - 0.813 * nV - 0.391 * nU); // nB = (int)(1.164 * nY + 1.596 * nV); nB = (int)(1192 * nY + 2066 * nU); nG = (int)(1192 * nY - 833 * nV - 400 * nU); nR = (int)(1192 * nY + 1634 * nV); nR = min(262143, max(0, nR)); nG = min(262143, max(0, nG)); nB = min(262143, max(0, nB)); nR >>= 10; nR &= 0xff; nG >>= 10; nG &= 0xff; nB >>= 10; nB &= 0xff; out[offset++] = (unsigned char)nR; out[offset++] = (unsigned char)nG; out[offset++] = (unsigned char)nB; } //offset = i * width * 3; //non power of two //offset = i * texture_size + j;//power of two //offset *= 3; //3 byte per pixel //out = buffer + offset; } }
/*---------------------------------------------------------------------------- * CMSIS-RTOS - RTX *---------------------------------------------------------------------------- * Name: RT_LIST.H * Purpose: Functions for the management of different lists * Rev.: V4.79 *---------------------------------------------------------------------------- * * Copyright (c) 1999-2009 KEIL, 2009-2015 ARM Germany GmbH * 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 ARM 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 COPYRIGHT HOLDERS AND 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. *---------------------------------------------------------------------------*/ /* Definitions */ /* Values for 'cb_type' */ #define TCB 0U #define MCB 1U #define SCB 2U #define MUCB 3U #define HCB 4U /* Variables */ extern struct OS_XCB os_rdy; extern struct OS_XCB os_dly; /* Functions */ extern void rt_put_prio (P_XCB p_CB, P_TCB p_task); extern P_TCB rt_get_first (P_XCB p_CB); extern void rt_put_rdy_first (P_TCB p_task); extern P_TCB rt_get_same_rdy_prio (void); extern void rt_resort_prio (P_TCB p_task); extern void rt_put_dly (P_TCB p_task, U16 delay); extern void rt_dec_dly (void); extern void rt_rmv_list (P_TCB p_task); extern void rt_rmv_dly (P_TCB p_task); extern void rt_psq_enq (OS_ID entry, U32 arg); /* This is a fast macro generating in-line code */ #define rt_rdy_prio(void) (os_rdy.p_lnk->prio) /*---------------------------------------------------------------------------- * end of file *---------------------------------------------------------------------------*/
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. 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 TENSORFLOW_CORE_COMMON_RUNTIME_IMMUTABLE_EXECUTOR_STATE_H_ #define TENSORFLOW_CORE_COMMON_RUNTIME_IMMUTABLE_EXECUTOR_STATE_H_ #include <atomic> #include <deque> #include <memory> #include <vector> #include "absl/container/flat_hash_map.h" #include "tensorflow/core/common_runtime/graph_view.h" #include "tensorflow/core/common_runtime/local_executor_params.h" #include "tensorflow/core/common_runtime/pending_counts.h" #include "tensorflow/core/framework/tensor.h" #include "tensorflow/core/lib/core/status.h" #include "tensorflow/core/lib/gtl/flatmap.h" #include "tensorflow/core/lib/gtl/flatset.h" #include "tensorflow/core/platform/macros.h" #include "tensorflow/core/platform/types.h" namespace tensorflow { class Graph; // Represents the state of an executor (graph and control flow information) // that is immutable throughout execution. // // TODO(b/152651962): Add independent unit tests for this class. class ImmutableExecutorState { public: struct FrameInfo { explicit FrameInfo(string name) : name(std::move(name)), input_count(0), total_inputs(0), pending_counts(nullptr), nodes(nullptr), parallel_iterations(-1) {} // The name of the frame. string name; // The total number of inputs to a frame. int input_count; // The total number of input tensors of a frame. // == sum(nodes[*].num_inputs()) where nodes are the nodes in the frame. int total_inputs; // Used to determine the next place to allocate space in the // pending_counts data structure we'll eventually construct PendingCounts::Layout pending_counts_layout; // Each frame has its own PendingCounts only for the nodes in the frame. std::unique_ptr<PendingCounts> pending_counts; // The nodes in a frame. Used only for debugging. std::unique_ptr<std::vector<const NodeItem*>> nodes; // The number of iterations of this frame that can execute concurrently. int32 parallel_iterations; }; explicit ImmutableExecutorState(const LocalExecutorParams& p) : params_(p), gview_() {} ~ImmutableExecutorState(); Status Initialize(const Graph& graph); // Process all Nodes in the current graph, attempting to infer the // memory allocation attributes to be used wherever they may allocate // a tensor buffer. Status SetAllocAttrs(); const LocalExecutorParams& params() const { return params_; } const GraphView& graph_view() const { return gview_; } const std::vector<PendingCounts::Handle>& pending_ids() const { return pending_ids_; } const std::vector<const NodeItem*>& root_nodes() const { return root_nodes_; } const FrameInfo& get_root_frame_info() const { return *root_frame_info_; } const FrameInfo& get_enter_frame_info(const NodeItem& node_item) const { DCHECK(node_item.is_enter); return *enter_frame_info_[node_item.node_id]; } bool requires_control_flow_support() const { return requires_control_flow_; } // Copies the pending counts for nodes in this graph to the given array. // // This method provides a more efficient way of initializing // `SimplePropagatorState` than individually accessing the pending counts from // `get_root_frame_info().counts`. // // REQUIRES: `!requires_control_flow_support && len(dest) == // graph_view().num_nodes()`. void copy_pending_counts(std::atomic<int32>* dest) const { DCHECK(!requires_control_flow_); memcpy(dest, atomic_pending_counts_.get(), graph_view().num_nodes() * sizeof(std::atomic<int32>)); std::atomic_thread_fence(std::memory_order_release); } private: struct ControlFlowInfo { gtl::FlatSet<string> unique_frame_names; std::vector<string> frame_names; }; static Status BuildControlFlowInfo(const Graph* graph, ControlFlowInfo* cf_info); void InitializePending(const Graph* graph, const ControlFlowInfo& cf_info); FrameInfo* EnsureFrameInfo(const string& fname); // Owned. LocalExecutorParams params_; GraphView gview_; bool requires_control_flow_; std::vector<PendingCounts::Handle> pending_ids_; // Root nodes (with no in edges) that should form the initial ready queue std::vector<const NodeItem*> root_nodes_; // Mapping from frame name to static information about the frame. // TODO(yuanbyu): We could cache it along with the graph so to avoid // the overhead of constructing it for each executor instance. absl::flat_hash_map<absl::string_view, std::unique_ptr<FrameInfo>> frame_info_; const FrameInfo* root_frame_info_; // Not owned. // If the graph contains any "Enter" or "RefEnter" nodes, this vector maps // dense node IDs to the corresponding FrameInfo. std::vector<FrameInfo*> enter_frame_info_; // If `requires_control_flow_` is false, this points to an array of initial // pending counts for the nodes in the graph, indexed by node ID. std::unique_ptr<std::atomic<int32>[]> atomic_pending_counts_; // Shallow copies of the constant tensors used in the graph. std::vector<Tensor> const_tensors_; TF_DISALLOW_COPY_AND_ASSIGN(ImmutableExecutorState); }; } // namespace tensorflow #endif // TENSORFLOW_CORE_COMMON_RUNTIME_IMMUTABLE_EXECUTOR_STATE_H_
/** * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA * * All rights reserved. * * 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, except as embedded into a Nordic * Semiconductor ASA integrated circuit in a product or a software update for * such product, 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. * * 3. Neither the name of Nordic Semiconductor ASA nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * 4. This software, with or without modification, must only be used with a * Nordic Semiconductor ASA integrated circuit. * * 5. Any software provided in binary form under this license must not be reverse * engineered, decompiled, modified and/or disassembled. * * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA 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 "es_gatts.h" #include "es_gatts_read.h" #include "es_gatts_write.h" #include "es_slot.h" static nrf_ble_escs_lock_state_read_t m_lock_state; static uint8_t m_active_slot; /**@brief Function checking if beacon is unlocked. * * @param[in] p_escs Pointer to Eddystone Configuration Service. * * @retval true If beacon is unlocked. * @retval false If beacon is locked. */ static bool is_beacon_unlocked(const nrf_ble_escs_t * p_escs) { return m_lock_state != NRF_BLE_ESCS_LOCK_STATE_LOCKED; } ret_code_t es_gatts_send_reply(nrf_ble_escs_t * p_escs, ble_gatts_rw_authorize_reply_params_t * p_reply) { VERIFY_PARAM_NOT_NULL(p_escs); VERIFY_PARAM_NOT_NULL(p_reply); if (p_escs->conn_handle != BLE_CONN_HANDLE_INVALID) { return sd_ble_gatts_rw_authorize_reply(p_escs->conn_handle, p_reply); } return NRF_ERROR_INVALID_STATE; } ret_code_t es_gatts_send_op_not_permitted(nrf_ble_escs_t * p_escs, bool read) { ble_gatts_rw_authorize_reply_params_t reply = {0}; VERIFY_PARAM_NOT_NULL(p_escs); if (read) { reply.type = BLE_GATTS_AUTHORIZE_TYPE_READ; reply.params.read.gatt_status = BLE_GATT_STATUS_ATTERR_READ_NOT_PERMITTED; } else { reply.type = BLE_GATTS_AUTHORIZE_TYPE_WRITE; reply.params.write.gatt_status = BLE_GATT_STATUS_ATTERR_WRITE_NOT_PERMITTED; } return es_gatts_send_reply(p_escs, &reply); } void es_gatts_handle_write(nrf_ble_escs_t * p_escs, uint16_t uuid, uint16_t val_handle, uint8_t * p_data, uint16_t length) { ret_code_t err_code; if (is_beacon_unlocked(p_escs)) { if (uuid == BLE_UUID_ESCS_UNLOCK_CHAR) { err_code = es_gatts_send_op_not_permitted(p_escs, false); APP_ERROR_CHECK(err_code); } else { err_code = es_gatts_write_handle_unlocked_write( p_escs, uuid, val_handle, p_data, length, m_active_slot); APP_ERROR_CHECK(err_code); } } else { if (uuid == BLE_UUID_ESCS_UNLOCK_CHAR) { err_code = es_gatts_write_handle_unlock(p_escs, p_data, length, val_handle); APP_ERROR_CHECK(err_code); } else { err_code = es_gatts_send_op_not_permitted(p_escs, false); APP_ERROR_CHECK(err_code); } } } void es_gatts_handle_read(nrf_ble_escs_t * p_escs, uint16_t uuid, uint16_t val_handle) { ret_code_t err_code; if (is_beacon_unlocked(p_escs)) { if (uuid == BLE_UUID_ESCS_UNLOCK_CHAR) { err_code = es_gatts_send_op_not_permitted(p_escs, true); APP_ERROR_CHECK(err_code); } else { err_code = es_gatts_read_handle_unlocked_read(p_escs, uuid, val_handle, m_active_slot, m_lock_state); APP_ERROR_CHECK(err_code); } } else // Beacon is locked. { if (uuid == BLE_UUID_ESCS_UNLOCK_CHAR) { err_code = es_gatts_read_handle_unlock(p_escs); APP_ERROR_CHECK(err_code); } else { err_code = es_gatts_read_handle_locked_read(p_escs, uuid, m_lock_state); APP_ERROR_CHECK(err_code); } } } ret_code_t es_gatts_init(nrf_ble_escs_t * p_ble_escs) { VERIFY_PARAM_NOT_NULL(p_ble_escs); m_active_slot = 0; m_lock_state = NRF_BLE_ESCS_LOCK_STATE_LOCKED; p_ble_escs->p_active_slot = &m_active_slot; p_ble_escs->p_lock_state = &m_lock_state; return NRF_SUCCESS; }
// Copyright 2015 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 CONTENT_BROWSER_COMPOSITOR_REFLECTOR_TEXTURE_H_ #define CONTENT_BROWSER_COMPOSITOR_REFLECTOR_TEXTURE_H_ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "content/browser/compositor/owned_mailbox.h" #include "content/common/content_export.h" namespace cc { class ContextProvider; } namespace gfx { class Rect; class Size; } namespace content { class GLHelper; // Create and manages texture mailbox to be used by Reflector. class CONTENT_EXPORT ReflectorTexture { public: explicit ReflectorTexture(cc::ContextProvider* provider); ~ReflectorTexture(); void CopyTextureFullImage(const gfx::Size& size); void CopyTextureSubImage(const gfx::Rect& size); uint32 texture_id() const { return texture_id_; } scoped_refptr<OwnedMailbox> mailbox() { return mailbox_; } private: scoped_refptr<OwnedMailbox> mailbox_; scoped_ptr<GLHelper> gl_helper_; uint32 texture_id_; DISALLOW_COPY_AND_ASSIGN(ReflectorTexture); }; } // namespace content #endif
// // RTSpinKitArcAltAnimation.h // SpinKit // // Copyright (c) 2014 Ramon Torres // // 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. // #import <Foundation/Foundation.h> #import "RTSpinKitAnimating.h" @interface RTSpinKitArcAltAnimation : NSObject<RTSpinKitAnimating> @end
/***************************************************************************** Copyright(c) 2013 FCI Inc. All Rights Reserved File name : fc8300_spi.h Description : header of SPI interface 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA History : ---------------------------------------------------------------------- *******************************************************************************/ #ifndef __FC8300_SPI__ #define __FC8300_SPI__ #ifdef __cplusplus extern "C" { #endif extern s32 fc8300_spi_init(HANDLE handle, u16 param1, u16 param2); extern s32 fc8300_spi_byteread(HANDLE handle, DEVICEID devid, u16 addr, u8 *data); extern s32 fc8300_spi_wordread(HANDLE handle, DEVICEID devid, u16 addr, u16 *data); extern s32 fc8300_spi_longread(HANDLE handle, DEVICEID devid, u16 addr, u32 *data); extern s32 fc8300_spi_bulkread(HANDLE handle, DEVICEID devid, u16 addr, u8 *data, u16 length); extern s32 fc8300_spi_bytewrite(HANDLE handle, DEVICEID devid, u16 addr, u8 data); extern s32 fc8300_spi_wordwrite(HANDLE handle, DEVICEID devid, u16 addr, u16 data); extern s32 fc8300_spi_longwrite(HANDLE handle, DEVICEID devid, u16 addr, u32 data); extern s32 fc8300_spi_bulkwrite(HANDLE handle, DEVICEID devid, u16 addr, u8 *data, u16 length); extern s32 fc8300_spi_dataread(HANDLE handle, DEVICEID devid, u16 addr, u8 *data, u32 length); extern s32 fc8300_spi_deinit(HANDLE handle); #ifdef __cplusplus } #endif #endif /* __FC8300_SPI__ */
/* * WPS IE share utility header file * * Copyright (C) 2012, Broadcom Corporation * All Rights Reserved. * * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation; * the contents of this file may not be disclosed to third parties, copied * or duplicated in any form, in whole or in part, without the prior * written permission of Broadcom Corporation. * * $Id: ie_utils.h 241182 2011-02-17 21:50:03Z $ */ #ifndef _WPS_IE_UTILS_H_ #define _WPS_IE_UTILS_H_ #ifdef __cplusplus extern "C" { #endif #include <typedefs.h> #include <wpstypes.h> #define IE_UTILS_BUILD_WPS_IE_FUNC_NUM 5 /* AuthorizedMacs octet structure */ typedef struct { int len; char macs[SIZE_MAC_ADDR * SIZE_AUTHORIZEDMACS_NUM]; } IE_UTILS_AUTHOMACS_OCTET; /* Beacon parameters WPS IE structure */ typedef struct { uint8 version; uint8 scState; uint8 apLockdown; uint8 selReg; uint16 devPwdId; uint16 selRegCfgMethods; uint8 uuid_e[SIZE_UUID]; uint8 rfBand; uint16 primDeviceCategory; uint32 primDeviceOui; uint16 primDeviceSubCategory; char deviceName[SIZE_32_BYTES + 1]; /* WSC 2.0 */ uint8 version2; IE_UTILS_AUTHOMACS_OCTET authorizedMacs; } IE_UTILS_BEACON_PARAMS; /* Probe Response parameters WPS IE structure */ typedef struct { uint8 version; uint8 scState; uint8 apLockdown; uint8 selReg; uint16 devPwdId; uint16 selRegCfgMethods; uint8 respType; uint8 uuid_e[SIZE_UUID]; char manufacturer[SIZE_64_BYTES + 1]; char modelName[SIZE_32_BYTES + 1]; char modelNumber[SIZE_32_BYTES + 1]; char serialNumber[SIZE_32_BYTES + 1]; uint16 primDeviceCategory; uint32 primDeviceOui; uint16 primDeviceSubCategory; char deviceName[SIZE_32_BYTES + 1]; uint16 configMethods; uint8 rfBand; /* WSC 2.0 */ uint8 version2; IE_UTILS_AUTHOMACS_OCTET authorizedMacs; } IE_UTILS_PROBERESP_PARAMS; /* Associate Response parameters WPS IE structure */ typedef struct { uint8 version; uint8 respType; /* WSC 2.0 */ uint8 version2; } IE_UTILS_ASSOCRESP_PARAMS; /* Probe Request parameters WPS IE structure */ typedef struct { uint8 version; uint8 reqType; uint16 configMethods; uint8 uuid[SIZE_UUID]; uint16 primDeviceCategory; uint32 primDeviceOui; uint16 primDeviceSubCategory; uint8 rfBand; uint16 assocState; uint16 configError; uint16 devPwdId; uint16 reqDeviceCategory; uint32 reqDeviceOui; uint16 reqDeviceSubCategory; /* WSC 2.0 */ uint8 version2; char manufacturer[SIZE_64_BYTES + 1]; char modelName[SIZE_32_BYTES + 1]; char modelNumber[SIZE_32_BYTES + 1]; char deviceName[SIZE_32_BYTES + 1]; uint8 reqToEnroll; } IE_UTILS_PROBEREQ_PARAMS; /* Associate Request WPS IE parameters structure */ typedef struct { uint8 version; uint8 reqType; /* WSC 2.0 */ uint8 version2; } IE_UTILS_ASSOCREQ_PARAMS; /* * implemented in ie_utils.c */ uint32 ie_utils_build_beacon_IE(void *params, uint8 *buf, int *buflen); uint32 ie_utils_build_proberesp_IE(void *params, uint8 *buf, int *buflen); uint32 ie_utils_build_assocresp_IE(void *params, uint8 *buf, int *buflen); uint32 ie_utils_build_probereq_IE(void *params, uint8 *buf, int *buflen); uint32 ie_utils_build_assocreq_IE(void *params, uint8 *buf, int *buflen); #ifdef __cplusplus } #endif #endif /* _WPS_IE_UTILS_H_ */
/* * include/asm-mips/i8259.h * * i8259A interrupt definitions. * * Copyright (C) 2003 Maciej W. Rozycki * * 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_MIPS64_I8259_H #define __ASM_MIPS64_I8259_H #include <linux/spinlock.h> #include <asm/io.h> #include <asm/system.h> extern void init_i8259_irqs(void); #endif /* __ASM_MIPS64_I8259_H */
/* Declarations for use by board files for creating devices. */ #ifndef HW_BOARDS_H #define HW_BOARDS_H #include "exec/cpu-common.h" typedef void QEMUMachineInitFunc(ram_addr_t ram_size, const char *boot_device, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model); typedef struct QEMUMachine { const char *name; const char *desc; QEMUMachineInitFunc *init; int use_scsi; int max_cpus; int is_default; struct QEMUMachine *next; } QEMUMachine; int qemu_register_machine(QEMUMachine *m); extern QEMUMachine *current_machine; /* android_arm.c */ extern QEMUMachine android_arm_machine; /* android_mips.c */ extern QEMUMachine android_mips_machine; #endif
/* Copyright Rene Rivera 2008-2013 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef MSGPACK_PREDEF_ARCHITECTURE_PPC_H #define MSGPACK_PREDEF_ARCHITECTURE_PPC_H #include <msgpack/predef/version_number.h> #include <msgpack/predef/make.h> /*` [heading `MSGPACK_ARCH_PPC`] [@http://en.wikipedia.org/wiki/PowerPC PowerPC] architecture. [table [[__predef_symbol__] [__predef_version__]] [[`__powerpc`] [__predef_detection__]] [[`__powerpc__`] [__predef_detection__]] [[`__POWERPC__`] [__predef_detection__]] [[`__ppc__`] [__predef_detection__]] [[`_M_PPC`] [__predef_detection__]] [[`_ARCH_PPC`] [__predef_detection__]] [[`__PPCGECKO__`] [__predef_detection__]] [[`__PPCBROADWAY__`] [__predef_detection__]] [[`_XENON`] [__predef_detection__]] [[`__ppc601__`] [6.1.0]] [[`_ARCH_601`] [6.1.0]] [[`__ppc603__`] [6.3.0]] [[`_ARCH_603`] [6.3.0]] [[`__ppc604__`] [6.4.0]] [[`__ppc604__`] [6.4.0]] ] */ #define MSGPACK_ARCH_PPC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE #if defined(__powerpc) || defined(__powerpc__) || \ defined(__POWERPC__) || defined(__ppc__) || \ defined(_M_PPC) || defined(_ARCH_PPC) || \ defined(__PPCGECKO__) || defined(__PPCBROADWAY__) || \ defined(_XENON) # undef MSGPACK_ARCH_PPC # if !defined (MSGPACK_ARCH_PPC) && (defined(__ppc601__) || defined(_ARCH_601)) # define MSGPACK_ARCH_PPC MSGPACK_VERSION_NUMBER(6,1,0) # endif # if !defined (MSGPACK_ARCH_PPC) && (defined(__ppc603__) || defined(_ARCH_603)) # define MSGPACK_ARCH_PPC MSGPACK_VERSION_NUMBER(6,3,0) # endif # if !defined (MSGPACK_ARCH_PPC) && (defined(__ppc604__) || defined(__ppc604__)) # define MSGPACK_ARCH_PPC MSGPACK_VERSION_NUMBER(6,4,0) # endif # if !defined (MSGPACK_ARCH_PPC) # define MSGPACK_ARCH_PPC MSGPACK_VERSION_NUMBER_AVAILABLE # endif #endif #if MSGPACK_ARCH_PPC # define MSGPACK_ARCH_PPC_AVAILABLE #endif #define MSGPACK_ARCH_PPC_NAME "PowerPC" #include <msgpack/predef/detail/test.h> MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_PPC,MSGPACK_ARCH_PPC_NAME) #endif
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the plugins 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 QWINRTCURSOR_H #define QWINRTCURSOR_H #include <qpa/qplatformcursor.h> namespace ABI { namespace Windows { namespace UI { namespace Core { struct ICoreWindow; struct ICoreCursorFactory; } } } } QT_BEGIN_NAMESPACE class QWinRTCursor : public QPlatformCursor { public: explicit QWinRTCursor(ABI::Windows::UI::Core::ICoreWindow *window); ~QWinRTCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor * windowCursor, QWindow *); #endif QPoint pos() const; private: ABI::Windows::UI::Core::ICoreWindow *m_window; ABI::Windows::UI::Core::ICoreCursorFactory *m_cursorFactory; }; QT_END_NAMESPACE #endif // QWINRTCURSOR_H
/* FUNCTION <<isupper>>, <<isupper_l>>---uppercase character predicate INDEX isupper INDEX isupper_l SYNOPSIS #include <ctype.h> int isupper(int <[c]>); #include <ctype.h> int isupper_l(int <[c]>, locale_t <[locale]>); DESCRIPTION <<isupper>> is a macro which classifies singlebyte charset values by table lookup. It is a predicate returning non-zero for uppercase letters (<<A>>--<<Z>>), and 0 for other characters. <<isupper_l>> is like <<isupper>> but performs the check based on the locale specified by the locale object locale. If <[locale]> is LC_GLOBAL_LOCALE or not a valid locale object, the behaviour is undefined. You can use a compiled subroutine instead of the macro definition by undefining the macro using `<<#undef isupper>>' or `<<#undef isupper_l>>'. RETURNS <<isupper>>, <<isupper_l>> return non-zero if <[c]> is an uppercase letter. PORTABILITY <<isupper>> is ANSI C. <<isupper_l>> is POSIX-1.2008. No supporting OS subroutines are required. */ #include <_ansi.h> #include <ctype.h> #undef isupper int isupper (int c) { return ((__CTYPE_PTR[c+1] & (_U|_L)) == _U); }
#include <util/curl/curl-helper.h> #include <stdlib.h> #include <string.h> #include <util/dstr.h> #include "util/base.h" #include "younow.h" struct younow_mem_struct { char *memory; size_t size; }; static char *current_ingest = NULL; static size_t younow_write_cb(void *contents, size_t size, size_t nmemb, void *userp) { size_t realsize = size * nmemb; struct younow_mem_struct *mem = (struct younow_mem_struct *)userp; mem->memory = realloc(mem->memory, mem->size + realsize + 1); if (mem->memory == NULL) { blog(LOG_WARNING, "yyounow_write_cb: realloc returned NULL"); return 0; } memcpy(&(mem->memory[mem->size]), contents, realsize); mem->size += realsize; mem->memory[mem->size] = 0; return realsize; } const char *younow_get_ingest(const char *server, const char *key) { CURL *curl_handle; CURLcode res; struct younow_mem_struct chunk; struct dstr uri; long response_code; // find the delimiter in stream key const char *delim = strchr(key, '_'); if (delim == NULL) { blog(LOG_WARNING, "younow_get_ingest: delimiter not found in stream key"); return server; } curl_handle = curl_easy_init(); chunk.memory = malloc(1); /* will be grown as needed by realloc */ chunk.size = 0; /* no data at this point */ dstr_init(&uri); dstr_copy(&uri, server); dstr_ncat(&uri, key, delim - key); curl_easy_setopt(curl_handle, CURLOPT_URL, uri.array); curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, true); curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 2L); curl_easy_setopt(curl_handle, CURLOPT_TIMEOUT, 3L); curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, younow_write_cb); curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&chunk); curl_obs_set_revoke_setting(curl_handle); #if LIBCURL_VERSION_NUM >= 0x072400 // A lot of servers don't yet support ALPN curl_easy_setopt(curl_handle, CURLOPT_SSL_ENABLE_ALPN, 0); #endif res = curl_easy_perform(curl_handle); dstr_free(&uri); if (res != CURLE_OK) { blog(LOG_WARNING, "younow_get_ingest: curl_easy_perform() failed: %s", curl_easy_strerror(res)); curl_easy_cleanup(curl_handle); free(chunk.memory); return server; } curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &response_code); if (response_code != 200) { blog(LOG_WARNING, "younow_get_ingest: curl_easy_perform() returned code: %ld", response_code); curl_easy_cleanup(curl_handle); free(chunk.memory); return server; } curl_easy_cleanup(curl_handle); if (chunk.size == 0) { blog(LOG_WARNING, "younow_get_ingest: curl_easy_perform() returned empty response"); free(chunk.memory); return server; } if (current_ingest) { free(current_ingest); current_ingest = NULL; } current_ingest = strdup(chunk.memory); free(chunk.memory); blog(LOG_INFO, "younow_get_ingest: returning ingest: %s", current_ingest); return current_ingest; }
/* FUNCTION <<mbstowcs>>---minimal multibyte string to wide char converter INDEX mbstowcs SYNOPSIS #include <stdlib.h> int mbstowcs(wchar_t *restrict <[pwc]>, const char *restrict <[s]>, size_t <[n]>); DESCRIPTION When _MB_CAPABLE is not defined, this is a minimal ANSI-conforming implementation of <<mbstowcs>>. In this case, the only ``multi-byte character sequences'' recognized are single bytes, and they are ``converted'' to wide-char versions simply by byte extension. When _MB_CAPABLE is defined, this routine calls <<_mbstowcs_r>> to perform the conversion, passing a state variable to allow state dependent decoding. The result is based on the locale setting which may be restricted to a defined set of locales. RETURNS This implementation of <<mbstowcs>> returns <<0>> if <[s]> is <<NULL>> or is the empty string; it returns <<-1>> if _MB_CAPABLE and one of the multi-byte characters is invalid or incomplete; otherwise it returns the minimum of: <<n>> or the number of multi-byte characters in <<s>> plus 1 (to compensate for the nul character). If the return value is -1, the state of the <<pwc>> string is indeterminate. If the input has a length of 0, the output string will be modified to contain a wchar_t nul terminator. PORTABILITY <<mbstowcs>> is required in the ANSI C standard. However, the precise effects vary with the locale. <<mbstowcs>> requires no supporting OS subroutines. */ #ifndef _REENT_ONLY #include <newlib.h> #include <stdlib.h> #include <wchar.h> size_t mbstowcs (wchar_t *__restrict pwcs, const char *__restrict s, size_t n) { #ifdef _MB_CAPABLE mbstate_t state; state.__count = 0; return _mbstowcs_r (_REENT, pwcs, s, n, &state); #else /* not _MB_CAPABLE */ int count = 0; if (n != 0) { do { if ((*pwcs++ = (wchar_t) *s++) == 0) break; count++; } while (--n != 0); } return count; #endif /* not _MB_CAPABLE */ } #endif /* !_REENT_ONLY */
/* Copyright (c) 2012, Broadcom Europe Ltd 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 copyright holder 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 "interface/vcos/vcos.h" #include "interface/mmal/util/mmal_list.h" /* Private list context */ typedef struct MMAL_LIST_PRIVATE_T { MMAL_LIST_T list; /* must be first */ VCOS_MUTEX_T lock; } MMAL_LIST_PRIVATE_T; /* Lock the list. */ static inline void mmal_list_lock(MMAL_LIST_T *list) { vcos_mutex_lock(&((MMAL_LIST_PRIVATE_T*)list)->lock); } /* Unlock the list. */ static inline void mmal_list_unlock(MMAL_LIST_T *list) { vcos_mutex_unlock(&((MMAL_LIST_PRIVATE_T*)list)->lock); } /* Create a new linked list. */ MMAL_LIST_T* mmal_list_create(void) { MMAL_LIST_PRIVATE_T *private; private = vcos_malloc(sizeof(MMAL_LIST_PRIVATE_T), "mmal-list"); if (private == NULL) goto error; if (vcos_mutex_create(&private->lock, "mmal-list lock") != VCOS_SUCCESS) goto error; /* lock to keep coverity happy */ vcos_mutex_lock(&private->lock); private->list.first = NULL; private->list.last = NULL; private->list.length = 0; vcos_mutex_unlock(&private->lock); return &private->list; error: vcos_free(private); return NULL; } /* Destroy a linked list. */ void mmal_list_destroy(MMAL_LIST_T *list) { MMAL_LIST_PRIVATE_T *private = (MMAL_LIST_PRIVATE_T*)list; vcos_mutex_delete(&private->lock); vcos_free(private); } /* Remove the last element in the list. */ MMAL_LIST_ELEMENT_T* mmal_list_pop_back(MMAL_LIST_T *list) { MMAL_LIST_ELEMENT_T *element; mmal_list_lock(list); element = list->last; if (element != NULL) { list->length--; list->last = element->prev; if (list->last) list->last->next = NULL; else list->first = NULL; /* list is now empty */ element->prev = NULL; element->next = NULL; } mmal_list_unlock(list); return element; } /* Remove the first element in the list. */ MMAL_LIST_ELEMENT_T* mmal_list_pop_front(MMAL_LIST_T *list) { MMAL_LIST_ELEMENT_T *element; mmal_list_lock(list); element = list->first; if (element != NULL) { list->length--; list->first = element->next; if (list->first) list->first->prev = NULL; else list->last = NULL; /* list is now empty */ element->prev = NULL; element->next = NULL; } mmal_list_unlock(list); return element; } /* Add an element to the front of the list. */ void mmal_list_push_front(MMAL_LIST_T *list, MMAL_LIST_ELEMENT_T *element) { mmal_list_lock(list); list->length++; element->prev = NULL; element->next = list->first; if (list->first) list->first->prev = element; else list->last = element; /* list was empty */ list->first = element; mmal_list_unlock(list); } /* Add an element to the back of the list. */ void mmal_list_push_back(MMAL_LIST_T *list, MMAL_LIST_ELEMENT_T *element) { mmal_list_lock(list); list->length++; element->next = NULL; element->prev = list->last; if (list->last) list->last->next = element; else list->first = element; /* list was empty */ list->last = element; mmal_list_unlock(list); } /* Insert an element into the list. */ void mmal_list_insert(MMAL_LIST_T *list, MMAL_LIST_ELEMENT_T *element, MMAL_LIST_COMPARE_T compare) { MMAL_LIST_ELEMENT_T *cur; mmal_list_lock(list); if (list->first == NULL) { /* List empty */ mmal_list_unlock(list); mmal_list_push_front(list, element); return; } cur = list->first; while (cur) { if (compare(element, cur)) { /* Slot found! */ list->length++; if (cur == list->first) list->first = element; else cur->prev->next = element; element->prev = cur->prev; element->next = cur; cur->prev = element; mmal_list_unlock(list); return; } cur = cur->next; } /* If we get here, none of the existing elements are greater * than the new on, so just add it to the back of the list */ mmal_list_unlock(list); mmal_list_push_back(list, element); }
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. 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 TENSORFLOW_PLATFORM_DENORMAL_H_ #define TENSORFLOW_PLATFORM_DENORMAL_H_ #include "tensorflow/core/platform/macros.h" namespace tensorflow { namespace port { // Remembers the flush denormal state on construction and restores that same // state on destruction. class ScopedRestoreFlushDenormalState { public: ScopedRestoreFlushDenormalState(); ~ScopedRestoreFlushDenormalState(); private: bool flush_zero_mode_; bool denormals_zero_mode_; TF_DISALLOW_COPY_AND_ASSIGN(ScopedRestoreFlushDenormalState); }; // While this class is active, denormal floating point numbers are flushed // to zero. The destructor restores the original flags. class ScopedFlushDenormal { public: ScopedFlushDenormal(); private: ScopedRestoreFlushDenormalState restore_; TF_DISALLOW_COPY_AND_ASSIGN(ScopedFlushDenormal); }; // While this class is active, denormal floating point numbers are not flushed // to zero. The destructor restores the original flags. class ScopedDontFlushDenormal { public: ScopedDontFlushDenormal(); private: ScopedRestoreFlushDenormalState restore_; TF_DISALLOW_COPY_AND_ASSIGN(ScopedDontFlushDenormal); }; } // namespace port } // namespace tensorflow #endif // TENSORFLOW_PLATFORM_DENORMAL_H_
/**************************************************************************** * PROJECT: mac apple constants * FILE: sqMacUIConstants.h * CONTENT: * * AUTHOR: John McIntosh * ADDRESS: * EMAIL: johnmci@smalltalkconsulting.com * RCSID: $Id: sqMacUIConstants.h 1344 2006-03-05 21:07:15Z johnmci $ * * NOTES: * 2011/04/01 WARNING: I'm usinf this file as is, copying it from platforms/Mac OS/vm because this plugin sources needs to be rewritten, and in the mean time there is * no good reason to pollute the other code. */ #define IMAGE_NAME_SIZE 1000 #define SHORTIMAGE_NAME_SIZE 255 #define DOCUMENT_NAME_SIZE 1000 #define VMPATH_SIZE 1000 #define DELIMITER "/" #define DELIMITERInt '/'
/* * Copyright © 2010 Team XBMC * http://xbmc.org * * 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, see <http://www.gnu.org/licenses/>. * */ #ifndef _TEXTURE_H_ #define _TEXTURE_H_ #include "Renderer.h" #include <string> using namespace std; class Texture { public: Texture(); void CreateTexture(); void LoadTexture( string& filename ); void AddRef(); void Release(); LPDIRECT3DTEXTURE9 m_pTexture; bool m_renderTarget; protected: ~Texture(); int m_iRefCount; }; inline Texture* Texture_Factory() { // The class constructor is initializing the reference counter to 1 return new Texture(); } #endif
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * 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. * */ /* * Implementation of main gameplay loop */ #ifndef GLK_TADS_TADS2_PLAY #define GLK_TADS_TADS2_PLAY #include "glk/tads/tads2/lib.h" #include "glk/tads/tads2/object.h" #include "glk/tads/tads2/run.h" #include "glk/tads/tads2/vocabulary.h" #include "glk/tads/tads2/tokenizer.h" namespace Glk { namespace TADS { namespace TADS2 { void plygo(runcxdef *run, voccxdef *voc, tiocxdef *tio, objnum preinit, char *restore_fname); } // End of namespace TADS2 } // End of namespace TADS } // End of namespace Glk #endif
/* * Copyright 2016 Advanced Micro Devices, Inc. * * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 __SOC15_H__ #define __SOC15_H__ #include "nbio_v6_1.h" #include "nbio_v7_0.h" #include "nbio_v7_4.h" #define SOC15_FLUSH_GPU_TLB_NUM_WREG 4 #define SOC15_FLUSH_GPU_TLB_NUM_REG_WAIT 1 extern const struct amd_ip_funcs soc15_common_ip_funcs; struct soc15_reg_golden { u32 hwip; u32 instance; u32 segment; u32 reg; u32 and_mask; u32 or_mask; }; struct soc15_reg_entry { uint32_t hwip; uint32_t inst; uint32_t seg; uint32_t reg_offset; uint32_t reg_value; uint32_t se_num; uint32_t instance; }; struct soc15_allowed_register_entry { uint32_t hwip; uint32_t inst; uint32_t seg; uint32_t reg_offset; bool grbm_indexed; }; #define SOC15_REG_ENTRY(ip, inst, reg) ip##_HWIP, inst, reg##_BASE_IDX, reg #define SOC15_REG_ENTRY_OFFSET(entry) (adev->reg_offset[entry.hwip][entry.inst][entry.seg] + entry.reg_offset) #define SOC15_REG_GOLDEN_VALUE(ip, inst, reg, and_mask, or_mask) \ { ip##_HWIP, inst, reg##_BASE_IDX, reg, and_mask, or_mask } void soc15_grbm_select(struct amdgpu_device *adev, u32 me, u32 pipe, u32 queue, u32 vmid); int soc15_set_ip_blocks(struct amdgpu_device *adev); void soc15_program_register_sequence(struct amdgpu_device *adev, const struct soc15_reg_golden *registers, const u32 array_size); int vega10_reg_base_init(struct amdgpu_device *adev); int vega20_reg_base_init(struct amdgpu_device *adev); int arct_reg_base_init(struct amdgpu_device *adev); void vega10_doorbell_index_init(struct amdgpu_device *adev); void vega20_doorbell_index_init(struct amdgpu_device *adev); #endif
#pragma once #include <atomic> #include "AP_HAL_Linux.h" #define LINUX_RC_INPUT_NUM_CHANNELS 16 namespace Linux { class RCInput : public AP_HAL::RCInput { public: RCInput(); static RCInput *from(AP_HAL::RCInput *rcinput) { return static_cast<RCInput*>(rcinput); } virtual void init(); bool new_input(); uint8_t num_channels(); uint16_t read(uint8_t ch); uint8_t read(uint16_t* periods, uint8_t len); int16_t get_rssi(void) override { return _rssi; } bool set_overrides(int16_t *overrides, uint8_t len); bool set_override(uint8_t channel, int16_t override); void clear_overrides(); // default empty _timer_tick, this is overridden by board // specific implementations virtual void _timer_tick() {} // add some DSM input bytes, for RCInput over a serial port bool add_dsm_input(const uint8_t *bytes, size_t nbytes); // add some SBUS input bytes, for RCInput over a serial port void add_sbus_input(const uint8_t *bytes, size_t nbytes); // add some SUMD input bytes, for RCInput over a serial port bool add_sumd_input(const uint8_t *bytes, size_t nbytes); // add some st24 input bytes, for RCInput over a serial port bool add_st24_input(const uint8_t *bytes, size_t nbytes); // add some srxl input bytes, for RCInput over a serial port bool add_srxl_input(const uint8_t *bytes, size_t nbytes); protected: void _process_rc_pulse(uint16_t width_s0, uint16_t width_s1); void _update_periods(uint16_t *periods, uint8_t len); std::atomic<unsigned int> rc_input_count; std::atomic<unsigned int> last_rc_input_count; uint16_t _pwm_values[LINUX_RC_INPUT_NUM_CHANNELS]; uint8_t _num_channels; void _process_ppmsum_pulse(uint16_t width); void _process_sbus_pulse(uint16_t width_s0, uint16_t width_s1); void _process_dsm_pulse(uint16_t width_s0, uint16_t width_s1); /* override state */ uint16_t _override[LINUX_RC_INPUT_NUM_CHANNELS]; // state of ppm decoder struct { int8_t _channel_counter; uint16_t _pulse_capt[LINUX_RC_INPUT_NUM_CHANNELS]; } ppm_state; // state of SBUS bit decoder struct { uint16_t bytes[25]; // including start bit, parity and stop bits uint16_t bit_ofs; } sbus_state; // state of DSM decoder struct { uint16_t bytes[16]; // including start bit and stop bit uint16_t bit_ofs; } dsm_state; // state of add_dsm_input struct { uint8_t frame[16]; uint8_t partial_frame_count; uint32_t last_input_ms; } dsm; // state of add_sbus_input struct { uint8_t frame[25]; uint8_t partial_frame_count; uint32_t last_input_ms; } sbus; int16_t _rssi = -1; }; }
/** ****************************************************************************** * @file i2c_hal.h * @author Satish Nair, Brett Walach * @version V1.0.0 * @date 12-Sept-2014 * @brief ****************************************************************************** Copyright (c) 2013-2015 Particle Industries, Inc. All rights reserved. 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 3 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, see <http://www.gnu.org/licenses/>. ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __I2C_HAL_H #define __I2C_HAL_H /* Includes ------------------------------------------------------------------*/ #include "pinmap_hal.h" /* Exported types ------------------------------------------------------------*/ typedef enum { I2C_MODE_MASTER = 0, I2C_MODE_SLAVE = 1 } I2C_Mode; /* Exported types ------------------------------------------------------------*/ typedef enum HAL_I2C_Interface { HAL_I2C_INTERFACE1 = 0, //maps to I2C1 (pins: D0, D1) #if PLATFORM_ID == 10 // Electron HAL_I2C_INTERFACE2 = 1 //maps to I2C1 (pins: C4, C5) ,HAL_I2C_INTERFACE3 = 2 //maps to I2C3 (PM_SDA_UC, PM_SCL_UC) #endif } HAL_I2C_Interface; /* Exported constants --------------------------------------------------------*/ /* Exported macros -----------------------------------------------------------*/ #define CLOCK_SPEED_100KHZ (uint32_t)100000 #define CLOCK_SPEED_400KHZ (uint32_t)400000 /* Exported functions --------------------------------------------------------*/ #ifdef __cplusplus extern "C" { #endif void HAL_I2C_Init(HAL_I2C_Interface i2c, void* reserved); void HAL_I2C_Set_Speed(HAL_I2C_Interface i2c, uint32_t speed, void* reserved); void HAL_I2C_Enable_DMA_Mode(HAL_I2C_Interface i2c, bool enable, void* reserved); void HAL_I2C_Stretch_Clock(HAL_I2C_Interface i2c, bool stretch, void* reserved); void HAL_I2C_Begin(HAL_I2C_Interface i2c, I2C_Mode mode, uint8_t address, void* reserved); void HAL_I2C_End(HAL_I2C_Interface i2c, void* reserved); uint32_t HAL_I2C_Request_Data(HAL_I2C_Interface i2c, uint8_t address, uint8_t quantity, uint8_t stop, void* reserved); void HAL_I2C_Begin_Transmission(HAL_I2C_Interface i2c, uint8_t address, void* reserved); uint8_t HAL_I2C_End_Transmission(HAL_I2C_Interface i2c, uint8_t stop, void* reserved); uint32_t HAL_I2C_Write_Data(HAL_I2C_Interface i2c, uint8_t data, void* reserved); int32_t HAL_I2C_Available_Data(HAL_I2C_Interface i2c, void* reserved); int32_t HAL_I2C_Read_Data(HAL_I2C_Interface i2c, void* reserved); int32_t HAL_I2C_Peek_Data(HAL_I2C_Interface i2c, void* reserved); void HAL_I2C_Flush_Data(HAL_I2C_Interface i2c, void* reserved); bool HAL_I2C_Is_Enabled(HAL_I2C_Interface i2c, void* reserved); void HAL_I2C_Set_Callback_On_Receive(HAL_I2C_Interface i2c, void (*function)(int), void* reserved); void HAL_I2C_Set_Callback_On_Request(HAL_I2C_Interface i2c, void (*function)(void), void* reserved); void HAL_I2C_Set_Speed_v1(uint32_t speed); void HAL_I2C_Enable_DMA_Mode_v1(bool enable); void HAL_I2C_Stretch_Clock_v1(bool stretch); void HAL_I2C_Begin_v1(I2C_Mode mode, uint8_t address); void HAL_I2C_End_v1(); uint32_t HAL_I2C_Request_Data_v1(uint8_t address, uint8_t quantity, uint8_t stop); void HAL_I2C_Begin_Transmission_v1(uint8_t address); uint8_t HAL_I2C_End_Transmission_v1(uint8_t stop); uint32_t HAL_I2C_Write_Data_v1(uint8_t data); int32_t HAL_I2C_Available_Data_v1(void); int32_t HAL_I2C_Read_Data_v1(void); int32_t HAL_I2C_Peek_Data_v1(void); void HAL_I2C_Flush_Data_v1(void); bool HAL_I2C_Is_Enabled_v1(void); void HAL_I2C_Set_Callback_On_Receive_v1(void (*function)(int)); void HAL_I2C_Set_Callback_On_Request_v1(void (*function)(void)); #define I2C_BUFFER_LENGTH 32 #define I2C_BUFFER_LENGTH 32 #ifdef __cplusplus } #endif #endif /* __I2C_HAL_H */
/* Internal header for proving correct grouping in strings of numbers. Copyright (C) 1995-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. 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, see <http://www.gnu.org/licenses/>. */ #include <limits.h> #include <stddef.h> #include <string.h> #ifndef MAX #define MAX(a,b) ({ typeof(a) _a = (a); typeof(b) _b = (b); \ _a > _b ? _a : _b; }) #endif #ifdef USE_WIDE_CHAR # include <wctype.h> # define L_(Ch) L##Ch # define UCHAR_TYPE wint_t # define STRING_TYPE wchar_t #else # define L_(Ch) Ch # define UCHAR_TYPE unsigned char # define STRING_TYPE char #endif #include "grouping.h" /* Find the maximum prefix of the string between BEGIN and END which satisfies the grouping rules. It is assumed that at least one digit follows BEGIN directly. */ const STRING_TYPE * #ifdef USE_WIDE_CHAR __correctly_grouped_prefixwc (const STRING_TYPE *begin, const STRING_TYPE *end, wchar_t thousands, #else __correctly_grouped_prefixmb (const STRING_TYPE *begin, const STRING_TYPE *end, const char *thousands, #endif const char *grouping) { #ifndef USE_WIDE_CHAR size_t thousands_len; int cnt; #endif if (grouping == NULL) return end; #ifndef USE_WIDE_CHAR thousands_len = strlen (thousands); #endif while (end > begin) { const STRING_TYPE *cp = end - 1; const char *gp = grouping; /* Check first group. */ while (cp >= begin) { #ifdef USE_WIDE_CHAR if (*cp == thousands) break; #else if (cp[thousands_len - 1] == *thousands) { for (cnt = 1; thousands[cnt] != '\0'; ++cnt) if (thousands[cnt] != cp[thousands_len - 1 - cnt]) break; if (thousands[cnt] == '\0') break; } #endif --cp; } /* We allow the representation to contain no grouping at all even if the locale specifies we can have grouping. */ if (cp < begin) return end; if (end - cp == (int) *gp + 1) { /* This group matches the specification. */ const STRING_TYPE *new_end; if (cp < begin) /* There is just one complete group. We are done. */ return end; /* CP points to a thousands separator character. The preceding remainder of the string from BEGIN to NEW_END is the part we will consider if there is a grouping error in this trailing portion from CP to END. */ new_end = cp - 1; /* Loop while the grouping is correct. */ while (1) { /* Get the next grouping rule. */ ++gp; if (*gp == 0) /* If end is reached use last rule. */ --gp; /* Skip the thousands separator. */ --cp; if (*gp == CHAR_MAX #if CHAR_MIN < 0 || *gp < 0 #endif ) { /* No more thousands separators are allowed to follow. */ while (cp >= begin) { #ifdef USE_WIDE_CHAR if (*cp == thousands) break; #else for (cnt = 0; thousands[cnt] != '\0'; ++cnt) if (thousands[cnt] != cp[thousands_len - cnt - 1]) break; if (thousands[cnt] == '\0') break; #endif --cp; } if (cp < begin) /* OK, only digits followed. */ return end; } else { /* Check the next group. */ const STRING_TYPE *group_end = cp; while (cp >= begin) { #ifdef USE_WIDE_CHAR if (*cp == thousands) break; #else for (cnt = 0; thousands[cnt] != '\0'; ++cnt) if (thousands[cnt] != cp[thousands_len - cnt - 1]) break; if (thousands[cnt] == '\0') break; #endif --cp; } if (cp < begin && group_end - cp <= (int) *gp) /* Final group is correct. */ return end; if (cp < begin || group_end - cp != (int) *gp) /* Incorrect group. Punt. */ break; } } /* The trailing portion of the string starting at NEW_END contains a grouping error. So we will look for a correctly grouped number in the preceding portion instead. */ end = new_end; } else { /* Even the first group was wrong; determine maximum shift. */ if (end - cp > (int) *gp + 1) end = cp + (int) *gp + 1; else if (cp < begin) /* This number does not fill the first group, but is correct. */ return end; else /* CP points to a thousands separator character. */ end = cp; } } return MAX (begin, end); }
/* SDL - Simple DirectMedia Layer Copyright (C) 1997-2010 Sam Lantinga 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.1 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 St, Fifth Floor, Boston, MA 02110-1301 USA Sam Lantinga slouken@libsdl.org */ #include "SDL_config.h" #include "SDL_DirectFB_video.h" /* Functions to be exported */ extern void DirectFB_InitKeyboard(_THIS); extern void DirectFB_QuitKeyboard(_THIS); extern void DirectFB_PumpEventsWindow(_THIS); extern SDLKey DirectFB_GetLayoutKey(_THIS, SDLKey physicalKey);
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. * */ /* * * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved * */ #ifndef __GLYPHDEFINITIONTABLES_H #define __GLYPHDEFINITIONTABLES_H /** * \file * \internal */ #include "LETypes.h" #include "OpenTypeTables.h" #include "ClassDefinitionTables.h" U_NAMESPACE_BEGIN typedef ClassDefinitionTable GlyphClassDefinitionTable; enum GlyphClassDefinitions { gcdNoGlyphClass = 0, gcdSimpleGlyph = 1, gcdLigatureGlyph = 2, gcdMarkGlyph = 3, gcdComponentGlyph = 4 }; struct AttachmentListTable { Offset coverageTableOffset; le_uint16 glyphCount; Offset attachPointTableOffsetArray[ANY_NUMBER]; }; struct AttachPointTable { le_uint16 pointCount; le_uint16 pointIndexArray[ANY_NUMBER]; }; struct LigatureCaretListTable { Offset coverageTableOffset; le_uint16 ligGlyphCount; Offset ligGlyphTableOffsetArray[ANY_NUMBER]; }; struct LigatureGlyphTable { le_uint16 caretCount; Offset caretValueTableOffsetArray[ANY_NUMBER]; }; struct CaretValueTable { le_uint16 caretValueFormat; }; struct CaretValueFormat1Table : CaretValueTable { le_int16 coordinate; }; struct CaretValueFormat2Table : CaretValueTable { le_uint16 caretValuePoint; }; struct CaretValueFormat3Table : CaretValueTable { le_int16 coordinate; Offset deviceTableOffset; }; typedef ClassDefinitionTable MarkAttachClassDefinitionTable; struct GlyphDefinitionTableHeader { fixed32 version; Offset glyphClassDefOffset; Offset attachListOffset; Offset ligCaretListOffset; Offset MarkAttachClassDefOffset; const GlyphClassDefinitionTable *getGlyphClassDefinitionTable() const; const AttachmentListTable *getAttachmentListTable()const ; const LigatureCaretListTable *getLigatureCaretListTable() const; const MarkAttachClassDefinitionTable *getMarkAttachClassDefinitionTable() const; }; U_NAMESPACE_END #endif
/* Conversion from and to BRF. Copyright (C) 2006-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Samuel Thibault <samuel.thibault@ens-lyon.org>, 2006. 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, see <http://www.gnu.org/licenses/>. */ #include <stdint.h> /* Get the conversion table. */ #define TABLES <brf.h> #define CHARSET_NAME "BRF//" #define HAS_HOLES 1 /* Not all 256 character are defined. */ #include <8bit-gap.c>
// license:BSD-3-Clause // copyright-holders:Vas Crabb #ifndef MAME_VIDEO_DOOYONG_H #define MAME_VIDEO_DOOYONG_H #pragma once #include "video/bufsprite.h" #include "tilemap.h" DECLARE_DEVICE_TYPE(DOOYONG_ROM_TILEMAP, dooyong_rom_tilemap_device) DECLARE_DEVICE_TYPE(RSHARK_ROM_TILEMAP, rshark_rom_tilemap_device) DECLARE_DEVICE_TYPE(DOOYONG_RAM_TILEMAP, dooyong_ram_tilemap_device) class dooyong_tilemap_device_base : public device_t { public: template <typename T> void set_gfxdecode_tag(T &&gfxdecode_tag) { m_gfxdecode.set_tag(std::forward<T>(gfxdecode_tag)); } void set_gfxnum(int gfxnum) { m_gfxnum = gfxnum; } void draw(screen_device &screen, bitmap_ind16 &dest, rectangle const &cliprect, u32 flags, u8 priority, u8 priority_mask = 0xff); void set_palette_bank(u16 bank); protected: dooyong_tilemap_device_base( machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock); gfx_element const &gfx() const { return *m_gfxdecode->gfx(m_gfxnum); } required_device<gfxdecode_device> m_gfxdecode; int m_gfxnum; tilemap_t *m_tilemap; u16 m_palette_bank; }; class dooyong_rom_tilemap_device : public dooyong_tilemap_device_base { public: template <typename T, typename U> dooyong_rom_tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&gfxdecode_tag, int gfxnum, U &&tilerom_tag, int tilerom_offset, int tilerom_length) : dooyong_rom_tilemap_device(mconfig, tag, owner, 0) { set_gfxdecode_tag(std::forward<T>(gfxdecode_tag)); set_gfxnum(gfxnum); set_tilerom_tag(std::forward<U>(tilerom_tag)); set_tilerom_offset(tilerom_offset); set_tilerom_length(tilerom_length); } dooyong_rom_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); template <typename U> void set_tilerom_tag(U &&tilerom_tag) { m_tilerom.set_tag(std::forward<U>(tilerom_tag)); } void set_tilerom_offset(int offset) { m_tilerom_offset = offset; } void set_tilerom_length(int length) { m_tilerom_length = length; } void set_transparent_pen(unsigned pen) { m_transparent_pen = pen; } typedef device_delegate<void (u16 attr, u32 &code, u32 &color)> dooyong_tmap_cb_delegate; template <typename... T> void set_tile_callback(T &&... args) { m_tmap_cb.set(std::forward<T>(args)...); } void ctrl_w(offs_t offset, u8 data); protected: dooyong_rom_tilemap_device( machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock); virtual void device_start() override; virtual TILE_GET_INFO_MEMBER(tile_info); tilemap_memory_index adjust_tile_index(tilemap_memory_index tile_index) const { return tile_index + ((unsigned(m_registers[1]) * 256U / gfx().width()) * m_rows); } int m_rows; private: required_region_ptr<u16> m_tilerom; dooyong_tmap_cb_delegate m_tmap_cb; int m_tilerom_offset; int m_tilerom_length; unsigned m_transparent_pen; u8 m_registers[0x10]; }; class rshark_rom_tilemap_device : public dooyong_rom_tilemap_device { public: template <typename T, typename U, typename V> rshark_rom_tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&gfxdecode_tag, int gfxnum, U &&tilerom_tag, int tilerom_offset, int tilerom_length, V &&colorrom_tag, int colorrom_offset, int colorrom_length) : rshark_rom_tilemap_device(mconfig, tag, owner, 0) { set_gfxdecode_tag(std::forward<T>(gfxdecode_tag)); set_gfxnum(gfxnum); set_tilerom_tag(std::forward<U>(tilerom_tag)); set_tilerom_offset(tilerom_offset); set_tilerom_length(tilerom_length); set_colorrom_tag(std::forward<V>(colorrom_tag)); set_colorrom_offset(colorrom_offset); set_colorrom_length(colorrom_length); } rshark_rom_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); template <typename V> void set_colorrom_tag(V &&colorrom_tag) { m_colorrom.set_tag(std::forward<V>(colorrom_tag)); } void set_colorrom_offset(int offset) { m_colorrom_offset = offset; } void set_colorrom_length(int length) { m_colorrom_length = length; } protected: virtual void device_start() override; virtual TILE_GET_INFO_MEMBER(tile_info) override; private: required_region_ptr<u8> m_colorrom; int m_colorrom_offset; int m_colorrom_length; }; class dooyong_ram_tilemap_device : public dooyong_tilemap_device_base { public: template <typename T> dooyong_ram_tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&gfxdecode_tag, int gfxnum) : dooyong_ram_tilemap_device(mconfig, tag, owner, 0) { set_gfxdecode_tag(std::forward<T>(gfxdecode_tag)); set_gfxnum(gfxnum); } dooyong_ram_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); u16 tileram_r(offs_t offset) { return m_tileram[offset & ((64U * 32U) - 1)]; } void tileram_w(offs_t offset, u16 data, u16 mem_mask = ~0); void set_scrolly(int value) { m_tilemap->set_scrolly(value); } protected: virtual void device_start() override; private: TILE_GET_INFO_MEMBER(tile_info); std::unique_ptr<u16[]> m_tileram; }; #endif // MAME_VIDEO_DOOYONG_H
/* * <asm/smplock.h> * * Default SMP lock implementation */ #include <linux/interrupt.h> #include <linux/spinlock.h> extern spinlock_t kernel_flag; #define kernel_locked() spin_is_locked(&kernel_flag) /* * Release global kernel lock and global interrupt lock */ #define release_kernel_lock(task, cpu) \ do { \ if (task->lock_depth >= 0) \ spin_unlock(&kernel_flag); \ release_irqlock(cpu); \ __sti(); \ } while (0) /* * Re-acquire the kernel lock */ #define reacquire_kernel_lock(task) \ do { \ if (task->lock_depth >= 0) \ spin_lock(&kernel_flag); \ } while (0) /* * Getting the big kernel lock. * * This cannot happen asynchronously, * so we only need to worry about other * CPU's. */ extern __inline__ void lock_kernel(void) { if (!++current->lock_depth) spin_lock(&kernel_flag); } extern __inline__ void unlock_kernel(void) { if (--current->lock_depth < 0) spin_unlock(&kernel_flag); }
//===- SeparateConstOffsetFromGEP.h ---------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef LLVM_TRANSFORMS_SCALAR_SEPARATECONSTOFFSETFROMGEP_H #define LLVM_TRANSFORMS_SCALAR_SEPARATECONSTOFFSETFROMGEP_H #include "llvm/IR/PassManager.h" namespace llvm { class SeparateConstOffsetFromGEPPass : public PassInfoMixin<SeparateConstOffsetFromGEPPass> { bool LowerGEP; public: SeparateConstOffsetFromGEPPass(bool LowerGEP = false) : LowerGEP(LowerGEP) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &); }; } // end namespace llvm #endif // LLVM_TRANSFORMS_SCALAR_SEPARATECONSTOFFSETFROMGEP_H
//===--- ParentMap.h - Mappings from Stmts to their Parents -----*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file defines the ParentMap class. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_AST_PARENTMAP_H #define LLVM_CLANG_AST_PARENTMAP_H namespace clang { class Stmt; class Expr; class ParentMap { void* Impl; public: ParentMap(Stmt* ASTRoot); ~ParentMap(); /// Adds and/or updates the parent/child-relations of the complete /// stmt tree of S. All children of S including indirect descendants are /// visited and updated or inserted but not the parents of S. void addStmt(Stmt* S); /// Manually sets the parent of \p S to \p Parent. /// /// If \p S is already in the map, this method will update the mapping. void setParent(const Stmt *S, const Stmt *Parent); Stmt *getParent(Stmt*) const; Stmt *getParentIgnoreParens(Stmt *) const; Stmt *getParentIgnoreParenCasts(Stmt *) const; Stmt *getParentIgnoreParenImpCasts(Stmt *) const; Stmt *getOuterParenParent(Stmt *) const; const Stmt *getParent(const Stmt* S) const { return getParent(const_cast<Stmt*>(S)); } const Stmt *getParentIgnoreParens(const Stmt *S) const { return getParentIgnoreParens(const_cast<Stmt*>(S)); } const Stmt *getParentIgnoreParenCasts(const Stmt *S) const { return getParentIgnoreParenCasts(const_cast<Stmt*>(S)); } bool hasParent(const Stmt *S) const { return getParent(S) != nullptr; } bool isConsumedExpr(Expr *E) const; bool isConsumedExpr(const Expr *E) const { return isConsumedExpr(const_cast<Expr*>(E)); } }; } // end clang namespace #endif
/*************************************************************************** * Copyright (c) 2013 Jürgen Riegel <FreeCAD@juergen-riegel.net> * * * * This file is part of the FreeCAD CAx development system. * * * * 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; see the file COPYING.LIB. If not, * * write to the Free Software Foundation, Inc., 59 Temple Place, * * Suite 330, Boston, MA 02111-1307, USA * * * ***************************************************************************/ #ifndef FEMGUI_TaskTetParameter_H #define FEMGUI_TaskTetParameter_H #include <Gui/TaskView/TaskView.h> class Ui_TaskTetParameter; class SoEventCallback; namespace Base { class Polygon2d; } namespace App { class Property; } namespace Gui { class ViewProvider; class ViewVolumeProjection; } namespace Fem{ class FemMeshShapeNetgenObject; } namespace FemGui { class ViewProviderFemMeshShapeNetgen; class TaskTetParameter : public Gui::TaskView::TaskBox { Q_OBJECT public: TaskTetParameter(Fem::FemMeshShapeNetgenObject *pcObject,QWidget *parent = 0); ~TaskTetParameter(); void setInfo(void); bool touched; private Q_SLOTS: void SwitchMethod(int Value); void maxSizeValueChanged(double Value); void setQuadric(int s); void setGrowthRate(double v); void setSegsPerEdge(int v); void setSegsPerRadius(int v); void setOptimize(int v); protected: Fem::FemMeshShapeNetgenObject *pcObject; private: QWidget* proxy; Ui_TaskTetParameter* ui; }; } //namespace FemGui #endif // FEMGUI_TaskTetParameter_H
/***************************************************************************** * Project: RooFit * * Package: RooFitCore * * File: $Id: RooHistError.h,v 1.14 2007/05/11 09:11:30 verkerke Exp $ * Authors: * * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu * * DK, David Kirkby, UC Irvine, dkirkby@uci.edu * * * * Copyright (c) 2000-2005, Regents of the University of California * * and Stanford University. All rights reserved. * * * * Redistribution and use in source and binary forms, * * with or without modification, are permitted according to the terms * * listed in LICENSE (http://roofit.sourceforge.net/license.txt) * *****************************************************************************/ #ifndef ROO_HIST_ERROR #define ROO_HIST_ERROR #include "Rtypes.h" #include "RooNumber.h" #include "RooAbsFunc.h" #include <cmath> #include <iostream> class RooHistError { public: static const RooHistError &instance(); virtual ~RooHistError() {} ; Bool_t getPoissonInterval(Int_t n, Double_t &mu1, Double_t &mu2, Double_t nSigma= 1) const; Bool_t getBinomialIntervalAsym(Int_t n, Int_t m, Double_t &a1, Double_t &a2, Double_t nSigma= 1) const; Bool_t getBinomialIntervalEff(Int_t n, Int_t m, Double_t &a1, Double_t &a2, Double_t nSigma= 1) const; Bool_t getInterval(const RooAbsFunc *Qu, const RooAbsFunc *Ql, Double_t pointEstimate, Double_t stepSize, Double_t &lo, Double_t &hi, Double_t nSigma) const; static RooAbsFunc *createPoissonSum(Int_t n) ; static RooAbsFunc *createBinomialSum(Int_t n, Int_t m, Bool_t eff) ; private: Bool_t getPoissonIntervalCalc(Int_t n, Double_t &mu1, Double_t &mu2, Double_t nSigma= 1) const; Double_t _poissonLoLUT[1000] ; Double_t _poissonHiLUT[1000] ; RooHistError(); Double_t seek(const RooAbsFunc &f, Double_t startAt, Double_t step, Double_t value) const; // ----------------------------------------------------------- // Define a 1-dim RooAbsFunc of mu that evaluates the sum: // // Q(n|mu) = Sum_{k=0}^{n} P(k|mu) // // where P(n|mu) = exp(-mu) mu**n / n! is the Poisson PDF. // ----------------------------------------------------------- class PoissonSum : public RooAbsFunc { public: inline PoissonSum(Int_t n) : RooAbsFunc(1), _n(n) { } inline Double_t operator()(const Double_t xvec[]) const { Double_t mu(xvec[0]),result(1),factorial(1); for(Int_t k= 1; k <= _n; k++) { factorial*= k; result+= pow(mu,k)/factorial; } return exp(-mu)*result; }; inline Double_t getMinLimit(UInt_t /*index*/) const { return 0; } inline Double_t getMaxLimit(UInt_t /*index*/) const { return RooNumber::infinity() ; } private: Int_t _n; }; // ----------------------------------------------------------- // Define a 1-dim RooAbsFunc of a that evaluates the sum: // // Q(n|n+m,a) = Sum_{k=0}^{n} B(k|n+m,a) // // where B(n|n+m,a) = (n+m)!/(n!m!) ((1+a)/2)**n ((1-a)/2)**m // is the Binomial PDF. // ----------------------------------------------------------- class BinomialSumAsym : public RooAbsFunc { public: BinomialSumAsym(Int_t n, Int_t m) : RooAbsFunc(1), _n1(n), _N1(n+m) { } inline Double_t operator()(const Double_t xvec[]) const { Double_t p1(0.5*(1+xvec[0])),p2(1-p1),result(0),fact1(1),fact2(1); for(Int_t k= 0; k <= _n1; k++) { if(k > 0) { fact2*= k; fact1*= _N1-k+1; } result+= fact1/fact2*pow(p1,k)*pow(p2,_N1-k); } return result; }; inline Double_t getMinLimit(UInt_t /*index*/) const { return -1; } inline Double_t getMaxLimit(UInt_t /*index*/) const { return +1; } private: Int_t _n1 ; // WVE Solaris CC5 doesn't want _n or _N here (likely compiler bug) Int_t _N1 ; } ; // ----------------------------------------------------------- // Define a 1-dim RooAbsFunc of a that evaluates the sum: // // Q(n|n+m,a) = Sum_{k=0}^{n} B(k|n+m,a) // // where B(n|n+m,a) = (n+m)!/(n!m!) ((1+a)/2)**n ((1-a)/2)**m // is the Binomial PDF. // ----------------------------------------------------------- class BinomialSumEff : public RooAbsFunc { public: BinomialSumEff(Int_t n, Int_t m) : RooAbsFunc(1), _n1(n), _N1(n+m) { } inline Double_t operator()(const Double_t xvec[]) const { Double_t p1(xvec[0]),p2(1-p1),result(0),fact1(1),fact2(1); for(Int_t k= 0; k <= _n1; k++) { if(k > 0) { fact2*= k; fact1*= _N1-k+1; } result+= fact1/fact2*pow(p1,k)*pow(p2,_N1-k); } return result; }; inline Double_t getMinLimit(UInt_t /*index*/) const { return 0; } inline Double_t getMaxLimit(UInt_t /*index*/) const { return +1; } private: Int_t _n1 ; // WVE Solaris CC5 doesn't want _n or _N here (likely compiler bug) Int_t _N1 ; } ; ClassDef(RooHistError,1) // Utility class for calculating histogram errors }; #endif
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. 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 TENSORFLOW_CORE_COMMON_RUNTIME_GPU_GPU_UTIL_H_ #define TENSORFLOW_CORE_COMMON_RUNTIME_GPU_GPU_UTIL_H_ #include "tensorflow/core/common_runtime/device.h" #include "tensorflow/core/common_runtime/dma_helper.h" #include "tensorflow/core/framework/tensor.h" #include "tensorflow/core/lib/core/status.h" #include "tensorflow/core/platform/stream_executor.h" namespace tensorflow { class RecvTensorResponse; class TensorProto; class GPUUtil { public: // "tensor" is GPU-local. "dev" is the hosting GPU. // "device_context" should be the context of the GPU "_Send" op // which provides the Tensor. // Sets all necessary fields of "proto" by transferring value // bytes from GPU to CPU RAM. "is_dead" indicates that the // tensor is dead with an uninit value. static void SetProtoFromGPU(const Tensor& tensor, Device* dev, const DeviceContext* device_context, TensorProto* proto, bool is_dead, StatusCallback done); // Copies the data in 'gpu_tensor' into 'cpu_tensor'. // 'gpu_tensor''s backing memory must be on 'gpu_device' and // 'cpu_tensor' must be allocated to be of the same size as // 'gpu_tensor'. Synchronous: may block. static void CopyGPUTensorToCPU(Device* gpu_device, const DeviceContext* device_context, const Tensor* gpu_tensor, Tensor* cpu_tensor, StatusCallback done); // Blocks until all operations queued on the stream associated with // "gpu_device" at the time of the call have completed. Returns any // error pending on the stream at completion. static Status Sync(Device* gpu_device); // Blocks until all operations queued on all streams associated with the // corresponding GPU device at the time of call have completed. // Returns any error pending on the stream at completion. static Status SyncAll(Device* gpu_device); // For debugging purpose, given a "device" and a "tensor" allocated // on the device, return a string printing each byte in the tensor // (up to a limit). "device" can be either a CPU or a GPU device. static string MemoryDebugString(const Device* device, Tensor* tensor); // Map a Tensor as a DeviceMemory object wrapping the given typed // buffer. // // NOTE: will be removed soon, see StreamExecutorUtil::AsDeviceMemory // instead. template <typename T> static se::DeviceMemory<T> AsDeviceMemory(const Tensor& t) { T* ptr = reinterpret_cast<T*>(const_cast<void*>(DMAHelper::base(&t))); return se::DeviceMemory<T>(se::DeviceMemoryBase(ptr, t.TotalBytes())); } // Computes a checksum over the contents of "tensor", which is allocated // on "gpu_device". static uint64 Checksum(Device* gpu_device, const DeviceContext* device_context, const Tensor& tensor); // Computes a checksum over the contents of "tensor", which is allocated // in local CPU RAM. static uint64 Checksum(const Tensor& tensor); static void CopyCPUTensorToGPU(const Tensor* cpu_tensor, const DeviceContext* device_context, Device* gpu_device, Tensor* gpu_tensor, StatusCallback done); static void DeviceToDeviceCopy( DeviceContext* send_dev_context, DeviceContext* recv_dev_context, Device* src, Device* dst, AllocatorAttributes src_alloc_attr, AllocatorAttributes dst_alloc_attr, const Tensor* input, Tensor* output, int dev_to_dev_stream_index, StatusCallback done); // Deep-copying of GPU tensor on the same device. // 'src_gpu_tensor''s and 'dst_gpu_tensor''s backing memory must be on // 'gpu_device' and 'dst_cpu_tensor' must be allocated to be of the same // size as 'src_gpu_tensor'. static void CopyGPUTensorToSameGPU(Device* gpu_device, const DeviceContext* device_context, const Tensor* src_gpu_tensor, Tensor* dst_gpu_tensor, StatusCallback done); }; } // namespace tensorflow #endif // TENSORFLOW_CORE_COMMON_RUNTIME_GPU_GPU_UTIL_H_
/* mbed Microcontroller Library * Copyright (c) 2015-2017 Nuvoton * * 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_CMSIS_NVIC_H #define MBED_CMSIS_NVIC_H #include "cmsis.h" #define NVIC_USER_IRQ_OFFSET 16 #define NVIC_USER_IRQ_NUMBER 32 #define NVIC_NUM_VECTORS (NVIC_USER_IRQ_OFFSET + NVIC_USER_IRQ_NUMBER) /* Avoid optimization error on e.g. ARMC6 * * If NVIC_FLASH_VECTOR_ADDRESS is directly defined as 0, the compiler would see it * as NULL, and deliberately optimize NVIC_GetVector to an undefined instruction - * trapping because we're accessing an array at NULL. * * A suggested solution by Arm is to define NVIC_FLASH_VECTOR_ADDRESS as a symbol * instead to avoid such unwanted optimization. */ #if defined(__ARMCC_VERSION) extern uint32_t Image$$ER_IROM1$$Base; #define NVIC_FLASH_VECTOR_ADDRESS ((uint32_t) &Image$$ER_IROM1$$Base) #elif defined(__ICCARM__) #pragma section = "ROMVEC" #define NVIC_FLASH_VECTOR_ADDRESS ((uint32_t) __section_begin("ROMVEC")) #elif defined(__GNUC__) extern uint32_t __vector_table; #define NVIC_FLASH_VECTOR_ADDRESS ((uint32_t) &__vector_table) #endif #ifdef __cplusplus extern "C" { #endif /** Set the ISR for IRQn * * Sets an Interrupt Service Routine vector for IRQn; if the feature is available, the vector table is relocated to SRAM * the first time this function is called * @param[in] IRQn The Interrupt Request number for which a vector will be registered * @param[in] vector The ISR vector to register for IRQn */ void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector); /** Get the ISR registered for IRQn * * Reads the Interrupt Service Routine currently registered for IRQn * @param[in] IRQn The Interrupt Request number the vector of which will be read * @return Returns the ISR registered for IRQn */ uint32_t NVIC_GetVector(IRQn_Type IRQn); #ifdef __cplusplus } #endif #endif
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _ASM_X86_UNISTD_H #define _ASM_X86_UNISTD_H /* * x32 syscall flag bit. Some user programs expect syscall NR macros * and __X32_SYSCALL_BIT to have type int, even though syscall numbers * are, for practical purposes, unsigned long. * * Fortunately, expressions like (nr & ~__X32_SYSCALL_BIT) do the right * thing regardless. */ #define __X32_SYSCALL_BIT 0x40000000 # ifdef __i386__ # include <asm/unistd_32.h> # elif defined(__ILP32__) # include <asm/unistd_x32.h> # else # include <asm/unistd_64.h> # endif #endif /* _ASM_X86_UNISTD_H */
/* * copyright (c) 2003 Fabrice Bellard * * 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 */ #ifndef AVUTIL_VERSION_H #define AVUTIL_VERSION_H #include "macros.h" /** * @addtogroup version_utils * * Useful to check and match library version in order to maintain * backward compatibility. * * @{ */ #define AV_VERSION_INT(a, b, c) ((a)<<16 | (b)<<8 | (c)) #define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c) /** * @} */ /** * @file * @ingroup lavu * Libavutil version macros */ /** * @defgroup lavu_ver Version and Build diagnostics * * Macros and function useful to check at compiletime and at runtime * which version of libavutil is in use. * * @{ */ #define LIBAVUTIL_VERSION_MAJOR 54 #define LIBAVUTIL_VERSION_MINOR 20 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \ LIBAVUTIL_VERSION_MICRO) #define LIBAVUTIL_VERSION AV_VERSION(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \ LIBAVUTIL_VERSION_MICRO) #define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT #define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION) /** * @} * * @defgroup depr_guards Deprecation guards * FF_API_* defines may be placed below to indicate public API that will be * dropped at a future version bump. The defines themselves are not part of * the public API and may change, break or disappear at any time. * * @{ */ #ifndef FF_API_OLD_AVOPTIONS #define FF_API_OLD_AVOPTIONS (LIBAVUTIL_VERSION_MAJOR < 55) #endif #ifndef FF_API_PIX_FMT #define FF_API_PIX_FMT (LIBAVUTIL_VERSION_MAJOR < 55) #endif #ifndef FF_API_CONTEXT_SIZE #define FF_API_CONTEXT_SIZE (LIBAVUTIL_VERSION_MAJOR < 55) #endif #ifndef FF_API_PIX_FMT_DESC #define FF_API_PIX_FMT_DESC (LIBAVUTIL_VERSION_MAJOR < 55) #endif #ifndef FF_API_AV_REVERSE #define FF_API_AV_REVERSE (LIBAVUTIL_VERSION_MAJOR < 55) #endif #ifndef FF_API_AUDIOCONVERT #define FF_API_AUDIOCONVERT (LIBAVUTIL_VERSION_MAJOR < 55) #endif #ifndef FF_API_CPU_FLAG_MMX2 #define FF_API_CPU_FLAG_MMX2 (LIBAVUTIL_VERSION_MAJOR < 55) #endif #ifndef FF_API_LLS_PRIVATE #define FF_API_LLS_PRIVATE (LIBAVUTIL_VERSION_MAJOR < 55) #endif #ifndef FF_API_AVFRAME_LAVC #define FF_API_AVFRAME_LAVC (LIBAVUTIL_VERSION_MAJOR < 55) #endif #ifndef FF_API_VDPAU #define FF_API_VDPAU (LIBAVUTIL_VERSION_MAJOR < 55) #endif #ifndef FF_API_GET_CHANNEL_LAYOUT_COMPAT #define FF_API_GET_CHANNEL_LAYOUT_COMPAT (LIBAVUTIL_VERSION_MAJOR < 55) #endif #ifndef FF_API_XVMC #define FF_API_XVMC (LIBAVUTIL_VERSION_MAJOR < 55) #endif #ifndef FF_API_OPT_TYPE_METADATA #define FF_API_OPT_TYPE_METADATA (LIBAVUTIL_VERSION_MAJOR < 55) #endif #ifndef FF_CONST_AVUTIL55 #if LIBAVUTIL_VERSION_MAJOR >= 55 #define FF_CONST_AVUTIL55 const #else #define FF_CONST_AVUTIL55 #endif #endif /** * @} */ #endif /* AVUTIL_VERSION_H */
// 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 REMOTING_PROTOCOL_CLIPBOARD_FILTER_H_ #define REMOTING_PROTOCOL_CLIPBOARD_FILTER_H_ #include "base/compiler_specific.h" #include "base/macros.h" #include "remoting/protocol/clipboard_stub.h" namespace remoting { namespace protocol { // Forwards clipboard events to |clipboard_stub|, if configured. Event // forwarding may also be disabled independently of the configured // |clipboard_stub|. ClipboardFilters initially have event forwarding enabled. class ClipboardFilter : public ClipboardStub { public: ClipboardFilter(); explicit ClipboardFilter(ClipboardStub* clipboard_stub); ~ClipboardFilter() override; // Set the ClipboardStub that events will be forwarded to. void set_clipboard_stub(ClipboardStub* clipboard_stub); // Enable/disable forwarding of clipboard events to the ClipboardStub. void set_enabled(bool enabled) { enabled_ = enabled; } bool enabled() const { return enabled_; } // ClipboardStub interface. void InjectClipboardEvent(const ClipboardEvent& event) override; private: ClipboardStub* clipboard_stub_; bool enabled_; DISALLOW_COPY_AND_ASSIGN(ClipboardFilter); }; } // namespace protocol } // namespace remoting #endif // REMOTING_PROTOCOL_CLIPBOARD_FILTER_H_
// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * Copyright (C) 2009-2016, International Business Machines Corporation, * * Google, and others. All Rights Reserved. * ******************************************************************************* */ #ifndef __TMUNIT_H__ #define __TMUNIT_H__ /** * \file * \brief C++ API: time unit object */ #include "unicode/measunit.h" #if !UCONFIG_NO_FORMATTING U_NAMESPACE_BEGIN /** * Measurement unit for time units. * @see TimeUnitAmount * @see TimeUnit * @stable ICU 4.2 */ class U_I18N_API TimeUnit: public MeasureUnit { public: /** * Constants for all the time units we supported. * @stable ICU 4.2 */ enum UTimeUnitFields { UTIMEUNIT_YEAR, UTIMEUNIT_MONTH, UTIMEUNIT_DAY, UTIMEUNIT_WEEK, UTIMEUNIT_HOUR, UTIMEUNIT_MINUTE, UTIMEUNIT_SECOND, #ifndef U_HIDE_DEPRECATED_API /** * One more than the highest normal UTimeUnitFields value. * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UTIMEUNIT_FIELD_COUNT #endif // U_HIDE_DEPRECATED_API }; /** * Create Instance. * @param timeUnitField time unit field based on which the instance * is created. * @param status input-output error code. * If the timeUnitField is invalid, * then this will be set to U_ILLEGAL_ARGUMENT_ERROR. * @return a TimeUnit instance * @stable ICU 4.2 */ static TimeUnit* U_EXPORT2 createInstance(UTimeUnitFields timeUnitField, UErrorCode& status); /** * Override clone. * @stable ICU 4.2 */ virtual UObject* clone() const; /** * Copy operator. * @stable ICU 4.2 */ TimeUnit(const TimeUnit& other); /** * Assignment operator. * @stable ICU 4.2 */ TimeUnit& operator=(const TimeUnit& other); /** * Returns a unique class ID for this object POLYMORPHICALLY. * This method implements a simple form of RTTI used by ICU. * @return The class ID for this object. All objects of a given * class have the same class ID. Objects of other classes have * different class IDs. * @stable ICU 4.2 */ virtual UClassID getDynamicClassID() const; /** * Returns the class ID for this class. This is used to compare to * the return value of getDynamicClassID(). * @return The class ID for all objects of this class. * @stable ICU 4.2 */ static UClassID U_EXPORT2 getStaticClassID(); /** * Get time unit field. * @return time unit field. * @stable ICU 4.2 */ UTimeUnitFields getTimeUnitField() const; /** * Destructor. * @stable ICU 4.2 */ virtual ~TimeUnit(); private: UTimeUnitFields fTimeUnitField; /** * Constructor * @internal (private) */ TimeUnit(UTimeUnitFields timeUnitField); }; U_NAMESPACE_END #endif /* #if !UCONFIG_NO_FORMATTING */ #endif // __TMUNIT_H__ //eof //
// // XAlignPattern.h // main // // Created by QFish on 11/30/13. // Copyright (c) 2013 net.qfish. All rights reserved. // #import <Foundation/Foundation.h> #import "blade.h" typedef enum XAlignPosition{ XAlignPositionFisrt = -1, XAlignPositionLast, } XAlignPosition; typedef enum XAlignPaddingMode { XAlignPaddingModeNone = 0, XAlignPaddingModeMin, XAlignPaddingModeMax, } XAlignPaddingMode; typedef NSString * (^XAlignPatternControlBlockU)(NSUInteger padding); typedef NSString * (^XAlignPatternControlBlockUS)(NSUInteger padding, NSString * match); @interface XAlignPadding : NSObject + (NSString *)stringWithFormat:(NSString *)format; @end @interface XAlignPattern : NSObject @property (nonatomic, assign) BOOL isOptional; @property (nonatomic, retain) NSString * string; @property (nonatomic, assign) XAlignPosition position; @property (nonatomic, assign) XAlignPaddingMode headMode; @property (nonatomic, assign) XAlignPaddingMode matchMode; @property (nonatomic, assign) XAlignPaddingMode tailMode; @property (nonatomic, copy) XAlignPatternControlBlockUS control; @end @interface XAlignPatternManager : NSObject AS_SINGLETON( XAlignPatternManager ); @property (nonatomic, strong) NSMutableDictionary * specifiers; + (void)setupWithRawArray:(NSArray *)array; + (NSArray *)patternGroupsWithContentsOfFile:(NSString *)name; + (NSArray *)patternGroupsWithRawArray:(NSArray *)array; + (NSArray *)patternGroupMatchWithString:(NSString *)string; + (NSArray *)patternGroupWithDictinary:(NSDictionary *)dictionary; @end
// Copyright (c) 2015-2017 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_ZMQ_ZMQPUBLISHNOTIFIER_H #define BITCOIN_ZMQ_ZMQPUBLISHNOTIFIER_H #include <zmq/zmqabstractnotifier.h> class CBlockIndex; class CZMQAbstractPublishNotifier : public CZMQAbstractNotifier { private: uint32_t nSequence; //!< upcounting per message sequence number public: /* send zmq multipart message parts: * command * data * message sequence number */ bool SendMessage(const char *command, const void* data, size_t size); bool Initialize(void *pcontext) override; void Shutdown() override; }; class CZMQPublishHashBlockNotifier : public CZMQAbstractPublishNotifier { public: bool NotifyBlock(const CBlockIndex *pindex) override; }; class CZMQPublishHashTransactionNotifier : public CZMQAbstractPublishNotifier { public: bool NotifyTransaction(const CTransaction &transaction) override; }; class CZMQPublishRawBlockNotifier : public CZMQAbstractPublishNotifier { public: bool NotifyBlock(const CBlockIndex *pindex) override; }; class CZMQPublishRawTransactionNotifier : public CZMQAbstractPublishNotifier { public: bool NotifyTransaction(const CTransaction &transaction) override; }; #endif // BITCOIN_ZMQ_ZMQPUBLISHNOTIFIER_H
/* Copyright 1993, 1998 The Open Group 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 copyright notice and this permission notice appear in supporting documentation. 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 OPEN GROUP 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. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* $XFree86$ */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #ifndef MIVALIDATE_H #define MIVALIDATE_H #include "regionstr.h" typedef union _Validate { struct BeforeValidate { DDXPointRec oldAbsCorner; /* old window position */ RegionPtr borderVisible; /* visible region of border, */ /* non-null when size changes */ Bool resized; /* unclipped winSize has changed - */ /* don't call SaveDoomedAreas */ } before; struct AfterValidate { RegionRec exposed; /* exposed regions, absolute pos */ RegionRec borderExposed; } after; } ValidateRec; #endif /* MIVALIDATE_H */
#include <math.h> #include <stdio.h> #include <errno.h> #include "math_private.h" long double __kernel_sinl (long double x, long double y, int iy) { fputs ("__kernel_sinl not implemented\n", stderr); __set_errno (ENOSYS); return 0.0; } stub_warning (__kernel_sinl) #include <stub-tag.h>
/* * Copyright (c) 2004 Hewlett-Packard Development Company, L.P. * * 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. */ /* Definitions for architectures on which loads of given type are */ /* atomic (either for suitably aligned data only or for any legal */ /* alignment). */ AO_INLINE unsigned AO_int_load(const volatile unsigned *addr) { # ifdef AO_ACCESS_int_CHECK_ALIGNED assert(((size_t)addr & (sizeof(*addr) - 1)) == 0); # endif /* Cast away the volatile for architectures like IA64 where */ /* volatile adds barrier (fence) semantics. */ return *(const unsigned *)addr; } #define AO_HAVE_int_load
#ifndef _LMUSEFLG_H #define _LMUSEFLG_H #if __GNUC__ >=3 #pragma GCC system_header #endif #define USE_NOFORCE 0 #define USE_FORCE 1 #define USE_LOTS_OF_FORCE 2 #endif
/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. Copyright (C) 2013 - 2015, OpenJK contributors This file is part of the OpenJK source code. OpenJK 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, see <http://www.gnu.org/licenses/>. =========================================================================== */ // Filename: statindex.h // // accessed from both server and game modules #ifndef STATINDEX_H #define STATINDEX_H // player_state->stats[] indexes typedef enum { STAT_HEALTH, STAT_ITEMS, STAT_WEAPONS, // 16 bit fields STAT_ARMOR, STAT_DEAD_YAW, // look this direction when dead (FIXME: get rid of?) STAT_CLIENTS_READY, // bit mask of clients wishing to exit the intermission (FIXME: configstring?) STAT_MAX_HEALTH // health / armor limit, changable by handicap } statIndex_t; #endif // #ifndef STATINDEX_H /////////////////////// eof /////////////////////
/* * Copyright (C) 2013 Spreadtrum Communications Inc. * * 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. * ************************************************* * Automatically generated C header: do not edit * ************************************************* */ #ifndef __REGS_MM_CLK_H__ #define __REGS_MM_CLK_H__ #ifndef __SCI_GLB_REGS_H__ #error "Don't include this file directly, include <mach/sci_glb_regs.h>" #endif #define REGS_MM_CLK /* registers definitions for controller REGS_MM_CLK */ #define REG_MM_CLK_MM_AHB_CFG SCI_ADDR(REGS_MM_CLK_BASE, 0x0020) #define REG_MM_CLK_SENSOR_CFG SCI_ADDR(REGS_MM_CLK_BASE, 0x0024) #define REG_MM_CLK_CCIR_CFG SCI_ADDR(REGS_MM_CLK_BASE, 0x0028) #define REG_MM_CLK_DCAM_CFG SCI_ADDR(REGS_MM_CLK_BASE, 0x002c) #define REG_MM_CLK_VSP_CFG SCI_ADDR(REGS_MM_CLK_BASE, 0x0030) #define REG_MM_CLK_ISP_CFG SCI_ADDR(REGS_MM_CLK_BASE, 0x0034) #define REG_MM_CLK_JPG_CFG SCI_ADDR(REGS_MM_CLK_BASE, 0x0038) /* vars definitions for controller REGS_MM_CLK */ #endif /* __REGS_MM_CLK_H__ */
// Copyright 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 CC_RESOURCES_RESOURCE_UPDATE_CONTROLLER_H_ #define CC_RESOURCES_RESOURCE_UPDATE_CONTROLLER_H_ #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "cc/base/cc_export.h" #include "cc/resources/resource_update_queue.h" namespace base { class SingleThreadTaskRunner; } namespace cc { class ResourceProvider; class ResourceUpdateControllerClient { public: virtual void ReadyToFinalizeTextureUpdates() = 0; protected: virtual ~ResourceUpdateControllerClient() {} }; class CC_EXPORT ResourceUpdateController { public: static scoped_ptr<ResourceUpdateController> Create( ResourceUpdateControllerClient* client, base::SingleThreadTaskRunner* task_runner, scoped_ptr<ResourceUpdateQueue> queue, ResourceProvider* resource_provider) { return make_scoped_ptr(new ResourceUpdateController( client, task_runner, queue.Pass(), resource_provider)); } static size_t MaxPartialTextureUpdates(); virtual ~ResourceUpdateController(); // Discard uploads to textures that were evicted on the impl thread. void DiscardUploadsToEvictedResources(); void PerformMoreUpdates(base::TimeTicks time_limit); void Finalize(); // Virtual for testing. virtual base::TimeTicks Now() const; virtual base::TimeDelta UpdateMoreTexturesTime() const; virtual size_t UpdateMoreTexturesSize() const; protected: ResourceUpdateController(ResourceUpdateControllerClient* client, base::SingleThreadTaskRunner* task_runner, scoped_ptr<ResourceUpdateQueue> queue, ResourceProvider* resource_provider); private: static size_t MaxFullUpdatesPerTick(ResourceProvider* resource_provider); size_t MaxBlockingUpdates() const; base::TimeDelta PendingUpdateTime() const; void UpdateTexture(ResourceUpdate update); // This returns true when there were textures left to update. bool UpdateMoreTexturesIfEnoughTimeRemaining(); void UpdateMoreTexturesNow(); void OnTimerFired(); ResourceUpdateControllerClient* client_; scoped_ptr<ResourceUpdateQueue> queue_; bool contents_textures_purged_; ResourceProvider* resource_provider_; base::TimeTicks time_limit_; size_t texture_updates_per_tick_; bool first_update_attempt_; base::SingleThreadTaskRunner* task_runner_; base::WeakPtrFactory<ResourceUpdateController> weak_factory_; bool task_posted_; DISALLOW_COPY_AND_ASSIGN(ResourceUpdateController); }; } // namespace cc #endif // CC_RESOURCES_RESOURCE_UPDATE_CONTROLLER_H_
// 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 WEBKIT_BLOB_FILE_STREAM_READER_H_ #define WEBKIT_BLOB_FILE_STREAM_READER_H_ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "net/base/completion_callback.h" #include "webkit/browser/webkit_storage_browser_export.h" namespace base { class FilePath; class TaskRunner; class Time; } namespace net { class IOBuffer; } namespace fileapi { class FileSystemContext; class FileSystemURL; } namespace webkit_blob { // A generic interface for reading a file-like object. class FileStreamReader { public: // Creates a new FileReader for a local file |file_path|. // |initial_offset| specifies the offset in the file where the first read // should start. If the given offset is out of the file range any // read operation may error out with net::ERR_REQUEST_RANGE_NOT_SATISFIABLE. // |expected_modification_time| specifies the expected last modification // If the value is non-null, the reader will check the underlying file's // actual modification time to see if the file has been modified, and if // it does any succeeding read operations should fail with // ERR_UPLOAD_FILE_CHANGED error. WEBKIT_STORAGE_BROWSER_EXPORT static FileStreamReader* CreateForLocalFile(base::TaskRunner* task_runner, const base::FilePath& file_path, int64 initial_offset, const base::Time& expected_modification_time); // Creates a new reader for a filesystem URL |url| form |initial_offset|. // |expected_modification_time| specifies the expected last modification if // the value is non-null, the reader will check the underlying file's actual // modification time to see if the file has been modified, and if it does any // succeeding read operations should fail with ERR_UPLOAD_FILE_CHANGED error. WEBKIT_STORAGE_BROWSER_EXPORT static FileStreamReader* CreateForFileSystemFile(fileapi::FileSystemContext* context, const fileapi::FileSystemURL& url, int64 initial_offset, const base::Time& expected_modification_time); // It is valid to delete the reader at any time. If the stream is deleted // while it has a pending read, its callback will not be called. virtual ~FileStreamReader() {} // Reads from the current cursor position asynchronously. // // Up to buf_len bytes will be copied into buf. (In other words, partial // reads are allowed.) Returns the number of bytes copied, 0 if at // end-of-file, or an error code if the operation could not be performed. // If the read could not complete synchronously, then ERR_IO_PENDING is // returned, and the callback will be run on the thread where Read() // was called, when the read has completed. // // It is invalid to call Read while there is an in-flight Read operation. // // If the stream is deleted while it has an in-flight Read operation // |callback| will not be called. virtual int Read(net::IOBuffer* buf, int buf_len, const net::CompletionCallback& callback) = 0; // Returns the length of the file if it could successfully retrieve the // file info *and* its last modification time equals to // expected modification time (rv >= 0 cases). // Otherwise, a negative error code is returned (rv < 0 cases). // If the stream is deleted while it has an in-flight GetLength operation // |callback| will not be called. // Note that the return type is int64 to return a larger file's size (a file // larger than 2G) but an error code should fit in the int range (may be // smaller than int64 range). virtual int64 GetLength(const net::Int64CompletionCallback& callback) = 0; }; } // namespace webkit_blob #endif // WEBKIT_BLOB_FILE_STREAM_READER_H_
/* * This file is part of Cleanflight. * * Cleanflight 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. * * Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #define TARGET_BOARD_IDENTIFIER "EUF1" #define LED0_GPIO GPIOB #define LED0_PIN Pin_3 // PB3 (LED) #define LED0_PERIPHERAL RCC_APB2Periph_GPIOB #define LED1_GPIO GPIOB #define LED1_PIN Pin_4 // PB4 (LED) #define LED1_PERIPHERAL RCC_APB2Periph_GPIOB #define INVERTER_PIN Pin_2 // PB2 (BOOT1) abused as inverter select GPIO #define INVERTER_GPIO GPIOB #define INVERTER_PERIPHERAL RCC_APB2Periph_GPIOB #define INVERTER_USART USART2 #define MPU6000_CS_GPIO GPIOB #define MPU6000_CS_PIN GPIO_Pin_12 #define MPU6000_SPI_INSTANCE SPI2 #define MPU6500_CS_GPIO_CLK_PERIPHERAL RCC_APB2Periph_GPIOB #define MPU6500_CS_GPIO GPIOB #define MPU6500_CS_PIN GPIO_Pin_12 #define MPU6500_SPI_INSTANCE SPI2 #define GYRO #define USE_FAKE_GYRO #define USE_GYRO_L3G4200D //#define USE_GYRO_L3GD20 //#define USE_GYRO_MPU3050 #define USE_GYRO_MPU6050 #define USE_GYRO_SPI_MPU6000 #define USE_GYRO_SPI_MPU6500 #define GYRO_MPU6050_ALIGN CW0_DEG #define ACC #define USE_FAKE_ACC #define USE_ACC_ADXL345 #define USE_ACC_BMA280 #define USE_ACC_MMA8452 #define USE_ACC_MPU6050 //#define USE_ACC_SPI_MPU6000 #define USE_ACC_SPI_MPU6500 #define ACC_MPU6050_ALIGN CW0_DEG #define BARO #define USE_BARO_MS5611 #define USE_BARO_BMP085 #define MAG #define USE_MAG_HMC5883 #define USE_MAG_AK8975 #define MAG_AK8975_ALIGN CW180_DEG_FLIP #define SONAR #define LED0 #define LED1 #define DISPLAY #define INVERTER #define USE_USART1 #define USE_USART2 #define USE_SOFTSERIAL1 #define USE_SOFTSERIAL2 #define SERIAL_PORT_COUNT 4 #define SOFTSERIAL_1_TIMER TIM3 #define SOFTSERIAL_1_TIMER_RX_HARDWARE 4 // PWM 5 #define SOFTSERIAL_1_TIMER_TX_HARDWARE 5 // PWM 6 #define SOFTSERIAL_2_TIMER TIM3 #define SOFTSERIAL_2_TIMER_RX_HARDWARE 6 // PWM 7 #define SOFTSERIAL_2_TIMER_TX_HARDWARE 7 // PWM 8 #define USE_I2C #define I2C_DEVICE (I2CDEV_2) // #define SOFT_I2C // enable to test software i2c // #define SOFT_I2C_PB1011 // If SOFT_I2C is enabled above, need to define pinout as well (I2C1 = PB67, I2C2 = PB1011) // #define SOFT_I2C_PB67 #define USE_ADC #define CURRENT_METER_ADC_GPIO GPIOB #define CURRENT_METER_ADC_GPIO_PIN GPIO_Pin_1 #define CURRENT_METER_ADC_CHANNEL ADC_Channel_9 #define VBAT_ADC_GPIO GPIOA #define VBAT_ADC_GPIO_PIN GPIO_Pin_4 #define VBAT_ADC_CHANNEL ADC_Channel_4 #define RSSI_ADC_GPIO GPIOA #define RSSI_ADC_GPIO_PIN GPIO_Pin_1 #define RSSI_ADC_CHANNEL ADC_Channel_1 #define EXTERNAL1_ADC_GPIO GPIOA #define EXTERNAL1_ADC_GPIO_PIN GPIO_Pin_5 #define EXTERNAL1_ADC_CHANNEL ADC_Channel_5 #define GPS #define LED_STRIP #define LED_STRIP_TIMER TIM3 #define BLACKBOX #define TELEMETRY #define SERIAL_RX #define AUTOTUNE #define USE_SERVOS #define USE_CLI #define SPEKTRUM_BIND // USART2, PA3 #define BIND_PORT GPIOA #define BIND_PIN Pin_3
/*============================================================================= Library: CTK Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics 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 CTKEVENTHANDLERWRAPPER_P_H #define CTKEVENTHANDLERWRAPPER_P_H #include <QStringList> #include <service/event/ctkEventAdmin.h> #include <service/event/ctkEventConstants.h> #include <ctkLDAPSearchFilter.h> #include <iostream> class ctkEventHandlerWrapper : public QObject { Q_OBJECT private: ctkProperties properties; QStringList topicList; ctkLDAPSearchFilter filter; public: ctkEventHandlerWrapper(const QObject* subscriber, const char* handler, const ctkProperties& properties) : properties(properties) { connect(this, SIGNAL(notifySubscriber(ctkEvent)), subscriber, handler); } QStringList topics() const { return topicList; } bool init() { topicList.clear(); // Get topic names QVariant v = properties[ctkEventConstants::EVENT_TOPIC]; topicList = v.toStringList(); if (topicList.empty()) { return false; } v = properties[ctkEventConstants::EVENT_FILTER]; filter = ctkLDAPSearchFilter(v.toString()); return true; } void handleEvent(const ctkEvent& event /*, const Permission& perm */) { if (!event.matches(filter)) return; // should do permissions checks now somehow // ... try { emit notifySubscriber(event); } catch (const std::exception& e) { // TODO logging std::cerr << "Exception occured during publishing " << qPrintable(event.getTopic()) << ": " << e.what() << std::endl; } } Q_SIGNALS: void notifySubscriber(const ctkEvent&); }; #endif // CTKEVENTHANDLERWRAPPER_P_H
// Copyright 2016 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 EXTENSIONS_BROWSER_ENTRY_INFO_H_ #define EXTENSIONS_BROWSER_ENTRY_INFO_H_ #include <string> #include "base/files/file_path.h" namespace extensions { // Contains information about files and directories. struct EntryInfo { EntryInfo(const base::FilePath& path, const std::string& mime_type, bool is_directory) : path(path), mime_type(mime_type), is_directory(is_directory) {} base::FilePath path; std::string mime_type; // Useful only if is_directory = false. bool is_directory; }; } // namespace extensions #endif // EXTENSIONS_BROWSER_ENTRY_INFO_H_
/* * Read-Copy Update mechanism for mutual exclusion * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Copyright IBM Corporation, 2001 * * Authors: Dipankar Sarma <dipankar@in.ibm.com> * Manfred Spraul <manfred@colorfullife.com> * * Based on the original work by Paul McKenney <paulmck@us.ibm.com> * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen. * Papers: * http://www.rdrop.com/users/paulmck/paper/rclockpdcsproof.pdf * http://lse.sourceforge.net/locking/rclock_OLS.2001.05.01c.sc.pdf (OLS2001) * * For detailed explanation of Read-Copy Update mechanism see - * http://lse.sourceforge.net/locking/rcupdate.html * */ #include <linux/types.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/spinlock.h> #include <linux/smp.h> #include <linux/interrupt.h> #include <linux/sched.h> #include <asm/atomic.h> #include <linux/bitops.h> #include <linux/percpu.h> #include <linux/notifier.h> #include <linux/cpu.h> #include <linux/mutex.h> #include <linux/module.h> enum rcu_barrier { RCU_BARRIER_STD, RCU_BARRIER_BH, RCU_BARRIER_SCHED, }; static DEFINE_PER_CPU(struct rcu_head, rcu_barrier_head) = {NULL}; static atomic_t rcu_barrier_cpu_count; static DEFINE_MUTEX(rcu_barrier_mutex); static struct completion rcu_barrier_completion; /* * Awaken the corresponding synchronize_rcu() instance now that a * grace period has elapsed. */ void wakeme_after_rcu(struct rcu_head *head) { struct rcu_synchronize *rcu; rcu = container_of(head, struct rcu_synchronize, head); complete(&rcu->completion); } /** * synchronize_rcu - wait until a grace period has elapsed. * * Control will return to the caller some time after a full grace * period has elapsed, in other words after all currently executing RCU * read-side critical sections have completed. RCU read-side critical * sections are delimited by rcu_read_lock() and rcu_read_unlock(), * and may be nested. */ void synchronize_rcu(void); /* Makes kernel-doc tools happy */ synchronize_rcu_xxx(synchronize_rcu, call_rcu) EXPORT_SYMBOL_GPL(synchronize_rcu); static void rcu_barrier_callback(struct rcu_head *notused) { if (atomic_dec_and_test(&rcu_barrier_cpu_count)) complete(&rcu_barrier_completion); } /* * Called with preemption disabled, and from cross-cpu IRQ context. */ static void rcu_barrier_func(void *type) { int cpu = smp_processor_id(); struct rcu_head *head = &per_cpu(rcu_barrier_head, cpu); atomic_inc(&rcu_barrier_cpu_count); switch ((enum rcu_barrier)type) { case RCU_BARRIER_STD: call_rcu(head, rcu_barrier_callback); break; case RCU_BARRIER_BH: call_rcu_bh(head, rcu_barrier_callback); break; case RCU_BARRIER_SCHED: call_rcu_sched(head, rcu_barrier_callback); break; } } /* * Orchestrate the specified type of RCU barrier, waiting for all * RCU callbacks of the specified type to complete. */ static void _rcu_barrier(enum rcu_barrier type) { BUG_ON(in_interrupt()); /* Take cpucontrol mutex to protect against CPU hotplug */ mutex_lock(&rcu_barrier_mutex); init_completion(&rcu_barrier_completion); /* * Initialize rcu_barrier_cpu_count to 1, then invoke * rcu_barrier_func() on each CPU, so that each CPU also has * incremented rcu_barrier_cpu_count. Only then is it safe to * decrement rcu_barrier_cpu_count -- otherwise the first CPU * might complete its grace period before all of the other CPUs * did their increment, causing this function to return too * early. */ atomic_set(&rcu_barrier_cpu_count, 1); on_each_cpu(rcu_barrier_func, (void *)type, 1); if (atomic_dec_and_test(&rcu_barrier_cpu_count)) complete(&rcu_barrier_completion); wait_for_completion(&rcu_barrier_completion); mutex_unlock(&rcu_barrier_mutex); } /** * rcu_barrier - Wait until all in-flight call_rcu() callbacks complete. */ void rcu_barrier(void) { _rcu_barrier(RCU_BARRIER_STD); } EXPORT_SYMBOL_GPL(rcu_barrier); /** * rcu_barrier_bh - Wait until all in-flight call_rcu_bh() callbacks complete. */ void rcu_barrier_bh(void) { _rcu_barrier(RCU_BARRIER_BH); } EXPORT_SYMBOL_GPL(rcu_barrier_bh); /** * rcu_barrier_sched - Wait for in-flight call_rcu_sched() callbacks. */ void rcu_barrier_sched(void) { _rcu_barrier(RCU_BARRIER_SCHED); } EXPORT_SYMBOL_GPL(rcu_barrier_sched); void __init rcu_init(void) { __rcu_init(); }
/* * include/linux/sunrpc/xdr.h * * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de> */ #ifndef _SUNRPC_XDR_H_ #define _SUNRPC_XDR_H_ #ifdef __KERNEL__ #include <linux/uio.h> /* * Buffer adjustment */ #define XDR_QUADLEN(l) (((l) + 3) >> 2) /* * Generic opaque `network object.' At the kernel level, this type * is used only by lockd. */ #define XDR_MAX_NETOBJ 1024 struct xdr_netobj { unsigned int len; u8 * data; }; /* * This is the generic XDR function. rqstp is either a rpc_rqst (client * side) or svc_rqst pointer (server side). * Encode functions always assume there's enough room in the buffer. */ typedef int (*kxdrproc_t)(void *rqstp, u32 *data, void *obj); /* * Basic structure for transmission/reception of a client XDR message. * Features a header (for a linear buffer containing RPC headers * and the data payload for short messages), and then an array of * pages. * The tail iovec allows you to append data after the page array. Its * main interest is for appending padding to the pages in order to * satisfy the int_32-alignment requirements in RFC1832. * * For the future, we might want to string several of these together * in a list if anybody wants to make use of NFSv4 COMPOUND * operations and/or has a need for scatter/gather involving pages. */ struct xdr_buf { struct iovec head[1], /* RPC header + non-page data */ tail[1]; /* Appended after page data */ struct page ** pages; /* Array of contiguous pages */ unsigned int page_base, /* Start of page data */ page_len; /* Length of page data */ unsigned int len; /* Total length of data */ }; /* * pre-xdr'ed macros. */ #define xdr_zero __constant_htonl(0) #define xdr_one __constant_htonl(1) #define xdr_two __constant_htonl(2) #define rpc_success __constant_htonl(RPC_SUCCESS) #define rpc_prog_unavail __constant_htonl(RPC_PROG_UNAVAIL) #define rpc_prog_mismatch __constant_htonl(RPC_PROG_MISMATCH) #define rpc_proc_unavail __constant_htonl(RPC_PROC_UNAVAIL) #define rpc_garbage_args __constant_htonl(RPC_GARBAGE_ARGS) #define rpc_system_err __constant_htonl(RPC_SYSTEM_ERR) #define rpc_auth_ok __constant_htonl(RPC_AUTH_OK) #define rpc_autherr_badcred __constant_htonl(RPC_AUTH_BADCRED) #define rpc_autherr_rejectedcred __constant_htonl(RPC_AUTH_REJECTEDCRED) #define rpc_autherr_badverf __constant_htonl(RPC_AUTH_BADVERF) #define rpc_autherr_rejectedverf __constant_htonl(RPC_AUTH_REJECTEDVERF) #define rpc_autherr_tooweak __constant_htonl(RPC_AUTH_TOOWEAK) /* * Miscellaneous XDR helper functions */ u32 * xdr_encode_array(u32 *p, const char *s, unsigned int len); u32 * xdr_encode_string(u32 *p, const char *s); u32 * xdr_decode_string(u32 *p, char **sp, int *lenp, int maxlen); u32 * xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen); u32 * xdr_encode_netobj(u32 *p, const struct xdr_netobj *); u32 * xdr_decode_netobj(u32 *p, struct xdr_netobj *); u32 * xdr_decode_netobj_fixed(u32 *p, void *obj, unsigned int len); void xdr_encode_pages(struct xdr_buf *, struct page **, unsigned int, unsigned int); void xdr_inline_pages(struct xdr_buf *, unsigned int, struct page **, unsigned int, unsigned int); /* * Decode 64bit quantities (NFSv3 support) */ static inline u32 * xdr_encode_hyper(u32 *p, __u64 val) { *p++ = htonl(val >> 32); *p++ = htonl(val & 0xFFFFFFFF); return p; } static inline u32 * xdr_decode_hyper(u32 *p, __u64 *valp) { *valp = ((__u64) ntohl(*p++)) << 32; *valp |= ntohl(*p++); return p; } /* * Adjust iovec to reflect end of xdr'ed data (RPC client XDR) */ static inline int xdr_adjust_iovec(struct iovec *iov, u32 *p) { return iov->iov_len = ((u8 *) p - (u8 *) iov->iov_base); } void xdr_shift_iovec(struct iovec *, int, size_t); void xdr_zero_iovec(struct iovec *, int, size_t); /* * Maximum number of iov's we use. */ #define MAX_IOVEC (12) /* * XDR buffer helper functions */ extern int xdr_kmap(struct iovec *, struct xdr_buf *, unsigned int); extern void xdr_kunmap(struct xdr_buf *, unsigned int, int); extern void xdr_shift_buf(struct xdr_buf *, size_t); /* * Helper structure for copying from an sk_buff. */ typedef struct { struct sk_buff *skb; unsigned int offset; size_t count; unsigned int csum; } skb_reader_t; typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len); extern void xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int, skb_reader_t *, skb_read_actor_t); extern int xdr_copy_skb(struct xdr_buf *xdr, unsigned int base, struct sk_buff *skb, unsigned int offset); extern int xdr_copy_and_csum_skb(struct xdr_buf *xdr, unsigned int base, struct sk_buff *skb, unsigned int offset, unsigned int csum); #endif /* __KERNEL__ */ #endif /* _SUNRPC_XDR_H_ */
// 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_RENDERER_EXTENSIONS_MESSAGING_BINDINGS_H_ #define CHROME_RENDERER_EXTENSIONS_MESSAGING_BINDINGS_H_ #include <string> #include "chrome/renderer/extensions/chrome_v8_context_set.h" namespace base { class DictionaryValue; } namespace content { class RenderView; } namespace v8 { class Extension; } namespace extensions { class ChromeV8Extension; class Dispatcher; struct Message; // Manually implements JavaScript bindings for extension messaging. // // TODO(aa): This should all get re-implemented using SchemaGeneratedBindings. // If anything needs to be manual for some reason, it should be implemented in // its own class. class MessagingBindings { public: // Creates an instance of the extension. static ChromeV8Extension* Get(Dispatcher* dispatcher, ChromeV8Context* context); // Dispatches the onConnect content script messaging event to some contexts // in |contexts|. If |restrict_to_render_view| is specified, only contexts in // that render view will receive the message. static void DispatchOnConnect( const ChromeV8ContextSet::ContextSet& contexts, int target_port_id, const std::string& channel_name, const base::DictionaryValue& source_tab, const std::string& source_extension_id, const std::string& target_extension_id, const GURL& source_url, const std::string& tls_channel_id, content::RenderView* restrict_to_render_view); // Delivers a message sent using content script messaging to some of the // contexts in |bindings_context_set|. If |restrict_to_render_view| is // specified, only contexts in that render view will receive the message. static void DeliverMessage( const ChromeV8ContextSet::ContextSet& context_set, int target_port_id, const Message& message, content::RenderView* restrict_to_render_view); // Dispatches the onDisconnect event in response to the channel being closed. static void DispatchOnDisconnect( const ChromeV8ContextSet::ContextSet& context_set, int port_id, const std::string& error_message, content::RenderView* restrict_to_render_view); }; } // namespace extensions #endif // CHROME_RENDERER_EXTENSIONS_MESSAGING_BINDINGS_H_
/*add interface for sipc files*/ void _non_fmt_wakelock_timeout(void); void _fmt_wakelock_timeout(void);
/* Copyright (c) 2016 Phoenix Systems All rights reserved. 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. THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.*/ #ifndef _SYS_TYPES_H #define _SYS_TYPES_H #include <machine/types.h> #include <machine/_types.h> #include <stdint.h> #include <sys/_types.h> #include <sys/_null.h> #include <phoenix/types.h> typedef __uint32_t __ino_t ; typedef __uint64_t __ino64_t; typedef __uint64_t __off64_t; typedef __uint32_t __key_t; typedef __uint32_t __useconds_t; typedef __uint32_t __daddr_t; typedef char * caddr_t; typedef __uint32_t __nlink_t; typedef __uint8_t __u_char; typedef unsigned short __u_short; typedef unsigned __u_int; typedef unsigned long __u_long; typedef _CLOCK_T_ clock_t; typedef _ssize_t ssize_t; typedef __ino_t ino_t; typedef __ino64_t ino64_t; typedef __off64_t off64_t; typedef __off_t off_t; typedef __loff_t loff_t; typedef __key_t key_t; typedef __suseconds_t suseconds_t; typedef __useconds_t useconds_t; typedef __daddr_t daddr_t; typedef char * caddr_t; typedef __nlink_t nlink_t; typedef pid_t id_t; typedef __u_char u_char; typedef __u_short u_short; typedef __u_int u_int; typedef __u_long u_long; typedef __uint8_t u_int8_t; typedef __uint16_t u_int16_t; typedef __uint32_t u_int32_t; typedef __uint64_t u_int64_t; typedef __uint8_t uint8_t; typedef __uint16_t uint16_t; typedef __uint32_t uint32_t; typedef __uint64_t uint64_t; typedef __int8_t int8_t; typedef __int16_t int16_t; typedef __int32_t int32_t; typedef __int64_t int64_t; typedef __uint32_t __blksize_t; typedef __int64_t __blkcnt_t; typedef __int64_t sbintime_t; typedef __blkcnt_t blkcnt_t; #define __time_t_defined #define __gid_t_defined #define __uid_t_defined #define __ssize_t_defined #define __key_t_defined #define __off_t_defined #define __off64_t_defined static inline unsigned int dev_major (unsigned long int dev) { return ((dev >> 16) & 0xffff); } static inline unsigned int dev_minor (unsigned long int dev) { return (dev & 0xffff); } static inline unsigned long int dev_makedev (unsigned int major, unsigned int minor) { return (minor & 0xffff) | ((major & 0xffff) << 16); } /* Access the functions with their traditional names. */ # define major(dev) dev_major(dev) # define minor(dev) dev_minor(dev) # define makedev(maj, min) dev_makedev(maj, min) #endif
#ifndef P54USB_H #define P54USB_H /* * Defines for USB based mac80211 Prism54 driver * * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net> * * Based on the islsm (softmac prism54) driver, which is: * Copyright 2004-2006 Jean-Baptiste Note <jbnote@gmail.com>, et al. * * 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. */ /* for isl3886 register definitions used on ver 1 devices */ #include "p54pci.h" #include "net2280.h" /* pci */ #define NET2280_BASE 0x10000000 #define NET2280_BASE2 0x20000000 /* gpio */ #define P54U_BRG_POWER_UP (1 << GPIO0_DATA) #define P54U_BRG_POWER_DOWN (1 << GPIO1_DATA) /* devinit */ #define NET2280_CLK_4Mhz (15 << LOCAL_CLOCK_FREQUENCY) #define NET2280_CLK_30Mhz (2 << LOCAL_CLOCK_FREQUENCY) #define NET2280_CLK_60Mhz (1 << LOCAL_CLOCK_FREQUENCY) #define NET2280_CLK_STOP (0 << LOCAL_CLOCK_FREQUENCY) #define NET2280_PCI_ENABLE (1 << PCI_ENABLE) #define NET2280_PCI_SOFT_RESET (1 << PCI_SOFT_RESET) /* endpoints */ #define NET2280_CLEAR_NAK_OUT_PACKETS_MODE (1 << CLEAR_NAK_OUT_PACKETS_MODE) #define NET2280_FIFO_FLUSH (1 << FIFO_FLUSH) /* irq */ #define NET2280_USB_INTERRUPT_ENABLE (1 << USB_INTERRUPT_ENABLE) #define NET2280_PCI_INTA_INTERRUPT (1 << PCI_INTA_INTERRUPT) #define NET2280_PCI_INTA_INTERRUPT_ENABLE (1 << PCI_INTA_INTERRUPT_ENABLE) /* registers */ #define NET2280_DEVINIT 0x00 #define NET2280_USBIRQENB1 0x24 #define NET2280_IRQSTAT1 0x2c #define NET2280_FIFOCTL 0x38 #define NET2280_GPIOCTL 0x50 #define NET2280_RELNUM 0x88 #define NET2280_EPA_RSP 0x324 #define NET2280_EPA_STAT 0x32c #define NET2280_EPB_STAT 0x34c #define NET2280_EPC_RSP 0x364 #define NET2280_EPC_STAT 0x36c #define NET2280_EPD_STAT 0x38c #define NET2280_EPA_CFG 0x320 #define NET2280_EPB_CFG 0x340 #define NET2280_EPC_CFG 0x360 #define NET2280_EPD_CFG 0x380 #define NET2280_EPE_CFG 0x3A0 #define NET2280_EPF_CFG 0x3C0 #define P54U_DEV_BASE 0x40000000 struct net2280_tx_hdr { __le32 device_addr; __le16 len; __le16 follower; /* ? */ u8 padding[8]; } __attribute__((packed)); struct lm87_tx_hdr { __le32 device_addr; __le32 chksum; } __attribute__((packed)); /* Some flags for the isl hardware registers controlling DMA inside the * chip */ #define ISL38XX_DMA_STATUS_DONE 0x00000001 #define ISL38XX_DMA_STATUS_READY 0x00000002 #define NET2280_EPA_FIFO_PCI_ADDR 0x20000000 #define ISL38XX_DMA_MASTER_CONTROL_TRIGGER 0x00000004 enum net2280_op_type { NET2280_BRG_U32 = 0x001F, NET2280_BRG_CFG_U32 = 0x000F, NET2280_BRG_CFG_U16 = 0x0003, NET2280_DEV_U32 = 0x080F, NET2280_DEV_CFG_U32 = 0x088F, NET2280_DEV_CFG_U16 = 0x0883 }; #define P54U_FW_BLOCK 2048 #define X2_SIGNATURE "x2 " #define X2_SIGNATURE_SIZE 4 struct x2_header { u8 signature[X2_SIGNATURE_SIZE]; __le32 fw_load_addr; __le32 fw_length; __le32 crc; } __attribute__((packed)); /* pipes 3 and 4 are not used by the driver */ #define P54U_PIPE_NUMBER 9 enum p54u_pipe_addr { P54U_PIPE_DATA = 0x01, P54U_PIPE_MGMT = 0x02, P54U_PIPE_3 = 0x03, P54U_PIPE_4 = 0x04, P54U_PIPE_BRG = 0x0d, P54U_PIPE_DEV = 0x0e, P54U_PIPE_INT = 0x0f }; struct p54u_rx_info { struct urb *urb; struct ieee80211_hw *dev; }; struct p54u_priv { struct p54_common common; struct usb_device *udev; struct usb_interface *intf; enum { P54U_NET2280 = 0, P54U_3887 } hw_type; spinlock_t lock; struct sk_buff_head rx_queue; struct usb_anchor submitted; }; #endif /* P54USB_H */
/* * Copyright (C) Eicon Technology Corporation, 2000. * * Eicon File Revision : 1.0 * * This software may be used and distributed according to the terms * of the GNU General Public License, incorporated herein by reference. * */ #ifndef DSPDIDS_H_ #define DSPDIDS_H_ /*---------------------------------------------------------------------------*/ #define DSP_DID_INVALID 0 #define DSP_DID_DIVA 1 #define DSP_DID_DIVA_PRO 2 #define DSP_DID_DIVA_PRO_20 3 #define DSP_DID_DIVA_PRO_PCCARD 4 #define DSP_DID_DIVA_SERVER_BRI_1M 5 #define DSP_DID_DIVA_SERVER_BRI_2M 6 #define DSP_DID_DIVA_SERVER_PRI_2M_TX 7 #define DSP_DID_DIVA_SERVER_PRI_2M_RX 8 #define DSP_DID_DIVA_SERVER_PRI_30M 9 #define DSP_DID_TASK_HSCX 100 #define DSP_DID_TASK_HSCX_PRI_2M_TX 101 #define DSP_DID_TASK_HSCX_PRI_2M_RX 102 #define DSP_DID_TASK_V110KRNL 200 #define DSP_DID_OVERLAY_V1100 201 #define DSP_DID_OVERLAY_V1101 202 #define DSP_DID_OVERLAY_V1102 203 #define DSP_DID_OVERLAY_V1103 204 #define DSP_DID_OVERLAY_V1104 205 #define DSP_DID_OVERLAY_V1105 206 #define DSP_DID_OVERLAY_V1106 207 #define DSP_DID_OVERLAY_V1107 208 #define DSP_DID_OVERLAY_V1108 209 #define DSP_DID_OVERLAY_V1109 210 #define DSP_DID_TASK_V110_PRI_2M_TX 220 #define DSP_DID_TASK_V110_PRI_2M_RX 221 #define DSP_DID_TASK_MODEM 300 #define DSP_DID_TASK_FAX05 400 #define DSP_DID_TASK_VOICE 500 #define DSP_DID_TASK_TIKRNL81 600 #define DSP_DID_OVERLAY_DIAL 601 #define DSP_DID_OVERLAY_V22 602 #define DSP_DID_OVERLAY_V32 603 #define DSP_DID_OVERLAY_FSK 604 #define DSP_DID_OVERLAY_FAX 605 #define DSP_DID_OVERLAY_VXX 606 #define DSP_DID_OVERLAY_V8 607 #define DSP_DID_OVERLAY_INFO 608 #define DSP_DID_OVERLAY_V34 609 #define DSP_DID_OVERLAY_DFX 610 #define DSP_DID_PARTIAL_OVERLAY_DIAL 611 #define DSP_DID_PARTIAL_OVERLAY_FSK 612 #define DSP_DID_PARTIAL_OVERLAY_FAX 613 #define DSP_DID_TASK_TIKRNL05 700 /*---------------------------------------------------------------------------*/ #endif /*---------------------------------------------------------------------------*/
/* SPDX-License-Identifier: LGPL-2.1+ */ #pragma once #include "sd-event.h" #include "import-compress.h" #include "macro.h" typedef struct RawExport RawExport; typedef void (*RawExportFinished)(RawExport *export, int error, void *userdata); int raw_export_new(RawExport **export, sd_event *event, RawExportFinished on_finished, void *userdata); RawExport* raw_export_unref(RawExport *export); DEFINE_TRIVIAL_CLEANUP_FUNC(RawExport*, raw_export_unref); int raw_export_start(RawExport *export, const char *path, int fd, ImportCompressType compress);
#include <pthread.h> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <unistd.h> #include <strings.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include "buffer.h" void main(int argc, char *argv[]) { int server; int n = 0, status; void *buf = NULL; time_t t0, t1, t2; /* open the TCP socket */ if ((server = open_connection(argv[1], atoi(argv[2]))) < 0) { fprintf(stderr, "ERROR; failed to create socket\n"); exit(1); } time(&t0); status = 1; while (status) { time(&t1); n++; buf = malloc(BUFSIZE); status = (bufwrite(server, buf, BUFSIZE)==BUFSIZE); FREE(buf); time(&t2); fprintf(stderr, "n = %d, ct = %d, dt = %d\n", n, t2-t0, t2-t1); } close(server); }
/*************************************************************************** * Copyright (c) 2014 Abdullah Tahiri <abdullah.tahiri.yo@gmail.com> * * * * This file is part of the FreeCAD CAx development system. * * * * 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; see the file COPYING.LIB. If not, * * write to the Free Software Foundation, Inc., 59 Temple Place, * * Suite 330, Boston, MA 02111-1307, USA * * * ***************************************************************************/ #ifndef PROPERTYCONSTRAINTLISTITEM_H #define PROPERTYCONSTRAINTLISTITEM_H #include <QObject> #include <QPointer> #include <QItemEditorFactory> #include <vector> #include <QList> #include <Base/Type.h> #include <Base/Quantity.h> #include <Base/UnitsApi.h> #include <App/PropertyStandard.h> #include <Gui/Widgets.h> #include <Gui/propertyeditor/PropertyItem.h> namespace SketcherGui { class PropertyConstraintListItem: public Gui::PropertyEditor::PropertyItem { Q_OBJECT PROPERTYITEM_HEADER virtual ~PropertyConstraintListItem(); virtual void assignProperty(const App::Property* prop); virtual QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const; virtual void setEditorData(QWidget *editor, const QVariant& data) const; virtual QVariant editorData(QWidget *editor) const; protected: virtual QVariant toString(const QVariant&) const; virtual QVariant value(const App::Property*) const; virtual void setValue(const QVariant&); virtual bool event (QEvent* ev); virtual void initialize(); protected: PropertyConstraintListItem(); bool blockEvent; bool onlyUnnamed; }; } //namespace SketcherGui #endif
// clang-format off /** @file FIRStorageConstants.h @brief Firebase SDK @copyright Copyright 2016 Google Inc. @remarks Use of this SDK is subject to the Google APIs Terms of Service: https://developers.google.com/terms/ */ // clang-format on #import <Foundation/Foundation.h> @class FIRStorageDownloadTask; @class FIRStorageMetadata; @class FIRStorageTaskSnapshot; @class FIRStorageUploadTask; NS_ASSUME_NONNULL_BEGIN /** * NSString typedef representing a task listener handle. */ typedef NSString *FIRStorageHandle; /** * Block typedef typically used when downloading data. * @param data The data returned by the download, or nil if no data available or download failed. * @param error The error describing failure, if one occurred. */ typedef void (^FIRStorageVoidDataError)(NSData *_Nullable data, NSError *_Nullable error); /** * Block typedef typically used when performing "binary" async operations such as delete, * where the operation either succeeds without an error or fails with an error. * @param error The error describing failure, if one occurred. */ typedef void (^FIRStorageVoidError)(NSError *_Nullable error); /** * Block typedef typically used when retrieving metadata. * @param metadata The metadata returned by the operation, if metadata exists. */ typedef void (^FIRStorageVoidMetadata)(FIRStorageMetadata *_Nullable metadata); /** * Block typedef typically used when retrieving metadata with the possibility of an error. * @param metadata The metadata returned by the operation, if metadata exists. * @param error The error describing failure, if one occurred. */ typedef void (^FIRStorageVoidMetadataError)(FIRStorageMetadata *_Nullable metadata, NSError *_Nullable error); /** * Block typedef typically used to asynchronously return a storage task snapshot. * @param snapshot The returned task snapshot. */ typedef void (^FIRStorageVoidSnapshot)(FIRStorageTaskSnapshot *snapshot); /** * Block typedef typically used when retrieving a download URL. * @param URL The download URL associated with the operation. * @param error The error describing failure, if one occurred. */ typedef void (^FIRStorageVoidURLError)(NSURL *_Nullable URL, NSError *_Nullable error); /** * Enum representing the upload and download task status. */ typedef NS_ENUM(NSInteger, FIRStorageTaskStatus) { /** * Unknown task status. */ FIRStorageTaskStatusUnknown, /** * Task is being resumed. */ FIRStorageTaskStatusResume, /** * Task reported a progress event. */ FIRStorageTaskStatusProgress, /** * Task is paused. */ FIRStorageTaskStatusPause, /** * Task has completed successfully. */ FIRStorageTaskStatusSuccess, /** * Task has failed and is unrecoverable. */ FIRStorageTaskStatusFailure }; /** * Firebase Storage error domain. */ FOUNDATION_EXPORT NSString *const FIRStorageErrorDomain; /** * Enum representing the errors raised by Firebase Storage. */ typedef NS_ENUM(NSInteger, FIRStorageErrorCode) { /** An unknown error occurred. */ FIRStorageErrorCodeUnknown = -13000, /** No object exists at the desired reference. */ FIRStorageErrorCodeObjectNotFound = -13010, /** No bucket is configured for Firebase Storage. */ FIRStorageErrorCodeBucketNotFound = -13011, /** No project is configured for Firebase Storage. */ FIRStorageErrorCodeProjectNotFound = -13012, /** * Quota on your Firebase Storage bucket has been exceeded. * If you're on the free tier, upgrade to a paid plan. * If you're on a paid plan, reach out to Firebase support. */ FIRStorageErrorCodeQuotaExceeded = -13013, /** User is unauthenticated. Authenticate and try again. */ FIRStorageErrorCodeUnauthenticated = -13020, /** * User is not authorized to perform the desired action. * Check your rules to ensure they are correct. */ FIRStorageErrorCodeUnauthorized = -13021, /** * The maximum time limit on an operation (upload, download, delete, etc.) has been exceeded. * Try uploading again. */ FIRStorageErrorCodeRetryLimitExceeded = -13030, /** * File on the client does not match the checksum of the file received by the server. * Try uploading again. */ FIRStorageErrorCodeNonMatchingChecksum = -13031, /** * Size of the downloaded file exceeds the amount of memory allocated for the download. * Increase memory cap and try downloading again. */ FIRStorageErrorCodeDownloadSizeExceeded = -13032, /** User cancelled the operation. */ FIRStorageErrorCodeCancelled = -13040 }; NS_ASSUME_NONNULL_END
//********************************************************* // // Copyright (c) Microsoft. All rights reserved. // This code is licensed under the MIT License (MIT). // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. // //********************************************************* #pragma once using namespace DirectX; class SimpleCamera { public: SimpleCamera(); void Init(XMFLOAT3 position); void Update(float elapsedSeconds); XMMATRIX GetViewMatrix(); XMMATRIX GetProjectionMatrix(float fov, float aspectRatio, float nearPlane = 1.0f, float farPlane = 1000.0f); void SetMoveSpeed(float unitsPerSecond); void SetTurnSpeed(float radiansPerSecond); void OnKeyDown(WPARAM key); void OnKeyUp(WPARAM key); private: void Reset(); struct KeysPressed { bool w; bool a; bool s; bool d; bool left; bool right; bool up; bool down; }; XMFLOAT3 m_initialPosition; XMFLOAT3 m_position; float m_yaw; // Relative to the +z axis. float m_pitch; // Relative to the xz plane. XMFLOAT3 m_lookDirection; XMFLOAT3 m_upDirection; float m_moveSpeed; // Speed at which the camera moves, in units per second. float m_turnSpeed; // Speed at which the camera turns, in radians per second. KeysPressed m_keysPressed; };
/* Test _Float32 built-in functions. */ /* { dg-do run } */ /* { dg-options "" } */ /* { dg-add-options float32 } */ /* { dg-add-options ieee } */ /* { dg-require-effective-target float32_runtime } */ #define WIDTH 32 #define EXT 0 #include "floatn-builtin.h"
// // HBCoreLabel.h // CoreTextMagazine // // Created by weqia on 13-10-27. // Copyright (c) 2013年 Marin Todorov. All rights reserved. // #import <UIKit/UIKit.h> #import "MatchParser.h" @class HBCoreLabel; @protocol HBCoreLabelDelegate <NSObject> @optional -(void)coreLabel:(HBCoreLabel*)coreLabel linkClick:(NSString*)linkStr; -(void)coreLabel:(HBCoreLabel *)coreLabel phoneClick:(NSString *)linkStr; -(void)coreLabel:(HBCoreLabel *)coreLabel mobieClick:(NSString *)linkStr; @end @interface HBCoreLabel : UILabel<UIActionSheetDelegate> { MatchParser* _match; BOOL touch; id<MatchParserDelegate> _data; NSString * _linkStr; NSString * _linkType; BOOL _copyEnableAlready; BOOL _attributed; } @property(nonatomic,strong ) MatchParser * match; @property(nonatomic,strong) IBOutlet id<HBCoreLabelDelegate> delegate; @property(nonatomic) BOOL linesLimit; -(void)registerCopyAction; -(void)setAttributedText:(NSString *)attributedText; @end
#ifndef __AP_HAL_LINUX_MAIN_H__ #define __AP_HAL_LINUX_MAIN_H__ #if CONFIG_HAL_BOARD == HAL_BOARD_LINUX #define AP_HAL_MAIN() extern "C" {\ int main (int argc, char * const argv[]) { \ hal.init(argc, argv); \ setup();\ hal.scheduler->system_initialized(); \ for(;;) loop();\ return 0;\ }\ } #endif // HAL_BOARD_LINUX #endif // __AP_HAL_LINUX_MAIN_H__
// // HTTPStream.h // // $Id: //poco/1.4/Net/include/Poco/Net/HTTPStream.h#1 $ // // Library: Net // Package: HTTP // Module: HTTPStream // // Definition of the HTTPStream class. // // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. // and Contributors. // // SPDX-License-Identifier: BSL-1.0 // #ifndef Net_HTTPStream_INCLUDED #define Net_HTTPStream_INCLUDED #include "Poco/Net/Net.h" #include "Poco/Net/HTTPBasicStreamBuf.h" #include "Poco/MemoryPool.h" #include <cstddef> #include <istream> #include <ostream> namespace Poco { namespace Net { class HTTPSession; class Net_API HTTPStreamBuf: public HTTPBasicStreamBuf /// This is the streambuf class used for reading and writing /// HTTP message bodies. { public: typedef HTTPBasicStreamBuf::openmode openmode; HTTPStreamBuf(HTTPSession& session, openmode mode); ~HTTPStreamBuf(); void close(); protected: int readFromDevice(char* buffer, std::streamsize length); int writeToDevice(const char* buffer, std::streamsize length); private: HTTPSession& _session; openmode _mode; }; class Net_API HTTPIOS: public virtual std::ios /// The base class for HTTPInputStream. { public: HTTPIOS(HTTPSession& session, HTTPStreamBuf::openmode mode); ~HTTPIOS(); HTTPStreamBuf* rdbuf(); protected: HTTPStreamBuf _buf; }; class Net_API HTTPInputStream: public HTTPIOS, public std::istream /// This class is for internal use by HTTPSession only. { public: HTTPInputStream(HTTPSession& session); ~HTTPInputStream(); void* operator new(std::size_t size); void operator delete(void* ptr); private: static Poco::MemoryPool _pool; }; class Net_API HTTPOutputStream: public HTTPIOS, public std::ostream /// This class is for internal use by HTTPSession only. { public: HTTPOutputStream(HTTPSession& session); ~HTTPOutputStream(); void* operator new(std::size_t size); void operator delete(void* ptr); private: static Poco::MemoryPool _pool; }; } } // namespace Poco::Net #endif // Net_HTTPStream_INCLUDED
/* * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2015 Daniel Campora * * 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. */ #include "py/builtin.h" const char cc3200_help_text[] = "Welcome to MicroPython!\n" "For online help please visit http://micropython.org/help/.\n" "For further help on a specific object, type help(obj)\n";
/* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* ==================================================================== * Copyright (c) 2009 Carnegie Mellon University. All rights * reserved. * * 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. * * This work was supported in part by funding from the Defense Advanced * Research Projects Agency and the National Science Foundation of the * United States of America, and the CMU Sphinx Speech Consortium. * * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND * ANY EXPRESSED 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 CARNEGIE MELLON UNIVERSITY * NOR ITS EMPLOYEES 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 huff_code.h * @brief Huffman code and bitstream implementation * * This interface supports building canonical Huffman codes from * string and integer values. It also provides support for encoding * and decoding from strings and files, and for reading and writing * codebooks from files. */ #ifndef __HUFF_CODE_H__ #define __HUFF_CODE_H__ #include <stdio.h> #include <sphinxbase/sphinxbase_export.h> #include <sphinxbase/prim_type.h> #include <sphinxbase/cmd_ln.h> typedef struct huff_code_s huff_code_t; /** * Create a codebook from 32-bit integer data. */ SPHINXBASE_EXPORT huff_code_t *huff_code_build_int(int32 const *values, int32 const *frequencies, int nvals); /** * Create a codebook from string data. */ SPHINXBASE_EXPORT huff_code_t *huff_code_build_str(char * const *values, int32 const *frequencies, int nvals); /** * Read a codebook from a file. */ SPHINXBASE_EXPORT huff_code_t *huff_code_read(FILE *infh); /** * Write a codebook to a file. */ SPHINXBASE_EXPORT int huff_code_write(huff_code_t *hc, FILE *outfh); /** * Print a codebook to a file as text (for debugging) */ SPHINXBASE_EXPORT int huff_code_dump(huff_code_t *hc, FILE *dumpfh); /** * Retain a pointer to a Huffman codec object. */ SPHINXBASE_EXPORT huff_code_t *huff_code_retain(huff_code_t *hc); /** * Release a pointer to a Huffman codec object. */ SPHINXBASE_EXPORT int huff_code_free(huff_code_t *hc); /** * Attach a Huffman codec to a file handle for input/output. */ SPHINXBASE_EXPORT FILE *huff_code_attach(huff_code_t *hc, FILE *fh, char const *mode); /** * Detach a Huffman codec from its file handle. */ SPHINXBASE_EXPORT FILE *huff_code_detach(huff_code_t *hc); /** * Encode an integer, writing it to the file handle, if any. */ SPHINXBASE_EXPORT int huff_code_encode_int(huff_code_t *hc, int32 sym, uint32 *outcw); /** * Encode a string, writing it to the file handle, if any. */ SPHINXBASE_EXPORT int huff_code_encode_str(huff_code_t *hc, char const *sym, uint32 *outcw); /** * Decode an integer, reading it from the file if no data given. */ SPHINXBASE_EXPORT int huff_code_decode_int(huff_code_t *hc, int *outval, char const **inout_data, size_t *inout_data_len, int *inout_offset); /** * Decode a string, reading it from the file if no data given. */ SPHINXBASE_EXPORT char const *huff_code_decode_str(huff_code_t *hc, char const **inout_data, size_t *inout_data_len, int *inout_offset); #endif /* __HUFF_CODE_H__ */
/* Copyright (c) 2013, LGE Inc. All rights reserved. * Copyright (c) 2011-2013, 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. */ #include <linux/kernel.h> #include <linux/device.h> #include <linux/platform_device.h> #include <linux/init.h> #include <linux/module.h> #include <mach/htc_lcd_kcal.h> #if defined(CONFIG_LCD_KCAL) static struct kcal_platform_data *kcal_pdata; static int last_status_kcal_ctrl; static ssize_t kcal_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { int kcal_r = 0; int kcal_g = 0; int kcal_b = 0; if (!count) return -EINVAL; sscanf(buf, "%d %d %d", &kcal_r, &kcal_g, &kcal_b); kcal_pdata->set_values(kcal_r, kcal_g, kcal_b); return count; } static ssize_t kcal_show(struct device *dev, struct device_attribute *attr, char *buf) { int kcal_r = 0; int kcal_g = 0; int kcal_b = 0; kcal_pdata->get_values(&kcal_r, &kcal_g, &kcal_b); return sprintf(buf, "%d %d %d\n", kcal_r, kcal_g, kcal_b); } static ssize_t kcal_ctrl_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { int cmd = 0; if (!count) return last_status_kcal_ctrl = -EINVAL; sscanf(buf, "%d", &cmd); if(cmd != 1) return last_status_kcal_ctrl = -EINVAL; last_status_kcal_ctrl = kcal_pdata->refresh_display(); if(last_status_kcal_ctrl) { return -EINVAL; } else { return count; } } static ssize_t kcal_ctrl_show(struct device *dev, struct device_attribute *attr, char *buf) { if(last_status_kcal_ctrl) return sprintf(buf, "NG\n"); else return sprintf(buf, "OK\n"); } static DEVICE_ATTR(kcal, 0644, kcal_show, kcal_store); static DEVICE_ATTR(kcal_ctrl, 0644, kcal_ctrl_show, kcal_ctrl_store); static int kcal_ctrl_probe(struct platform_device *pdev) { int rc = 0; kcal_pdata = pdev->dev.platform_data; if(!kcal_pdata->set_values || !kcal_pdata->get_values || !kcal_pdata->refresh_display) { return -1; } rc = device_create_file(&pdev->dev, &dev_attr_kcal); if(rc !=0) return -1; rc = device_create_file(&pdev->dev, &dev_attr_kcal_ctrl); if(rc !=0) return -1; return 0; } static struct platform_driver this_driver = { .probe = kcal_ctrl_probe, .driver = { .name = "kcal_ctrl", }, }; int __init kcal_ctrl_init(void) { return platform_driver_register(&this_driver); } device_initcall(kcal_ctrl_init); #endif MODULE_DESCRIPTION("LCD KCAL Driver"); MODULE_LICENSE("GPL v2");
/* * Copyright (c) 2015-2016 Quantenna Communications, 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. * */ #ifndef _QTN_FMAC_QLINK_UTIL_H_ #define _QTN_FMAC_QLINK_UTIL_H_ #include <linux/types.h> #include <linux/skbuff.h> #include "qlink.h" static inline void qtnf_cmd_skb_put_action(struct sk_buff *skb, u16 action) { __le16 *buf_ptr; buf_ptr = skb_put(skb, sizeof(action)); *buf_ptr = cpu_to_le16(action); } static inline void qtnf_cmd_skb_put_buffer(struct sk_buff *skb, const u8 *buf_src, size_t len) { skb_put_data(skb, buf_src, len); } static inline void qtnf_cmd_skb_put_tlv_arr(struct sk_buff *skb, u16 tlv_id, const u8 arr[], size_t arr_len) { struct qlink_tlv_hdr *hdr = skb_put(skb, sizeof(*hdr) + arr_len); hdr->type = cpu_to_le16(tlv_id); hdr->len = cpu_to_le16(arr_len); memcpy(hdr->val, arr, arr_len); } static inline void qtnf_cmd_skb_put_tlv_u8(struct sk_buff *skb, u16 tlv_id, u8 value) { struct qlink_tlv_hdr *hdr = skb_put(skb, sizeof(*hdr) + sizeof(value)); hdr->type = cpu_to_le16(tlv_id); hdr->len = cpu_to_le16(sizeof(value)); *hdr->val = value; } static inline void qtnf_cmd_skb_put_tlv_u16(struct sk_buff *skb, u16 tlv_id, u16 value) { struct qlink_tlv_hdr *hdr = skb_put(skb, sizeof(*hdr) + sizeof(value)); __le16 tmp = cpu_to_le16(value); hdr->type = cpu_to_le16(tlv_id); hdr->len = cpu_to_le16(sizeof(value)); memcpy(hdr->val, &tmp, sizeof(tmp)); } u16 qlink_iface_type_mask_to_nl(u16 qlink_mask); u8 qlink_chan_width_mask_to_nl(u16 qlink_mask); #endif /* _QTN_FMAC_QLINK_UTIL_H_ */
/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. 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; version 2 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, write to the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ #ifndef TABLE_METADATA_LOCK_H #define TABLE_METADATA_LOCK_H /** @file storage/perfschema/table_md_locks.h Table METADATA_LOCKS (declarations). */ #include "pfs_column_types.h" #include "pfs_engine_table.h" #include "table_helper.h" struct PFS_metadata_lock; /** @addtogroup Performance_schema_tables @{ */ /** A row of table PERFORMANCE_SCHEMA.MUTEX_INSTANCES. */ struct row_metadata_lock { /** Column OBJECT_INSTANCE_BEGIN. */ const void *m_identity; opaque_mdl_type m_mdl_type; opaque_mdl_duration m_mdl_duration; opaque_mdl_status m_mdl_status; /** Column SOURCE. */ char m_source[COL_SOURCE_SIZE]; /** Length in bytes of @c m_source. */ uint m_source_length; /** Column OWNER_THREAD_ID. */ ulong m_owner_thread_id; /** Column OWNER_EVENT_ID. */ ulong m_owner_event_id; /** Columns OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME. */ PFS_object_row m_object; }; /** Table PERFORMANCE_SCHEMA.METADATA_LOCKS. */ class table_metadata_locks : public PFS_engine_table { public: /** Table share. */ static PFS_engine_table_share m_share; static PFS_engine_table* create(); static ha_rows get_row_count(); virtual int rnd_next(); virtual int rnd_pos(const void *pos); virtual void reset_position(void); private: virtual int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all); table_metadata_locks(); public: ~table_metadata_locks() {} private: void make_row(PFS_metadata_lock *pfs); /** Table share lock. */ static THR_LOCK m_table_lock; /** Fields definition. */ static TABLE_FIELD_DEF m_field_def; /** Current row. */ row_metadata_lock m_row; /** True if the current row exists. */ bool m_row_exists; /** Current position. */ PFS_simple_index m_pos; /** Next position. */ PFS_simple_index m_next_pos; }; /** @} */ #endif
#include "config.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include "stream/stream.h" #include "demuxer.h" /* * An autodetection based on the extension is not a good idea, but we don't care ;-) */ static struct { const char *extension; int demuxer_type; } extensions_table[] = { // { "mpeg", DEMUXER_TYPE_MPEG_PS }, // { "mpg", DEMUXER_TYPE_MPEG_PS }, // { "mpe", DEMUXER_TYPE_MPEG_PS }, { "vob", DEMUXER_TYPE_MPEG_PS }, { "m2v", DEMUXER_TYPE_MPEG_PS }, { "gxf", DEMUXER_TYPE_LAVF }, { "mxf", DEMUXER_TYPE_LAVF }, { "avi", DEMUXER_TYPE_AVI }, { "mp4", DEMUXER_TYPE_MOV }, { "mov", DEMUXER_TYPE_MOV }, { "qt", DEMUXER_TYPE_MOV }, { "asx", DEMUXER_TYPE_ASF }, { "asf", DEMUXER_TYPE_ASF }, { "wmv", DEMUXER_TYPE_ASF }, { "wma", DEMUXER_TYPE_ASF }, { "viv", DEMUXER_TYPE_VIVO }, { "vivo", DEMUXER_TYPE_VIVO }, { "rm", DEMUXER_TYPE_REAL }, { "rmvb", DEMUXER_TYPE_REAL }, { "ra", DEMUXER_TYPE_REAL }, { "y4m", DEMUXER_TYPE_Y4M }, { "mp3", DEMUXER_TYPE_AUDIO }, { "wav", DEMUXER_TYPE_AUDIO }, { "flac", DEMUXER_TYPE_AUDIO }, { "fla", DEMUXER_TYPE_AUDIO }, { "ogg", DEMUXER_TYPE_OGG }, { "ogm", DEMUXER_TYPE_OGG }, // { "pls", DEMUXER_TYPE_PLAYLIST }, // { "m3u", DEMUXER_TYPE_PLAYLIST }, { "xm", DEMUXER_TYPE_XMMS }, { "mod", DEMUXER_TYPE_XMMS }, { "s3m", DEMUXER_TYPE_XMMS }, { "it", DEMUXER_TYPE_XMMS }, { "mid", DEMUXER_TYPE_XMMS }, { "midi", DEMUXER_TYPE_XMMS }, { "vqf", DEMUXER_TYPE_XMMS }, { "nsv", DEMUXER_TYPE_NSV }, { "nsa", DEMUXER_TYPE_NSV }, { "mpc", DEMUXER_TYPE_MPC }, #ifdef USE_WIN32DLL { "avs", DEMUXER_TYPE_AVS }, #endif { "nut", DEMUXER_TYPE_LAVF }, { "swf", DEMUXER_TYPE_LAVF }, { "flv", DEMUXER_TYPE_LAVF }, { "302", DEMUXER_TYPE_LAVF }, { "264", DEMUXER_TYPE_H264_ES }, { "26l", DEMUXER_TYPE_H264_ES }, { "ac3", DEMUXER_TYPE_LAVF }, { "wv", DEMUXER_TYPE_LAVF }, }; int demuxer_type_by_filename(char* filename){ int i; char* extension=strrchr(filename,'.'); mp_msg(MSGT_OPEN, MSGL_V, "Searching demuxer type for filename %s ext: %s\n",filename,extension); if(extension) { ++extension; // mp_msg(MSGT_CPLAYER,MSGL_DBG2,"Extension: %s\n", extension ); // Look for the extension in the extensions table for( i=0 ; i<(sizeof(extensions_table)/sizeof(extensions_table[0])) ; i++ ) { if( !strcasecmp(extension, extensions_table[i].extension) ) { mp_msg(MSGT_OPEN, MSGL_V, "Trying demuxer %d based on filename extension\n",extensions_table[i].demuxer_type); return extensions_table[i].demuxer_type; } } } return DEMUXER_TYPE_UNKNOWN; }
// 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 CONTENT_BROWSER_SSL_SSL_MANAGER_H_ #define CONTENT_BROWSER_SSL_SSL_MANAGER_H_ #include <string> #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "content/browser/ssl/ssl_error_handler.h" #include "content/browser/ssl/ssl_policy_backend.h" #include "content/common/content_export.h" #include "content/public/browser/global_request_id.h" #include "net/base/net_errors.h" #include "net/cert/cert_status_flags.h" #include "url/gurl.h" namespace net { class SSLInfo; } namespace content { class BrowserContext; class NavigationEntryImpl; class NavigationControllerImpl; class SSLPolicy; struct LoadCommittedDetails; struct LoadFromMemoryCacheDetails; struct ResourceRedirectDetails; struct ResourceRequestDetails; // The SSLManager SSLManager controls the SSL UI elements in a WebContents. It // listens for various events that influence when these elements should or // should not be displayed and adjusts them accordingly. // // There is one SSLManager per tab. // The security state (secure/insecure) is stored in the navigation entry. // Along with it are stored any SSL error code and the associated cert. class SSLManager { public: // Entry point for SSLCertificateErrors. This function begins the process // of resolving a certificate error during an SSL connection. SSLManager // will adjust the security UI and either call |CancelSSLRequest| or // |ContinueSSLRequest| of |delegate| with |id| as the first argument. // // Called on the IO thread. static void OnSSLCertificateError( const base::WeakPtr<SSLErrorHandler::Delegate>& delegate, const GlobalRequestID& id, ResourceType resource_type, const GURL& url, int render_process_id, int render_frame_id, const net::SSLInfo& ssl_info, bool fatal); // Called when SSL state for a host or tab changes. static void NotifySSLInternalStateChanged(BrowserContext* context); // Construct an SSLManager for the specified tab. // If |delegate| is NULL, SSLPolicy::GetDefaultPolicy() is used. explicit SSLManager(NavigationControllerImpl* controller); virtual ~SSLManager(); SSLPolicy* policy() { return policy_.get(); } SSLPolicyBackend* backend() { return &backend_; } // The navigation controller associated with this SSLManager. The // NavigationController is guaranteed to outlive the SSLManager. NavigationControllerImpl* controller() { return controller_; } void DidCommitProvisionalLoad(const LoadCommittedDetails& details); void DidLoadFromMemoryCache(const LoadFromMemoryCacheDetails& details); void DidStartResourceResponse(const ResourceRequestDetails& details); void DidReceiveResourceRedirect(const ResourceRedirectDetails& details); // Insecure content entry point. void DidDisplayInsecureContent(); void DidRunInsecureContent(const std::string& security_origin); private: // Update the NavigationEntry with our current state. void UpdateEntry(NavigationEntryImpl* entry); // The backend for the SSLPolicy to actuate its decisions. SSLPolicyBackend backend_; // The SSLPolicy instance for this manager. scoped_ptr<SSLPolicy> policy_; // The NavigationController that owns this SSLManager. We are responsible // for the security UI of this tab. NavigationControllerImpl* controller_; DISALLOW_COPY_AND_ASSIGN(SSLManager); }; } // namespace content #endif // CONTENT_BROWSER_SSL_SSL_MANAGER_H_
// // ______ ______ ______ // /\ __ \ /\ ___\ /\ ___\ // \ \ __< \ \ __\_ \ \ __\_ // \ \_____\ \ \_____\ \ \_____\ // \/_____/ \/_____/ \/_____/ // // // Copyright (c) 2014-2015, Geek Zoo Studio // http://www.bee-framework.com // // // 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. // #import "Bee.h" #pragma mark - @interface SplashBoard_iPhone : BeeUIBoard AS_NOTIFICATION( PLAY_DONE ) @end
/* Copyright (C) 2009-2013 by Daniel Stenberg * * 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 M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ typedef enum { ARES_DATATYPE_UNKNOWN = 1, /* unknown data type - introduced in 1.7.0 */ ARES_DATATYPE_SRV_REPLY, /* struct ares_srv_reply - introduced in 1.7.0 */ ARES_DATATYPE_TXT_REPLY, /* struct ares_txt_reply - introduced in 1.7.0 */ ARES_DATATYPE_TXT_EXT, /* struct ares_txt_ext - introduced in 1.11.0 */ ARES_DATATYPE_ADDR_NODE, /* struct ares_addr_node - introduced in 1.7.1 */ ARES_DATATYPE_MX_REPLY, /* struct ares_mx_reply - introduced in 1.7.2 */ ARES_DATATYPE_NAPTR_REPLY,/* struct ares_naptr_reply - introduced in 1.7.6 */ ARES_DATATYPE_SOA_REPLY, /* struct ares_soa_reply - introduced in 1.9.0 */ #if 0 ARES_DATATYPE_ADDR6TTL, /* struct ares_addrttl */ ARES_DATATYPE_ADDRTTL, /* struct ares_addr6ttl */ ARES_DATATYPE_HOSTENT, /* struct hostent */ ARES_DATATYPE_OPTIONS, /* struct ares_options */ #endif ARES_DATATYPE_ADDR_PORT_NODE, /* struct ares_addr_port_node - introduced in 1.11.0 */ ARES_DATATYPE_LAST /* not used - introduced in 1.7.0 */ } ares_datatype; #define ARES_DATATYPE_MARK 0xbead /* * ares_data struct definition is internal to c-ares and shall not * be exposed by the public API in order to allow future changes * and extensions to it without breaking ABI. This will be used * internally by c-ares as the container of multiple types of data * dynamically allocated for which a reference will be returned * to the calling application. * * c-ares API functions returning a pointer to c-ares internally * allocated data will actually be returning an interior pointer * into this ares_data struct. * * All this is 'invisible' to the calling application, the only * requirement is that this kind of data must be free'ed by the * calling application using ares_free_data() with the pointer * it has received from a previous c-ares function call. */ struct ares_data { ares_datatype type; /* Actual data type identifier. */ unsigned int mark; /* Private ares_data signature. */ union { struct ares_txt_reply txt_reply; struct ares_txt_ext txt_ext; struct ares_srv_reply srv_reply; struct ares_addr_node addr_node; struct ares_addr_port_node addr_port_node; struct ares_mx_reply mx_reply; struct ares_naptr_reply naptr_reply; struct ares_soa_reply soa_reply; } data; }; void *ares_malloc_data(ares_datatype type);
#ifndef LINUX_MMC_IOCTL_H #define LINUX_MMC_IOCTL_H #include <linux/types.h> struct mmc_ioc_cmd { int write_flag; int is_acmd; __u32 opcode; __u32 arg; __u32 response[4]; unsigned int flags; unsigned int blksz; unsigned int blocks; unsigned int postsleep_min_us; unsigned int postsleep_max_us; unsigned int data_timeout_ns; unsigned int cmd_timeout_ms; __u32 __pad; __u64 data_ptr; }; #define mmc_ioc_cmd_set_data(ic, ptr) ic.data_ptr = (__u64)(unsigned long) ptr #define MMC_IOC_CMD _IOWR(MMC_BLOCK_MAJOR, 0, struct mmc_ioc_cmd) #define MMC_IOC_MAX_RPMB_CMD 3 struct mmc_ioc_rpmb { struct mmc_ioc_cmd cmds[MMC_IOC_MAX_RPMB_CMD]; }; #define MMC_IOC_RPMB_CMD _IOWR(MMC_BLOCK_MAJOR, 0, struct mmc_ioc_rpmb) #define MMC_IOC_MAX_BYTES (512L * 256) #endif
#ifndef B43legacy_LEDS_H_ #define B43legacy_LEDS_H_ struct b43legacy_wldev; #ifdef CONFIG_B43LEGACY_LEDS #include <linux/types.h> #include <linux/leds.h> #define B43legacy_LED_MAX_NAME_LEN 31 struct b43legacy_led { struct b43legacy_wldev *dev; struct led_classdev led_dev; u8 index; bool activelow; char name[B43legacy_LED_MAX_NAME_LEN + 1]; }; #define B43legacy_LED_BEHAVIOUR 0x7F #define B43legacy_LED_ACTIVELOW 0x80 enum b43legacy_led_behaviour { B43legacy_LED_OFF, B43legacy_LED_ON, B43legacy_LED_ACTIVITY, B43legacy_LED_RADIO_ALL, B43legacy_LED_RADIO_A, B43legacy_LED_RADIO_B, B43legacy_LED_MODE_BG, B43legacy_LED_TRANSFER, B43legacy_LED_APTRANSFER, B43legacy_LED_WEIRD, B43legacy_LED_ASSOC, B43legacy_LED_INACTIVE, }; void b43legacy_leds_init(struct b43legacy_wldev *dev); void b43legacy_leds_exit(struct b43legacy_wldev *dev); #else struct b43legacy_led { }; static inline void b43legacy_leds_init(struct b43legacy_wldev *dev) { } static inline void b43legacy_leds_exit(struct b43legacy_wldev *dev) { } #endif #endif
#ifndef _ASM_SCORE_AUXVEC_H #define _ASM_SCORE_AUXVEC_H #endif
/* ---------------------------------------------------------------------------- * SAM Software Package License * ---------------------------------------------------------------------------- * Copyright (c) 2011, Atmel Corporation * * 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 disclaimer below. * * Atmel's name may not be used to endorse or promote products derived from * this software without specific prior written permission. * * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 */ /*---------------------------------------------------------------------------- * Headers *----------------------------------------------------------------------------*/ #include "board.h" #include <stdio.h> /*---------------------------------------------------------------------------- * Definiation *----------------------------------------------------------------------------*/ /* WAV letters "RIFF" */ #define WAV_CHUNKID 0x46464952 /* WAV letters "WAVE"*/ #define WAV_FORMAT 0x45564157 /* WAV letters "fmt "*/ #define WAV_SUBCHUNKID 0x20746D66 /*---------------------------------------------------------------------------- * Exported functions *----------------------------------------------------------------------------*/ /** * \brief Check if the header of a Wav file is valid ot not. * * \param file Buffer holding the file to examinate. * \return 1 if the header of a Wav file is valid; otherwise returns 0. */ unsigned char WAV_IsValid(const WavHeader *header) { return ((header->chunkID == WAV_CHUNKID) && (header->format == WAV_FORMAT) && (header->subchunk1Size == 0x10)); } /** * \brief Display the information of the WAV file (sample rate, stereo/mono * and frame size). * * \param header Wav head information. */ void WAV_DisplayInfo(const WavHeader *header) { printf( "Wave file header information\n\r"); printf( "--------------------------------\n\r"); printf( " - Chunk ID = 0x%08X\n\r", header->chunkID); printf( " - Chunk Size = %u\n\r", header->chunkSize); printf( " - Format = 0x%08X\n\r", header->format); printf( " - SubChunk ID = 0x%08X\n\r", header->subchunk1ID); printf( " - Subchunk1 Size = %u\n\r", header->subchunk1Size); printf( " - Audio Format = 0x%04X\n\r", header->audioFormat); printf( " - Num. Channels = %d\n\r", header->numChannels); printf( " - Sample Rate = %u\n\r", header->sampleRate); printf( " - Byte Rate = %u\n\r", header->byteRate); printf( " - Block Align = %d\n\r", header->blockAlign); printf( " - Bits Per Sample = %d\n\r", header->bitsPerSample); printf( " - Subchunk2 ID = 0x%08X\n\r", header->subchunk2ID); printf( " - Subchunk2 Size = %u\n\r", header->subchunk2Size); }
#include "WebCore/platform/mac/SoftLinking.h"
/* Configuration file for Symbian OS on ARM processors. Copyright (C) 2004-2014 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC 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/>. */ /* Do not expand builtin functions (unless explicitly prefixed with "__builtin"). Symbian OS code relies on properties of the standard library that go beyond those guaranteed by the ANSI/ISO standard. For example, "memcpy" works even with overlapping memory, like "memmove". We cannot simply set flag_no_builtin in arm.c because (a) flag_no_builtin is not declared in language-independent code, and (b) that would prevent users from explicitly overriding the default with -fbuiltin, which may sometimes be useful. Make all symbols hidden by default. Symbian OS expects that all exported symbols will be explicitly marked with "__declspec(dllexport)". Enumeration types use 4 bytes, even if the enumerals are small, unless explicitly overridden. The wchar_t type is a 2-byte type, unless explicitly overridden. */ #define CC1_SPEC \ "%{!fbuiltin:%{!fno-builtin:-fno-builtin}} " \ "%{!fvisibility=*:-fvisibility=hidden} " \ "%{!fshort-enums:%{!fno-short-enums:-fno-short-enums}} " \ "%{!fshort-wchar:%{!fno-short-wchar:-fshort-wchar}} " #define CC1PLUS_SPEC CC1_SPEC /* Symbian OS does not use crt*.o, unlike the generic unknown-elf configuration. */ #undef STARTFILE_SPEC #define STARTFILE_SPEC "" #undef ENDFILE_SPEC #define ENDFILE_SPEC "" /* Do not link with any libraries by default. On Symbian OS, the user must supply all required libraries on the command line. */ #undef LIB_SPEC #define LIB_SPEC "" /* Support the "dllimport" attribute. */ #define TARGET_DLLIMPORT_DECL_ATTRIBUTES 1 /* Symbian OS assumes ARM V5 or above. Since -march=armv5 is equivalent to making the ARM 10TDMI core the default, we can set SUBTARGET_CPU_DEFAULT and get an equivalent effect. */ #undef SUBTARGET_CPU_DEFAULT #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi /* The assembler should assume VFP FPU format, and armv5t. */ #undef SUBTARGET_ASM_FLOAT_SPEC #define SUBTARGET_ASM_FLOAT_SPEC \ "%{!mfpu=*:-mfpu=vfp} %{!mcpu=*:%{!march=*:-march=armv5t}}" /* Define the __symbian__ macro. */ #undef TARGET_OS_CPP_BUILTINS #define TARGET_OS_CPP_BUILTINS() \ do \ { \ /* Include the default BPABI stuff. */ \ TARGET_BPABI_CPP_BUILTINS (); \ /* Symbian OS does not support merging symbols across DLL \ boundaries. */ \ builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \ builtin_define ("__symbian__"); \ } \ while (false) /* On SymbianOS, these sections are not writable, so we use "a", rather than "aw", for the section attributes. */ #undef ARM_EABI_CTORS_SECTION_OP #define ARM_EABI_CTORS_SECTION_OP \ "\t.section\t.init_array,\"a\",%init_array" #undef ARM_EABI_DTORS_SECTION_OP #define ARM_EABI_DTORS_SECTION_OP \ "\t.section\t.fini_array,\"a\",%fini_array" /* SymbianOS cannot merge entities with vague linkage at runtime. */ #define TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P false #define TARGET_DEFAULT_WORD_RELOCATIONS 1 #define ARM_TARGET2_DWARF_FORMAT DW_EH_PE_absptr
/* * Copyright (C) 2016 Gautier Hattenberger <gautier.hattenberger@enac.fr> * * 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, see * <http://www.gnu.org/licenses/>. */ /** * @file pprz_mutex.h * * Utility functions and macros to abstract some RTOS functionalities * such as mutexes. */ #ifndef PPRZ_MUTEX_H #define PPRZ_MUTEX_H #if USE_CHIBIOS_RTOS #include <ch.h> #define PPRZ_MUTEX(_mtx) mutex_t _mtx #define PPRZ_MUTEX_DECL(_mtx) extern mutex_t _mtx #define PPRZ_MUTEX_INIT(_mtx) chMtxObjectInit(&(_mtx)) #define PPRZ_MUTEX_LOCK(_mtx) chMtxLock(&(_mtx)) #define PPRZ_MUTEX_UNLOCK(_mtx) chMtxUnlock(&(_mtx)) #else // no RTOS #define PPRZ_MUTEX(_mtx) #define PPRZ_MUTEX_DECL(_mtx) #define PPRZ_MUTEX_INIT(_mtx) {} #define PPRZ_MUTEX_LOCK(_mtx) {} #define PPRZ_MUTEX_UNLOCK(_mtx) {} #endif #endif
// SPDX-License-Identifier: GPL-2.0-only /* * STMicroelectronics sensors i2c library driver * * Copyright 2012-2013 STMicroelectronics Inc. * * Denis Ciocca <denis.ciocca@st.com> */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/iio/iio.h> #include <linux/regmap.h> #include <linux/iio/common/st_sensors_i2c.h> #define ST_SENSORS_I2C_MULTIREAD 0x80 static const struct regmap_config st_sensors_i2c_regmap_config = { .reg_bits = 8, .val_bits = 8, }; static const struct regmap_config st_sensors_i2c_regmap_multiread_bit_config = { .reg_bits = 8, .val_bits = 8, .read_flag_mask = ST_SENSORS_I2C_MULTIREAD, }; /* * st_sensors_i2c_configure() - configure I2C interface * @indio_dev: IIO device reference. * @client: i2c client reference. * * Return: 0 on success, else a negative error code. */ int st_sensors_i2c_configure(struct iio_dev *indio_dev, struct i2c_client *client) { struct st_sensor_data *sdata = iio_priv(indio_dev); const struct regmap_config *config; if (sdata->sensor_settings->multi_read_bit) config = &st_sensors_i2c_regmap_multiread_bit_config; else config = &st_sensors_i2c_regmap_config; sdata->regmap = devm_regmap_init_i2c(client, config); if (IS_ERR(sdata->regmap)) { dev_err(&client->dev, "Failed to register i2c regmap (%ld)\n", PTR_ERR(sdata->regmap)); return PTR_ERR(sdata->regmap); } i2c_set_clientdata(client, indio_dev); indio_dev->dev.parent = &client->dev; indio_dev->name = client->name; sdata->dev = &client->dev; sdata->irq = client->irq; return 0; } EXPORT_SYMBOL(st_sensors_i2c_configure); MODULE_AUTHOR("Denis Ciocca <denis.ciocca@st.com>"); MODULE_DESCRIPTION("STMicroelectronics ST-sensors i2c driver"); MODULE_LICENSE("GPL v2");
/* * Copyright (C) 2008 Manuel Lauss <mano@roarinelk.homelinux.net> * * Previous incarnations were: * Copyright (C) 2001, 2006, 2008 MontaVista Software, <source@mvista.com> * Copied and modified Carsten Langgaard's time.c * * Carsten Langgaard, carstenl@mips.com * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved. * * ######################################################################## * * 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. * * ######################################################################## * * Clocksource/event using the 32.768kHz-clocked Counter1 ('RTC' in the * databooks). Firmware/Board init code must enable the counters in the * counter control register, otherwise the CP0 counter clocksource/event * will be installed instead (and use of 'wait' instruction is prohibited). */ #include <linux/clockchips.h> #include <linux/clocksource.h> #include <linux/interrupt.h> #include <linux/spinlock.h> #include <asm/processor.h> #include <asm/time.h> #include <asm/mach-au1x00/au1000.h> /* 32kHz clock enabled and detected */ #define CNTR_OK (SYS_CNTRL_E0 | SYS_CNTRL_32S) static cycle_t au1x_counter1_read(struct clocksource *cs) { return au_readl(SYS_RTCREAD); } static struct clocksource au1x_counter1_clocksource = { .name = "alchemy-counter1", .read = au1x_counter1_read, .mask = CLOCKSOURCE_MASK(32), .flags = CLOCK_SOURCE_IS_CONTINUOUS, .rating = 100, }; static int au1x_rtcmatch2_set_next_event(unsigned long delta, struct clock_event_device *cd) { delta += au_readl(SYS_RTCREAD); /* wait for register access */ while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M21) ; au_writel(delta, SYS_RTCMATCH2); au_sync(); return 0; } static void au1x_rtcmatch2_set_mode(enum clock_event_mode mode, struct clock_event_device *cd) { } static irqreturn_t au1x_rtcmatch2_irq(int irq, void *dev_id) { struct clock_event_device *cd = dev_id; cd->event_handler(cd); return IRQ_HANDLED; } static struct clock_event_device au1x_rtcmatch2_clockdev = { .name = "rtcmatch2", .features = CLOCK_EVT_FEAT_ONESHOT, .rating = 100, .irq = AU1000_RTC_MATCH2_INT, .set_next_event = au1x_rtcmatch2_set_next_event, .set_mode = au1x_rtcmatch2_set_mode, .cpumask = cpu_all_mask, }; static struct irqaction au1x_rtcmatch2_irqaction = { .handler = au1x_rtcmatch2_irq, .flags = IRQF_DISABLED | IRQF_TIMER, .name = "timer", .dev_id = &au1x_rtcmatch2_clockdev, }; void __init plat_time_init(void) { struct clock_event_device *cd = &au1x_rtcmatch2_clockdev; unsigned long t; /* Check if firmware (YAMON, ...) has enabled 32kHz and clock * has been detected. If so install the rtcmatch2 clocksource, * otherwise don't bother. Note that both bits being set is by * no means a definite guarantee that the counters actually work * (the 32S bit seems to be stuck set to 1 once a single clock- * edge is detected, hence the timeouts). */ if (CNTR_OK != (au_readl(SYS_COUNTER_CNTRL) & CNTR_OK)) goto cntr_err; /* * setup counter 1 (RTC) to tick at full speed */ t = 0xffffff; while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S) && --t) asm volatile ("nop"); if (!t) goto cntr_err; au_writel(0, SYS_RTCTRIM); /* 32.768 kHz */ au_sync(); t = 0xffffff; while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && --t) asm volatile ("nop"); if (!t) goto cntr_err; au_writel(0, SYS_RTCWRITE); au_sync(); t = 0xffffff; while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && --t) asm volatile ("nop"); if (!t) goto cntr_err; /* register counter1 clocksource and event device */ clocksource_set_clock(&au1x_counter1_clocksource, 32768); clocksource_register(&au1x_counter1_clocksource); cd->shift = 32; cd->mult = div_sc(32768, NSEC_PER_SEC, cd->shift); cd->max_delta_ns = clockevent_delta2ns(0xffffffff, cd); cd->min_delta_ns = clockevent_delta2ns(8, cd); /* ~0.25ms */ clockevents_register_device(cd); setup_irq(AU1000_RTC_MATCH2_INT, &au1x_rtcmatch2_irqaction); printk(KERN_INFO "Alchemy clocksource installed\n"); return; cntr_err: /* * MIPS kernel assigns 'au1k_wait' to 'cpu_wait' before this * function is called. Because the Alchemy counters are unusable * the C0 timekeeping code is installed and use of the 'wait' * instruction must be prohibited, which is done most easily by * assigning NULL to cpu_wait. */ cpu_wait = NULL; r4k_clockevent_init(); init_r4k_clocksource(); }
/* ** FFI C call handling. ** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h */ #ifndef _LJ_CCALL_H #define _LJ_CCALL_H #include "lj_obj.h" #include "lj_ctype.h" #if LJ_HASFFI /* -- C calling conventions ----------------------------------------------- */ #if LJ_TARGET_X86ORX64 #if LJ_TARGET_X86 #define CCALL_NARG_GPR 2 /* For fastcall arguments. */ #define CCALL_NARG_FPR 0 #define CCALL_NRET_GPR 2 #define CCALL_NRET_FPR 1 /* For FP results on x87 stack. */ #define CCALL_ALIGN_STACKARG 0 /* Don't align argument on stack. */ #elif LJ_ABI_WIN #define CCALL_NARG_GPR 4 #define CCALL_NARG_FPR 4 #define CCALL_NRET_GPR 1 #define CCALL_NRET_FPR 1 #define CCALL_SPS_EXTRA 4 #else #define CCALL_NARG_GPR 6 #define CCALL_NARG_FPR 8 #define CCALL_NRET_GPR 2 #define CCALL_NRET_FPR 2 #define CCALL_VECTOR_REG 1 /* Pass vectors in registers. */ #endif #define CCALL_SPS_FREE 1 #define CCALL_ALIGN_CALLSTATE 16 typedef LJ_ALIGN(16) union FPRArg { double d[2]; float f[4]; uint8_t b[16]; uint16_t s[8]; int i[4]; int64_t l[2]; } FPRArg; typedef intptr_t GPRArg; #elif LJ_TARGET_ARM #define CCALL_NARG_GPR 4 #define CCALL_NRET_GPR 2 /* For softfp double. */ #if LJ_ABI_SOFTFP #define CCALL_NARG_FPR 0 #define CCALL_NRET_FPR 0 #else #define CCALL_NARG_FPR 8 #define CCALL_NRET_FPR 4 #endif #define CCALL_SPS_FREE 0 typedef intptr_t GPRArg; typedef union FPRArg { double d; float f[2]; } FPRArg; #elif LJ_TARGET_ARM64 #define CCALL_NARG_GPR 8 #define CCALL_NRET_GPR 2 #define CCALL_NARG_FPR 8 #define CCALL_NRET_FPR 4 #define CCALL_SPS_FREE 0 typedef intptr_t GPRArg; typedef union FPRArg { double d; float f; uint32_t u32; } FPRArg; #elif LJ_TARGET_PPC #define CCALL_NARG_GPR 8 #define CCALL_NARG_FPR 8 #define CCALL_NRET_GPR 4 /* For complex double. */ #define CCALL_NRET_FPR 1 #define CCALL_SPS_EXTRA 4 #define CCALL_SPS_FREE 0 typedef intptr_t GPRArg; typedef double FPRArg; #elif LJ_TARGET_MIPS #define CCALL_NARG_GPR 4 #define CCALL_NARG_FPR (LJ_ABI_SOFTFP ? 0 : 2) #define CCALL_NRET_GPR 2 #define CCALL_NRET_FPR (LJ_ABI_SOFTFP ? 0 : 2) #define CCALL_SPS_EXTRA 7 #define CCALL_SPS_FREE 1 typedef intptr_t GPRArg; typedef union FPRArg { double d; struct { LJ_ENDIAN_LOHI(float f; , float g;) }; } FPRArg; #else #error "Missing calling convention definitions for this architecture" #endif #ifndef CCALL_SPS_EXTRA #define CCALL_SPS_EXTRA 0 #endif #ifndef CCALL_VECTOR_REG #define CCALL_VECTOR_REG 0 #endif #ifndef CCALL_ALIGN_STACKARG #define CCALL_ALIGN_STACKARG 1 #endif #ifndef CCALL_ALIGN_CALLSTATE #define CCALL_ALIGN_CALLSTATE 8 #endif #define CCALL_NUM_GPR \ (CCALL_NARG_GPR > CCALL_NRET_GPR ? CCALL_NARG_GPR : CCALL_NRET_GPR) #define CCALL_NUM_FPR \ (CCALL_NARG_FPR > CCALL_NRET_FPR ? CCALL_NARG_FPR : CCALL_NRET_FPR) /* Check against constants in lj_ctype.h. */ LJ_STATIC_ASSERT(CCALL_NUM_GPR <= CCALL_MAX_GPR); LJ_STATIC_ASSERT(CCALL_NUM_FPR <= CCALL_MAX_FPR); #define CCALL_MAXSTACK 32 /* -- C call state -------------------------------------------------------- */ typedef LJ_ALIGN(CCALL_ALIGN_CALLSTATE) struct CCallState { void (*func)(void); /* Pointer to called function. */ uint32_t spadj; /* Stack pointer adjustment. */ uint8_t nsp; /* Number of stack slots. */ uint8_t retref; /* Return value by reference. */ #if LJ_TARGET_X64 uint8_t ngpr; /* Number of arguments in GPRs. */ uint8_t nfpr; /* Number of arguments in FPRs. */ #elif LJ_TARGET_X86 uint8_t resx87; /* Result on x87 stack: 1:float, 2:double. */ #elif LJ_TARGET_ARM64 void *retp; /* Aggregate return pointer in x8. */ #elif LJ_TARGET_PPC uint8_t nfpr; /* Number of arguments in FPRs. */ #endif #if LJ_32 int32_t align1; #endif #if CCALL_NUM_FPR FPRArg fpr[CCALL_NUM_FPR]; /* Arguments/results in FPRs. */ #endif GPRArg gpr[CCALL_NUM_GPR]; /* Arguments/results in GPRs. */ GPRArg stack[CCALL_MAXSTACK]; /* Stack slots. */ } CCallState; /* -- C call handling ----------------------------------------------------- */ /* Really belongs to lj_vm.h. */ LJ_ASMF void LJ_FASTCALL lj_vm_ffi_call(CCallState *cc); LJ_FUNC CTypeID lj_ccall_ctid_vararg(CTState *cts, cTValue *o); LJ_FUNC int lj_ccall_func(lua_State *L, GCcdata *cd); #endif #endif
/* * linux/arch/arm/mach-sa1100/pleb.c */ #include <linux/init.h> #include <linux/kernel.h> #include <linux/tty.h> #include <linux/ioport.h> #include <linux/platform_data/sa11x0-serial.h> #include <linux/platform_device.h> #include <linux/irq.h> #include <linux/io.h> #include <linux/mtd/partitions.h> #include <linux/smc91x.h> #include <mach/hardware.h> #include <asm/setup.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> #include <asm/mach/flash.h> #include <mach/irqs.h> #include "generic.h" /* * Ethernet IRQ mappings */ #define PLEB_ETH0_P (0x20000300) /* Ethernet 0 in PCMCIA0 IO */ #define PLEB_ETH0_V (0xf6000300) #define GPIO_ETH0_IRQ GPIO_GPIO(21) #define GPIO_ETH0_EN GPIO_GPIO(26) #define IRQ_GPIO_ETH0_IRQ IRQ_GPIO21 static struct resource smc91x_resources[] = { [0] = DEFINE_RES_MEM(PLEB_ETH0_P, 0x04000000), #if 0 /* Autoprobe instead, to get rising/falling edge characteristic right */ [1] = DEFINE_RES_IRQ(IRQ_GPIO_ETH0_IRQ), #endif }; static struct smc91x_platdata smc91x_platdata = { .flags = SMC91X_USE_16BIT | SMC91X_USE_8BIT | SMC91X_NOWAIT, }; static struct platform_device smc91x_device = { .name = "smc91x", .id = 0, .num_resources = ARRAY_SIZE(smc91x_resources), .resource = smc91x_resources, .dev = { .platform_data = &smc91x_platdata, }, }; static struct platform_device *devices[] __initdata = { &smc91x_device, }; /* * Pleb's memory map * has flash memory (typically 4 or 8 meg) selected by * the two SA1100 lowest chip select outputs. */ static struct resource pleb_flash_resources[] = { [0] = DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_8M), [1] = DEFINE_RES_MEM(SA1100_CS1_PHYS, SZ_8M), }; static struct mtd_partition pleb_partitions[] = { { .name = "blob", .offset = 0, .size = 0x00020000, }, { .name = "kernel", .offset = MTDPART_OFS_APPEND, .size = 0x000e0000, }, { .name = "rootfs", .offset = MTDPART_OFS_APPEND, .size = 0x00300000, } }; static struct flash_platform_data pleb_flash_data = { .map_name = "cfi_probe", .parts = pleb_partitions, .nr_parts = ARRAY_SIZE(pleb_partitions), }; static void __init pleb_init(void) { sa11x0_register_mtd(&pleb_flash_data, pleb_flash_resources, ARRAY_SIZE(pleb_flash_resources)); platform_add_devices(devices, ARRAY_SIZE(devices)); } static void __init pleb_map_io(void) { sa1100_map_io(); sa1100_register_uart(0, 3); sa1100_register_uart(1, 1); GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD); GPDR |= GPIO_UART_TXD; GPDR &= ~GPIO_UART_RXD; PPAR |= PPAR_UPR; /* * Fix expansion memory timing for network card */ MECR = ((2<<10) | (2<<5) | (2<<0)); /* * Enable the SMC ethernet controller */ GPDR |= GPIO_ETH0_EN; /* set to output */ GPCR = GPIO_ETH0_EN; /* clear MCLK (enable smc) */ GPDR &= ~GPIO_ETH0_IRQ; irq_set_irq_type(GPIO_ETH0_IRQ, IRQ_TYPE_EDGE_FALLING); } MACHINE_START(PLEB, "PLEB") .map_io = pleb_map_io, .nr_irqs = SA1100_NR_IRQS, .init_irq = sa1100_init_irq, .init_time = sa1100_timer_init, .init_machine = pleb_init, .init_late = sa11x0_init_late, .restart = sa11x0_restart, MACHINE_END
#ifndef __ASM_ARM_IRQ_H #define __ASM_ARM_IRQ_H #include <asm/arch/irqs.h> #ifndef irq_cannonicalize #define irq_cannonicalize(i) (i) #endif #ifndef NR_IRQS #define NR_IRQS 128 #endif /* * Use this value to indicate lack of interrupt * capability */ #ifndef NO_IRQ #define NO_IRQ ((unsigned int)(-1)) #endif #define disable_irq_nosync(i) disable_irq(i) extern void disable_irq(unsigned int); extern void enable_irq(unsigned int); #endif
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. 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; version 2 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Static variables for MyISAM library. All definied here for easy making of a shared library */ #ifndef _global_h #include "myisamdef.h" #endif LIST *myisam_open_list=0; uchar myisam_file_magic[]= { (uchar) 254, (uchar) 254,'\007', '\001', }; uchar myisam_pack_file_magic[]= { (uchar) 254, (uchar) 254,'\010', '\002', }; char * myisam_log_filename=(char*) "myisam.log"; File myisam_log_file= -1; uint myisam_quick_table_bits=9; ulong myisam_block_size= MI_KEY_BLOCK_LENGTH; /* Best by test */ my_bool myisam_flush=0, myisam_delay_key_write=0, myisam_single_user=0; #if !defined(DONT_USE_RW_LOCKS) ulong myisam_concurrent_insert= 2; #else ulong myisam_concurrent_insert= 0; #endif ulonglong myisam_max_temp_length= MAX_FILE_SIZE; ulong myisam_data_pointer_size=4; ulonglong myisam_mmap_size= SIZE_T_MAX, myisam_mmap_used= 0; static int always_valid(const char *filename __attribute__((unused))) { return 0; } int (*myisam_test_invalid_symlink)(const char *filename)= always_valid; /* read_vec[] is used for converting between P_READ_KEY.. and SEARCH_ Position is , == , >= , <= , > , < */ uint myisam_read_vec[]= { SEARCH_FIND, SEARCH_FIND | SEARCH_BIGGER, SEARCH_FIND | SEARCH_SMALLER, SEARCH_NO_FIND | SEARCH_BIGGER, SEARCH_NO_FIND | SEARCH_SMALLER, SEARCH_FIND | SEARCH_PREFIX, SEARCH_LAST, SEARCH_LAST | SEARCH_SMALLER, MBR_CONTAIN, MBR_INTERSECT, MBR_WITHIN, MBR_DISJOINT, MBR_EQUAL }; uint myisam_readnext_vec[]= { SEARCH_BIGGER, SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_SMALLER }; #ifdef HAVE_PSI_INTERFACE PSI_mutex_key mi_key_mutex_MYISAM_SHARE_intern_lock, mi_key_mutex_MI_SORT_INFO_mutex, mi_key_mutex_MI_CHECK_print_msg; static PSI_mutex_info all_myisam_mutexes[]= { { &mi_key_mutex_MI_SORT_INFO_mutex, "MI_SORT_INFO::mutex", 0}, { &mi_key_mutex_MYISAM_SHARE_intern_lock, "MYISAM_SHARE::intern_lock", 0}, { &mi_key_mutex_MI_CHECK_print_msg, "MI_CHECK::print_msg", 0} }; PSI_rwlock_key mi_key_rwlock_MYISAM_SHARE_key_root_lock, mi_key_rwlock_MYISAM_SHARE_mmap_lock; static PSI_rwlock_info all_myisam_rwlocks[]= { { &mi_key_rwlock_MYISAM_SHARE_key_root_lock, "MYISAM_SHARE::key_root_lock", 0}, { &mi_key_rwlock_MYISAM_SHARE_mmap_lock, "MYISAM_SHARE::mmap_lock", 0} }; PSI_cond_key mi_key_cond_MI_SORT_INFO_cond; static PSI_cond_info all_myisam_conds[]= { { &mi_key_cond_MI_SORT_INFO_cond, "MI_SORT_INFO::cond", 0} }; PSI_file_key mi_key_file_datatmp, mi_key_file_dfile, mi_key_file_kfile, mi_key_file_log; static PSI_file_info all_myisam_files[]= { { & mi_key_file_datatmp, "data_tmp", 0}, { & mi_key_file_dfile, "dfile", 0}, { & mi_key_file_kfile, "kfile", 0}, { & mi_key_file_log, "log", 0} }; PSI_thread_key mi_key_thread_find_all_keys; static PSI_thread_info all_myisam_threads[]= { { &mi_key_thread_find_all_keys, "find_all_keys", 0}, }; void init_myisam_psi_keys() { const char* category= "myisam"; int count; if (PSI_server == NULL) return; count= array_elements(all_myisam_mutexes); PSI_server->register_mutex(category, all_myisam_mutexes, count); count= array_elements(all_myisam_rwlocks); PSI_server->register_rwlock(category, all_myisam_rwlocks, count); count= array_elements(all_myisam_conds); PSI_server->register_cond(category, all_myisam_conds, count); count= array_elements(all_myisam_files); PSI_server->register_file(category, all_myisam_files, count); count= array_elements(all_myisam_threads); PSI_server->register_thread(category, all_myisam_threads, count); } #endif /* HAVE_PSI_INTERFACE */
#ifndef QT_NO_QT_INCLUDE_WARN #if defined(__GNUC__) #warning "Inclusion of header files from include/Qt is deprecated." #elif defined(_MSC_VER) #pragma message("WARNING: Inclusion of header files from include/Qt is deprecated.") #endif #endif #include "../ActiveQt/qaxaggregated.h"