text
stringlengths
4
6.14k
/* * include/asm-mips/irq.h * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1994 by Waldorf GMBH * written by Ralf Baechle * */ #ifndef __ASM_MIPS_IRQ_H #define __ASM_MIPS_IRQ_H /* * Actually this is a lie but we hide the local device's interrupts ... */ #define NR_IRQS 16 extern void disable_irq(unsigned int); extern void enable_irq(unsigned int); #endif /* __ASM_MIPS_IRQ_H */
/* EEPROM like API that uses Arduino Zero's flash memory. Written by A. Christian Copyright (c) 2015-2016 Arduino LLC. All right 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 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 */ #ifndef FLASH_AS_EEPROM_h #define FLASH_AS_EEPROM_h #include "FlashStorage.h" #ifndef EEPROM_EMULATION_SIZE #define EEPROM_EMULATION_SIZE 1024 #endif typedef struct { byte data[EEPROM_EMULATION_SIZE]; boolean valid; } EEPROM_EMULATION; class EEPROMClass { public: EEPROMClass(void); /** * Read an eeprom cell * @param index * @return value */ uint8_t read(int); /** * Write value to an eeprom cell * @param index * @param value */ void write(int, uint8_t); /** * Update a eeprom cell * @param index * @param value */ void update(int, uint8_t); /** * Check whether the eeprom data is valid * @return true, if eeprom data is valid (has been written at least once), false if not */ bool isValid(); /** * Write previously made eeprom changes to the underlying flash storage * Use this with care: Each and every commit will harm the flash and reduce it's lifetime (like with every flash memory) */ void commit(); uint16_t length() { return EEPROM_EMULATION_SIZE; } private: void init(); bool _initialized; EEPROM_EMULATION _eeprom; bool _dirty; }; extern EEPROMClass EEPROM; #endif
/* Return backtrace of current program state. 64 bit S/390 version. Copyright (C) 2001-2016 Free Software Foundation, Inc. Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>. 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 <libc-lock.h> #include <dlfcn.h> #include <execinfo.h> #include <stddef.h> #include <stdlib.h> #include <unwind.h> /* This is a global variable set at program start time. It marks the highest used stack address. */ extern void *__libc_stack_end; /* This is the stack layout we see for every non-leaf function. size offset %r15 -> +------------------+ 8 | back chain | 0 8 | end of stack | 8 32 | scratch | 16 80 | save area r6-r15 | 48 16 | save area f4,f6 | 128 16 | empty | 144 +------------------+ r14 in the save area holds the return address. */ struct layout { long back_chain; long end_of_stack; long scratch[4]; long save_grps[10]; long save_fp[2]; long empty[2]; }; struct trace_arg { void **array; int cnt, size; }; #ifdef SHARED static _Unwind_Reason_Code (*unwind_backtrace) (_Unwind_Trace_Fn, void *); static _Unwind_Ptr (*unwind_getip) (struct _Unwind_Context *); static void init (void) { void *handle = __libc_dlopen ("libgcc_s.so.1"); if (handle == NULL) return; unwind_backtrace = __libc_dlsym (handle, "_Unwind_Backtrace"); unwind_getip = __libc_dlsym (handle, "_Unwind_GetIP"); if (unwind_getip == NULL) unwind_backtrace = NULL; } static int __backchain_backtrace (void **array, int size) { /* We assume that all the code is generated with frame pointers set. */ struct layout *stack; int cnt = 0; __asm__ ("LGR %0,%%r15" : "=d" (stack) ); /* We skip the call to this function, it makes no sense to record it. */ stack = (struct layout *) stack->back_chain; while (cnt < size) { if (stack == NULL || (void *) stack > __libc_stack_end) /* This means the address is out of range. Note that for the toplevel we see a frame pointer with value NULL which clearly is out of range. */ break; array[cnt++] = (void *) stack->save_grps[8]; stack = (struct layout *) stack->back_chain; } return cnt; } #else # define unwind_backtrace _Unwind_Backtrace # define unwind_getip _Unwind_GetIP #endif static _Unwind_Reason_Code backtrace_helper (struct _Unwind_Context *ctx, void *a) { struct trace_arg *arg = a; /* We are first called with address in the __backtrace function. Skip it. */ if (arg->cnt != -1) arg->array[arg->cnt] = (void *) unwind_getip (ctx); if (++arg->cnt == arg->size) return _URC_END_OF_STACK; return _URC_NO_REASON; } int __backtrace (void **array, int size) { struct trace_arg arg = { .array = array, .size = size, .cnt = -1 }; if (size <= 0) return 0; #ifdef SHARED __libc_once_define (static, once); __libc_once (once, init); if (unwind_backtrace == NULL) return __backchain_backtrace (array, size); #endif unwind_backtrace (backtrace_helper, &arg); return arg.cnt != -1 ? arg.cnt : 0; } weak_alias (__backtrace, backtrace) libc_hidden_def (__backtrace)
#ifndef _ASM_X86_PGTABLE_64_H #define _ASM_X86_PGTABLE_64_H #include <linux/const.h> #include <asm/pgtable_64_types.h> #ifndef __ASSEMBLY__ /* * This file contains the functions and defines necessary to modify and use * the x86-64 page table tree. */ #include <asm/processor.h> #include <linux/bitops.h> #include <linux/threads.h> #include <asm/mm_track.h> extern pud_t level3_kernel_pgt[512]; extern pud_t level3_ident_pgt[512]; extern pmd_t level2_kernel_pgt[512]; extern pmd_t level2_fixmap_pgt[512]; extern pmd_t level2_ident_pgt[512]; extern pgd_t init_level4_pgt[]; #define swapper_pg_dir init_level4_pgt extern void paging_init(void); #define pte_ERROR(e) \ pr_err("%s:%d: bad pte %p(%016lx)\n", \ __FILE__, __LINE__, &(e), pte_val(e)) #define pmd_ERROR(e) \ pr_err("%s:%d: bad pmd %p(%016lx)\n", \ __FILE__, __LINE__, &(e), pmd_val(e)) #define pud_ERROR(e) \ pr_err("%s:%d: bad pud %p(%016lx)\n", \ __FILE__, __LINE__, &(e), pud_val(e)) #define pgd_ERROR(e) \ pr_err("%s:%d: bad pgd %p(%016lx)\n", \ __FILE__, __LINE__, &(e), pgd_val(e)) struct mm_struct; void set_pte_vaddr_pud(pud_t *pud_page, unsigned long vaddr, pte_t new_pte); static inline void native_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { mm_track_pte(ptep); *ptep = native_make_pte(0); } static inline void native_set_pte(pte_t *ptep, pte_t pte) { mm_track_pte(ptep); *ptep = pte; } static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte) { native_set_pte(ptep, pte); } static inline void native_set_pmd(pmd_t *pmdp, pmd_t pmd) { mm_track_pmd(pmdp); *pmdp = pmd; } static inline void native_pmd_clear(pmd_t *pmd) { native_set_pmd(pmd, native_make_pmd(0)); } static inline pte_t native_ptep_get_and_clear(pte_t *xp) { mm_track_pte(xp); #ifdef CONFIG_SMP return native_make_pte(xchg(&xp->pte, 0)); #else /* native_local_ptep_get_and_clear, but duplicated because of cyclic dependency */ pte_t ret = *xp; native_pte_clear(NULL, 0, xp); return ret; #endif } static inline pmd_t native_pmdp_get_and_clear(pmd_t *xp) { #ifdef CONFIG_SMP return native_make_pmd(xchg(&xp->pmd, 0)); #else /* native_local_pmdp_get_and_clear, but duplicated because of cyclic dependency */ pmd_t ret = *xp; native_pmd_clear(xp); return ret; #endif } static inline void native_set_pud(pud_t *pudp, pud_t pud) { mm_track_pud(pudp); *pudp = pud; } static inline void native_pud_clear(pud_t *pud) { native_set_pud(pud, native_make_pud(0)); } static inline void native_set_pgd(pgd_t *pgdp, pgd_t pgd) { mm_track_pgd(pgdp); *pgdp = pgd; } static inline void native_pgd_clear(pgd_t *pgd) { native_set_pgd(pgd, native_make_pgd(0)); } extern void sync_global_pgds(unsigned long start, unsigned long end); /* * Conversion functions: convert a page and protection to a page entry, * and a page entry and page directory to the page they refer to. */ /* * Level 4 access. */ static inline int pgd_large(pgd_t pgd) { return 0; } #define mk_kernel_pgd(address) __pgd((address) | _KERNPG_TABLE) /* PUD - Level3 access */ /* PMD - Level 2 access */ #define pte_to_pgoff(pte) ((pte_val((pte)) & PHYSICAL_PAGE_MASK) >> PAGE_SHIFT) #define pgoff_to_pte(off) ((pte_t) { .pte = ((off) << PAGE_SHIFT) | \ _PAGE_FILE }) #define PTE_FILE_MAX_BITS __PHYSICAL_MASK_SHIFT /* PTE - Level 1 access. */ /* x86-64 always has all page tables mapped. */ #define pte_offset_map(dir, address) pte_offset_kernel((dir), (address)) #define pte_unmap(pte) ((void)(pte))/* NOP */ /* Encode and de-code a swap entry */ #if _PAGE_BIT_FILE < _PAGE_BIT_PROTNONE #define SWP_TYPE_BITS (_PAGE_BIT_FILE - _PAGE_BIT_PRESENT - 1) #define SWP_OFFSET_SHIFT (_PAGE_BIT_PROTNONE + 1) #else #define SWP_TYPE_BITS (_PAGE_BIT_PROTNONE - _PAGE_BIT_PRESENT - 1) #define SWP_OFFSET_SHIFT (_PAGE_BIT_FILE + 1) #endif #define MAX_SWAPFILES_CHECK() BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > SWP_TYPE_BITS) #define __swp_type(x) (((x).val >> (_PAGE_BIT_PRESENT + 1)) \ & ((1U << SWP_TYPE_BITS) - 1)) #define __swp_offset(x) ((x).val >> SWP_OFFSET_SHIFT) #define __swp_entry(type, offset) ((swp_entry_t) { \ ((type) << (_PAGE_BIT_PRESENT + 1)) \ | ((offset) << SWP_OFFSET_SHIFT) }) #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val((pte)) }) #define __swp_entry_to_pte(x) ((pte_t) { .pte = (x).val }) extern int kern_addr_valid(unsigned long addr); extern void cleanup_highmap(void); #define HAVE_ARCH_UNMAPPED_AREA #define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN #define pgtable_cache_init() do { } while (0) #define check_pgt_cache() do { } while (0) #define PAGE_AGP PAGE_KERNEL_NOCACHE #define HAVE_PAGE_AGP 1 /* fs/proc/kcore.c */ #define kc_vaddr_to_offset(v) ((v) & __VIRTUAL_MASK) #define kc_offset_to_vaddr(o) ((o) | ~__VIRTUAL_MASK) #define __HAVE_ARCH_PTE_SAME #define vmemmap ((struct page *)VMEMMAP_START) extern void init_extra_mapping_uc(unsigned long phys, unsigned long size); extern void init_extra_mapping_wb(unsigned long phys, unsigned long size); #endif /* !__ASSEMBLY__ */ #endif /* _ASM_X86_PGTABLE_64_H */
/* * BK Id: SCCS/s.uninorth.h 1.13 10/23/01 08:09:35 trini */ /* * uninorth.h: definitions for using the "UniNorth" host bridge chip * from Apple. This chip is used on "Core99" machines * */ #ifdef __KERNEL__ #ifndef __ASM_UNINORTH_H__ #define __ASM_UNINORTH_H__ /* * Uni-N config space reg. definitions * * (Little endian) */ /* Address ranges selection. This one should work with Bandit too */ #define UNI_N_ADDR_SELECT 0x48 #define UNI_N_ADDR_COARSE_MASK 0xffff0000 /* 256Mb regions at *0000000 */ #define UNI_N_ADDR_FINE_MASK 0x0000ffff /* 16Mb regions at f*000000 */ /* AGP registers */ #define UNI_N_CFG_GART_BASE 0x8c #define UNI_N_CFG_AGP_BASE 0x90 #define UNI_N_CFG_GART_CTRL 0x94 #define UNI_N_CFG_INTERNAL_STATUS 0x98 /* UNI_N_CFG_GART_CTRL bits definitions */ #define UNI_N_CFG_GART_INVAL 0x00000001 #define UNI_N_CFG_GART_ENABLE 0x00000100 #define UNI_N_CFG_GART_2xRESET 0x00010000 /* My understanding of UniNorth AGP as of UniNorth rev 1.0x, * revision 1.5 (x4 AGP) may need further changes. * * AGP_BASE register contains the base address of the AGP aperture on * the AGP bus. It doesn't seem to be visible to the CPU as of UniNorth 1.x, * even if decoding of this address range is enabled in the address select * register. Apparently, the only supported bases are 256Mb multiples * (high 4 bits of that register). * * GART_BASE register appear to contain the physical address of the GART * in system memory in the high address bits (page aligned), and the * GART size in the low order bits (number of GART pages) * * The GART format itself is one 32bits word per physical memory page. * This word contains, in little-endian format (!!!), the physical address * of the page in the high bits, and what appears to be an "enable" bit * in the LSB bit (0) that must be set to 1 when the entry is valid. * * Obviously, the GART is not cache coherent and so any change to it * must be flushed to memory (or maybe just make the GART space non * cachable). AGP memory itself doens't seem to be cache coherent neither. * * In order to invalidate the GART (which is probably necessary to inval * the bridge internal TLBs), the following sequence has to be written, * in order, to the GART_CTRL register: * * UNI_N_CFG_GART_ENABLE | UNI_N_CFG_GART_INVAL * UNI_N_CFG_GART_ENABLE * UNI_N_CFG_GART_ENABLE | UNI_N_CFG_GART_2xRESET * UNI_N_CFG_GART_ENABLE * * As far as AGP "features" are concerned, it looks like fast write may * not be supported but this has to be confirmed. * * Turning on AGP seem to require a double invalidate operation, one before * setting the AGP command register, on after. * * Turning off AGP seems to require the following sequence: first wait * for the AGP to be idle by reading the internal status register, then * write in that order to the GART_CTRL register: * * UNI_N_CFG_GART_ENABLE | UNI_N_CFG_GART_INVAL * 0 * UNI_N_CFG_GART_2xRESET * 0 */ /* * Uni-N memory mapped reg. definitions * * Those registers are Big-Endian !! * * Their meaning come from either Darwin and/or from experiments I made with * the bootrom, I'm not sure about their exact meaning yet * */ /* Version of the UniNorth chip */ #define UNI_N_VERSION 0x0000 /* Known versions: 3,7 and 8 */ /* This register is used to enable/disable various clocks */ #define UNI_N_CLOCK_CNTL 0x0020 #define UNI_N_CLOCK_CNTL_PCI 0x00000001 /* PCI2 clock control */ #define UNI_N_CLOCK_CNTL_GMAC 0x00000002 /* GMAC clock control */ #define UNI_N_CLOCK_CNTL_FW 0x00000004 /* FireWire clock control */ /* Power Management control */ #define UNI_N_POWER_MGT 0x0030 #define UNI_N_POWER_MGT_NORMAL 0x00 #define UNI_N_POWER_MGT_IDLE2 0x01 #define UNI_N_POWER_MGT_SLEEP 0x02 /* This register is configured by Darwin depending on the UniN * revision */ #define UNI_N_ARB_CTRL 0x0040 #define UNI_N_ARB_CTRL_QACK_DELAY_SHIFT 15 #define UNI_N_ARB_CTRL_QACK_DELAY_MASK 0x0e1f8000 #define UNI_N_ARB_CTRL_QACK_DELAY 0x30 #define UNI_N_ARB_CTRL_QACK_DELAY105 0x00 /* This one _might_ return the CPU number of the CPU reading it; * the bootROM decides wether to boot or to sleep/spinloop depending * on this register beeing 0 or not */ #define UNI_N_CPU_NUMBER 0x0050 /* This register appear to be read by the bootROM to decide what * to do on a non-recoverable reset (powerup or wakeup) */ #define UNI_N_HWINIT_STATE 0x0070 #define UNI_N_HWINIT_STATE_SLEEPING 0x01 #define UNI_N_HWINIT_STATE_RUNNING 0x02 /* This last bit appear to be used by the bootROM to know the second * CPU has started and will enter it's sleep loop with IP=0 */ #define UNI_N_HWINIT_STATE_CPU1_FLAG 0x10000000 /* Uninorth 1.5 rev. has additional perf. monitor registers at 0xf00-0xf50 */ #endif /* __ASM_UNINORTH_H__ */ #endif /* __KERNEL__ */
/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * FILE: drivers/net/afd/afd/context.c * PURPOSE: Ancillary functions driver * PROGRAMMER: Art Yerkes (ayerkes@speakeasy.net) * UPDATE HISTORY: * 20040708 Created */ #include "afd.h" NTSTATUS NTAPI AfdGetContext( PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp ) { NTSTATUS Status = STATUS_INVALID_PARAMETER; PFILE_OBJECT FileObject = IrpSp->FileObject; PAFD_FCB FCB = FileObject->FsContext; UINT ContextSize = IrpSp->Parameters.DeviceIoControl.OutputBufferLength; UNREFERENCED_PARAMETER(DeviceObject); if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); if( FCB->ContextSize < ContextSize ) ContextSize = FCB->ContextSize; if( FCB->Context ) { RtlCopyMemory( Irp->UserBuffer, FCB->Context, ContextSize ); Status = STATUS_SUCCESS; } AFD_DbgPrint(MID_TRACE,("Returning %x\n", Status)); return UnlockAndMaybeComplete( FCB, Status, Irp, ContextSize ); } NTSTATUS NTAPI AfdGetContextSize( PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp ) { PFILE_OBJECT FileObject = IrpSp->FileObject; PAFD_FCB FCB = FileObject->FsContext; UNREFERENCED_PARAMETER(DeviceObject); if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); if (IrpSp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(ULONG)) { AFD_DbgPrint(MIN_TRACE,("Buffer too small\n")); return UnlockAndMaybeComplete(FCB, STATUS_BUFFER_TOO_SMALL, Irp, sizeof(ULONG)); } RtlCopyMemory(Irp->UserBuffer, &FCB->ContextSize, sizeof(ULONG)); return UnlockAndMaybeComplete(FCB, STATUS_SUCCESS, Irp, sizeof(ULONG)); } NTSTATUS NTAPI AfdSetContext( PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp ) { PFILE_OBJECT FileObject = IrpSp->FileObject; PAFD_FCB FCB = FileObject->FsContext; PVOID Context = LockRequest(Irp, IrpSp, FALSE, NULL); UNREFERENCED_PARAMETER(DeviceObject); if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); if (!Context) return UnlockAndMaybeComplete(FCB, STATUS_NO_MEMORY, Irp, 0); if( FCB->Context ) { ExFreePool( FCB->Context ); FCB->ContextSize = 0; } FCB->Context = ExAllocatePool( PagedPool, IrpSp->Parameters.DeviceIoControl.InputBufferLength ); if( !FCB->Context ) return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0 ); FCB->ContextSize = IrpSp->Parameters.DeviceIoControl.InputBufferLength; RtlCopyMemory( FCB->Context, Context, FCB->ContextSize ); return UnlockAndMaybeComplete( FCB, STATUS_SUCCESS, Irp, 0 ); }
/**************************************************************************** ** ** Copyright (C) 2014 Kurt Pattyn <pattyn.kurt@gmail.com>. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWebSockets module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QWEBSOCKETSERVER_H #define QWEBSOCKETSERVER_H #include "QtWebSockets/qwebsockets_global.h" #include "QtWebSockets/qwebsocketprotocol.h" #include <QtCore/QObject> #include <QtCore/QString> #include <QtNetwork/QHostAddress> #ifndef QT_NO_SSL #include <QtNetwork/QSslConfiguration> #include <QtNetwork/QSslError> #endif QT_BEGIN_NAMESPACE class QWebSocketServerPrivate; class QWebSocket; class QWebSocketCorsAuthenticator; class Q_WEBSOCKETS_EXPORT QWebSocketServer : public QObject { Q_OBJECT Q_DISABLE_COPY(QWebSocketServer) Q_DECLARE_PRIVATE(QWebSocketServer) Q_ENUMS(SslMode) public: enum SslMode { #ifndef QT_NO_SSL SecureMode, #endif NonSecureMode }; explicit QWebSocketServer(const QString &serverName, SslMode secureMode, QObject *parent = 0); virtual ~QWebSocketServer(); bool listen(const QHostAddress &address = QHostAddress::Any, quint16 port = 0); void close(); bool isListening() const; void setMaxPendingConnections(int numConnections); int maxPendingConnections() const; quint16 serverPort() const; QHostAddress serverAddress() const; QUrl serverUrl() const; SslMode secureMode() const; bool setSocketDescriptor(int socketDescriptor); int socketDescriptor() const; bool hasPendingConnections() const; virtual QWebSocket *nextPendingConnection(); QWebSocketProtocol::CloseCode error() const; QString errorString() const; void pauseAccepting(); void resumeAccepting(); void setServerName(const QString &serverName); QString serverName() const; #ifndef QT_NO_NETWORKPROXY void setProxy(const QNetworkProxy &networkProxy); QNetworkProxy proxy() const; #endif #ifndef QT_NO_SSL void setSslConfiguration(const QSslConfiguration &sslConfiguration); QSslConfiguration sslConfiguration() const; #endif QList<QWebSocketProtocol::Version> supportedVersions() const; Q_SIGNALS: void acceptError(QAbstractSocket::SocketError socketError); void serverError(QWebSocketProtocol::CloseCode closeCode); //TODO: should use a delegate iso of a synchronous signal //see also QTBUG-16251 void originAuthenticationRequired(QWebSocketCorsAuthenticator *pAuthenticator); void newConnection(); #ifndef QT_NO_SSL void peerVerifyError(const QSslError &error); void sslErrors(const QList<QSslError> &errors); #endif void closed(); }; QT_END_NAMESPACE #endif // QWEBSOCKETSERVER_H
#pragma once #include "AP_HAL_VRBRAIN.h" #include <systemlib/perf_counter.h> #include <uORB/topics/actuator_outputs.h> #include <uORB/topics/actuator_armed.h> #define VRBRAIN_NUM_OUTPUT_CHANNELS 16 class VRBRAIN::VRBRAINRCOutput : public AP_HAL::RCOutput { public: void init() override; void set_freq(uint32_t chmask, uint16_t freq_hz) override; uint16_t get_freq(uint8_t ch) override; void enable_ch(uint8_t ch) override; void disable_ch(uint8_t ch) override; void write(uint8_t ch, uint16_t period_us) override; uint16_t read(uint8_t ch) override; void read(uint16_t* period_us, uint8_t len) override; uint16_t read_last_sent(uint8_t ch) override; void read_last_sent(uint16_t* period_us, uint8_t len) override; void set_safety_pwm(uint32_t chmask, uint16_t period_us) override; void set_failsafe_pwm(uint32_t chmask, uint16_t period_us) override; bool force_safety_on(void) override; void force_safety_off(void) override; void force_safety_no_wait(void) override; void set_esc_scaling(uint16_t min_pwm, uint16_t max_pwm) override { _esc_pwm_min = min_pwm; _esc_pwm_max = max_pwm; } void cork(); void push(); void set_output_mode(enum output_mode mode) override; void _timer_tick(void); bool enable_px4io_sbus_out(uint16_t rate_hz) override; private: int _pwm_fd; int _alt_fd; uint16_t _freq_hz; uint16_t _period[VRBRAIN_NUM_OUTPUT_CHANNELS]; volatile uint8_t _max_channel; volatile bool _need_update; bool _sbus_enabled:1; perf_counter_t _perf_rcout; uint32_t _last_output; uint32_t _last_config_us; unsigned _servo_count; unsigned _alt_servo_count; uint32_t _rate_mask; uint16_t _enabled_channels; struct { int pwm_sub; actuator_outputs_s outputs; } _outputs[ORB_MULTI_MAX_INSTANCES] {}; actuator_armed_s _armed; orb_advert_t _actuator_direct_pub = nullptr; orb_advert_t _actuator_armed_pub = nullptr; uint16_t _esc_pwm_min = 0; uint16_t _esc_pwm_max = 0; void _init_alt_channels(void); void _publish_actuators(void); void _arm_actuators(bool arm); void set_freq_fd(int fd, uint32_t chmask, uint16_t freq_hz); bool _corking; enum output_mode _output_mode = MODE_PWM_NORMAL; void _send_outputs(void); enum AP_HAL::Util::safety_state _safety_state_request = AP_HAL::Util::SAFETY_NONE; uint32_t _safety_state_request_last_ms = 0; void force_safety_pending_requests(void); };
/* factorial.h Copyright (C) 2011 and later Lubomir I. Ivanov (neolit123 [at] gmail) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ /* methods to return low-order factorials depending on allowed data types. 20! = 2432902008176640000 is the maximum factorial to be held in a unsigned 64bit integer. 13! = 479001600 is the maximum factorial to be held in a unsigned 32bit integer. */ #ifndef _FACTORIAL_H_ #define _FACTORIAL_H_ #include "custom_math.h" #define FACTORIAL_LOWER \ MK_ULL(1), \ MK_ULL(1), \ MK_ULL(2), \ MK_ULL(6), \ MK_ULL(24), \ MK_ULL(120), \ MK_ULL(720), \ MK_ULL(5040), \ MK_ULL(40320), \ MK_ULL(362880), \ MK_ULL(3628800), \ MK_ULL(39916800), \ MK_ULL(479001600) #define FACTORIAL_HIGHER \ MK_ULL(6227020800), \ MK_ULL(87178291200), \ MK_ULL(1307674368000), \ MK_ULL(20922789888000), \ MK_ULL(355687428096000), \ MK_ULL(6402373705728000), \ MK_ULL(121645100408832000), \ MK_ULL(2432902008176640000) static const cmath_std_uint_t _factorials[] = { #ifdef _CMATH_ANSI FACTORIAL_LOWER #else FACTORIAL_LOWER, FACTORIAL_HIGHER #endif }; static const cmath_t _inv_factorials[] = { 1.00000000000000000000000000000000, 1.00000000000000000000000000000000, 0.50000000000000000000000000000000, 0.16666666666666666666666666666667, 0.04166666666666666666666666666666, 0.00833333333333333333333333333333, 0.00138888888888888888888888888888, 0.00019841269841269841269841269841, 0.00002480158730158730158730158730, 0.00000275573192239858906525573192, 0.00000027557319223985890652557319, 0.00000002505210838544171877505210, 0.00000000208767569878680989792100, 0.00000000016059043836821614599390, 0.00000000001147074559772972471385, 0.00000000000076471637318198164750, 0.00000000000004779477332387385297, 0.00000000000000281145725434552076, 0.00000000000000015619206968586225, 0.00000000000000000822063524662433, 0.00000000000000000041103176233122 }; _CMATH_INLINE cmath_std_uint_t factorial(const cmath_uint32_t x) { if(x >= cmath_array_size(_factorials)) return 0; else return _factorials[x]; } _CMATH_INLINE cmath_t inv_factorial(const cmath_uint32_t x) { if(x >= cmath_array_size(_inv_factorials)) return 0; else return _inv_factorials[x]; } #endif /* _FACTORIAL_H_ */
/* * Multi2Sim * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) * * 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 ARCH_HSA_DISASSEMBLER_BRIGFILE_H #define ARCH_HSA_DISASSEMBLER_BRIGFILE_H #include <cstdint> #include <memory> #include <vector> #include <lib/cpp/Error.h> #include "Brig.h" #include "BrigSection.h" namespace HSA { class BrigSection; class BrigCodeEntry; class BrigDataEntry; class BrigOperandEntry; /// This class represents the ELF file defined by HSA standard, or called /// BRIG format. It encapsulates the ELFReader class and provide unique /// interfaces to the other parts of the Multi2sim. class BrigFile { // The path to the file std::string path; // The buffer of the file content std::unique_ptr<char> buffer; // An list of BRIG sections, maps section index to section std::vector<std::unique_ptr<BrigSection>> sections; // Set the section vector void PrepareSections(); public: /// Constructor BrigFile() {}; /// Loads a BRIG file from the file system, create sections void LoadFileByPath(const std::string &path); /// Loads a BRIG file from a memory block /// BrigFile(char *file, unsigned size); /// Load the file from a chunk of memory void LoadFileFromBuffer(const char *file); /// Destructor ~BrigFile(); /// Returns the path to the BRIG file const std::string &getPath() const { return path; } /// Return the buffer of the BRIG file const char *getBuffer() const { return buffer.get(); } /// Returns the section according to the type value passed in BrigSection *getBrigSection(BrigSectionIndex section_index) const; /// Checks if the loaded brig file is a brig file /// /// \return /// Returns \c true if the loaded file is valid /// static bool isBrigFile(const char *file); /// Returns the number of sections in the BRIG file unsigned int getNumSections() const; /// Retrieve an entry in the code section std::unique_ptr<BrigCodeEntry> getCodeEntryByOffset( unsigned int offset) const; /// Return the string that is stored in the hsa_data section by its /// offset virtual const std::string getStringByOffset(unsigned int offset) const; /// Return the data entry at a certain offset virtual std::unique_ptr<BrigDataEntry> getDataEntryByOffset( unsigned int offset) const; /// Return an operand from the operand section by offset virtual std::unique_ptr<BrigOperandEntry> getOperandByOffset( unsigned int offset) const; }; } // namespace HSA #endif
/* optimize: get a grip on the different optimizations copyright 2006 by the mpg123 project - free software under the terms of the LGPL 2.1 see COPYING and AUTHORS files in distribution or http://mpg123.org initially written by Thomas Orgis, inspired by 3DNow stuff in mpg123.[hc] Currently, this file contains the struct and function to choose an optimization variant and works only when OPT_MULTI is in effect. */ #include "mpg123lib_intern.h" /* includes optimize.h */ #ifdef OPT_MULTI #include "getcpuflags.h" struct cpuflags cpu_flags; /* same number of entries as full list, but empty at beginning */ static char *mpg123_supported_decoder_list[] = { #ifdef OPT_3DNOWEXT NULL, #endif #ifdef OPT_SSE NULL, #endif #ifdef OPT_3DNOW NULL, #endif #ifdef OPT_MMX NULL, #endif #ifdef OPT_I586 NULL, #endif #ifdef OPT_I586_DITHER NULL, #endif #ifdef OPT_I486 NULL, #endif #ifdef OPT_I386 NULL, #endif #ifdef OPT_ALTIVEC NULL, #endif NULL, /* generic */ NULL }; #endif static char *mpg123_decoder_list[] = { #ifdef OPT_3DNOWEXT "3DNowExt", #endif #ifdef OPT_SSE "SSE", #endif #ifdef OPT_3DNOW "3DNow", #endif #ifdef OPT_MMX "MMX", #endif #ifdef OPT_I586 "i586", #endif #ifdef OPT_I586_DITHER "i586_dither", #endif #ifdef OPT_I486 "i486", #endif #ifdef OPT_I386 "i386", #endif #ifdef OPT_ALTIVEC "AltiVec", #endif #ifdef OPT_GENERIC "generic", #endif NULL }; void check_decoders(void ) { #ifndef OPT_MULTI return; #else char **d = mpg123_supported_decoder_list; #ifdef OPT_X86 getcpuflags(&cpu_flags); if(cpu_i586(cpu_flags)) { /* not yet: if(cpu_sse2(cpu_flags)) printf(" SSE2"); if(cpu_sse3(cpu_flags)) printf(" SSE3"); */ #ifdef OPT_3DNOWEXT if(cpu_3dnowext(cpu_flags)) *(d++) = "3DNowExt"; #endif #ifdef OPT_SSE if(cpu_sse(cpu_flags)) *(d++) = "SSE"; #endif #ifdef OPT_3DNOW if(cpu_3dnow(cpu_flags)) *(d++) = "3DNow"; #endif #ifdef OPT_MMX if(cpu_mmx(cpu_flags)) *(d++) = "MMX"; #endif #ifdef OPT_I586 *(d++) = "i586"; #endif #ifdef OPT_I586_DITHER *(d++) = "i586_dither"; #endif } #endif /* just assume that the i486 built is run on a i486 cpu... */ #ifdef OPT_I486 *(d++) = "i486"; #endif #ifdef OPT_ALTIVEC *(d++) = "AltiVec"; #endif /* every supported x86 can do i386, any cpu can do generic */ #ifdef OPT_I386 *(d++) = "i386"; #endif #ifdef OPT_GENERIC *(d++) = "generic"; #endif #endif /* ndef OPT_MULTI */ } char attribute_align_arg **mpg123_decoders(){ return mpg123_decoder_list; } char attribute_align_arg **mpg123_supported_decoders() { #ifdef OPT_MULTI return mpg123_supported_decoder_list; #else return mpg123_decoder_list; #endif }
/* ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio 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 _BOARD_H_ #define _BOARD_H_ /* * Setup for a generic SPC563Mxx proto board. */ /* * Board identifiers. */ #define BOARD_SPC563MXX_EVB #define BOARD_NAME "EVB with SPC563Mxx Mini Module" /* * Board frequencies. */ #if !defined(SPC5_XOSC_CLK) #define SPC5_XOSC_CLK 8000000 #endif /* * I/O definitions. */ #define P5_ESCI_A_TX 9 #define P5_ESCI_A_RX 10 #define P11_BUTTON1 3 #define P11_BUTTON2 5 #define P11_BUTTON3 7 #define P11_BUTTON4 9 #define P11_LED1 12 #define P11_LED2 13 #define P11_LED3 14 #define P11_LED4 15 /* * Support macros. */ #define PCR(port, pin) (((port) * 16) + (pin)) #if !defined(_FROM_ASM_) #ifdef __cplusplus extern "C" { #endif void boardInit(void); #ifdef __cplusplus } #endif #endif /* _FROM_ASM_ */ #endif /* _BOARD_H_ */
#ifndef INC_REPLICAINFO_H #define INC_REPLICAINFO_H #include <map> #include <set> /// Hold types/classes/functions having to do with processing ensemble/replica data. namespace ReplicaInfo { // TODO just Replica /// Replica sort target type enum TargetType { NONE = 0, TEMP, INDICES, CRDIDX }; /// Hold temperature/indices for replica ensemble. template <class T> class Map { typedef std::map<T, int> RmapType; public: Map() {} /// Create a map from T array to replicas 0->N, potentially allow duplicate input values int CreateMap(std::vector<T> const&, bool); /// Create a map from T array to replicas 0->N int CreateMap(std::vector<T> const&); T const& Duplicate() const { return duplicate_; } // Given T, find index in map int FindIndex( T const& ) const; typedef typename RmapType::const_iterator const_iterator; const_iterator begin() const { return repMap_.begin(); } const_iterator end() const { return repMap_.end(); } bool empty() const { return repMap_.empty(); } void ClearMap() { repMap_.clear(); } private: RmapType repMap_; T duplicate_; }; // Map::CreateMap() /** Create a map of indices to sorted input values. * \param Vals array of input values. * \param checkForDuplicates If true, return 1 if duplicate values detected in Vals */ template <class T> int Map<T>::CreateMap(std::vector<T> const& Vals, bool checkForDuplicates) { std::set<T> tList; for (typename std::vector<T>::const_iterator val = Vals.begin(); val != Vals.end(); ++val) { std::pair<typename std::set<T>::iterator, bool> ret = tList.insert( *val ); if (checkForDuplicates && !ret.second) { // Duplicate value detected. duplicate_ = *val; return 1; } } repMap_.clear(); // Values are now sorted lowest to highest in set. int repnum = 0; for (typename std::set<T>::const_iterator v0 = tList.begin(); v0 != tList.end(); ++v0, ++repnum) repMap_.insert(std::pair<T, int>(*v0, repnum)); return 0; } /** Create a map of indices to sorted input values. * \return 0 if map created, 1 if duplicate values detected in Vals. */ template <class T> int Map<T>::CreateMap(std::vector<T> const& Vals) { return CreateMap(Vals, true); } // Map::FindIndex() template <class T> int Map<T>::FindIndex( T const& Val ) const { typename RmapType::const_iterator rmap = repMap_.find( Val ); if (rmap == repMap_.end()) return -1; else return rmap->second; } } // END namespace Replica #endif
// ----------------------------------------------------------------------------------------- // <copyright file="AZSBlobRequestOptions.h" company="Microsoft"> // Copyright 2015 Microsoft Corporation // // Licensed under the MIT License; // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://spdx.org/licenses/MIT // // 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. // </copyright> // ----------------------------------------------------------------------------------------- #import "AZSRequestOptions.h" AZS_ASSUME_NONNULL_BEGIN /** AZSBlobRequestOptions contains options used for requests to the blob service. AZSBlobRequestOptions is used for configuring the behavior of blob requests. Defaults will be used if any options that are not set, or if a AZSBlobRequestOptions object is not provided. */ @interface AZSBlobRequestOptions : AZSRequestOptions /** If YES, all operations that support it will calculate the MD5 of the message bodies on both the client and the service, to validate that there were no errors in transmission. This has nothing to do with the content-MD5 header stored on a blob.*/ @property BOOL useTransactionalMD5; /** If YES, when uploading a blob, the content-MD5 header will be stored along with the blob. If one is not supplied, the library will calculate one where possible.*/ @property BOOL storeBlobContentMD5; /** If YES, the library will not calculate and validate the MD5 when downloading a blob.*/ @property BOOL disableContentMD5Validation; /** The number of simultaneous outstanding block uploads to permit when uploading a blob as a series of blocks.*/ @property NSInteger parallelismFactor; /** If YES, when uploading an append blob in a streaming fashion, conditional errors should be ignored. When uploading append blobs in a streaming fashion, an append-offset conditional header is used to avoid duplicate blocks. If this is set to YES, errors from the append-offset header will be ignored when the error is coming from a block already being written to the service. Only set this to YES if there is no possiblity of multiple writers writing to the blob simultaneously. Otherwise, data corruption can occur. */ @property BOOL absorbConditionalErrorsOnRetry; // TODO: Implement logic to upload a blob as a single Put Blob call if below the below threshold. //@property NSInteger *singleBlobUploadThreshold; /** Initializes a new AZSBlobRequestOptions object. Once the object is initialized, individual properties can be set.*/ -(instancetype)init AZS_DESIGNATED_INITIALIZER; +(AZSBlobRequestOptions *)copyOptions:(AZSNullable AZSBlobRequestOptions *)optionsToCopy; -(instancetype)applyDefaultsFromOptions:(AZSNullable AZSBlobRequestOptions *)sourceOptions; @end AZS_ASSUME_NONNULL_END
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /** * \file communication_p.h * \brief Communication module header. * Copyright (C) 2012 Signove Tecnologia Corporation. * All rights reserved. * Contact: Signove Tecnologia Corporation (contact@signove.com) * * $LICENSE_TEXT:BEGIN$ * 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 and appearing * in the file LICENSE included in the packaging of this file; 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 Street, Fifth Floor, Boston, MA 02110-1301 USA * $LICENSE_TEXT:END$ * * \author Fabricio Silva * \author Elvis Pfutzenreuter * \date Feb 29, 2012 */ #ifndef COMMUNICATION_P_H_ #define COMMUNICATION_P_H_ void communication_lock(Context *ctx); void communication_unlock(Context *ctx); /** * @} */ #endif /* COMMUNICATION_P_H_ */
/* ugensa.h: Copyright (C) 1997 J. Michael Clarke, based on ideas from CHANT (IRCAM) This file is part of Csound. The Csound 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. Csound 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 Csound; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* UGENSM.H */ #define PFRAC1(x) ((MYFLT)((x) & ftp1->lomask) * ftp1->lodiv) typedef struct overlap { struct overlap *nxtact; struct overlap *nxtfree; int32 timrem, dectim, formphs, forminc; uint32 risphs; int32 risinc, decphs, decinc; MYFLT curamp, expamp; } OVERLAP; typedef struct { OPDS h; MYFLT *ar, *xamp, *xdens, *xtrans, *xspd, *koct, *kband, *kris, *kdur, *kdec; MYFLT *iolaps, *ifna, *ifnb, *itotdur, *iphs, *itmode, *iskip; OVERLAP basovrlap; int32 durtogo, fundphs, fofcount, prvsmps, spdphs; /*last added JMC for FOG*/ MYFLT prvband, expamp, preamp, fogcvt; /*last added JMC for FOG*/ int16 xincod, ampcod, fundcod; int16 formcod, fmtmod, speedcod; /*last added JMC for FOG*/ AUXCH auxch; FUNC *ftp1, *ftp2; } FOGS; /*typedef struct { OPDS h; MYFLT *sr, *xamp, *xcps, *ifn, *iphs; int32 lphs; FUNC *ftp; } JMC; */
/* * Copyright (C) 2014 Freie Universität Berlin * * This file is subject to the terms and conditions of the GNU Lesser General * Public License v2.1. See the file LICENSE in the top level directory for more * details. */ /** * @defgroup cpu_stm32f4 STM32F4 * @ingroup cpu * @brief CPU specific implementations for the STM32F4 * @{ * * @file * @brief Implementation specific CPU configuration options * * @author Hauke Petersen <hauke.peterse@fu-berlin.de> */ #ifndef STM32F4_CPU_CONF_H #define STM32F4_CPU_CONF_H #include "cpu_conf_common.h" #if defined(CPU_MODEL_STM32F401RE) #include "stm32f401xe.h" #elif defined(CPU_MODEL_STM32F407VG) #include "stm32f407xx.h" #elif defined(CPU_MODEL_STM32F415RG) #include "stm32f415xx.h" #endif #ifdef __cplusplus extern "C" { #endif /** * @brief ARM Cortex-M specific CPU configuration * @{ */ #define CPU_DEFAULT_IRQ_PRIO (1U) #define CPU_IRQ_NUMOF (82U) #define CPU_FLASH_BASE FLASH_BASE /** @} */ #ifdef __cplusplus } #endif #endif /* STM32F4_CPU_CONF_H */ /** @} */
/****************************************************************/ /* DO NOT MODIFY THIS HEADER */ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* (c) 2010 Battelle Energy Alliance, LLC */ /* ALL RIGHTS RESERVED */ /* */ /* Prepared by Battelle Energy Alliance, LLC */ /* Under Contract No. DE-AC07-05ID14517 */ /* With the U. S. Department of Energy */ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ #ifndef NODALVARIABLEVALUE_H #define NODALVARIABLEVALUE_H #include "GeneralPostprocessor.h" // Forward Declarations class NodalVariableValue; class MooseMesh; namespace libMesh { class Node; } template <> InputParameters validParams<NodalVariableValue>(); /** * Sums a nodal value across all processors and multiplies the result * by a scale factor. */ class NodalVariableValue : public GeneralPostprocessor { public: NodalVariableValue(const InputParameters & parameters); virtual void initialize() override {} virtual void execute() override {} virtual Real getValue() override; protected: MooseMesh & _mesh; std::string _var_name; Node * _node_ptr; const Real _scale_factor; }; #endif // NODALVARIABLEVALUE_H
/* * Do not modify this file; it is automatically * generated and any modifications will be overwritten. * * @(#) xdc-A71 */ #ifndef xdc_runtime_Types__INTERNAL__ #define xdc_runtime_Types__INTERNAL__ #ifndef xdc_runtime_Types__internalaccess #define xdc_runtime_Types__internalaccess #endif #include <xdc/runtime/Types.h> #undef xdc_FILE__ #ifndef xdc_FILE #define xdc_FILE__ NULL #else #define xdc_FILE__ xdc_FILE #endif /* Module_startup */ #undef xdc_runtime_Types_Module_startup #define xdc_runtime_Types_Module_startup xdc_runtime_Types_Module_startup__E /* Instance_init */ #undef xdc_runtime_Types_Instance_init #define xdc_runtime_Types_Instance_init xdc_runtime_Types_Instance_init__E /* Instance_finalize */ #undef xdc_runtime_Types_Instance_finalize #define xdc_runtime_Types_Instance_finalize xdc_runtime_Types_Instance_finalize__E /* per-module runtime symbols */ #undef Module__MID #define Module__MID xdc_runtime_Types_Module__id__C #undef Module__DGSINCL #define Module__DGSINCL xdc_runtime_Types_Module__diagsIncluded__C #undef Module__DGSENAB #define Module__DGSENAB xdc_runtime_Types_Module__diagsEnabled__C #undef Module__DGSMASK #define Module__DGSMASK xdc_runtime_Types_Module__diagsMask__C #undef Module__LOGDEF #define Module__LOGDEF xdc_runtime_Types_Module__loggerDefined__C #undef Module__LOGOBJ #define Module__LOGOBJ xdc_runtime_Types_Module__loggerObj__C #undef Module__LOGFXN0 #define Module__LOGFXN0 xdc_runtime_Types_Module__loggerFxn0__C #undef Module__LOGFXN1 #define Module__LOGFXN1 xdc_runtime_Types_Module__loggerFxn1__C #undef Module__LOGFXN2 #define Module__LOGFXN2 xdc_runtime_Types_Module__loggerFxn2__C #undef Module__LOGFXN4 #define Module__LOGFXN4 xdc_runtime_Types_Module__loggerFxn4__C #undef Module__LOGFXN8 #define Module__LOGFXN8 xdc_runtime_Types_Module__loggerFxn8__C #undef Module__G_OBJ #define Module__G_OBJ xdc_runtime_Types_Module__gateObj__C #undef Module__G_PRMS #define Module__G_PRMS xdc_runtime_Types_Module__gatePrms__C #undef Module__GP_create #define Module__GP_create xdc_runtime_Types_Module_GateProxy_create #undef Module__GP_delete #define Module__GP_delete xdc_runtime_Types_Module_GateProxy_delete #undef Module__GP_enter #define Module__GP_enter xdc_runtime_Types_Module_GateProxy_enter #undef Module__GP_leave #define Module__GP_leave xdc_runtime_Types_Module_GateProxy_leave #undef Module__GP_query #define Module__GP_query xdc_runtime_Types_Module_GateProxy_query #endif /* xdc_runtime_Types__INTERNAL____ */
// RUN: %clang -target i686-pc-windows-msvc19 -S -emit-llvm %s -o - | FileCheck %s --check-prefix=TARGET-19 // RUN: %clang -target i686-pc-windows-msvc -S -emit-llvm %s -o - -fms-compatibility-version=19 | FileCheck %s --check-prefix=OVERRIDE-19 // RUN: %clang -target i686-pc-windows-msvc-elf -S -emit-llvm %s -o - | FileCheck %s --check-prefix=ELF-DEFAULT // TARGET-19: target triple = "i686-pc-windows-msvc19.0.0" // OVERRIDE-19: target triple = "i686-pc-windows-msvc19.0.0" // ELF-DEFAULT: target triple = "i686-pc-windows-msvc{{.*}}-elf"
/* * pthread_spin_unlock.c * * Description: * This translation unit implements spin lock primitives. * * -------------------------------------------------------------------------- * * Pthreads4w - POSIX Threads for Windows * Copyright 1998 John E. Bossom * Copyright 1999-2018, Pthreads4w contributors * * Homepage: https://sourceforge.net/projects/pthreads4w/ * * The current list of contributors is contained * in the file CONTRIBUTORS included with the source * code distribution. The list can also be seen at the * following World Wide Web location: * * https://sourceforge.net/p/pthreads4w/wiki/Contributors/ * * 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. */ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include "pthread.h" #include "implement.h" int pthread_spin_unlock (pthread_spinlock_t * lock) { register pthread_spinlock_t s; if (NULL == lock || NULL == *lock) { return (EINVAL); } s = *lock; if (s == PTHREAD_SPINLOCK_INITIALIZER) { return EPERM; } switch ((long) __PTW32_INTERLOCKED_COMPARE_EXCHANGE_LONG ((__PTW32_INTERLOCKED_LONGPTR) &s->interlock, (__PTW32_INTERLOCKED_LONG) __PTW32_SPIN_UNLOCKED, (__PTW32_INTERLOCKED_LONG) __PTW32_SPIN_LOCKED)) { case __PTW32_SPIN_LOCKED: case __PTW32_SPIN_UNLOCKED: return 0; case __PTW32_SPIN_USE_MUTEX: return pthread_mutex_unlock (&(s->u.mutex)); } return EINVAL; }
//---------------------------------------------------------- -*- Mode: C++ -*- // $Id$ // // Created 2006/10/09 // Author: Sriram Rao // // Copyright 2008 Quantcast Corp. // Copyright 2006-2008 Kosmix Corp. // // This file is part of Kosmos File System (KFS). // // 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. // // \brief Define the globals needed by the KFS IO library. These // globals are also available to any app that uses the KFS IO library. //---------------------------------------------------------------------------- #ifndef LIBKFSIO_GLOBALS_H #define LIBKFSIO_GLOBALS_H #include "NetManager.h" #include "Counter.h" namespace KFS { namespace libkfsio { struct Globals_t { CounterManager counterManager; // Commonly needed counters Counter ctrOpenNetFds; Counter ctrOpenDiskFds; Counter ctrNetBytesRead; Counter ctrNetBytesWritten; Counter ctrDiskBytesRead; Counter ctrDiskBytesWritten; // track the # of failed read/writes Counter ctrDiskIOErrors; void Init(); static NetManager& getNetManager(); static void Destroy(); static Globals_t& Instance(); private: ~Globals_t(); Globals_t(); bool mInitedFlag; bool mDestructedFlag; NetManager* mForGdbToFindNetManager; static Globals_t* sForGdbToFindInstance; }; inline static void InitGlobals() { Globals_t::Instance().Init(); } inline static void DestroyGlobals() { Globals_t::Destroy(); } inline static NetManager& globalNetManager() { return Globals_t::getNetManager(); } inline static Globals_t & globals() { return Globals_t::Instance(); } } } #endif // LIBKFSIO_GLOBALS_H
/* * Copyright 1999-2006 University of Chicago * * 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. */ /** * @file memory_test.c * @brief Test case for globus_memory_t */ #include "globus_common.h" #include "globus_thread_common.h" static globus_memory_t mem; #define MEM_INIT_SIZE 15 #ifndef TARGET_ARCH_WIN32 #define POPS 100000 #else #define POPS 1000 #endif const char * reference_output = "abc.....abc.....abc.....abc.....abc....." "abc.....abc.....abc.....abc.....abc....." "abc.....abc.....abc.....abc.....abc....."; typedef struct mem_test_s { char a; char b; char c; char x[4]; } mem_test_t; int mem_init(mem_test_t * m, int cnt); int dump(globus_byte_t * buf, int size); int globus_memory_test(void) { int rc = GLOBUS_SUCCESS; mem_test_t * mem_ptr[POPS]; int cnt = 0; printf("1..1\n"); /** * @test * Create a globus_memory_t with globus_memory_init(), pop a whole * lot of memory off of it, dump the initial set of memory, and then * push the nodes back. */ globus_module_activate(GLOBUS_COMMON_MODULE); globus_memory_init(&mem, sizeof(mem_test_t), MEM_INIT_SIZE); for(cnt = 0; cnt < POPS; cnt++) { mem_ptr[cnt] = ( mem_test_t *) globus_memory_pop_node(&mem); mem_init(mem_ptr[cnt], cnt); } /* nodes are aligned on mod 8 boundaries, add 1 to 7 to make 8 */ rc = dump((globus_byte_t *) mem_ptr[0], MEM_INIT_SIZE * (sizeof(mem_test_t) + 1)); printf("%s\n", (rc==0)?"ok":"not ok"); globus_memory_push_node(&mem, (globus_byte_t *)mem_ptr[0]); for(cnt = 1; cnt < POPS; cnt++) { globus_memory_push_node(&mem, (globus_byte_t *) mem_ptr[cnt]); } globus_memory_destroy(&mem); globus_module_deactivate(GLOBUS_COMMON_MODULE); return rc; } int main(int argc, char * argv[]) { return globus_memory_test(); } int mem_init(mem_test_t * m, int cnt) { memset(m, 0, sizeof(mem_test_t) + 1); m->a = 'a'; m->b = 'b'; m->c = 'c'; return GLOBUS_TRUE; } int dump(globus_byte_t * buf, int size) { int ctr; int col = 0; int failed=0; const char *p = reference_output; for(ctr = 0; ctr < size; ctr++) { if (reference_output[ctr] != (isprint(buf[ctr]) ? buf[ctr] : '.')) { failed++; } col++; if(col >= 40) { col = 0; } } return failed; }
/* pbrt source code is Copyright(c) 1998-2015 Matt Pharr, Greg Humphreys, and Wenzel Jakob. This file is part of pbrt. 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. 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. */ #if defined(_MSC_VER) #define NOMINMAX #pragma once #endif #ifndef PBRT_LIGHTS_PROJECTION_H #define PBRT_LIGHTS_PROJECTION_H #include "stdafx.h" // lights/projection.h* #include "pbrt.h" #include "light.h" #include "shape.h" #include "mipmap.h" // ProjectionLight Declarations class ProjectionLight : public Light { public: // ProjectionLight Public Methods ProjectionLight(const Transform &LightToWorld, const MediumInterface &medium, const Spectrum &I, const std::string &texname, Float fov); Spectrum Sample_Li(const Interaction &ref, const Point2f &u, Vector3f *wi, Float *pdf, VisibilityTester *vis) const; Spectrum Projection(const Vector3f &w) const; Spectrum Power() const; Float Pdf_Li(const Interaction &, const Vector3f &) const; Spectrum Sample_Le(const Point2f &u1, const Point2f &u2, Float time, Ray *ray, Normal3f *nLight, Float *pdfPos, Float *pdfDir) const; void Pdf_Le(const Ray &, const Normal3f &, Float *pdfPos, Float *pdfDir) const; private: // ProjectionLight Private Data std::unique_ptr<MIPMap<RGBSpectrum>> projectionMap; const Point3f pLight; const Spectrum I; Transform lightProjection; Float hither, yon; Bounds2f screenBounds; Float cosTotalWidth; }; std::shared_ptr<ProjectionLight> CreateProjectionLight( const Transform &light2world, const Medium *medium, const ParamSet &paramSet); #endif // PBRT_LIGHTS_PROJECTION_H
#include <../MatrixOps/cholmod_sdmult.c>
#include <hre/config.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <mpi.h> #include "Dtaudlts.h" #include "paint.h" #include "groups.h" #include <hre/runtime.h> #include <hre-mpi/user.h> #include <lts-lib/lts.h> // some variables requested by bufs.h int flag; int send_pending; int bufnewids_pending; MPI_Request send_request; static enum { SCC_COLOR = 1, SCC_GROUP = 2 } action = SCC_COLOR; static struct poptOption options[] = { {"color", 0, POPT_ARG_VAL, &action, SCC_COLOR, "cycle elimination using coloring (default)", NULL}, {"group", 0, POPT_ARG_VAL, &action, SCC_GROUP, "cycle elimination using groups", NULL}, // This program should use: // { NULL, 0 , POPT_ARG_INCLUDE_TABLE, lts_io_options , 0 , NULL, // NULL}, POPT_TABLEEND }; // the number of vertices and arcs .. // final int Nfinal, Mfinal; // hooked, i.e. on a cycle int Nhooked, Mhooked; // not yet classified as "final" or "hooked" int Nleft, Mleft; int me, nodes; // *************************************************************** int main (int argc, char **argv) { dlts_t lts; rt_timer_t timer; int oldN, oldM, tauN, tauM, N, M, i, j; char *files[2]; HREinitBegin(argv[0]); HREaddOptions(options,"Perform a distributed cycle elimination on the input.\n\nOptions"); lts_lib_setup(); HREselectMPI(); HREinitStart(&argc,&argv,1,2,files,"<input> [<output>]"); MPI_Comm_size (MPI_COMM_WORLD, &nodes); MPI_Comm_rank (MPI_COMM_WORLD, &me); timer = RTcreateTimer (); if (me == 0) Warning (info, "(tau)SCC elimination"); if (me == 0) RTstartTimer (timer); MPI_Barrier (MPI_COMM_WORLD); lts = dlts_read(MPI_COMM_WORLD,files[0]); oldN = lts->state_count[me]; oldM = 0; for (i = 0; i < lts->segment_count; i++) oldM += lts->transition_count[me][i]; MPI_Reduce (&oldN, &i, 1, MPI_INT, MPI_SUM, 0, lts->comm); MPI_Reduce (&oldM, &j, 1, MPI_INT, MPI_SUM, 0, lts->comm); if (me == 0) { oldN = i; oldM = j; Warning (info, "%d states and %d transitions", oldN, oldM); RTstopTimer (timer); RTprintTimer (info, timer, "***** reading the LTS took"); RTresetTimer (timer); RTstartTimer (timer); } MPI_Barrier (MPI_COMM_WORLD); switch (action) { case SCC_COLOR: dlts_elim_tauscc_colours (lts); break; case SCC_GROUP: if (!dlts_elim_tauscc_groups (lts)) { if (me == 0) Abort("cannot get it small enough!"); } MPI_Barrier (MPI_COMM_WORLD); break; default: if (me == 0) Abort("bad action %d", action); MPI_Barrier (MPI_COMM_WORLD); } MPI_Barrier (lts->comm); if (me == 0) { RTstopTimer (timer); RTprintTimer (info, timer, "***** SCC reduction took"); RTresetTimer (timer); RTstartTimer (timer); } // statistics... N = lts->state_count[me]; M = 0; for (i = 0; i < lts->segment_count; i++) M += lts->transition_count[me][i]; MPI_Reduce (&N, &i, 1, MPI_INT, MPI_SUM, 0, lts->comm); MPI_Reduce (&M, &j, 1, MPI_INT, MPI_SUM, 0, lts->comm); if (me == 0) { Warning (info, "LTS initial:%10d states and %10d transitions", oldN, oldM); Warning (info, "LTS reduced:%10d states [%3.3f] and %10d [%3.3f] transitions", i, 100 * i / (float)oldN, j, 100 * j / (float)oldM); } N = Nfinal + Nleft + Nhooked; M = Mfinal + Mhooked; MPI_Reduce (&N, &i, 1, MPI_INT, MPI_SUM, 0, lts->comm); MPI_Reduce (&M, &j, 1, MPI_INT, MPI_SUM, 0, lts->comm); tauN = i; tauM = j; N = Nfinal + Nleft; M = Mfinal; MPI_Reduce (&N, &i, 1, MPI_INT, MPI_SUM, 0, lts->comm); MPI_Reduce (&M, &j, 1, MPI_INT, MPI_SUM, 0, lts->comm); if (me == 0) { Warning (info, "TAU initial:%10d states [%3.3f] and %10d [%3.3f] transitions", tauN, 100 * tauN / (float)oldN, tauM, 100 * tauM / (float)oldM); Warning (info, "TAU reduced:%10d states [%3.3f] and %10d [%3.3f] transitions", i, 100 * i / (float)tauN, j, 100 * j / (float)tauM); } if (files[1]) { if (me == 0) Warning (info, "NOW WRITING"); dlts_writedir (lts, files[1]); } // if (lts != NULL) dlts_free(lts); HREexit(HRE_EXIT_SUCCESS); }
long function(char t1[4], char t2[4]) { return t1 == t2; } int main() { return function("asdfg", "asdf"); }
#pragma once #ifndef SELECTION_COMMANDS_IDS_H #define SELECTION_COMMANDS_IDS_H #define MI_Cut "MI_Cut" #define MI_Copy "MI_Copy" #define MI_Insert "MI_Insert" #define MI_InsertAbove "MI_InsertAbove" #define MI_Paste "MI_Paste" #define MI_PasteAbove "MI_PasteAbove" #define MI_PasteInto "MI_PasteInto" #define MI_PasteValues "MI_PasteValues" #define MI_PasteColors "MI_PasteColors" #define MI_PasteNames "MI_PasteNames" #define MI_GetColorFromStudioPalette "MI_GetColorFromStudioPalette" #define MI_ToggleLinkToStudioPalette "MI_ToggleLinkToStudioPalette" #define MI_RemoveReferenceToStudioPalette "MI_RemoveReferenceToStudioPalette" #define MI_Clear "MI_Clear" #define MI_SelectAll "MI_SelectAll" #define MI_InvertSelection "MI_InvertSelection" #define MI_BlendColors "MI_BlendColors" #define MI_EraseUnusedStyles "MI_EraseUnusedStyles" #define MI_Group "MI_Group" #define MI_Ungroup "MI_Ungroup" #define MI_BringToFront "MI_BringToFront" #define MI_BringForward "MI_BringForward" #define MI_SendBack "MI_SendBack" #define MI_SendBackward "MI_SendBackward" #define MI_EnterGroup "MI_EnterGroup" #define MI_ExitGroup "MI_ExitGroup" #define MI_RemoveEndpoints "MI_RemoveEndpoints" #define MI_OpenChild "MI_OpenChild" #define MI_CloseChild "MI_CloseChild" #define MI_Collapse "MI_Collapse" #define MI_ExplodeChild "MI_ExplodeChild" #define MI_ToggleEditInPlace "MI_ToggleEditInPlace" #define MI_PasteNumbers "MI_PasteNumbers" #endif
// Copyright 2013 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 MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CDM_VIDEO_DECODER_H_ #define MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CDM_VIDEO_DECODER_H_ #include <stdint.h> #include <memory> #include "media/cdm/api/content_decryption_module.h" #include "media/cdm/ppapi/external_clear_key/clear_key_cdm_common.h" namespace media { class CdmVideoDecoder { public: virtual ~CdmVideoDecoder() {} virtual bool Initialize(const cdm::VideoDecoderConfig& config) = 0; virtual void Deinitialize() = 0; virtual void Reset() = 0; virtual bool is_initialized() const = 0; // Decodes |compressed_frame|. Stores output frame in |decoded_frame| and // returns |cdm::kSuccess| when an output frame is available. Returns // |cdm::kNeedMoreData| when |compressed_frame| does not produce an output // frame. Returns |cdm::kDecodeError| when decoding fails. // // A null |compressed_frame| will attempt to flush the decoder of any // remaining frames. |compressed_frame_size| and |timestamp| are ignored. virtual cdm::Status DecodeFrame(const uint8_t* compressed_frame, int32_t compressed_frame_size, int64_t timestamp, cdm::VideoFrame* decoded_frame) = 0; }; // Initializes appropriate video decoder based on GYP flags and the value of // |config.codec|. Returns a scoped_ptr containing a non-null initialized // CdmVideoDecoder* upon success. std::unique_ptr<CdmVideoDecoder> CreateVideoDecoder( ClearKeyCdmHost* host, const cdm::VideoDecoderConfig& config); } // namespace media #endif // MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CDM_VIDEO_DECODER_H_
// Copyright 2014 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. // // KeywordExtensionsDelegateImpl contains the extensions-only logic used by // KeywordProvider. Overrides KeywordExtensionsDelegate which does nothing. #ifndef CHROME_BROWSER_AUTOCOMPLETE_KEYWORD_EXTENSIONS_DELEGATE_IMPL_H_ #define CHROME_BROWSER_AUTOCOMPLETE_KEYWORD_EXTENSIONS_DELEGATE_IMPL_H_ #include <vector> #include "base/memory/raw_ptr.h" #include "base/scoped_observation.h" #include "components/omnibox/browser/autocomplete_input.h" #include "components/omnibox/browser/autocomplete_match.h" #include "components/omnibox/browser/autocomplete_provider_listener.h" #include "components/omnibox/browser/keyword_extensions_delegate.h" #include "components/omnibox/browser/keyword_provider.h" #include "components/omnibox/browser/omnibox_input_watcher.h" #include "components/omnibox/browser/omnibox_suggestions_watcher.h" #include "extensions/buildflags/buildflags.h" #if !BUILDFLAG(ENABLE_EXTENSIONS) #error "Should not be included when extensions are disabled" #endif class Profile; class KeywordExtensionsDelegateImpl : public KeywordExtensionsDelegate, public OmniboxInputWatcher::Observer, public OmniboxSuggestionsWatcher::Observer { public: KeywordExtensionsDelegateImpl(Profile* profile, KeywordProvider* provider); KeywordExtensionsDelegateImpl(const KeywordExtensionsDelegateImpl&) = delete; KeywordExtensionsDelegateImpl& operator=( const KeywordExtensionsDelegateImpl&) = delete; ~KeywordExtensionsDelegateImpl() override; // KeywordExtensionsDelegate: void DeleteSuggestion(const TemplateURL* template_url, const std::u16string& suggestion_text) override; private: // KeywordExtensionsDelegate: void IncrementInputId() override; bool IsEnabledExtension(const std::string& extension_id) override; bool Start(const AutocompleteInput& input, bool minimal_changes, const TemplateURL* template_url, const std::u16string& remaining_input) override; void EnterExtensionKeywordMode(const std::string& extension_id) override; void MaybeEndExtensionKeywordMode() override; // OmniboxInputWatcher::Observer: void OnOmniboxInputEntered() override; // OmniboxSuggestionsWatcher::Observer: void OnOmniboxSuggestionsReady( extensions::api::omnibox::SendSuggestions::Params* suggestions) override; void OnOmniboxDefaultSuggestionChanged() override; ACMatches* matches() { return &provider_->matches_; } void set_done(bool done) { provider_->done_ = done; } // Notifies the KeywordProvider about asynchronous updates from the extension. void OnProviderUpdate(bool updated_matches); // Identifies the current input state. This is incremented each time the // autocomplete edit's input changes in any way. It is used to tell whether // suggest results from the extension are current. int current_input_id_; // The input state at the time we last asked the extension for suggest // results. AutocompleteInput extension_suggest_last_input_; // We remember the last suggestions we've received from the extension in case // we need to reset our matches without asking the extension again. std::vector<AutocompleteMatch> extension_suggest_matches_; // If non-empty, holds the ID of the extension whose keyword is currently in // the URL bar while the autocomplete popup is open. std::string current_keyword_extension_id_; raw_ptr<Profile> profile_; // The owner of this class. raw_ptr<KeywordProvider> provider_; // We need our input IDs to be unique across all profiles, so we keep a global // UID that each provider uses. static int global_input_uid_; base::ScopedObservation<OmniboxInputWatcher, OmniboxInputWatcher::Observer> omnibox_input_observation_{this}; base::ScopedObservation<OmniboxSuggestionsWatcher, OmniboxSuggestionsWatcher::Observer> omnibox_suggestions_observation_{this}; }; #endif // CHROME_BROWSER_AUTOCOMPLETE_KEYWORD_EXTENSIONS_DELEGATE_IMPL_H_
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_ASH_LOGIN_UI_MOCK_LOGIN_DISPLAY_H_ #define CHROME_BROWSER_ASH_LOGIN_UI_MOCK_LOGIN_DISPLAY_H_ #include "chrome/browser/ash/login/ui/login_display.h" #include "testing/gmock/include/gmock/gmock.h" namespace ash { class MockLoginDisplay : public LoginDisplay { public: MockLoginDisplay(); MockLoginDisplay(const MockLoginDisplay&) = delete; MockLoginDisplay& operator=(const MockLoginDisplay&) = delete; ~MockLoginDisplay() override; MOCK_METHOD(void, Init, (const user_manager::UserList&, bool), (override)); MOCK_METHOD(void, SetUIEnabled, (bool), (override)); }; } // namespace ash // TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos // source migration is finished. namespace chromeos { using ::ash::MockLoginDisplay; } #endif // CHROME_BROWSER_ASH_LOGIN_UI_MOCK_LOGIN_DISPLAY_H_
/** * PANDA 3D SOFTWARE * Copyright (c) Carnegie Mellon University. All rights reserved. * * All use of this software is subject to the terms of the revised BSD * license. You should have received a copy of this license along * with this source code in a file named "LICENSE." * * @file eggToDXF.h * @author drose * @date 2004-05-04 */ #ifndef EGGTODXF_H #define EGGTODXF_H #include "pandatoolbase.h" #include "eggToSomething.h" #include "eggToDXFLayer.h" class EggGroupNode; /** * A program to read an egg file and write a DXF file. */ class EggToDXF : public EggToSomething { public: EggToDXF(); void run(); bool _use_polyline; private: void get_layers(EggGroupNode *group); void write_tables(ostream &out); void write_entities(ostream &out); EggToDXFLayers _layers; }; #endif
/** * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the license found in the LICENSE file in * the root directory of this source tree. */ #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import "FBMemoryProfilerWindowTouchesHandling.h" /** Window that FBMemoryProfiler will reside in. */ @interface FBMemoryProfilerWindow : UIWindow /** Whenever we receive a touch event, window needs to ask delegate if this event should be captured. */ @property (nonatomic, weak, nullable) id<FBMemoryProfilerWindowTouchesHandling> touchesDelegate; @end
// // NSBundle+CULPlugin.h // // Created by Nikolay Demyankov on 15.09.15. // #import <Foundation/Foundation.h> /** * Helper category to work with NSBundle. */ @interface NSBundle (CULPlugin) /** * Path to the config.xml file in the project. * * @return path to the config file */ + (NSString *)pathToCordovaConfigXml; @end
/* Generated automatically. DO NOT EDIT! */ #define SIMD_HEADER "simd-support/simd-neon.h" #include "../common/t1bv_2.c"
/* * customer/boards/board-m6g24.h * * Copyright (C) 2011-2012 Amlogic, 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. * * 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. */ #ifndef __MACH_MESON6_BOARD_M6G24_H #define __MACH_MESON6_BOARD_M6G24_H #include <asm/page.h> /*********************************************************************** * IO Mapping **********************************************************************/ #define PHYS_MEM_START (0x80000000) #define PHYS_MEM_SIZE (1024*SZ_1M) #define PHYS_MEM_END (PHYS_MEM_START + PHYS_MEM_SIZE -1 ) /******** Reserved memory setting ************************/ #define RESERVED_MEM_START (0x80000000+64*SZ_1M) /*start at the second 64M*/ /******** CODEC memory setting ************************/ // Codec need 16M for 1080p decode // 4M for sd decode; #define ALIGN_MSK ((SZ_1M)-1) #define U_ALIGN(x) ((x+ALIGN_MSK)&(~ALIGN_MSK)) #define D_ALIGN(x) ((x)&(~ALIGN_MSK)) /******** AUDIODSP memory setting ************************/ #define AUDIODSP_ADDR_START U_ALIGN(RESERVED_MEM_START) /*audiodsp memstart*/ #define AUDIODSP_ADDR_END (AUDIODSP_ADDR_START+SZ_1M-1) /*audiodsp memend*/ /******** Frame buffer memory configuration ***********/ #define OSD_480_PIX (640*480) #define OSD_576_PIX (768*576) #define OSD_720_PIX (1280*720) #define OSD_1080_PIX (1920*1080) #define OSD_PANEL_PIX (1024*600) #define B16BpP (2) #define B32BpP (4) #define DOUBLE_BUFFER (2) #define OSD1_MAX_MEM U_ALIGN(OSD_1080_PIX*B32BpP*DOUBLE_BUFFER) #define OSD2_MAX_MEM U_ALIGN(32*32*B32BpP) /******** Reserved memory configuration ***************/ #define OSD1_ADDR_START U_ALIGN(AUDIODSP_ADDR_END ) #define OSD1_ADDR_END (OSD1_ADDR_START+OSD1_MAX_MEM - 1) #define OSD2_ADDR_START U_ALIGN(OSD1_ADDR_END) #define OSD2_ADDR_END (OSD2_ADDR_START +OSD2_MAX_MEM -1) /******** OSD3 OSD4 begin ***************/ #if defined(CONFIG_AM_FB_EXT) #define OSD3_MAX_MEM U_ALIGN(OSD_PANEL_PIX*B32BpP*DOUBLE_BUFFER) #define OSD4_MAX_MEM U_ALIGN(32*32*B32BpP) #define OSD3_ADDR_START U_ALIGN(OSD2_ADDR_END) #define OSD3_ADDR_END (OSD3_ADDR_START+OSD3_MAX_MEM-1) #define OSD4_ADDR_START U_ALIGN(OSD3_ADDR_END) #define OSD4_ADDR_END (OSD4_ADDR_START+OSD4_MAX_MEM-1) #endif /******** OSD3 OSD4 end ***************/ #if defined(CONFIG_AM_VDEC_H264) #define CODEC_MEM_SIZE U_ALIGN(64*SZ_1M) #else #define CODEC_MEM_SIZE U_ALIGN(16*SZ_1M) #endif #if defined(CONFIG_AM_FB_EXT) #define CODEC_ADDR_START U_ALIGN(OSD4_ADDR_END) #else #define CODEC_ADDR_START U_ALIGN(OSD2_ADDR_END) #endif #define CODEC_ADDR_END (CODEC_ADDR_START+CODEC_MEM_SIZE-1) /********VDIN memory configuration ***************/ #define VDIN_ADDR_START U_ALIGN(CODEC_ADDR_END) #define VDIN_ADDR_END (VDIN_ADDR_START + CODEC_MEM_SIZE - 1) #ifdef CONFIG_V4L_AMLOGIC_VIDEO2 #define VDIN1_MEM_SIZE (U_ALIGN(36*SZ_1M)) #define VDIN1_ADDR_START (U_ALIGN(VDIN_ADDR_END)) #define VDIN1_ADDR_END (VDIN1_ADDR_START + VDIN1_MEM_SIZE - 1) #define VM_ADDR_START U_ALIGN(VDIN1_ADDR_END) #else #define VM_ADDR_START U_ALIGN(VDIN_ADDR_END) #endif #if defined(CONFIG_AMLOGIC_VIDEOIN_MANAGER) #define VM_SIZE (SZ_1M*16) #else #define VM_SIZE (0) #endif /* CONFIG_AMLOGIC_VIDEOIN_MANAGER */ #define VM_ADDR_END (VM_SIZE + VM_ADDR_START - 1) #if defined(CONFIG_AM_DEINTERLACE_SD_ONLY) #define DI_MEM_SIZE (SZ_1M*3) #else #define DI_MEM_SIZE (SZ_1M*15) #endif #define DI_ADDR_START U_ALIGN(VM_ADDR_END) #define DI_ADDR_END (DI_ADDR_START+DI_MEM_SIZE-1) //32 bytes align #ifdef CONFIG_POST_PROCESS_MANAGER #ifdef CONFIG_POST_PROCESS_MANAGER_PPSCALER #define PPMGR_MEM_SIZE 1920 * 1088 * 22 #else #define PPMGR_MEM_SIZE 1920 * 1088 * 15 #endif #else #define PPMGR_MEM_SIZE 0 #endif /* CONFIG_POST_PROCESS_MANAGER */ #define PPMGR_ADDR_START U_ALIGN(DI_ADDR_END) #define PPMGR_ADDR_END (PPMGR_ADDR_START+PPMGR_MEM_SIZE-1) #ifdef CONFIG_V4L_AMLOGIC_VIDEO2 #define AMLVIDEO2_MEM_SIZE 1024 * 768 * 12 #else #define AMLVIDEO2_MEM_SIZE 0 #endif #define AMLVIDEO2_ADDR_START U_ALIGN(DI_ADDR_END) #define AMLVIDEO2_ADDR_END (AMLVIDEO2_ADDR_START+AMLVIDEO2_MEM_SIZE-1) #define STREAMBUF_MEM_SIZE (SZ_1M*15) #define STREAMBUF_ADDR_START U_ALIGN(PPMGR_ADDR_END) #define STREAMBUF_ADDR_END (STREAMBUF_ADDR_START+STREAMBUF_MEM_SIZE-1) #define RESERVED_MEM_END (STREAMBUF_ADDR_END) int m6g24_pi3900_lcd_init(void); int __init m6ref_power_init(void); #endif // __MACH_MESON6_BOARD_M6G24_H
/* * Copyright (C) 2008 Thomas Kallenberg * Copyright (C) 2008 Martin Willi * Copyright (C) 2008 Tobias Brunner * Hochschule fuer Technik Rapperswil * * 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. See <http://www.fsf.org/copyleft/gpl.txt>. * * 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 "uci_creds.h" #include <daemon.h> #include <credentials/keys/shared_key.h> #include <utils/identification.h> typedef struct private_uci_creds_t private_uci_creds_t; /** * Private data of an uci_creds_t object */ struct private_uci_creds_t { /** * Public part */ uci_creds_t public; /** * UCI parser context */ uci_parser_t *parser; }; typedef struct { /** implements enumerator */ enumerator_t public; /** inneer UCI enumerator */ enumerator_t *inner; /** currently enumerated shared shared */ shared_key_t *current; /** local ID to match */ identification_t *me; /** remote ID to match */ identification_t *other; } shared_enumerator_t; /** * Implementation of shared_enumerator_t.public.enumerate */ static bool shared_enumerator_enumerate(shared_enumerator_t *this, shared_key_t **key, id_match_t *me, id_match_t *other) { char *local_id, *remote_id, *psk; identification_t *local, *remote; while (TRUE) { /* defaults */ local_id = "%any"; remote_id = "%any"; psk = NULL; if (!this->inner->enumerate(this->inner, NULL, &local_id, &remote_id, &psk)) { return FALSE; } if (psk == NULL) { continue; } if (me) { local = identification_create_from_string(local_id); *me = this->me ? this->me->matches(this->me, local) : ID_MATCH_ANY; local->destroy(local); if (!*me) { continue; } } if (other) { remote = identification_create_from_string(remote_id); *other = this->other ? this->other->matches(this->other, remote) : ID_MATCH_ANY; remote->destroy(remote); if (!*other) { continue; } } break; } DESTROY_IF(this->current); this->current = shared_key_create(SHARED_IKE, chunk_clone(chunk_create(psk, strlen(psk)))); *key = this->current; return TRUE; } /** * Implementation of shared_enumerator_t.public.destroy */ static void shared_enumerator_destroy(shared_enumerator_t *this) { this->inner->destroy(this->inner); DESTROY_IF(this->current); free(this); } /** * Implementation of backend_t.create_shared_cfg_enumerator. */ static enumerator_t* create_shared_enumerator(private_uci_creds_t *this, shared_key_type_t type, identification_t *me, identification_t *other) { shared_enumerator_t *e; if (type != SHARED_IKE) { return NULL; } e = malloc_thing(shared_enumerator_t); e->current = NULL; e->public.enumerate = (void*)shared_enumerator_enumerate; e->public.destroy = (void*)shared_enumerator_destroy; e->me = me; e->other = other; e->inner = this->parser->create_section_enumerator(this->parser, "local_id", "remote_id", "psk", NULL); if (!e->inner) { free(e); return NULL; } return &e->public; } /** * Implementation of uci_creds_t.destroy */ static void destroy(private_uci_creds_t *this) { free(this); } uci_creds_t *uci_creds_create(uci_parser_t *parser) { private_uci_creds_t *this = malloc_thing(private_uci_creds_t); this->public.credential_set.create_shared_enumerator = (enumerator_t*(*)(credential_set_t*, shared_key_type_t, identification_t*, identification_t*))create_shared_enumerator; this->public.credential_set.create_private_enumerator = (enumerator_t*(*) (credential_set_t*, key_type_t, identification_t*))return_null; this->public.credential_set.create_cert_enumerator = (enumerator_t*(*) (credential_set_t*, certificate_type_t, key_type_t,identification_t *, bool))return_null; this->public.credential_set.create_cdp_enumerator = (enumerator_t*(*) (credential_set_t *,certificate_type_t, identification_t *))return_null; this->public.credential_set.cache_cert = (void (*)(credential_set_t *, certificate_t *))nop; this->public.destroy = (void(*) (uci_creds_t*))destroy; this->parser = parser; return &this->public; }
/* GStreamer * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu> * 2000 Wim Taymans <wtay@chello.be> * * gstpluginfeature.h: Header for base GstPluginFeature * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef __GST_PLUGIN_FEATURE_H__ #define __GST_PLUGIN_FEATURE_H__ #include <glib-object.h> #include <gst/gstobject.h> #include <gst/gstplugin.h> G_BEGIN_DECLS #define GST_TYPE_PLUGIN_FEATURE (gst_plugin_feature_get_type()) #define GST_PLUGIN_FEATURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PLUGIN_FEATURE, GstPluginFeature)) #define GST_IS_PLUGIN_FEATURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PLUGIN_FEATURE)) #define GST_PLUGIN_FEATURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PLUGIN_FEATURE, GstPluginFeatureClass)) #define GST_IS_PLUGIN_FEATURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PLUGIN_FEATURE)) #define GST_PLUGIN_FEATURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PLUGIN_FEATURE, GstPluginFeatureClass)) #define GST_PLUGIN_FEATURE_CAST(obj) ((GstPluginFeature*)(obj)) /** * GST_PLUGIN_FEATURE_NAME: * @feature: The feature to query * * Get the name of the feature */ #define GST_PLUGIN_FEATURE_NAME(feature) (GST_PLUGIN_FEATURE (feature)->name) typedef struct _GstPluginFeature GstPluginFeature; typedef struct _GstPluginFeatureClass GstPluginFeatureClass; /** * GstRank: * @GST_RANK_NONE: will be chosen last or not at all * @GST_RANK_MARGINAL: unlikely to be chosen * @GST_RANK_SECONDARY: likely to be chosen * @GST_RANK_PRIMARY: will be chosen first * * Element priority ranks. Defines the order in which the autoplugger (or * similar rank-picking mechanisms, such as e.g. gst_element_make_from_uri()) * will choose this element over an alternative one with the same function. * * These constants serve as a rough guidance for defining the rank of a * #GstPluginFeature. Any value is valid, including values bigger than * @GST_RANK_PRIMARY. */ typedef enum { GST_RANK_NONE = 0, GST_RANK_MARGINAL = 64, GST_RANK_SECONDARY = 128, GST_RANK_PRIMARY = 256 } GstRank; /** * GstPluginFeature: * * Opaque #GstPluginFeature structure. */ struct _GstPluginFeature { GstObject object; /*< private >*/ gboolean loaded; gchar *name; /* FIXME-0.11: remove variable, we use GstObject:name */ guint rank; const gchar *plugin_name; GstPlugin *plugin; /* weak ref */ /*< private >*/ gpointer _gst_reserved[GST_PADDING - 1]; }; struct _GstPluginFeatureClass { GstObjectClass parent_class; /*< private >*/ gpointer _gst_reserved[GST_PADDING]; }; /** * GstTypeNameData: * @name: a name * @type: a GType * * Structure used for filtering based on @name and @type. */ #ifndef GST_DISABLE_DEPRECATED typedef struct { const gchar *name; GType type; } GstTypeNameData; #endif /** * GstPluginFeatureFilter: * @feature: the pluginfeature to check * @user_data: the user_data that has been passed on e.g. * gst_registry_feature_filter() * * A function that can be used with e.g. gst_registry_feature_filter() * to get a list of pluginfeature that match certain criteria. * * Returns: %TRUE for a positive match, %FALSE otherwise */ typedef gboolean (*GstPluginFeatureFilter) (GstPluginFeature *feature, gpointer user_data); /* normal GObject stuff */ GType gst_plugin_feature_get_type (void); GstPluginFeature * gst_plugin_feature_load (GstPluginFeature *feature); #ifndef GST_DISABLE_DEPRECATED gboolean gst_plugin_feature_type_name_filter (GstPluginFeature *feature, GstTypeNameData *data); #endif void gst_plugin_feature_set_rank (GstPluginFeature *feature, guint rank); void gst_plugin_feature_set_name (GstPluginFeature *feature, const gchar *name); guint gst_plugin_feature_get_rank (GstPluginFeature *feature); const gchar *gst_plugin_feature_get_name (GstPluginFeature *feature); void gst_plugin_feature_list_free (GList *list); GList *gst_plugin_feature_list_copy (GList *list) G_GNUC_MALLOC; void gst_plugin_feature_list_debug (GList *list); /** * GST_PLUGIN_FEATURE_LIST_DEBUG: * @list: (transfer none) (element-type Gst.PluginFeature): a #GList of * plugin features * * Debug the plugin feature names in @list. * * Since: 0.10.31 */ #ifndef GST_DISABLE_GST_DEBUG #define GST_PLUGIN_FEATURE_LIST_DEBUG(list) gst_plugin_feature_list_debug(list) #else #define GST_PLUGIN_FEATURE_LIST_DEBUG(list) #endif gboolean gst_plugin_feature_check_version (GstPluginFeature *feature, guint min_major, guint min_minor, guint min_micro); gint gst_plugin_feature_rank_compare_func (gconstpointer p1, gconstpointer p2); G_END_DECLS #endif /* __GST_PLUGIN_FEATURE_H__ */
/* * GNT - The GLib Ncurses Toolkit * * GNT 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 library 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 02111-1301 USA */ #include <gmodule.h> #include "gntinternal.h" #include "gntbox.h" #include "gntwidget.h" #include "gntwindow.h" #include "gntwm.h" #include "gntws.h" static void widget_hide(gpointer data, gpointer nodes) { GntWidget *widget = GNT_WIDGET(data); GntNode *node = g_hash_table_lookup(nodes, widget); if (GNT_IS_WINDOW(widget)) gnt_window_workspace_hiding(GNT_WINDOW(widget)); if (node) hide_panel(node->panel); } static void widget_show(gpointer data, gpointer nodes) { GntNode *node = g_hash_table_lookup(nodes, data); GNT_WIDGET_UNSET_FLAGS(GNT_WIDGET(data), GNT_WIDGET_INVISIBLE); if (node) { show_panel(node->panel); gnt_wm_copy_win(GNT_WIDGET(data), node); } } void gnt_ws_draw_taskbar(GntWS *ws, gboolean reposition) { static WINDOW *taskbar = NULL; GList *iter; int n, width = 0; int i; if (gnt_is_refugee()) return; g_return_if_fail(ws != NULL); if (taskbar == NULL) { taskbar = newwin(1, getmaxx(stdscr), getmaxy(stdscr) - 1, 0); } else if (reposition) { int Y_MAX = getmaxy(stdscr) - 1; mvwin(taskbar, Y_MAX, 0); } wbkgdset(taskbar, '\0' | gnt_color_pair(GNT_COLOR_NORMAL)); werase(taskbar); n = g_list_length(ws->list); if (n) width = getmaxx(stdscr) / n; for (i = 0, iter = ws->list; iter; iter = iter->next, i++) { GntWidget *w = iter->data; int color; const char *title; if (w == ws->ordered->data) { /* This is the current window in focus */ color = GNT_COLOR_TITLE; } else if (GNT_WIDGET_IS_FLAG_SET(w, GNT_WIDGET_URGENT)) { /* This is a window with the URGENT hint set */ color = GNT_COLOR_URGENT; } else { color = GNT_COLOR_NORMAL; } wbkgdset(taskbar, '\0' | gnt_color_pair(color)); if (iter->next) mvwhline(taskbar, 0, width * i, ' ' | gnt_color_pair(color), width); else mvwhline(taskbar, 0, width * i, ' ' | gnt_color_pair(color), getmaxx(stdscr) - width * i); title = GNT_BOX(w)->title; mvwprintw(taskbar, 0, width * i, "%s", title ? C_(title) : "<gnt>"); if (i) mvwaddch(taskbar, 0, width *i - 1, ACS_VLINE | A_STANDOUT | gnt_color_pair(GNT_COLOR_NORMAL)); } wrefresh(taskbar); } static void gnt_ws_init(GTypeInstance *instance, gpointer class) { GntWS *ws = GNT_WS(instance); ws->list = NULL; ws->ordered = NULL; ws->name = NULL; } void gnt_ws_add_widget(GntWS *ws, GntWidget* wid) { GntWidget *oldfocus; oldfocus = ws->ordered ? ws->ordered->data : NULL; ws->list = g_list_append(ws->list, wid); ws->ordered = g_list_prepend(ws->ordered, wid); if (oldfocus) gnt_widget_set_focus(oldfocus, FALSE); } void gnt_ws_remove_widget(GntWS *ws, GntWidget* wid) { ws->list = g_list_remove(ws->list, wid); ws->ordered = g_list_remove(ws->ordered, wid); } void gnt_ws_set_name(GntWS *ws, const gchar *name) { g_free(ws->name); ws->name = g_strdup(name); } void gnt_ws_hide(GntWS *ws, GHashTable *nodes) { g_list_foreach(ws->ordered, widget_hide, nodes); } void gnt_ws_widget_hide(GntWidget *widget, GHashTable *nodes) { widget_hide(widget, nodes); } void gnt_ws_widget_show(GntWidget *widget, GHashTable *nodes) { widget_show(widget, nodes); } void gnt_ws_show(GntWS *ws, GHashTable *nodes) { GList *l; for (l = g_list_last(ws->ordered); l; l = g_list_previous(l)) widget_show(l->data, nodes); } GType gnt_ws_get_gtype(void) { static GType type = 0; if(type == 0) { static const GTypeInfo info = { sizeof(GntWSClass), NULL, /* base_init */ NULL, /* base_finalize */ NULL, /*(GClassInitFunc)gnt_ws_class_init,*/ NULL, NULL, /* class_data */ sizeof(GntWS), 0, /* n_preallocs */ gnt_ws_init, /* instance_init */ NULL /* value_table */ }; type = g_type_register_static(GNT_TYPE_BINDABLE, "GntWS", &info, 0); } return type; } GntWS *gnt_ws_new(const char *name) { GntWS *ws = GNT_WS(g_object_new(GNT_TYPE_WS, NULL)); ws->name = g_strdup(name ? name : "(noname)"); return ws; } const char * gnt_ws_get_name(GntWS *ws) { return ws->name; }
/* drivers/tty/smux_loopback.h * * Copyright (c) 2012, The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef SMUX_LOOPBACK_H #define SMUX_LOOPBACK_H #include "smux_private.h" #ifdef CONFIG_N_SMUX_LOOPBACK int smux_loopback_init(void); int smux_tx_loopback(struct smux_pkt_t *pkt_ptr); #else static inline int smux_loopback_init(void) { return 0; } static inline int smux_tx_loopback(struct smux_pkt_t *pkt_ptr) { return -ENODEV; } #endif /* CONFIG_N_SMUX_LOOPBACK */ #endif /* SMUX_LOOPBACK_H */
/* * GRUB -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, 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. * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_UBERBLOCK_IMPL_H #define _SYS_UBERBLOCK_IMPL_H /* * The uberblock version is incremented whenever an incompatible on-disk * format change is made to the SPA, DMU, or ZAP. * * Note: the first two fields should never be moved. When a storage pool * is opened, the uberblock must be read off the disk before the version * can be checked. If the ub_version field is moved, we may not detect * version mismatch. If the ub_magic field is moved, applications that * expect the magic number in the first word won't work. */ #define UBERBLOCK_MAGIC 0x00bab10c /* oo-ba-bloc! */ #define UBERBLOCK_SHIFT 10 /* up to 1K */ struct uberblock { uint64_t ub_magic; /* UBERBLOCK_MAGIC */ uint64_t ub_version; /* ZFS_VERSION */ uint64_t ub_txg; /* txg of last sync */ uint64_t ub_guid_sum; /* sum of all vdev guids */ uint64_t ub_timestamp; /* UTC time of last sync */ blkptr_t ub_rootbp; /* MOS objset_phys_t */ }; #endif /* _SYS_UBERBLOCK_IMPL_H */
/* * arch/arm/mach-spear13xx/include/mach/generic.h * * spear13xx machine family generic header file * * Copyright (C) 2012 ST Microelectronics * Viresh Kumar <viresh.linux@gmail.com> * * This file is licensed under the terms of the GNU General Public * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied. */ #ifndef __MACH_GENERIC_H #define __MACH_GENERIC_H #include <linux/dmaengine.h> #include <asm/mach/time.h> /* Add spear13xx structure declarations here */ extern void spear13xx_timer_init(void); extern struct pl022_ssp_controller pl022_plat_data; extern struct dw_dma_platform_data dmac_plat_data; extern struct dw_dma_slave cf_dma_priv; extern struct dw_dma_slave nand_read_dma_priv; extern struct dw_dma_slave nand_write_dma_priv; /* Add spear13xx family function declarations here */ void __init spear_setup_of_timer(void); void __init spear13xx_map_io(void); void __init spear13xx_dt_init_irq(void); void __init spear13xx_l2x0_init(void); bool dw_dma_filter(struct dma_chan *chan, void *slave); void spear_restart(char, const char *); void spear13xx_secondary_startup(void); void __cpuinit spear13xx_cpu_die(unsigned int cpu); extern struct smp_operations spear13xx_smp_ops; #ifdef CONFIG_MACH_SPEAR1310 void __init spear1310_clk_init(void); #else static inline void spear1310_clk_init(void) {} #endif #ifdef CONFIG_MACH_SPEAR1340 void __init spear1340_clk_init(void); #else static inline void spear1340_clk_init(void) {} #endif #endif /* __MACH_GENERIC_H */
#pragma once /* * Copyright (C) 2005-2013 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, 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 XBMC; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #include <stdint.h> #include <map> #include <memory> #include <set> #include <string> #include <utility> #include <vector> #include "XBDateTime.h" class TiXmlElement; namespace ADDON { typedef enum { ADDON_UNKNOWN, ADDON_VIZ, ADDON_SKIN, ADDON_PVRDLL, ADDON_ADSPDLL, ADDON_INPUTSTREAM, ADDON_GAMEDLL, ADDON_PERIPHERALDLL, ADDON_SCRIPT, ADDON_SCRIPT_WEATHER, ADDON_SUBTITLE_MODULE, ADDON_SCRIPT_LYRICS, ADDON_SCRAPER_ALBUMS, ADDON_SCRAPER_ARTISTS, ADDON_SCRAPER_MOVIES, ADDON_SCRAPER_MUSICVIDEOS, ADDON_SCRAPER_TVSHOWS, ADDON_SCREENSAVER, ADDON_PLUGIN, ADDON_REPOSITORY, ADDON_WEB_INTERFACE, ADDON_SERVICE, ADDON_AUDIOENCODER, ADDON_CONTEXT_ITEM, ADDON_AUDIODECODER, ADDON_RESOURCE_IMAGES, ADDON_RESOURCE_LANGUAGE, ADDON_RESOURCE_UISOUNDS, ADDON_RESOURCE_GAMES, ADDON_VIDEO, // virtual addon types ADDON_AUDIO, ADDON_IMAGE, ADDON_GAME, ADDON_EXECUTABLE, ADDON_SCRAPER_LIBRARY, ADDON_SCRIPT_LIBRARY, ADDON_SCRIPT_MODULE, ADDON_GAME_CONTROLLER, ADDON_MAX } TYPE; class IAddon; typedef std::shared_ptr<IAddon> AddonPtr; class CVisualisation; typedef std::shared_ptr<CVisualisation> VizPtr; class CSkinInfo; typedef std::shared_ptr<CSkinInfo> SkinPtr; class CPluginSource; typedef std::shared_ptr<CPluginSource> PluginPtr; class CAddonMgr; class AddonVersion; typedef std::map<std::string, std::pair<const AddonVersion, bool> > ADDONDEPS; typedef std::map<std::string, std::string> InfoMap; class AddonProps; class IAddon : public std::enable_shared_from_this<IAddon> { public: virtual ~IAddon() {}; virtual TYPE Type() const =0; virtual TYPE FullType() const =0; virtual bool IsType(TYPE type) const =0; virtual std::string ID() const =0; virtual std::string Name() const =0; virtual bool IsInUse() const =0; virtual AddonVersion Version() const =0; virtual AddonVersion MinVersion() const =0; virtual std::string Summary() const =0; virtual std::string Description() const =0; virtual std::string Path() const =0; virtual std::string Profile() const =0; virtual std::string LibPath() const =0; virtual std::string ChangeLog() const =0; virtual std::string FanArt() const =0; virtual std::vector<std::string> Screenshots() const =0; virtual std::string Author() const =0; virtual std::string Icon() const =0; virtual std::string Disclaimer() const =0; virtual std::string Broken() const =0; virtual CDateTime InstallDate() const =0; virtual CDateTime LastUpdated() const =0; virtual CDateTime LastUsed() const =0; virtual std::string Origin() const =0; virtual uint64_t PackageSize() const =0; virtual const InfoMap &ExtraInfo() const =0; virtual bool HasSettings() =0; virtual void SaveSettings() =0; virtual void UpdateSetting(const std::string& key, const std::string& value) =0; virtual std::string GetSetting(const std::string& key) =0; virtual TiXmlElement* GetSettingsXML() =0; virtual const ADDONDEPS &GetDeps() const =0; virtual AddonVersion GetDependencyVersion(const std::string &dependencyID) const =0; virtual bool MeetsVersion(const AddonVersion &version) const =0; virtual bool ReloadSettings() =0; virtual void OnDisabled() =0; virtual void OnEnabled() =0; virtual AddonPtr GetRunningInstance() const=0; virtual void OnPreInstall() =0; virtual void OnPostInstall(bool update, bool modal) =0; virtual void OnPreUnInstall() =0; virtual void OnPostUnInstall() =0; }; };
/* ********************************************************************************************************* * uC/GUI V3.98 * Universal graphic software for embedded applications * * (c) Copyright 2002, Micrium Inc., Weston, FL * (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH * * µC/GUI is protected by international copyright laws. Knowledge of the * source code may not be used to write a similar product. This file may * only be used in accordance with a license and should not be redistributed * in any way. We appreciate your understanding and fairness. * ---------------------------------------------------------------------- File : CHECKBOX_SetBkColor.c Purpose : Implementation of CHECKBOX_SetBkColor ---------------------------END-OF-HEADER------------------------------ */ #include "CHECKBOX_Private.h" #if GUI_WINSUPPORT /********************************************************************* * * Exported routines * ********************************************************************** */ /********************************************************************* * * CHECKBOX_SetBkColor */ void CHECKBOX_SetBkColor(CHECKBOX_Handle hObj, GUI_COLOR Color) { if (hObj) { CHECKBOX_Obj* pObj; WM_LOCK(); pObj = CHECKBOX_H2P(hObj); if (Color != pObj->Props.BkColor) { pObj->Props.BkColor = Color; #if WM_SUPPORT_TRANSPARENCY if (Color <= 0xFFFFFF) { WM_SetTransState(hObj, 0); } else { WM_SetTransState(hObj, WM_CF_HASTRANS); } #endif WM_InvalidateWindow(hObj); } WM_UNLOCK(); } } #else /* Avoid problems with empty object modules */ void CHECKBOX_SetBkColor_C(void); void CHECKBOX_SetBkColor_C(void) {} #endif
/* SPDX-License-Identifier: GPL-2.0+ */ /* * Taken from Linux v4.9 drivers/of/address.c * * Modified for U-Boot * Copyright (c) 2017 Google, Inc */ #ifndef _DM_OF_ADDR_H #define _DM_OF_ADDR_H /** * of_translate_address() - translate a device-tree address to a CPU address * * Translate an address from the device-tree into a CPU physical address, * this walks up the tree and applies the various bus mappings on the way. * * Note: We consider that crossing any level with #size-cells == 0 to mean * that translation is impossible (that is we are not dealing with a value * that can be mapped to a cpu physical address). This is not really specified * that way, but this is traditionally the way IBM at least do things * * @np: node to check * @in_addr: pointer to input address * @return translated address or OF_BAD_ADDR on error */ u64 of_translate_address(const struct device_node *no, const __be32 *in_addr); /** * of_translate_dma_address() - translate a device-tree DMA address to a CPU * address * * Translate a DMA address from the device-tree into a CPU physical address, * this walks up the tree and applies the various bus mappings on the way. * * Note: We consider that crossing any level with #size-cells == 0 to mean * that translation is impossible (that is we are not dealing with a value * that can be mapped to a cpu physical address). This is not really specified * that way, but this is traditionally the way IBM at least do things * * @np: node to check * @in_addr: pointer to input DMA address * @return translated DMA address or OF_BAD_ADDR on error */ u64 of_translate_dma_address(const struct device_node *no, const __be32 *in_addr); /** * of_get_address() - obtain an address from a node * * Extract an address from a node, returns the region size and the address * space flags too. The PCI version uses a BAR number instead of an absolute * index. * * @np: Node to check * @index: Index of address to read (0 = first) * @size: place to put size on success * @flags: place to put flags on success * @return pointer to address which can be read */ const __be32 *of_get_address(const struct device_node *no, int index, u64 *size, unsigned int *flags); struct resource; /** * of_address_to_resource() - translate device tree address to resource * * Note that if your address is a PIO address, the conversion will fail if * the physical address can't be internally converted to an IO token with * pci_address_to_pio(), that is because it's either called to early or it * can't be matched to any host bridge IO space * * @np: node to check * @index: index of address to read (0 = first) * @r: place to put resource information * @return 0 if OK, -ve on error */ int of_address_to_resource(const struct device_node *no, int index, struct resource *r); #endif
// Low-level functions for atomic operations: Sparc version -*- C++ -*- // Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005, 2009 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library 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. // 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 General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. #include <ext/atomicity.h> _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) #ifdef __arch64__ _Atomic_word __attribute__ ((__unused__)) __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw () { _Atomic_word __tmp1, __tmp2; _Atomic_word __val_extended = __val; __asm__ __volatile__("1: ldx [%3], %0\n\t" " add %0, %4, %1\n\t" " casx [%3], %0, %1\n\t" " sub %0, %1, %0\n\t" " brnz,pn %0, 1b\n\t" " nop" : "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__mem) : "r" (__mem), "r" (__val_extended), "m" (*__mem)); return __tmp2; } void __attribute__ ((__unused__)) __atomic_add(volatile _Atomic_word* __mem, int __val) throw () { _Atomic_word __tmp1, __tmp2; _Atomic_word __val_extended = __val; __asm__ __volatile__("1: ldx [%3], %0\n\t" " add %0, %4, %1\n\t" " casx [%3], %0, %1\n\t" " sub %0, %1, %0\n\t" " brnz,pn %0, 1b\n\t" " nop" : "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__mem) : "r" (__mem), "r" (__val_extended), "m" (*__mem)); } #else /* __arch32__ */ template<int __inst> struct _Atomicity_lock { static unsigned char _S_atomicity_lock; }; template<int __inst> unsigned char _Atomicity_lock<__inst>::_S_atomicity_lock = 0; template unsigned char _Atomicity_lock<0>::_S_atomicity_lock; _Atomic_word __attribute__ ((__unused__)) __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw () { _Atomic_word __result, __tmp; __asm__ __volatile__("1: ldstub [%1], %0\n\t" " cmp %0, 0\n\t" " bne 1b\n\t" " nop" : "=&r" (__tmp) : "r" (&_Atomicity_lock<0>::_S_atomicity_lock) : "memory"); __result = *__mem; *__mem += __val; __asm__ __volatile__("stb %%g0, [%0]" : /* no outputs */ : "r" (&_Atomicity_lock<0>::_S_atomicity_lock) : "memory"); return __result; } void __attribute__ ((__unused__)) __atomic_add(volatile _Atomic_word* __mem, int __val) throw () { _Atomic_word __tmp; __asm__ __volatile__("1: ldstub [%1], %0\n\t" " cmp %0, 0\n\t" " bne 1b\n\t" " nop" : "=&r" (__tmp) : "r" (&_Atomicity_lock<0>::_S_atomicity_lock) : "memory"); *__mem += __val; __asm__ __volatile__("stb %%g0, [%0]" : /* no outputs */ : "r" (&_Atomicity_lock<0>::_S_atomicity_lock) : "memory"); } #endif /* __arch32__ */ _GLIBCXX_END_NAMESPACE
/* * Copyright (C) 2005-2011 MaNGOS <http://www.getmangos.com/> * * Copyright (C) 2008-2011 Trinity <http://www.trinitycore.org/> * * Copyright (C) 2010-2011 Project SkyFire <http://www.projectskyfire.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, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __BATTLEGROUNDBE_H #define __BATTLEGROUNDBE_H class Battleground; enum BattlegroundBEObjectTypes { BG_BE_OBJECT_DOOR_1 = 0, BG_BE_OBJECT_DOOR_2 = 1, BG_BE_OBJECT_DOOR_3 = 2, BG_BE_OBJECT_DOOR_4 = 3, BG_BE_OBJECT_BUFF_1 = 4, BG_BE_OBJECT_BUFF_2 = 5, BG_BE_OBJECT_MAX = 6 }; enum BattlegroundBEObjects { BG_BE_OBJECT_TYPE_DOOR_1 = 183971, BG_BE_OBJECT_TYPE_DOOR_2 = 183973, BG_BE_OBJECT_TYPE_DOOR_3 = 183970, BG_BE_OBJECT_TYPE_DOOR_4 = 183972, BG_BE_OBJECT_TYPE_BUFF_1 = 184663, BG_BE_OBJECT_TYPE_BUFF_2 = 184664 }; class BattlegroundBEScore : public BattlegroundScore { public: BattlegroundBEScore() {}; virtual ~BattlegroundBEScore() {}; }; class BattlegroundBE : public Battleground { friend class BattlegroundMgr; public: BattlegroundBE(); ~BattlegroundBE(); void Update(uint32 diff); /* inherited from BattlegroundClass */ virtual void AddPlayer(Player *plr); virtual void StartingEventCloseDoors(); virtual void StartingEventOpenDoors(); void RemovePlayer(Player *plr, uint64 guid); void HandleAreaTrigger(Player *Source, uint32 Trigger); bool SetupBattleground(); virtual void Reset(); virtual void FillInitialWorldStates(WorldPacket &d); void HandleKillPlayer(Player* player, Player *killer); bool HandlePlayerUnderMap(Player * plr); /* Scorekeeping */ void UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor = true); }; #endif
//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: // //=============================================================================// #ifndef BONE_ACCESSOR_H #define BONE_ACCESSOR_H #ifdef _WIN32 #pragma once #endif #include "studio.h" class C_BaseAnimating; class CBoneAccessor { public: CBoneAccessor(); CBoneAccessor( matrix3x4_t *pBones ); // This can be used to allow access to all bones. // Initialize. #if defined( CLIENT_DLL ) void Init( const C_BaseAnimating *pAnimating, matrix3x4_t *pBones ); #endif int GetReadableBones(); void SetReadableBones( int flags ); int GetWritableBones(); void SetWritableBones( int flags ); // Get bones for read or write access. const matrix3x4_t& GetBone( int iBone ) const; const matrix3x4_t& operator[]( int iBone ) const; matrix3x4_t& GetBoneForWrite( int iBone ); matrix3x4_t *GetBoneArrayForWrite( ) const; private: #if defined( CLIENT_DLL ) && defined( _DEBUG ) void SanityCheckBone( int iBone, bool bReadable ) const; #endif // Only used in the client DLL for debug verification. const C_BaseAnimating *m_pAnimating; matrix3x4_t *m_pBones; int m_ReadableBones; // Which bones can be read. int m_WritableBones; // Which bones can be written. }; inline CBoneAccessor::CBoneAccessor() { m_pAnimating = NULL; m_pBones = NULL; m_ReadableBones = m_WritableBones = 0; } inline CBoneAccessor::CBoneAccessor( matrix3x4_t *pBones ) { m_pAnimating = NULL; m_pBones = pBones; } #if defined( CLIENT_DLL ) inline void CBoneAccessor::Init( const C_BaseAnimating *pAnimating, matrix3x4_t *pBones ) { m_pAnimating = pAnimating; m_pBones = pBones; } #endif inline int CBoneAccessor::GetReadableBones() { return m_ReadableBones; } inline void CBoneAccessor::SetReadableBones( int flags ) { m_ReadableBones = flags; } inline int CBoneAccessor::GetWritableBones() { return m_WritableBones; } inline void CBoneAccessor::SetWritableBones( int flags ) { m_WritableBones = flags; } inline const matrix3x4_t& CBoneAccessor::GetBone( int iBone ) const { #if defined( CLIENT_DLL ) && defined( _DEBUG ) SanityCheckBone( iBone, true ); #endif return m_pBones[iBone]; } inline const matrix3x4_t& CBoneAccessor::operator[]( int iBone ) const { #if defined( CLIENT_DLL ) && defined( _DEBUG ) SanityCheckBone( iBone, true ); #endif return m_pBones[iBone]; } inline matrix3x4_t& CBoneAccessor::GetBoneForWrite( int iBone ) { #if defined( CLIENT_DLL ) && defined( _DEBUG ) SanityCheckBone( iBone, false ); #endif return m_pBones[iBone]; } inline matrix3x4_t *CBoneAccessor::GetBoneArrayForWrite( void ) const { return m_pBones; } #endif // BONE_ACCESSOR_H
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. ** ** 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 The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ****************************************************************************/ #pragma once #include <texteditor/texteditor_global.h> #include <QString> #include <QList> #include <QIcon> namespace TextEditor { class AssistProposalItemInterface; class TEXTEDITOR_EXPORT SnippetAssistCollector { public: SnippetAssistCollector(const QString &groupId, const QIcon &icon, int order = 0); void setGroupId(const QString &gid); QString groupId() const; QList<AssistProposalItemInterface *> collect() const; private: QString m_groupId; QIcon m_icon; int m_order; }; } // TextEditor
/***************************************************************************** * * PROJECT: Multi Theft Auto v1.0 * LICENSE: See LICENSE in the top level directory * FILE: sdk/game/CWeapon.h * PURPOSE: Weapon entity interface * * Multi Theft Auto is available from http://www.multitheftauto.com/ * *****************************************************************************/ #pragma once #include "Common.h" #include "CWeaponInfo.h" class CPed; class CColPoint; class CVector2D; class CVector; class CWeaponInfo; class CWeaponStat; enum ePedPieceTypes; struct SLineOfSightFlags; struct SLineOfSightBuildingResult; struct SWeaponConfiguration; class CWeapon { public: virtual eWeaponType GetType() = 0; virtual VOID SetType(eWeaponType type) = 0; virtual eWeaponState GetState() = 0; virtual void SetState(eWeaponState state) = 0; virtual DWORD GetAmmoInClip() = 0; virtual VOID SetAmmoInClip(DWORD dwAmmoInClip) = 0; virtual DWORD GetAmmoTotal() = 0; virtual VOID SetAmmoTotal(DWORD dwAmmoTotal) = 0; virtual CPed* GetPed() = 0; virtual eWeaponSlot GetSlot() = 0; virtual VOID SetAsCurrentWeapon() = 0; virtual CWeaponInfo* GetInfo(eWeaponSkill skill) = 0; virtual void Remove() = 0; virtual void Destroy() = 0; virtual void Initialize(eWeaponType type, unsigned int uiAmmo, CPed* pPed) = 0; virtual void Update(CPed* pPed) = 0; virtual bool Fire(CEntity* pFiringEntity, CVector* pvecOrigin, CVector* pvecOffset, CEntity* pTargetEntity, CVector* pvec_1, CVector* pvec2) = 0; virtual void AddGunshell(CEntity* pFiringEntity, CVector* pvecOrigin, CVector2D* pvecDirection, float fSize) = 0; virtual void DoBulletImpact(CEntity* pFiringEntity, CEntitySAInterface* pEntityInterface, CVector* pvecOrigin, CVector* pvecTarget, CColPoint* pColPoint, int i_1) = 0; virtual unsigned char GenerateDamageEvent(CPed* pPed, CEntity* pResponsible, eWeaponType weaponType, int iDamagePerHit, ePedPieceTypes hitZone, int i_2) = 0; virtual bool ProcessLineOfSight(const CVector* vecStart, const CVector* vecEnd, CColPoint** colCollision, CEntity** CollisionEntity, const SLineOfSightFlags flags, SLineOfSightBuildingResult* pBuildingResult, eWeaponType weaponType, CEntitySAInterface** pEntity) = 0; virtual bool FireInstantHit(CEntity* pFiringEntity, const CVector* pvecOrigin, const CVector* pvecMuzzle, CEntity* pTargetEntity, const CVector* pvecTarget, const CVector* pvec, bool bCrossHairGun, bool bCreateGunFx) = 0; virtual bool FireBullet(CEntity* pFiringEntity, const CVector& vecOrigin, const CVector& vecTarget) = 0; virtual int GetWeaponReloadTime(CWeaponStat* pWeaponStat) = 0; };
/***************************************************************************** Licensed to Accellera Systems Initiative Inc. (Accellera) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Accellera licenses this file to you 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. *****************************************************************************/ /***************************************************************************** display.h -- Original Author: Rocco Jonack, Synopsys, Inc., 1999-07-09 *****************************************************************************/ /***************************************************************************** MODIFICATION LOG - modifiers, enter your name, affiliation, date and changes you are making here. Name, Affiliation, Date: Description of Modification: *****************************************************************************/ #include "common.h" SC_MODULE( display ) { SC_HAS_PROCESS( display ); sc_in_clk clk; const sc_signal_bool_vector4& in_data1; // Input port const sc_signal_bool_vector5& in_data2; // Input port const sc_signal_bool_vector6& in_data3; // Input port const sc_signal_bool_vector7& in_data4; // Input port const sc_signal_bool_vector8& in_data5; // Input port const sc_signal<bool>& in_valid; display( sc_module_name NAME, sc_clock& CLK, const sc_signal_bool_vector4& IN_DATA1, const sc_signal_bool_vector5& IN_DATA2, const sc_signal_bool_vector6& IN_DATA3, const sc_signal_bool_vector7& IN_DATA4, const sc_signal_bool_vector8& IN_DATA5, const sc_signal<bool>& IN_VALID ) : in_data1(IN_DATA1), in_data2(IN_DATA2), in_data3(IN_DATA3), in_data4(IN_DATA4), in_data5(IN_DATA5), in_valid(IN_VALID) { clk(CLK); SC_CTHREAD( entry, clk.pos() ); } void entry(); }; // EOF
// Copyright 2019-2020 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. // All rights not expressly granted are reserved. // // This software is distributed under the terms of the GNU General Public // License v3 (GPL Version 3), copied verbatim in the file "COPYING". // // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. // @brief placeholder class for arbitraty-version 64B-lonh RDH // @author ruben.shahoyan@cern.ch #ifndef ALICEO2_HEADER_RDHANY_H #define ALICEO2_HEADER_RDHANY_H #include "GPUCommonDef.h" #include "Headers/RAWDataHeader.h" #ifndef GPUCA_GPUCODE_DEVICE #include <type_traits> #include <stdexcept> #endif namespace o2 { namespace header { struct RDHAny { uint64_t word0 = 0x0; uint64_t word1 = 0x0; uint64_t word2 = 0x0; uint64_t word3 = 0x0; uint64_t word4 = 0x0; uint64_t word5 = 0x0; uint64_t word6 = 0x0; uint64_t word7 = 0x0; RDHAny(int v = 0); // 0 for default version template <typename H> RDHAny(const H& rdh); template <typename H> RDHAny& operator=(const H& rdh); //------------------ service methods using RDHv4 = o2::header::RAWDataHeaderV4; // V3 == V4 using RDHv5 = o2::header::RAWDataHeaderV5; using RDHv6 = o2::header::RAWDataHeaderV6; // update this for every new version /// make sure we RDH is a legitimate RAWDataHeader template <typename RDH> GPUhdi() static constexpr void sanityCheckStrict() { #ifndef GPUCA_GPUCODE_DEVICE static_assert(std::is_same<RDH, RDHv4>::value || std::is_same<RDH, RDHv5>::value || std::is_same<RDH, RDHv6>::value, "not an RDH"); #endif } /// make sure we RDH is a legitimate RAWDataHeader or generic RDHAny placeholder template <typename RDH> GPUhdi() static constexpr void sanityCheckLoose() { #ifndef GPUCA_GPUCODE_DEVICE static_assert(std::is_same<RDH, RDHv4>::value || std::is_same<RDH, RDHv5>::value || std::is_same<RDH, RDHv6>::value || std::is_same<RDHAny, RDH>::value, "not an RDH or RDHAny"); #endif } template <typename H> GPUhdi() static const void* voidify(const H& rdh) { sanityCheckLoose<H>(); return reinterpret_cast<const void*>(&rdh); } template <typename H> GPUhdi() static void* voidify(H& rdh) { sanityCheckLoose<H>(); return reinterpret_cast<void*>(&rdh); } GPUhdi() const void* voidify() const { return voidify(*this); } GPUhdi() void* voidify() { return voidify(*this); } template <typename H> GPUhdi() H* as_ptr() { sanityCheckLoose<H>(); return reinterpret_cast<H*>(this); } template <typename H> GPUhdi() H& as_ref() { sanityCheckLoose<H>(); return reinterpret_cast<H&>(this); } protected: void copyFrom(const void* rdh); }; ///_________________________________ /// create from arbitrary RDH version template <typename H> inline RDHAny::RDHAny(const H& rdh) { sanityCheckLoose<H>(); copyFrom(&rdh); } ///_________________________________ /// copy from arbitrary RDH version template <typename H> inline RDHAny& RDHAny::operator=(const H& rdh) { sanityCheckLoose<H>(); if (this != voidify(rdh)) { copyFrom(&rdh); } return *this; } } // namespace header } // namespace o2 #endif
/* * Copyright (C) 2010 Kaspar Schleiser * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @defgroup sys_chardevthread Chardev Thread * @ingroup sys * @brief Chardev thread */ #ifndef __CHARDEV_THREAD_H #define __CHARDEV_THREAD_H #include "ringbuffer.h" #ifdef __cplusplus extern "C" { #endif void chardev_loop(ringbuffer_t *rb); void *chardev_thread_entry(void *rb_); #ifdef __cplusplus } #endif #endif /* __CHARDEV_THREAD_H */
/* Various definitons used the the ARM uClibc assembly code. */ #ifndef _ARM_ASM_H #define _ARM_ASM_H #ifdef __thumb2__ # ifdef __ASSEMBLER__ .thumb .syntax unified # endif /* __ASSEMBLER__ */ #define IT(t, cond) i##t cond #else /* XXX: This can be removed if/when we require an assembler that supports unified assembly syntax. */ #define IT(t, cond) /* Code to return from a thumb function stub. */ # if defined __ARM_ARCH_4T__ && defined __THUMB_INTERWORK__ # define POP_RET pop {r2, r3}; bx r3 # else # define POP_RET pop {r2, pc} # endif #endif /* __thumb2__ */ #if defined(__ARM_ARCH_6M__) /* Force arm mode to flush out errors on M profile cores. */ #undef IT #define THUMB1_ONLY 1 #endif #endif /* _ARM_ASM_H */
/*************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Karoliina T. Salminen <karoliina.t.salminen@nokia.com> ** ** This file is part of duicontrolpanel. ** ** ** This library is free software; you can redistribute it and/or ** modify it 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. ** ****************************************************************************/ #ifndef DCPAPPLETLOADER_APPLET_H__ #define DCPAPPLETLOADER_APPLET_H__ #include <QObject> #include <QVector> #include <MAction> #include <QtDebug> #include "dcpappletif.h" class DcpAppletPluginApplet : public QObject, public DcpAppletIf { Q_OBJECT Q_INTERFACES(DcpAppletIf) public: DcpAppletPluginApplet() : m_Initialized(false) { } virtual void init() { m_Initialized = true; } virtual DcpWidget *constructWidget(int) {return 0;}; virtual QString title() const { return 0; }; virtual QVector<MAction *> viewMenuItems() { QVector<MAction*> empty; return empty; } virtual DcpBrief* constructBrief(int) { return 0; }; bool initialized() { return m_Initialized; } private: bool m_Initialized; }; #endif
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Copyright (c) 2008-2017, Petr Kobalicek This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ #ifndef __PLUMED_asmjit_x86internal_p_h #define __PLUMED_asmjit_x86internal_p_h #ifdef __PLUMED_HAS_ASMJIT #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" // [AsmJit] // Complete x86/x64 JIT and Remote Assembler for C++. // // [License] // Zlib - See LICENSE.md file in the package. // [Guard] #ifndef _ASMJIT_X86_X86INTERNAL_P_H #define _ASMJIT_X86_X86INTERNAL_P_H #include "./asmjit_build.h" // [Dependencies] #include "./func.h" #include "./x86emitter.h" #include "./x86operand.h" // [Api-Begin] #include "./asmjit_apibegin.h" namespace PLMD { namespace asmjit { //! \addtogroup asmjit_base //! \{ // ============================================================================ // [asmjit::X86Internal] // ============================================================================ //! \internal //! //! X86 utilities used at multiple places, not part of public API, not exported. struct X86Internal { //! Initialize `CallConv` to X86/X64 specific calling convention. static Error initCallConv(CallConv& cc, uint32_t ccId) noexcept; //! Initialize `FuncDetail` to X86/X64 specific function signature. static Error initFuncDetail(FuncDetail& func, const FuncSignature& sign, uint32_t gpSize) noexcept; //! Initialize `FuncFrameLayout` from X86/X64 specific function detail and frame information. static Error initFrameLayout(FuncFrameLayout& layout, const FuncDetail& func, const FuncFrameInfo& ffi) noexcept; static Error argsToFrameInfo(const FuncArgsMapper& args, FuncFrameInfo& ffi) noexcept; //! Emit function prolog. static Error emitProlog(X86Emitter* emitter, const FuncFrameLayout& layout); //! Emit function epilog. static Error emitEpilog(X86Emitter* emitter, const FuncFrameLayout& layout); //! Emit a pure move operation between two registers or the same type or //! between a register and its home slot. This function does not handle //! register conversion. static Error emitRegMove(X86Emitter* emitter, const Operand_& dst_, const Operand_& src_, uint32_t typeId, bool avxEnabled, const char* comment = nullptr); //! Emit move from a function argument (either register or stack) to a register. //! //! This function can handle the necessary conversion from one argument to //! another, and from one register type to another, if it's possible. Any //! attempt of conversion that requires third register of a different kind //! (for example conversion from K to MMX) will fail. static Error emitArgMove(X86Emitter* emitter, const X86Reg& dst_, uint32_t dstTypeId, const Operand_& src_, uint32_t srcTypeId, bool avxEnabled, const char* comment = nullptr); static Error allocArgs(X86Emitter* emitter, const FuncFrameLayout& layout, const FuncArgsMapper& args); }; //! \} } // asmjit namespace } // namespace PLMD // [Api-End] #include "./asmjit_apiend.h" // [Guard] #endif // _ASMJIT_X86_X86INTERNAL_P_H #pragma GCC diagnostic pop #endif // __PLUMED_HAS_ASMJIT #endif
/* radare - LGPL - Copyright 2014 Fedor Sakharov <fedor.sakharov@gmail.com> */ #ifndef COFF_H #define COFF_H #include <r_types.h> #include <r_util.h> #include <r_lib.h> #include <r_bin.h> #define COFF_IS_BIG_ENDIAN 1 #define COFF_IS_LITTLE_ENDIAN 0 #include "coff_specs.h" struct r_bin_coff_obj { struct coff_hdr hdr; struct coff_opt_hdr opt_hdr; struct coff_scn_hdr *scn_hdrs; struct coff_symbol *symbols; ut16 target_id; /* TI COFF specific */ RBuffer *b; size_t size; ut8 endian; Sdb *kv; bool verbose; }; bool r_coff_supported_arch(const ut8 *buf); /* Reads two bytes from buf. */ struct r_bin_coff_obj* r_bin_coff_new_buf(RBuffer *buf, bool verbose); void r_bin_coff_free(struct r_bin_coff_obj *obj); RBinAddr *r_coff_get_entry(struct r_bin_coff_obj *obj); char *r_coff_symbol_name (struct r_bin_coff_obj *obj, void *ptr); #endif /* COFF_H */
// // NSEnumerator+TFEasyCoder.h // TFEasyCoder // // Created by ztf on 16/10/26. // Copyright © 2016年 ztf. All rights reserved. // #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import "TFEasyCoderConst.h" typedef void(^NSEnumeratorEasyCoderBlock) (NSEnumerator * ins); @interface NSEnumerator (TFEasyCoder) +( NSEnumerator *)easyCoder:(NSEnumeratorEasyCoderBlock)block; -(NSEnumerator *)easyCoder:(NSEnumeratorEasyCoderBlock)block; //superclass pros NSObject -(NSEnumerator *(^)(NSArray * accessibilityElements))set_accessibilityElements; -(NSEnumerator *(^)(NSArray * accessibilityCustomActions))set_accessibilityCustomActions; -(NSEnumerator *(^)(BOOL isAccessibilityElement))set_isAccessibilityElement; -(NSEnumerator *(^)(NSString * accessibilityLabel))set_accessibilityLabel; -(NSEnumerator *(^)(NSString * accessibilityHint))set_accessibilityHint; -(NSEnumerator *(^)(NSString * accessibilityValue))set_accessibilityValue; -(NSEnumerator *(^)(unsigned long long accessibilityTraits))set_accessibilityTraits; -(NSEnumerator *(^)(UIBezierPath * accessibilityPath))set_accessibilityPath; -(NSEnumerator *(^)(CGPoint accessibilityActivationPoint))set_accessibilityActivationPoint; -(NSEnumerator *(^)(NSString * accessibilityLanguage))set_accessibilityLanguage; -(NSEnumerator *(^)(BOOL accessibilityElementsHidden))set_accessibilityElementsHidden; -(NSEnumerator *(^)(BOOL accessibilityViewIsModal))set_accessibilityViewIsModal; -(NSEnumerator *(^)(BOOL shouldGroupAccessibilityChildren))set_shouldGroupAccessibilityChildren; -(NSEnumerator *(^)(long long accessibilityNavigationStyle))set_accessibilityNavigationStyle; -(NSEnumerator *(^)(id value,NSString *key))set_ValueKey; @end
/*========================================================================= * * Copyright Insight Software Consortium * * 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.txt * * 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. * *=========================================================================*/ /** * This is a fully working example of SAX-based reader for the ITK object itk::ParticleSwarmOptimizer. * It performs the same function as ParticleSwarmOptimizerDOMReader; however, the traditional SAX * (Simple API for XML) is used during the reading process, which is more complicated and error prone. * * Please see [ITK_HOME]/Testing/Data/InputXML/test.pso.xml for an example of our XML format for the PSO object. */ #ifndef __itkParticleSwarmOptimizerSAXReader_h #define __itkParticleSwarmOptimizerSAXReader_h #include "itkXMLFile.h" #include "itkParticleSwarmOptimizer.h" #include "itkArray.h" #include <vector> namespace itk { class ParticleSwarmOptimizerSAXReader : public XMLReader<ParticleSwarmOptimizer> { public: /** Standard class typedefs */ typedef ParticleSwarmOptimizerSAXReader Self; typedef XMLReader<ParticleSwarmOptimizer> Superclass; typedef SmartPointer< Self > Pointer; typedef SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(ParticleSwarmOptimizerSAXReader, XMLReader); /** * Virtual method defined in itk::XMLReaderBase. * Check that whether the file with given name is readable. */ virtual int CanReadFile( const char* name ); /** * Virtual method defined in itk::XMLReaderBase. * Called when a new xml tag start is encountered. */ virtual void StartElement( const char* name, const char** atts ); /** * Virtual method defined in itk::XMLReaderBase. * Called when an xml tag end is encountered. */ virtual void EndElement( const char* name ); /** * Virtual method defined in itk::XMLReaderBase. * Called when handling character data inside an xml tag. */ virtual void CharacterDataHandler( const char* inData, int inLength ); /** * Method for performing XML reading and output generation. */ virtual int ReadFile(); protected: ParticleSwarmOptimizerSAXReader() {} /** Process tag 'optimizer' attributes. */ void ProcessOptimizerAttributes( const char** atts, ParticleSwarmOptimizer* opt ); /** Process tag 'bound' attributes. */ void ProcessBoundAttributes( const char** atts, std::vector<double>& bound ); /** Search for and return a particular attribute from the attribute list. */ const char* GetAttribute( const char** atts, const char* key ); /** Check the current tags to see whether it matches a user input. */ bool ContextIs( const char* test ) const; /** During the parsing process, current tags are stored in a LIFO stack. */ std::vector< const char* > m_CurrentTags; // other temporary variables used during XML parsing std::vector<double> m_LowerBound; std::vector<double> m_UpperBound; Array<double> m_ParametersConvergenceTolerance; private: ParticleSwarmOptimizerSAXReader(const Self &); //purposely not implemented void operator=(const Self &); //purposely not implemented }; } // namespace itk #endif // __itkParticleSwarmOptimizerSAXReader_h
// // Created by danya on 26.05.15. // //#ifndef ALLOCGC_TIMING_H //#define ALLOCGC_TIMING_H // //#endif //ALLOCGC_TIMING_H #pragma once #include <sys/time.h> #include <cstdlib> #include <iostream> // These macros were a quick hack for the Macintosh. #define currentTime() stats_rtclock() #define elapsedTime(x) (x) using std::cout; using std::endl; /* Get the current time in milliseconds */ unsigned stats_rtclock (void);
/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file stm32f4xx_it.h * @brief This file contains the headers of the interrupt handlers. ****************************************************************************** * * COPYRIGHT(c) 2018 STMicroelectronics * * 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. * 3. Neither the name of STMicroelectronics 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. * ****************************************************************************** */ /* USER CODE END Header */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F4xx_IT_H #define __STM32F4xx_IT_H #ifdef __cplusplus extern "C" { #endif /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ /* Exported types ------------------------------------------------------------*/ /* USER CODE BEGIN ET */ /* USER CODE END ET */ /* Exported constants --------------------------------------------------------*/ /* USER CODE BEGIN EC */ /* USER CODE END EC */ /* Exported macro ------------------------------------------------------------*/ /* USER CODE BEGIN EM */ /* USER CODE END EM */ /* Exported functions prototypes ---------------------------------------------*/ void NMI_Handler(void); void HardFault_Handler(void); void MemManage_Handler(void); void BusFault_Handler(void); void UsageFault_Handler(void); void SVC_Handler(void); void DebugMon_Handler(void); void PendSV_Handler(void); void SysTick_Handler(void); void SPI1_IRQHandler(void); void USART1_IRQHandler(void); /* USER CODE BEGIN EFP */ /* USER CODE END EFP */ #ifdef __cplusplus } #endif #endif /* __STM32F4xx_IT_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* * Copyright 2010-2015, Tarantool AUTHORS, please see AUTHORS file. * * 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 <COPYRIGHT HOLDER> ``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 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 "bit/bit.h" extern inline bool bit_test(const void *data, size_t pos); extern inline bool bit_set(void *data, size_t pos); extern inline bool bit_clear(void *data, size_t pos); extern inline int bit_ctz_u32(uint32_t x); extern inline int bit_ctz_u64(uint64_t x); extern inline int bit_clz_u32(uint32_t x); extern inline int bit_clz_u64(uint64_t x); extern inline int bit_count_u32(uint32_t x); extern inline int bit_count_u64(uint64_t x); extern inline uint32_t bit_rotl_u32(uint32_t x, int r); extern inline uint64_t bit_rotl_u64(uint64_t x, int r); extern inline uint32_t bit_rotr_u32(uint32_t x, int r); extern inline uint64_t bit_rotr_u64(uint64_t x, int r); extern inline uint16_t bswap_u16(uint16_t x); extern inline uint32_t bswap_u32(uint32_t x); extern inline uint64_t bswap_u64(uint64_t x); #define BITINDEX_NAIVE(type, x, bitsize) { \ /* naive generic implementation, worst case */ \ type bit = 1; \ int i = 0; \ for (int k = 0; k < bitsize; k++) { \ if (x & bit) { \ indexes[i++] = offset + k + 1; \ } \ bit <<= 1; \ } \ \ indexes[i] = 0; \ return indexes + i; \ } int * bit_index_u32(uint32_t x, int *indexes, int offset) { #if defined(HAVE_BUILTIN_CTZ) int prev_pos = 0; int i = 0; #if defined(HAVE_BUILTIN_POPCOUNT) /* fast implementation using built-in popcount function */ const int count = bit_count_u32(x); while (i < count) { #else /* sligtly slower implementation without using built-in popcount */ while(x) { #endif /* use ctz */ const int a = bit_ctz_u32(x); prev_pos += a + 1; x >>= a; x >>= 1; indexes[i++] = offset + prev_pos; } indexes[i] = 0; return indexes + i; #else /* !defined(HAVE_BUILTIN_CTZ) */ BITINDEX_NAIVE(uint32_t, x, sizeof(uint32_t) * CHAR_BIT); #endif } int * bit_index_u64(uint64_t x, int *indexes, int offset) { #if defined(HAVE_CTZLL) int prev_pos = 0; int i = 0; #if defined(HAVE_POPCOUNTLL) /* fast implementation using built-in popcount function */ const int count = bit_count_u64(x); while (i < count) { #else /* sligtly slower implementation without using built-in popcount */ while(x) { #endif /* use ctz */ const int a = bit_ctz_u64(x); prev_pos += a + 1; x >>= a; x >>= 1; indexes[i++] = offset + prev_pos; } indexes[i] = 0; return indexes + i; #else /* !defined(HAVE_CTZ) */ BITINDEX_NAIVE(uint64_t, x, sizeof(uint64_t) * CHAR_BIT); #endif } #undef BITINDEX_NAIVE extern inline void bit_iterator_init(struct bit_iterator *it, const void *data, size_t size, bool set); extern inline size_t bit_iterator_next(struct bit_iterator *it);
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_VIEWS_CRYPTO_MODULE_PASSWORD_DIALOG_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_CRYPTO_MODULE_PASSWORD_DIALOG_VIEW_H_ #pragma once #include <string> #include "base/basictypes.h" #include "base/gtest_prod_util.h" #include "chrome/browser/ui/crypto_module_password_dialog.h" #include "ui/views/controls/textfield/textfield_controller.h" #include "ui/views/window/dialog_delegate.h" namespace views { class Label; class Textfield; } namespace browser { class CryptoModulePasswordDialogView : public views::DialogDelegateView, public views::TextfieldController { public: CryptoModulePasswordDialogView(const std::string& slot_name, CryptoModulePasswordReason reason, const std::string& server, const CryptoModulePasswordCallback& callback); virtual ~CryptoModulePasswordDialogView(); private: FRIEND_TEST_ALL_PREFIXES(CryptoModulePasswordDialogViewTest, TestAccept); // views::WidgetDelegate: virtual views::View* GetInitiallyFocusedView() OVERRIDE; virtual ui::ModalType GetModalType() const OVERRIDE; virtual string16 GetWindowTitle() const OVERRIDE; virtual views::View* GetContentsView() OVERRIDE; // views::DialogDelegate: virtual string16 GetDialogButtonLabel( ui::DialogButton button) const OVERRIDE; virtual bool Cancel() OVERRIDE; virtual bool Accept() OVERRIDE; // views::TextfieldController: virtual void ContentsChanged(views::Textfield* sender, const string16& new_contents) OVERRIDE; virtual bool HandleKeyEvent(views::Textfield* sender, const views::KeyEvent& keystroke) OVERRIDE; // Initialize views and layout. void Init(const std::string& server, const std::string& slot_name, browser::CryptoModulePasswordReason reason); views::Label* title_label_; views::Label* reason_label_; views::Label* password_label_; views::Textfield* password_entry_; const CryptoModulePasswordCallback callback_; DISALLOW_COPY_AND_ASSIGN(CryptoModulePasswordDialogView); }; } // namespace browser #endif // CHROME_BROWSER_UI_VIEWS_CRYPTO_MODULE_PASSWORD_DIALOG_VIEW_H_
// Copyright 2014 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_DATAGRAM_CHANNEL_FACTORY_H_ #define REMOTING_PROTOCOL_DATAGRAM_CHANNEL_FACTORY_H_ #include <memory> #include <string> #include "base/callback_forward.h" namespace remoting { namespace protocol { class P2PDatagramSocket; class DatagramChannelFactory { public: typedef base::OnceCallback<void(std::unique_ptr<P2PDatagramSocket>)> ChannelCreatedCallback; DatagramChannelFactory() {} DatagramChannelFactory(const DatagramChannelFactory&) = delete; DatagramChannelFactory& operator=(const DatagramChannelFactory&) = delete; // Creates new channels and calls the |callback| when then new channel is // created and connected. The |callback| is called with nullptr if channel // setup failed for any reason. Callback may be called synchronously, before // the call returns. All channels must be destroyed, and // CancelChannelCreation() called for any pending channels, before the factory // is destroyed. virtual void CreateChannel(const std::string& name, ChannelCreatedCallback callback) = 0; // Cancels a pending CreateChannel() operation for the named channel. If the // channel creation already completed then canceling it has no effect. When // shutting down this method must be called for each channel pending creation. virtual void CancelChannelCreation(const std::string& name) = 0; protected: virtual ~DatagramChannelFactory() {} }; } // namespace protocol } // namespace remoting #endif // REMOTING_PROTOCOL_DATAGRAM_CHANNEL_FACTORY_H_
// Copyright 2014 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_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUEST_H_ #define EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUEST_H_ #include "base/memory/weak_ptr.h" #include "extensions/browser/extension_function_dispatcher.h" #include "extensions/browser/guest_view/guest_view.h" namespace content { class WebContents; struct ContextMenuParams; struct StreamInfo; } // namespace content namespace extensions { class MimeHandlerViewGuestDelegate; // A container for a StreamHandle and any other information necessary for a // MimeHandler to handle a resource stream. class StreamContainer { public: StreamContainer(scoped_ptr<content::StreamInfo> stream, int tab_id, bool embedded, const GURL& handler_url, const std::string& extension_id); ~StreamContainer(); // Aborts the stream. void Abort(const base::Closure& callback); base::WeakPtr<StreamContainer> GetWeakPtr(); const content::StreamInfo* stream_info() const { return stream_.get(); } bool embedded() const { return embedded_; } int tab_id() const { return tab_id_; } GURL handler_url() const { return handler_url_; } std::string extension_id() const { return extension_id_; } private: const scoped_ptr<content::StreamInfo> stream_; const bool embedded_; const int tab_id_; const GURL handler_url_; const std::string extension_id_; base::WeakPtrFactory<StreamContainer> weak_factory_; }; class MimeHandlerViewGuest : public GuestView<MimeHandlerViewGuest>, public ExtensionFunctionDispatcher::Delegate { public: static GuestViewBase* Create(content::WebContents* owner_web_contents); static const char Type[]; // ExtensionFunctionDispatcher::Delegate implementation. WindowController* GetExtensionWindowController() const override; content::WebContents* GetAssociatedWebContents() const override; // GuestViewBase implementation. const char* GetAPINamespace() const override; int GetTaskPrefix() const override; void CreateWebContents(const base::DictionaryValue& create_params, const WebContentsCreatedCallback& callback) override; void DidAttachToEmbedder() override; void DidInitialize(const base::DictionaryValue& create_params) override; bool ZoomPropagatesFromEmbedderToGuest() const override; // content::BrowserPluginGuestDelegate implementation bool Find(int request_id, const base::string16& search_text, const blink::WebFindOptions& options) override; bool StopFinding(content::StopFindAction action) override; // WebContentsDelegate implementation. content::WebContents* OpenURLFromTab( content::WebContents* source, const content::OpenURLParams& params) override; bool HandleContextMenu(const content::ContextMenuParams& params) override; bool PreHandleGestureEvent(content::WebContents* source, const blink::WebGestureEvent& event) override; content::JavaScriptDialogManager* GetJavaScriptDialogManager( content::WebContents* source) override; void FindReply(content::WebContents* web_contents, int request_id, int number_of_matches, const gfx::Rect& selection_rect, int active_match_ordinal, bool final_update) override; bool SaveFrame(const GURL& url, const content::Referrer& referrer) override; // content::WebContentsObserver implementation. void DocumentOnLoadCompletedInMainFrame() override; bool OnMessageReceived(const IPC::Message& message) override; std::string view_id() const { return view_id_; } base::WeakPtr<StreamContainer> GetStream() const; private: explicit MimeHandlerViewGuest(content::WebContents* owner_web_contents); ~MimeHandlerViewGuest() override; void OnRequest(const ExtensionHostMsg_Request_Params& params); scoped_ptr<MimeHandlerViewGuestDelegate> delegate_; scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_; scoped_ptr<StreamContainer> stream_; std::string view_id_; DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewGuest); }; } // namespace extensions #endif // EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUEST_H_
/* * Copyright (C) 2013 Google 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: * * * 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 Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER 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 THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_DOCUMENT_ANIMATIONS_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_DOCUMENT_ANIMATIONS_H_ #include "base/auto_reset.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/core/animation/animation.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/document_lifecycle.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h" #include "third_party/blink/renderer/platform/heap/member.h" namespace blink { class AnimationTimeline; class Document; class PaintArtifactCompositor; class CORE_EXPORT DocumentAnimations final : public GarbageCollected<DocumentAnimations> { public: DocumentAnimations(Document*); ~DocumentAnimations() = default; uint64_t TransitionGeneration() const { return current_transition_generation_; } void IncrementTrasitionGeneration() { current_transition_generation_++; } void AddTimeline(AnimationTimeline&); void UpdateAnimationTimingForAnimationFrame(); bool NeedsAnimationTimingUpdate(); void UpdateAnimationTimingIfNeeded(); void GetAnimationsTargetingTreeScope(HeapVector<Member<Animation>>&, const TreeScope&); // Updates existing animations as part of generating a new (document // lifecycle) frame. Note that this considers and updates state for // both composited and non-composited animations. void UpdateAnimations( DocumentLifecycle::LifecycleState required_lifecycle_state, const PaintArtifactCompositor*, bool compositor_properties_updated); size_t GetAnimationsCount(); void MarkAnimationsCompositorPending(); HeapVector<Member<Animation>> getAnimations(const TreeScope&); // All newly created AnimationTimelines are considered "unvalidated". This // means that the internal state of the timeline is considered tentative, // and that computing the actual state may require an additional style/layout // pass. // // The lifecycle update will call this function after style and layout has // completed. The function will then go though all unvalidated timelines, // and compare the current state snapshot to a fresh state snapshot. If they // are equal, then the tentative state turned out to be correct, and no // further action is needed. Otherwise, all effects targets associated with // the timeline are marked for recalc, which causes the style/layout phase // to run again. // // https://github.com/w3c/csswg-drafts/issues/5261 void ValidateTimelines(); // Detach compositor timelines to prevent further ticking of any animations // associated with the timelines. Detached timelines may be subsequently // reattached if needed. void DetachCompositorTimelines(); // Add an element to the set of elements with a pending animation update. // The elements in the set can be applied later using, // ApplyPendingElementUpdates. // // It's invalid to call this function if there is no current // CSSAnimationUpdateScope. void AddElementWithPendingAnimationUpdate(Element&); // Apply pending updates for any elements previously added during AddElement- // WithPendingAnimationUpdate. void ApplyPendingElementUpdates(); void AddPendingOldStyleForElement(Element&); const HeapHashSet<WeakMember<AnimationTimeline>>& GetTimelinesForTesting() const { return timelines_; } const HeapHashSet<WeakMember<AnimationTimeline>>& GetUnvalidatedTimelinesForTesting() const { return unvalidated_timelines_; } uint64_t current_transition_generation_; void Trace(Visitor*) const; protected: using ReplaceableAnimationsMap = HeapHashMap<Member<Element>, Member<HeapVector<Member<Animation>>>>; void RemoveReplacedAnimations(ReplaceableAnimationsMap*); private: void MarkPendingIfCompositorPropertyAnimationChanges( const PaintArtifactCompositor*); Member<Document> document_; HeapHashSet<WeakMember<AnimationTimeline>> timelines_; HeapHashSet<WeakMember<AnimationTimeline>> unvalidated_timelines_; }; } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_DOCUMENT_ANIMATIONS_H_
// Copyright (c) 2013 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 STORAGE_BROWSER_BLOB_BLOB_DATA_HANDLE_H_ #define STORAGE_BROWSER_BLOB_BLOB_DATA_HANDLE_H_ #include <limits> #include <memory> #include <string> #include "base/callback_forward.h" #include "base/component_export.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/supports_user_data.h" #include "base/task/sequenced_task_runner_helpers.h" #include "storage/browser/blob/blob_storage_constants.h" namespace base { class SequencedTaskRunner; } namespace storage { class BlobDataSnapshot; class BlobReader; class BlobStorageContext; // BlobDataHandle ensures that the underlying blob (keyed by the uuid) remains // in the BlobStorageContext's collection while this object is alive. Anything // that needs to keep a blob alive needs to store this handle. // When the blob data itself is needed, clients must call the CreateSnapshot() // method on the IO thread to create a snapshot of the blob data. This snapshot // is not intended to be persisted, and serves to ensure that the backing // resources remain around for the duration of reading the blob. This snapshot // can be read on any thread, but it must be destructed on the IO thread. // This object has delete semantics and may be deleted on any thread. class COMPONENT_EXPORT(STORAGE_BROWSER) BlobDataHandle : public base::SupportsUserData::Data { public: static constexpr uint64_t kUnknownSize = std::numeric_limits<uint64_t>::max(); BlobDataHandle(const BlobDataHandle& other); // May be copied on any thread. ~BlobDataHandle() override; // May be deleted on any thread. // Assignment operator matching copy constructor. BlobDataHandle& operator=(const BlobDataHandle& other); // Returns if this blob is still constructing. If so, one can use the // RunOnConstructionComplete to wait. // Must be called on IO thread. bool IsBeingBuilt() const; // Returns if this blob is broken, and there is no data associated with it. // Must be called on IO thread. bool IsBroken() const; // Returns the broken reason if this blob is broken. // Must be called on IO thread. BlobStatus GetBlobStatus() const; // The callback will be run on the IO thread when construction of the blob // is complete. If construction is already complete, then the task is run // immediately on the current message loop (i.e. IO thread). // Must be called on IO thread. // Calling this multiple times results in registering multiple // completion callbacks. void RunOnConstructionComplete(BlobStatusCallback done); // The callback will be run on the IO thread when construction of the blob // has began. If construction has already began (or has finished already), // then the task is run immediately on the current message loop (i.e. IO // thread). // Must be called on IO thread. // Calling this multiple times results in registering multiple // callbacks. void RunOnConstructionBegin(BlobStatusCallback done); // A BlobReader is used to read the data from the blob. This object is // intended to be transient and should not be stored for any extended period // of time. std::unique_ptr<BlobReader> CreateReader() const; // May be accessed on any thread. const std::string& uuid() const; // May be accessed on any thread. const std::string& content_type() const; // May be accessed on any thread. const std::string& content_disposition() const; // May be accessed on any thread. In rare cases where the blob is created // as a file from javascript, this will be kUnknownSize. uint64_t size() const; // This call and the destruction of the returned snapshot must be called // on the IO thread. If the blob is broken, then we return a nullptr here. // Please do not call this, and use CreateReader instead. It appropriately // waits until the blob is built before having a size (see CalculateSize). // TODO(dmurph): Make this protected, where only the BlobReader can call it. std::unique_ptr<BlobDataSnapshot> CreateSnapshot() const; private: // Internal class whose destructor is guarenteed to be called on the IO // thread. class BlobDataHandleShared : public base::RefCountedThreadSafe<BlobDataHandleShared> { public: BlobDataHandleShared(const std::string& uuid, const std::string& content_type, const std::string& content_disposition, uint64_t size, BlobStorageContext* context); BlobDataHandleShared(const BlobDataHandleShared&) = delete; BlobDataHandleShared& operator=(const BlobDataHandleShared&) = delete; private: friend class base::DeleteHelper<BlobDataHandleShared>; friend class base::RefCountedThreadSafe<BlobDataHandleShared>; friend class BlobDataHandle; virtual ~BlobDataHandleShared(); const std::string uuid_; const std::string content_type_; const std::string content_disposition_; const uint64_t size_; base::WeakPtr<BlobStorageContext> context_; }; friend class BlobStorageContext; BlobDataHandle(const std::string& uuid, const std::string& content_type, const std::string& content_disposition, uint64_t size, BlobStorageContext* context, base::SequencedTaskRunner* io_task_runner); scoped_refptr<base::SequencedTaskRunner> io_task_runner_; scoped_refptr<BlobDataHandleShared> shared_; }; } // namespace storage #endif // STORAGE_BROWSER_BLOB_BLOB_DATA_HANDLE_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_COMMON_CHROME_PATHS_INTERNAL_H_ #define CHROME_COMMON_CHROME_PATHS_INTERNAL_H_ #include <string> #include "build/build_config.h" #if defined(OS_MACOSX) #if defined(__OBJC__) @class NSBundle; #else class NSBundle; #endif #endif namespace base { class FilePath; } namespace chrome { // Get the path to the user's data directory, regardless of whether // DIR_USER_DATA has been overridden by a command-line option. bool GetDefaultUserDataDirectory(base::FilePath* result); // Get the path to the user's cache directory. This is normally the // same as the profile directory, but on Linux it can also be // $XDG_CACHE_HOME and on Mac it can be under ~/Library/Caches. // Note that the Chrome cache directories are actually subdirectories // of this directory, with names like "Cache" and "Media Cache". // This will always fill in |result| with a directory, sometimes // just |profile_dir|. void GetUserCacheDirectory(const base::FilePath& profile_dir, base::FilePath* result); // Get the path to the user's documents directory. bool GetUserDocumentsDirectory(base::FilePath* result); #if defined(OS_WIN) || defined(OS_LINUX) // Gets the path to a safe default download directory for a user. bool GetUserDownloadsDirectorySafe(base::FilePath* result); #endif // Get the path to the user's downloads directory. bool GetUserDownloadsDirectory(base::FilePath* result); // Gets the path to the user's music directory. bool GetUserMusicDirectory(base::FilePath* result); // Gets the path to the user's pictures directory. bool GetUserPicturesDirectory(base::FilePath* result); // Gets the path to the user's videos directory. bool GetUserVideosDirectory(base::FilePath* result); #if defined(OS_MACOSX) && !defined(OS_IOS) // The "versioned directory" is a directory in the browser .app bundle. It // contains the bulk of the application, except for the things that the system // requires be located at spepcific locations. The versioned directory is // in the .app at Contents/Versions/w.x.y.z. base::FilePath GetVersionedDirectory(); // This overrides the directory returned by |GetVersionedDirectory()|, to be // used when |GetVersionedDirectory()| can't automatically determine the proper // location. This is the case when the browser didn't load itself but by, e.g., // the app mode loader. This should be called before |ChromeMain()|. This takes // ownership of the object |path| and the caller must not delete it. void SetOverrideVersionedDirectory(const base::FilePath* path); // Most of the application is further contained within the framework. The // framework bundle is located within the versioned directory at a specific // path. The only components in the versioned directory not included in the // framework are things that also depend on the framework, such as the helper // app bundle. base::FilePath GetFrameworkBundlePath(); // Get the local library directory. bool GetLocalLibraryDirectory(base::FilePath* result); // Get the user library directory. bool GetUserLibraryDirectory(base::FilePath* result); // Get the user applications directory. bool GetUserApplicationsDirectory(base::FilePath* result); // Get the global Application Support directory (under /Library/). bool GetGlobalApplicationSupportDirectory(base::FilePath* result); // Returns the NSBundle for the outer browser application, even when running // inside the helper. In unbundled applications, such as tests, returns nil. NSBundle* OuterAppBundle(); // Get the user data directory for the Chrome browser bundle at |bundle|. // |bundle| should be the same value that would be returned from +[NSBundle // mainBundle] if Chrome were launched normaly. This is used by app shims, // which run from a bundle which isn't Chrome itself, but which need access to // the user data directory to connect to a UNIX-domain socket therein. // Returns false if there was a problem fetching the app data directory. bool GetUserDataDirectoryForBrowserBundle(NSBundle* bundle, base::FilePath* result); #endif // OS_MACOSX && !OS_IOS // Checks if the |process_type| has the rights to access the profile. bool ProcessNeedsProfileDir(const std::string& process_type); #if defined(OS_WIN) // Populates |crash_dir| with the default crash dump location regardless of // whether DIR_USER_DATA or DIR_CRASH_DUMPS has been overridden. bool GetDefaultCrashDumpLocation(base::FilePath* crash_dir); #endif } // namespace chrome #endif // CHROME_COMMON_CHROME_PATHS_INTERNAL_H_
/* * Copyright (C) 2012 Google 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: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER 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 THIRD_PARTY_BLINK_RENDERER_CORE_DOM_USER_ACTION_ELEMENT_SET_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_DOM_USER_ACTION_ELEMENT_SET_H_ #include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/wtf/hash_map.h" namespace blink { class Node; class Element; class UserActionElementSet final { DISALLOW_NEW(); public: bool IsFocused(const Node* node) { return HasFlags(node, kIsFocusedFlag); } bool HasFocusWithin(const Node* node) { return HasFlags(node, kHasFocusWithinFlag); } bool IsActive(const Node* node) { return HasFlags(node, kIsActiveFlag); } bool IsInActiveChain(const Node* node) { return HasFlags(node, kInActiveChainFlag); } bool IsDragged(const Node* node) { return HasFlags(node, kIsDraggedFlag); } bool IsHovered(const Node* node) { return HasFlags(node, kIsHoveredFlag); } void SetFocused(Node* node, bool enable) { SetFlags(node, enable, kIsFocusedFlag); } void SetHasFocusWithin(Node* node, bool enable) { SetFlags(node, enable, kHasFocusWithinFlag); } void SetActive(Node* node, bool enable) { SetFlags(node, enable, kIsActiveFlag); } void SetInActiveChain(Node* node, bool enable) { SetFlags(node, enable, kInActiveChainFlag); } void SetDragged(Node* node, bool enable) { SetFlags(node, enable, kIsDraggedFlag); } void SetHovered(Node* node, bool enable) { SetFlags(node, enable, kIsHoveredFlag); } UserActionElementSet(); void DidDetach(Element&); void Trace(Visitor*) const; private: enum ElementFlags { kIsActiveFlag = 1, kInActiveChainFlag = 1 << 1, kIsHoveredFlag = 1 << 2, kIsFocusedFlag = 1 << 3, kIsDraggedFlag = 1 << 4, kHasFocusWithinFlag = 1 << 5, }; void SetFlags(Node* node, bool enable, unsigned flags) { enable ? SetFlags(node, flags) : ClearFlags(node, flags); } void SetFlags(Node*, unsigned); void ClearFlags(Node*, unsigned); bool HasFlags(const Node*, unsigned flags) const; void SetFlags(Element*, unsigned); void ClearFlags(Element*, unsigned); bool HasFlags(const Element*, unsigned flags) const; typedef HeapHashMap<Member<Element>, unsigned> ElementFlagMap; ElementFlagMap elements_; }; } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_CORE_DOM_USER_ACTION_ELEMENT_SET_H_
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_WEBDATA_COMMON_WEB_DATABASE_TABLE_H_ #define COMPONENTS_WEBDATA_COMMON_WEB_DATABASE_TABLE_H_ #include "base/memory/raw_ptr.h" #include "components/webdata/common/webdata_export.h" namespace sql { class Database; class MetaTable; } // An abstract base class representing a table within a WebDatabase. // Each table should subclass this, adding type-specific methods as needed. class WEBDATA_EXPORT WebDatabaseTable { public: // To look up a WebDatabaseTable of a certain type from WebDatabase, // we use a void* key, so that we can simply use the address of one // of the type's statics. typedef void* TypeKey; // The object is not ready for use until Init() has been called. WebDatabaseTable(); WebDatabaseTable(const WebDatabaseTable&) = delete; WebDatabaseTable& operator=(const WebDatabaseTable&) = delete; virtual ~WebDatabaseTable(); // Retrieves the TypeKey for the concrete subtype. virtual TypeKey GetTypeKey() const = 0; // Stores the passed members as instance variables. void Init(sql::Database* db, sql::MetaTable* meta_table); // Create all of the expected SQL tables if they do not already exist. // Returns true on success, false on failure. virtual bool CreateTablesIfNecessary() = 0; // In order to encourage developers to think about sync when adding or // or altering new tables, this method must be implemented. Please get in // contact with the sync team if you believe you're making a change that they // should be aware of (or if you could break something). // TODO(andybons): Implement something more robust. virtual bool IsSyncable() = 0; // Migrates this table to |version|. Returns false if there was // migration work to do and it failed, true otherwise. // // Implementations may set |*update_compatible_version| to true if the // compatible version should be changed to |version|, i.e., if the change will // break previous versions when they try to use the updated database. // Implementations should otherwise not modify this parameter. virtual bool MigrateToVersion(int version, bool* update_compatible_version) = 0; protected: // Non-owning. These are owned by WebDatabase, valid as long as that // class exists. Since lifetime of WebDatabaseTable objects slightly // exceeds that of WebDatabase, they should not be used in // ~WebDatabaseTable. raw_ptr<sql::Database> db_; raw_ptr<sql::MetaTable> meta_table_; }; #endif // COMPONENTS_WEBDATA_COMMON_WEB_DATABASE_TABLE_H_
#include "../../../../../src/corelib/kernel/qmetatype_p.h"
// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_WEBUI_BROWSER_COMMAND_BROWSER_COMMAND_HANDLER_H_ #define CHROME_BROWSER_UI_WEBUI_BROWSER_COMMAND_BROWSER_COMMAND_HANDLER_H_ #include <memory> #include "base/memory/raw_ptr.h" #include "chrome/browser/command_updater_delegate.h" #include "chrome/browser/ui/chrome_pages.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/receiver.h" #include "ui/base/window_open_disposition.h" #include "ui/webui/resources/js/browser_command/browser_command.mojom.h" #include "url/gurl.h" class CommandUpdater; class Profile; // Struct containing the information needed to customize/configure the feedback // form. Used to populate arguments passed to chrome::ShowFeedbackPage(). struct FeedbackCommandSettings { FeedbackCommandSettings() = default; FeedbackCommandSettings(const GURL& url, chrome::FeedbackSource source, std::string category) : url(url), source(source), category(category) {} GURL url; chrome::FeedbackSource source = chrome::kFeedbackSourceCount; std::string category; }; // Handles browser commands send from JS. class BrowserCommandHandler : public CommandUpdaterDelegate, public browser_command::mojom::CommandHandler { public: static const char kPromoBrowserCommandHistogramName[]; BrowserCommandHandler( mojo::PendingReceiver<browser_command::mojom::CommandHandler> pending_page_handler, Profile* profile, std::vector<browser_command::mojom::Command> supported_commands); ~BrowserCommandHandler() override; // browser_command::mojom::CommandHandler: void CanExecuteCommand(browser_command::mojom::Command command_id, CanExecuteCommandCallback callback) override; void ExecuteCommand(browser_command::mojom::Command command_id, browser_command::mojom::ClickInfoPtr click_info, ExecuteCommandCallback callback) override; // CommandUpdaterDelegate: void ExecuteCommandWithDisposition( int command_id, WindowOpenDisposition disposition) override; void ConfigureFeedbackCommand(FeedbackCommandSettings settings); protected: void EnableSupportedCommands(); virtual CommandUpdater* GetCommandUpdater(); private: virtual void NavigateToURL(const GURL& url, WindowOpenDisposition disposition); virtual void OpenFeedbackForm(); FeedbackCommandSettings feedback_settings_; raw_ptr<Profile> profile_; std::vector<browser_command::mojom::Command> supported_commands_; std::unique_ptr<CommandUpdater> command_updater_; mojo::Receiver<browser_command::mojom::CommandHandler> page_handler_; }; #endif // CHROME_BROWSER_UI_WEBUI_BROWSER_COMMAND_BROWSER_COMMAND_HANDLER_H_
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef ___ASM_SPARC_STATFS_H #define ___ASM_SPARC_STATFS_H #include <asm-generic/statfs.h> #endif
// This file was generated based on 'C:\ProgramData\Uno\Packages\Outracks.Simulator.Client.Uno\0.1.0\Runtime\$.uno'. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Outracks.Simulator.Bytecode.Optional-1.h> #include <Uno.Object.h> namespace g{namespace Outracks{namespace Simulator{namespace Bytecode{struct Parameter;}}}} namespace g{namespace Outracks{namespace Simulator{namespace Bytecode{struct Variable;}}}} namespace g{namespace Outracks{namespace Simulator{namespace Runtime{struct Environment;}}}} namespace g{namespace Outracks{namespace Simulator{struct ImmutableList;}}} namespace g{namespace Uno{namespace Collections{struct Dictionary;}}} namespace g{ namespace Outracks{ namespace Simulator{ namespace Runtime{ // public sealed class Environment :11 // { uType* Environment_typeof(); void Environment__ctor__fn(Environment* __this, ::g::Outracks::Simulator::Bytecode::Optional1<uStrong<Environment*> >* parent); void Environment__Bind_fn(Environment* __this, ::g::Outracks::Simulator::Bytecode::Variable* variable, uObject* value); void Environment__Bind1_fn(Environment* __this, ::g::Outracks::Simulator::ImmutableList* parameters, uArray* arguments); void Environment__GetValue_fn(Environment* __this, ::g::Outracks::Simulator::Bytecode::Variable* variable, uObject** __retval); void Environment__New1_fn(::g::Outracks::Simulator::Bytecode::Optional1<uStrong<Environment*> >* parent, Environment** __retval); struct Environment : uObject { uTField _parent() { return __type->Field(this, 0); } uStrong< ::g::Uno::Collections::Dictionary*> _variableBindings; void ctor_(::g::Outracks::Simulator::Bytecode::Optional1<uStrong<Environment*> > parent); void Bind(::g::Outracks::Simulator::Bytecode::Variable* variable, uObject* value); void Bind1(::g::Outracks::Simulator::ImmutableList* parameters, uArray* arguments); uObject* GetValue(::g::Outracks::Simulator::Bytecode::Variable* variable); static Environment* New1(::g::Outracks::Simulator::Bytecode::Optional1<uStrong<Environment*> > parent); }; // } }}}} // ::g::Outracks::Simulator::Runtime
#ifndef __VISIBLERECT_H__ #define __VISIBLERECT_H__ #include "cocos2d.h" USING_NS_CC; class VisibleRect { public: static Rect getVisibleRect(); static Point left(); static Point right(); static Point top(); static Point bottom(); static Point center(); static Point leftTop(); static Point rightTop(); static Point leftBottom(); static Point rightBottom(); private: static void lazyInit(); static Rect s_visibleRect; }; #endif /* __VISIBLERECT_H__ */
//****************************************************************************** // // Copyright (c) 2015 Microsoft Corporation. All rights reserved. // // This code is licensed under the MIT License (MIT). // // 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. // //****************************************************************************** #pragma once @class NSSocket; @class NSSelectInputSource; @interface NSInputStream_socket : NSStream { @public id _delegate; id _error; NSSocket* _socket; NSSelectInputSource* _inputSource; } - (int)read:(uint8_t*)buffer maxLength:(DWORD)maxLength; - (BOOL)hasBytesAvailable; - (void)dealloc; - (instancetype)initWithSocket:(NSSocket*)socket streamStatus:(DWORD)status; - (void)setDelegate:(id)delegate; - (id)open; - (id)close; - (id)scheduleInRunLoop:(id)runLoop forMode:(id)mode; - (id)removeFromRunLoop:(id)runLoop forMode:(id)mode; - (id)selectInputSource:(id)inputSource selectEvent:(DWORD)selectEvent; - (BOOL)setProperty:(id)prop forKey:(id)key; @end
/* * cmdline.c: read the command line passed to us by the PROM. * * Copyright (C) 1998 Harald Koerfgen * Copyright (C) 2002, 2004 Maciej W. Rozycki */ #include <linux/init.h> #include <linux/kernel.h> #include <linux/string.h> #include <linux/types.h> #include <asm/bootinfo.h> #include <asm/dec/prom.h> #undef PROM_DEBUG char arcs_cmdline[CL_SIZE]; void __init prom_init_cmdline(s32 argc, s32 *argv, u32 magic) { char *arg; int start_arg, i; /* * collect args and prepare cmd_line */ if (!prom_is_rex(magic)) start_arg = 1; else start_arg = 2; for (i = start_arg; i < argc; i++) { arg = (void *)(long)(argv[i]); strcat(arcs_cmdline, arg); if (i < (argc - 1)) strcat(arcs_cmdline, " "); } #ifdef PROM_DEBUG printk("arcs_cmdline: %s\n", &(arcs_cmdline[0])); #endif }
#pragma once /* * Copyright (C) 2005-2013 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, 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 XBMC; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #include "DVDInputStream.h" class CDVDInputStreamFile : public CDVDInputStream { public: explicit CDVDInputStreamFile(const CFileItem& fileitem); ~CDVDInputStreamFile() override; bool Open() override; void Close() override; int Read(uint8_t* buf, int buf_size) override; int64_t Seek(int64_t offset, int whence) override; bool Pause(double dTime) override { return false; }; bool IsEOF() override; int64_t GetLength() override; BitstreamStats GetBitstreamStats() const override ; int GetBlockSize() override; void SetReadRate(unsigned rate) override; bool GetCacheStatus(XFILE::SCacheStatus *status) override; protected: XFILE::CFile* m_pFile; bool m_eof; };
/* * Copyright (C) 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 bbs_MEM_TBL_EM_H #define bbs_MEM_TBL_EM_H /* ---- includes ----------------------------------------------------------- */ #include "b_BasicEm/MemSeg.h" /* ---- related objects --------------------------------------------------- */ struct bbs_Context; /* ---- typedefs ----------------------------------------------------------- */ /* ---- constants ---------------------------------------------------------- */ /* maximum number of exclusive and shared memory segments used, increase this number if needed */ #define bbs_MAX_MEM_SEGS 4 /* ---- object definition -------------------------------------------------- */ /** Descriptor of a set of memory segments * The first segment in each array (exclusive and shared) with a size > 0 is * the default segment. */ struct bbs_MemTbl { /* number of exclusive memory segments */ uint32 esSizeE; /** array of exclusive memory segments (for initialisation purposes only ) */ struct bbs_MemSeg esArrE[ bbs_MAX_MEM_SEGS ]; /** array of pointer to exclusive memory segments */ struct bbs_MemSeg* espArrE[ bbs_MAX_MEM_SEGS ]; /* number of shared memory segments */ uint32 ssSizeE; /** array of shared memory segments */ struct bbs_MemSeg ssArrE[ bbs_MAX_MEM_SEGS ]; }; /* ---- associated objects ------------------------------------------------- */ /* ---- external functions ------------------------------------------------- */ /* ---- \ghd{ constructor/destructor } ------------------------------------- */ /** initializes bbs_MemTbl */ void bbs_MemTbl_init( struct bbs_Context* cpA, struct bbs_MemTbl* ptrA ); /** resets bbs_MemTbl */ void bbs_MemTbl_exit( struct bbs_Context* cpA, struct bbs_MemTbl* ptrA ); /* ---- \ghd{ operators } -------------------------------------------------- */ /* ---- \ghd{ query functions } -------------------------------------------- */ /* indicates whether memory segment overalps with any segment in memory table */ flag bbs_MemTbl_overlap( struct bbs_Context* cpA, struct bbs_MemTbl* ptrA, const void* memPtrA, uint32 sizeA ); /* ---- \ghd{ modify functions } ------------------------------------------- */ /* ---- \ghd{ memory I/O } ------------------------------------------------- */ /* ---- \ghd{ exec functions } --------------------------------------------- */ /** creates a memory table with one exclusive and one shared segment from a coherent memory block */ void bbs_MemTbl_create( struct bbs_Context* cpA, struct bbs_MemTbl* ptrA, void* memPtrA, uint32 sizeA, uint32 sharedSubSizeA ); /** adds new exclusive segment to table ( default segment must be added first ) */ void bbs_MemTbl_add( struct bbs_Context* cpA, struct bbs_MemTbl* ptrA, void* memPtrA, uint32 sizeA, uint32 idA ); /** adds new shared segment to table ( default segment must be added first ) */ void bbs_MemTbl_addShared( struct bbs_Context* cpA, struct bbs_MemTbl* ptrA, void* memPtrA, uint32 sizeA, uint32 idA ); /** returns specified segment. If specified segment is not found the default segment is returned */ struct bbs_MemSeg* bbs_MemTbl_segPtr( struct bbs_Context* cpA, struct bbs_MemTbl* ptrA, uint32 idA ); struct bbs_MemSeg* bbs_MemTbl_sharedSegPtr( struct bbs_Context* cpA, struct bbs_MemTbl* ptrA, uint32 idA ); /* Search functions below are obsolete. Please use bbs_MemTbl_segPtr or bbs_MemTbl_sharedSegPtr instead. */ /** returns pointer to fastest exclusive segment that has at least minSizeA words available */ struct bbs_MemSeg* bbs_MemTbl_fastestSegPtr( struct bbs_Context* cpA, struct bbs_MemTbl* ptrA, uint32 minSizeA ); /** returns pointer to exclusive segment that has most words available */ struct bbs_MemSeg* bbs_MemTbl_largestSegPtr( struct bbs_Context* cpA, struct bbs_MemTbl* ptrA ); /** returns fastest shared segment that has at least minSizeA words available */ struct bbs_MemSeg* bbs_MemTbl_fastestSharedSegPtr( struct bbs_Context* cpA, struct bbs_MemTbl* ptrA, uint32 minSizeA ); /** returns shared segment that has most words available */ struct bbs_MemSeg* bbs_MemTbl_largestSharedSegPtr( struct bbs_Context* cpA, struct bbs_MemTbl* ptrA ); #endif /* bbs_MEM_TBL_EM_H */
/* * VLAN netlink control interface * * Copyright (c) 2007 Patrick McHardy <kaber@trash.net> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. */ #include <linux/kernel.h> #include <linux/netdevice.h> #include <linux/if_vlan.h> #include <net/netlink.h> #include <net/rtnetlink.h> #include "vlan.h" static const struct nla_policy vlan_policy[IFLA_VLAN_MAX + 1] = { [IFLA_VLAN_ID] = { .type = NLA_U16 }, [IFLA_VLAN_FLAGS] = { .len = sizeof(struct ifla_vlan_flags) }, [IFLA_VLAN_EGRESS_QOS] = { .type = NLA_NESTED }, [IFLA_VLAN_INGRESS_QOS] = { .type = NLA_NESTED }, }; static const struct nla_policy vlan_map_policy[IFLA_VLAN_QOS_MAX + 1] = { [IFLA_VLAN_QOS_MAPPING] = { .len = sizeof(struct ifla_vlan_qos_mapping) }, }; static inline int vlan_validate_qos_map(struct nlattr *attr) { if (!attr) return 0; return nla_validate_nested(attr, IFLA_VLAN_QOS_MAX, vlan_map_policy); } static int vlan_validate(struct nlattr *tb[], struct nlattr *data[]) { struct ifla_vlan_flags *flags; u16 id; int err; if (tb[IFLA_ADDRESS]) { if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN) return -EINVAL; if (!is_valid_ether_addr(nla_data(tb[IFLA_ADDRESS]))) return -EADDRNOTAVAIL; } if (!data) return -EINVAL; if (data[IFLA_VLAN_ID]) { id = nla_get_u16(data[IFLA_VLAN_ID]); if (id >= VLAN_VID_MASK) return -ERANGE; } if (data[IFLA_VLAN_FLAGS]) { flags = nla_data(data[IFLA_VLAN_FLAGS]); if ((flags->flags & flags->mask) & ~VLAN_FLAG_REORDER_HDR) return -EINVAL; } err = vlan_validate_qos_map(data[IFLA_VLAN_INGRESS_QOS]); if (err < 0) return err; err = vlan_validate_qos_map(data[IFLA_VLAN_EGRESS_QOS]); if (err < 0) return err; return 0; } static int vlan_changelink(struct net_device *dev, struct nlattr *tb[], struct nlattr *data[]) { struct vlan_dev_info *vlan = VLAN_DEV_INFO(dev); struct ifla_vlan_flags *flags; struct ifla_vlan_qos_mapping *m; struct nlattr *attr; int rem; if (data[IFLA_VLAN_FLAGS]) { flags = nla_data(data[IFLA_VLAN_FLAGS]); vlan->flags = (vlan->flags & ~flags->mask) | (flags->flags & flags->mask); } if (data[IFLA_VLAN_INGRESS_QOS]) { nla_for_each_nested(attr, data[IFLA_VLAN_INGRESS_QOS], rem) { m = nla_data(attr); vlan_dev_set_ingress_priority(dev, m->to, m->from); } } if (data[IFLA_VLAN_EGRESS_QOS]) { nla_for_each_nested(attr, data[IFLA_VLAN_EGRESS_QOS], rem) { m = nla_data(attr); vlan_dev_set_egress_priority(dev, m->from, m->to); } } return 0; } static int vlan_newlink(struct net_device *dev, struct nlattr *tb[], struct nlattr *data[]) { struct vlan_dev_info *vlan = VLAN_DEV_INFO(dev); struct net_device *real_dev; int err; if (!data[IFLA_VLAN_ID]) return -EINVAL; if (!tb[IFLA_LINK]) return -EINVAL; real_dev = __dev_get_by_index(nla_get_u32(tb[IFLA_LINK])); if (!real_dev) return -ENODEV; vlan->vlan_id = nla_get_u16(data[IFLA_VLAN_ID]); vlan->real_dev = real_dev; vlan->flags = VLAN_FLAG_REORDER_HDR; err = vlan_check_real_dev(real_dev, vlan->vlan_id); if (err < 0) return err; if (!tb[IFLA_MTU]) dev->mtu = real_dev->mtu; else if (dev->mtu > real_dev->mtu) return -EINVAL; err = vlan_changelink(dev, tb, data); if (err < 0) return err; return register_vlan_dev(dev); } static void vlan_dellink(struct net_device *dev) { unregister_vlan_device(dev); } static inline size_t vlan_qos_map_size(unsigned int n) { if (n == 0) return 0; /* IFLA_VLAN_{EGRESS,INGRESS}_QOS + n * IFLA_VLAN_QOS_MAPPING */ return nla_total_size(sizeof(struct nlattr)) + nla_total_size(sizeof(struct ifla_vlan_qos_mapping)) * n; } static size_t vlan_get_size(const struct net_device *dev) { struct vlan_dev_info *vlan = VLAN_DEV_INFO(dev); return nla_total_size(2) + /* IFLA_VLAN_ID */ vlan_qos_map_size(vlan->nr_ingress_mappings) + vlan_qos_map_size(vlan->nr_egress_mappings); } static int vlan_fill_info(struct sk_buff *skb, const struct net_device *dev) { struct vlan_dev_info *vlan = VLAN_DEV_INFO(dev); struct vlan_priority_tci_mapping *pm; struct ifla_vlan_flags f; struct ifla_vlan_qos_mapping m; struct nlattr *nest; unsigned int i; NLA_PUT_U16(skb, IFLA_VLAN_ID, VLAN_DEV_INFO(dev)->vlan_id); if (vlan->flags) { f.flags = vlan->flags; f.mask = ~0; NLA_PUT(skb, IFLA_VLAN_FLAGS, sizeof(f), &f); } if (vlan->nr_ingress_mappings) { nest = nla_nest_start(skb, IFLA_VLAN_INGRESS_QOS); if (nest == NULL) goto nla_put_failure; for (i = 0; i < ARRAY_SIZE(vlan->ingress_priority_map); i++) { if (!vlan->ingress_priority_map[i]) continue; m.from = i; m.to = vlan->ingress_priority_map[i]; NLA_PUT(skb, IFLA_VLAN_QOS_MAPPING, sizeof(m), &m); } nla_nest_end(skb, nest); } if (vlan->nr_egress_mappings) { nest = nla_nest_start(skb, IFLA_VLAN_EGRESS_QOS); if (nest == NULL) goto nla_put_failure; for (i = 0; i < ARRAY_SIZE(vlan->egress_priority_map); i++) { for (pm = vlan->egress_priority_map[i]; pm; pm = pm->next) { if (!pm->vlan_qos) continue; m.from = pm->priority; m.to = (pm->vlan_qos >> 13) & 0x7; NLA_PUT(skb, IFLA_VLAN_QOS_MAPPING, sizeof(m), &m); } } nla_nest_end(skb, nest); } return 0; nla_put_failure: return -EMSGSIZE; } struct rtnl_link_ops vlan_link_ops __read_mostly = { .kind = "vlan", .maxtype = IFLA_VLAN_MAX, .policy = vlan_policy, .priv_size = sizeof(struct vlan_dev_info), .setup = vlan_setup, .validate = vlan_validate, .newlink = vlan_newlink, .changelink = vlan_changelink, .dellink = vlan_dellink, .get_size = vlan_get_size, .fill_info = vlan_fill_info, }; int __init vlan_netlink_init(void) { return rtnl_link_register(&vlan_link_ops); } void __exit vlan_netlink_fini(void) { rtnl_link_unregister(&vlan_link_ops); } MODULE_ALIAS_RTNL_LINK("vlan");
/****************************************************************************** * * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * * Modifications for inclusion into the Linux staging tree are * Copyright(c) 2010 Larry Finger. All rights reserved. * * Contact information: * WLAN FAE <wlanfae@realtek.com> * Larry Finger <Larry.Finger@lwfinger.net> * ******************************************************************************/ #ifndef __USB_OPS_H_ #define __USB_OPS_H_ #include "osdep_service.h" #include "drv_types.h" #include "osdep_intf.h" void r8712_usb_write_mem(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem); u32 r8712_usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem); u32 r8712_usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem); void r8712_usb_set_intf_option(u32 *poption); void r8712_usb_set_intf_funs(struct intf_hdl *pintf_hdl); uint r8712_usb_init_intf_priv(struct intf_priv *pintfpriv); void r8712_usb_unload_intf_priv(struct intf_priv *pintfpriv); void r8712_usb_set_intf_ops(struct _io_ops *pops); void r8712_usb_read_port_cancel(struct _adapter *padapter); void r8712_usb_write_port_cancel(struct _adapter *padapter); int r8712_usbctrl_vendorreq(struct intf_priv *pintfpriv, u8 request, u16 value, u16 index, void *pdata, u16 len, u8 requesttype); #endif
/* * platform_msic_audio.c: MSIC audio platform data initilization file * * (C) Copyright 2008 Intel Corporation * Author: * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; version 2 * of the License. */ #include <linux/kernel.h> #include <linux/interrupt.h> #include <linux/scatterlist.h> #include <linux/init.h> #include <linux/sfi.h> #include <linux/platform_device.h> #include <linux/mfd/intel_msic.h> #include <asm/platform_sst_audio.h> #include <asm/intel-mid.h> #include <asm/intel_mid_remoteproc.h> #include <sound/msic_audio_platform.h> #include "platform_msic.h" #include "platform_msic_audio.h" static struct resource msic_audio_resources[] __initdata = { { .name = "IRQ", .flags = IORESOURCE_IRQ, }, { .name = "IRQ_BASE", .flags = IORESOURCE_MEM, .start = MSIC_IRQ_STATUS_OCAUDIO, .end = MSIC_IRQ_STATUS_ACCDET, }, }; static struct msic_audio_platform_data msic_audio_pdata = { .spid = &spid, }; void *msic_audio_platform_data(void *info) { int i; void *pdata = NULL; struct platform_device *pdev = NULL; struct sfi_device_table_entry *entry = info; if (add_sst_platform_device() < 0) return NULL; pdev = platform_device_alloc("hdmi-audio", -1); if (!pdev) { pr_err("failed to allocate hdmi-audio platform device\n"); goto out; } if (platform_device_add(pdev)) { pr_err("failed to add hdmi-audio platform device\n"); goto pdev_add_fail; } pdev = platform_device_alloc("sn95031", -1); if (!pdev) { pr_err("failed to allocate sn95031 platform device\n"); goto out; } if (platform_device_add(pdev)) { pr_err("failed to add sn95031 platform device\n"); goto pdev_add_fail; } pdev = platform_device_alloc(MSIC_AUDIO_DEVICE_NAME, -1); if (!pdev) { pr_err("out of memory for SFI platform dev %s\n", MSIC_AUDIO_DEVICE_NAME); goto out; } msic_audio_pdata.jack_gpio = get_gpio_by_name("audio_jack_gpio"); if (platform_device_add_data(pdev, &msic_audio_pdata, sizeof(struct msic_audio_platform_data))) { pr_err("failed to add audio platform data\n"); goto pdev_add_fail; } for (i = 0; i < ARRAY_SIZE(msic_audio_resources); i++) { if (msic_audio_resources[i].flags & IORESOURCE_IRQ) { msic_audio_resources[i].start = entry->irq; break; } } if (platform_device_add_resources(pdev, msic_audio_resources, ARRAY_SIZE(msic_audio_resources))) { pr_err("failed to add audio resources\n"); goto pdev_add_fail; } if (platform_device_add(pdev)) { pr_err("failed to add SFI platform dev %s\n", MSIC_AUDIO_DEVICE_NAME); goto pdev_add_fail; } pdata = &msic_audio_pdata; register_rpmsg_service("rpmsg_msic_audio", RPROC_SCU, RP_MSIC_AUDIO); pdev_add_fail: platform_device_put(pdev); out: return pdata; }
/* * arch/arm/mach-tegra/mcerr-t14.c * * Tegra 14x SoC-specific mcerr code. * * Copyright (c) 2012-2013, NVIDIA Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "mcerr.h" #define dummy_client client("dummy") struct mc_client mc_clients[] = { client("ptc"), client("display0_wina"), client("display1_wina"), client("display0_winb"), client("display1_winb"), client("display0_winc"), client("display1_winc"), dummy_client, dummy_client, client("epp"), client("gr2d_pat"), /* 10 */ client("gr2d_src"), dummy_client, dummy_client, dummy_client, client("avp"), client("display0_cursor"), client("display1_cursor"), client("gr3d_fdc0"), client("gr3d_fdc1"), client("gr2d_dst"), /* 20 */ client("hda"), client("host1x_dma"), client("host1x_generic"), client("gr3d0_idx"), dummy_client, dummy_client, dummy_client, client("msenc"), client("ahb_dma"), client("ahb_slave_r"), /* 30 */ dummy_client, client("gr3d0_tex"), dummy_client, client("vde_bsev"), client("vde_mbe"), client("vde_mce"), client("vde_tpe"), client("cpu_lp"), client("cpu"), client("epp_u"), /* 40 */ client("epp_v"), client("epp_y"), client("msenc"), client("vi_sb"), client("vi_u"), client("vi_v"), client("vi_y"), client("gr2d_dst"), dummy_client, client("avp"), /* 50 */ client("gr3d_fdc0"), client("gr3d_fdc1"), client("hda"), client("host1x"), client("isp"), client("cpu_lp"), client("cpu"), dummy_client, client("ahb_dma"), client("ahb_slave_w"), /* 60 */ dummy_client, client("vde_bsev"), client("vde_dbg"), client("vde_mbe"), client("vde_tpm"), dummy_client, dummy_client, client("ve_ispra"), dummy_client, client("ve_ispwa"), /* 70 */ client("ve_ispwb"), dummy_client, dummy_client, dummy_client, dummy_client, dummy_client, dummy_client, dummy_client, dummy_client, dummy_client, /* 80 */ dummy_client, client("emucif"), client("emucif"), client("tsec"), client("tsec"), client("viw"), client("bbcr"), client("bbcw"), client("bbcllr"), client("disp_t"), /* 90 */ dummy_client, client("disp_d"), }; int mc_client_last = ARRAY_SIZE(mc_clients) - 1; static void mcerr_t14x_info_update(struct mc_client *c, u32 stat) { if (stat & MC_INT_DECERR_EMEM) c->intr_counts[0]++; if (stat & MC_INT_SECURITY_VIOLATION) c->intr_counts[1]++; if (stat & MC_INT_INVALID_SMMU_PAGE) c->intr_counts[2]++; if (stat & MC_INT_DECERR_VPR) c->intr_counts[3]++; if (stat & MC_INT_SECERR_SEC) c->intr_counts[4]++; if (stat & MC_INT_BBC_PRIVATE_MEM_VIOLATION) c->intr_counts[5]++; if (stat & MC_INT_DECERR_BBC) c->intr_counts[6]++; if (stat & ~MC_INT_EN_MASK) c->intr_counts[7]++; } static int mcerr_t14x_debugfs_show(struct seq_file *s, void *v) { int i, j; int do_print; const char *fmt = "%-18s %-9u %-9u %-9u %-10u %-10u %-9u %-9u %-9u\n"; seq_printf(s, "%-18s %-9s %-9s %-9s %-10s %-10s %-9s %-9s %-9s\n", "client", "decerr", "secerr", "smmuerr", "decerr-VPR", "secerr-SEC", "priv-bbc", "decerr-bbc", "unknown"); for (i = 0; i < ARRAY_SIZE(mc_clients); i++) { do_print = 0; if (strcmp(mc_clients[i].name, "dummy") == 0) continue; /* Only print clients who actually have errors. */ for (j = 0; j < INTR_COUNT; j++) { if (mc_clients[i].intr_counts[j]) { do_print = 1; break; } } if (do_print) seq_printf(s, fmt, mc_clients[i].name, mc_clients[i].intr_counts[0], mc_clients[i].intr_counts[1], mc_clients[i].intr_counts[2], mc_clients[i].intr_counts[3], mc_clients[i].intr_counts[4], mc_clients[i].intr_counts[5], mc_clients[i].intr_counts[6], mc_clients[i].intr_counts[7]); } return 0; } /* * Set up chip specific functions and data for handling this particular chip's * error decoding and logging. */ void mcerr_chip_specific_setup(struct mcerr_chip_specific *spec) { spec->mcerr_info_update = mcerr_t14x_info_update; spec->mcerr_debugfs_show = mcerr_t14x_debugfs_show; spec->nr_clients = ARRAY_SIZE(mc_clients); return; }
/* { dg-do compile } */ /* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic" } */ /* Test that the compiler properly optimizes floating point multiply and add instructions into FMA3 instructions. */ typedef double adouble __attribute__((aligned(sizeof (double)))); #define TYPE adouble #include "l_fma_3.h" /* { dg-final { scan-assembler-times "vfmadd\[123\]+pd" 8 } } */ /* { dg-final { scan-assembler-times "vfmsub\[123\]+pd" 8 } } */ /* { dg-final { scan-assembler-times "vfnmadd\[123\]+pd" 8 } } */ /* { dg-final { scan-assembler-times "vfnmsub\[123\]+pd" 8 } } */ /* { dg-final { scan-assembler-times "vfmadd\[123\]+sd" 56 } } */ /* { dg-final { scan-assembler-times "vfmsub\[123\]+sd" 56 } } */ /* { dg-final { scan-assembler-times "vfnmadd\[123\]+sd" 56 } } */ /* { dg-final { scan-assembler-times "vfnmsub\[123\]+sd" 56 } } */
/* * raster-cache.c - Simple cache for the raster-based video chip emulation * helper. * * Written by * Ettore Perazzoli <ettore@comm2000.it> * Andreas Boose <viceteam@t-online.de> * * This file is part of VICE, the Versatile Commodore Emulator. * See README for copyright notice. * * 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. * */ #include "vice.h" #include <string.h> #include "lib.h" #include "raster-cache.h" #include "raster-sprite-status.h" void raster_cache_new(raster_cache_t *cache, raster_sprite_status_t *status) { unsigned int i; memset(cache, 0, sizeof(raster_cache_t)); if (status != NULL) { for (i = 0; i < RASTER_CACHE_MAX_SPRITES; i++) { (status->cache_init_func)(&(cache->sprites[i])); } cache->gfx_msk = lib_calloc(1, RASTER_CACHE_GFX_MSK_SIZE); } cache->is_dirty = 1; } void raster_cache_destroy(raster_cache_t *cache, raster_sprite_status_t *status) { if (status != NULL) { lib_free(cache->gfx_msk); } } void raster_cache_realloc(raster_cache_t **cache, unsigned int screen_height) { *cache = lib_realloc(*cache, sizeof(raster_cache_t) * screen_height); }
#ifndef __DISP_CLK_H__ #define __DISP_CLK_H__ #include "disp_display_i.h" typedef struct { __u32 tve_clk; //required clock frequency for LCDx_ch1_clk2, for tv output used ,Hz __u32 pre_scale;//required divide LCDx_ch1_clk2 by 2 for LCDx_ch1_clk1 or NOT: 1:not divided , 2: divide by two __u32 hdmi_clk; //required clock frequency for internal hdmi module, Hz __u32 pll_clk; //required pll frequency for VIDEO_PLL0(1x) or VIDEO_PLL1(1x), Hz __u32 pll_2x; //required 2x VIDEO_PLL or NOT: 0:no, 1: required }__disp_tv_vga_clk_t; //record tv/vga/hdmi mode clock requirement typedef struct { __disp_tv_vga_clk_t tv_clk_tab[30]; //number related to number of tv mode supported __disp_tv_vga_clk_t vga_clk_tab[12];//number related to number of vga mode supported }__disp_clk_tab; typedef struct { __u32 factor_n; __u32 factor_k; __u32 divider_m; }__disp_ccmu_coef; typedef struct __CCMU_MIPI_PLL_REG0040 { __u32 FactorM:4; //bit0, PLL FactorM __u32 FactorK:2; //bit4, PLL FactorM __u32 reserved0:2; //bit6, reserved __u32 FactorN:4; //bit8, PLL factor N __u32 reserved1:4; //bit12, reserved __u32 VfbSel:1; //bit16, 0-mipi mode(n,k,m valid), 1-hdmi mode(sint_frac, sdiv2 // s6p25_7p5, pll_feedback_div valid) __u32 FeedBackDiv:1; //bit17, pll feedback division, 0:x5, 1:x7 __u32 reserved2:2; //bit18, reserved __u32 SdmEn:1; //bit20, sdm enable __u32 PllSrc:1; //bit21, PLL source, 0:video pll0, 1:video pll1 __u32 Ldo2En:1; //bit22, LDO2 enable __u32 Ldo1En:1; //bit23, LDO1 enable __u32 reserved3:1; //bit24, reserved __u32 Sel625Or750:1; //bit25, select pll out is input*6.25 or 7.50 __u32 SDiv2:1; //bit26, PLL output seclect, 0:pll output, 1:pll output x2 __u32 FracMode:1; //bit27, PLL output mode, 0:integer mode, 1:fraction mode __u32 Lock:1; //bit28, lock flag __u32 reserved4:2; //bit29, reserved __u32 PLLEn:1; //bit31, PLL enable } __ccmu_mipi_pll_reg0040_t; typedef struct __CCMU_MIPI_PLL_BIAS_REG0240 { __u32 reserved0:28; //bit0 __u32 pllvdd_ldo_out_ctrl:3; //bit28, pll ldo output control __u32 vco_rst:31; //bit31, vco reset in }__ccmu_mipi_pll_bias_reg0240_t; __s32 image_clk_init(__u32 sel); __s32 image_clk_exit(__u32 sel); __s32 image_clk_on(__u32 sel, __u32 type); __s32 image_clk_off(__u32 sel, __u32 type); __s32 scaler_clk_init(__u32 sel); __s32 scaler_clk_exit(__u32 sel); __s32 scaler_clk_on(__u32 sel); __s32 scaler_clk_off(__u32 sel); __s32 lcdc_clk_init(__u32 sel); __s32 lcdc_clk_exit(__u32 sel); __s32 lcdc_clk_on(__u32 sel, __u32 tcon_index, __u32 type); __s32 lcdc_clk_off(__u32 sel); __s32 tve_clk_init(__u32 sel); __s32 tve_clk_exit(__u32 sel); __s32 tve_clk_on(__u32 sel); __s32 tve_clk_off(__u32 sel); __s32 hdmi_clk_init(void); __s32 hdmi_clk_exit(void); __s32 hdmi_clk_on(void); __s32 hdmi_clk_off(void); __s32 lvds_clk_init(void); __s32 lvds_clk_exit(void); __s32 lvds_clk_on(void); __s32 lvds_clk_off(void); __s32 dsi_clk_init(void); __s32 dsi_clk_exit(void); __s32 dsi_clk_on(void); __s32 dsi_clk_off(void); __s32 disp_pll_init(void); __s32 disp_clk_cfg(__u32 sel, __u32 type, __u8 mode); __s32 disp_clk_adjust(__u32 sel, __u32 type); extern __disp_clk_tab clk_tab; #endif
/* * include/asm-s390/smp.h * * S390 version * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation * Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com), * Martin Schwidefsky (schwidefsky@de.ibm.com) * Heiko Carstens (heiko.carstens@de.ibm.com) */ #ifndef __ASM_SMP_H #define __ASM_SMP_H #include <linux/threads.h> #include <linux/cpumask.h> #include <linux/bitops.h> #if defined(__KERNEL__) && defined(CONFIG_SMP) && !defined(__ASSEMBLY__) #include <asm/lowcore.h> #include <asm/sigp.h> /* s390 specific smp.c headers */ typedef struct { int intresting; sigp_ccode ccode; __u32 status; __u16 cpu; } sigp_info; extern void smp_setup_cpu_possible_map(void); extern int smp_call_function_on(void (*func) (void *info), void *info, int nonatomic, int wait, int cpu); #define NO_PROC_ID 0xFF /* No processor magic marker */ /* * This magic constant controls our willingness to transfer * a process across CPUs. Such a transfer incurs misses on the L1 * cache, and on a P6 or P5 with multiple L2 caches L2 hits. My * gut feeling is this will vary by board in value. For a board * with separate L2 cache it probably depends also on the RSS, and * for a board with shared L2 cache it ought to decay fast as other * processes are run. */ #define PROC_CHANGE_PENALTY 20 /* Schedule penalty */ #define raw_smp_processor_id() (S390_lowcore.cpu_data.cpu_nr) extern int smp_get_cpu(cpumask_t cpu_map); extern void smp_put_cpu(int cpu); static inline __u16 hard_smp_processor_id(void) { __u16 cpu_address; __asm__ ("stap %0\n" : "=m" (cpu_address)); return cpu_address; } /* * returns 1 if cpu is in stopped/check stopped state or not operational * returns 0 otherwise */ static inline int smp_cpu_not_running(int cpu) { __u32 status; switch (signal_processor_ps(&status, 0, cpu, sigp_sense)) { case sigp_order_code_accepted: case sigp_status_stored: /* Check for stopped and check stop state */ if (status & 0x50) return 1; break; case sigp_not_operational: return 1; default: break; } return 0; } #define cpu_logical_map(cpu) (cpu) extern int __cpu_disable (void); extern void __cpu_die (unsigned int cpu); extern void cpu_die (void) __attribute__ ((noreturn)); extern int __cpu_up (unsigned int cpu); #endif #ifndef CONFIG_SMP static inline int smp_call_function_on(void (*func) (void *info), void *info, int nonatomic, int wait, int cpu) { func(info); return 0; } #define smp_cpu_not_running(cpu) 1 #define smp_get_cpu(cpu) ({ 0; }) #define smp_put_cpu(cpu) ({ 0; }) #define smp_setup_cpu_possible_map() #endif #endif
/* * drivers/mfd/mfd-core.c * * core MFD support * Copyright (c) 2006 Ian Molton * Copyright (c) 2007,2008 Dmitry Baryshkov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * */ #include <linux/kernel.h> #include <linux/platform_device.h> #include <linux/acpi.h> #include <linux/mfd/core.h> static int mfd_add_device(struct device *parent, int id, const struct mfd_cell *cell, struct resource *mem_base, int irq_base) { struct resource *res; struct platform_device *pdev; int ret = -ENOMEM; int r; pdev = platform_device_alloc(cell->name, id + cell->id); if (!pdev) goto fail_alloc; res = kzalloc(sizeof(*res) * cell->num_resources, GFP_KERNEL); if (!res) goto fail_device; pdev->dev.parent = parent; platform_set_drvdata(pdev, cell->driver_data); ret = platform_device_add_data(pdev, cell->platform_data, cell->data_size); if (ret) goto fail_res; for (r = 0; r < cell->num_resources; r++) { res[r].name = cell->resources[r].name; res[r].flags = cell->resources[r].flags; /* Find out base to use */ if (cell->resources[r].flags & IORESOURCE_MEM) { res[r].parent = mem_base; res[r].start = mem_base->start + cell->resources[r].start; res[r].end = mem_base->start + cell->resources[r].end; } else if (cell->resources[r].flags & IORESOURCE_IRQ) { res[r].start = irq_base + cell->resources[r].start; res[r].end = irq_base + cell->resources[r].end; } else { res[r].parent = cell->resources[r].parent; res[r].start = cell->resources[r].start; res[r].end = cell->resources[r].end; } ret = acpi_check_resource_conflict(res); if (ret) goto fail_res; } platform_device_add_resources(pdev, res, cell->num_resources); ret = platform_device_add(pdev); if (ret) goto fail_res; kfree(res); return 0; /* platform_device_del(pdev); */ fail_res: kfree(res); fail_device: platform_device_put(pdev); fail_alloc: return ret; } int mfd_add_devices(struct device *parent, int id, const struct mfd_cell *cells, int n_devs, struct resource *mem_base, int irq_base) { int i; int ret = 0; for (i = 0; i < n_devs; i++) { ret = mfd_add_device(parent, id, cells + i, mem_base, irq_base); if (ret) break; } if (ret) mfd_remove_devices(parent); return ret; } EXPORT_SYMBOL(mfd_add_devices); static int mfd_remove_devices_fn(struct device *dev, void *unused) { platform_device_unregister(to_platform_device(dev)); return 0; } void mfd_remove_devices(struct device *parent) { device_for_each_child(parent, NULL, mfd_remove_devices_fn); } EXPORT_SYMBOL(mfd_remove_devices); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Ian Molton, Dmitry Baryshkov");
/* * Cantata * * Copyright (c) 2011-2014 Craig Drummond <craig.p.drummond@gmail.com> * * ---- * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef OTHER_SETTINGS_H #define OTHER_SETTINGS_H #include "ui_othersettings.h" class OtherSettings : public QWidget, private Ui::OtherSettings { Q_OBJECT public: OtherSettings(QWidget *p); virtual ~OtherSettings() { } void load(); void save(); private Q_SLOTS: void toggleWikiNote(); void setContextBackdropOpacityLabel(); void setContextBackdropBlurLabel(); void enableContextBackdropOptions(); }; #endif
/* GIMP - The GNU Image Manipulation Program * Copyright (C) 1995 Spencer Kimball and Peter Mattis * * 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 3 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/>. */ #include "config.h" #include <gegl.h> #include <gtk/gtk.h> #include "libgimpwidgets/gimpwidgets.h" #include "actions-types.h" #include "core/gimpcontext.h" #include "core/gimpdata.h" #include "core/gimptoolpreset.h" #include "core/gimptooloptions.h" #include "widgets/gimpactiongroup.h" #include "widgets/gimphelp-ids.h" #include "actions.h" #include "data-commands.h" #include "tool-presets-actions.h" #include "gimp-intl.h" static const GimpActionEntry tool_presets_actions[] = { { "tool-presets-popup", GIMP_STOCK_TOOL_PRESET, NC_("tool-presets-action", "Tool Presets Menu"), NULL, NULL, NULL, GIMP_HELP_TOOL_PRESET_DIALOG }, { "tool-presets-new", GTK_STOCK_NEW, NC_("tool-presets-action", "_New Tool Preset"), "", NC_("tool-presets-action", "Create a new tool preset"), G_CALLBACK (data_new_cmd_callback), GIMP_HELP_TOOL_PRESET_NEW }, { "tool-presets-duplicate", GIMP_STOCK_DUPLICATE, NC_("tool-presets-action", "D_uplicate Tool Preset"), NULL, NC_("tool-presets-action", "Duplicate this tool preset"), G_CALLBACK (data_duplicate_cmd_callback), GIMP_HELP_TOOL_PRESET_DUPLICATE }, { "tool-presets-copy-location", GTK_STOCK_COPY, NC_("tool-presets-action", "Copy Tool Preset _Location"), "", NC_("tool-presets-action", "Copy tool preset file location to clipboard"), G_CALLBACK (data_copy_location_cmd_callback), GIMP_HELP_TOOL_PRESET_COPY_LOCATION }, { "tool-presets-delete", GTK_STOCK_DELETE, NC_("tool-presets-action", "_Delete Tool Preset"), "", NC_("tool-presets-action", "Delete this tool preset"), G_CALLBACK (data_delete_cmd_callback), GIMP_HELP_TOOL_PRESET_DELETE }, { "tool-presets-refresh", GTK_STOCK_REFRESH, NC_("tool-presets-action", "_Refresh Tool Presets"), "", NC_("tool-presets-action", "Refresh tool presets"), G_CALLBACK (data_refresh_cmd_callback), GIMP_HELP_TOOL_PRESET_REFRESH } }; static const GimpStringActionEntry tool_presets_edit_actions[] = { { "tool-presets-edit", GTK_STOCK_EDIT, NC_("tool-presets-action", "_Edit Tool Preset..."), NULL, NC_("tool-presets-action", "Edit this tool preset"), "gimp-tool-preset-editor", GIMP_HELP_TOOL_PRESET_EDIT } }; void tool_presets_actions_setup (GimpActionGroup *group) { gimp_action_group_add_actions (group, "tool-presets-action", tool_presets_actions, G_N_ELEMENTS (tool_presets_actions)); gimp_action_group_add_string_actions (group, "tool-presets-action", tool_presets_edit_actions, G_N_ELEMENTS (tool_presets_edit_actions), G_CALLBACK (data_edit_cmd_callback)); } void tool_presets_actions_update (GimpActionGroup *group, gpointer user_data) { GimpContext *context = action_data_get_context (user_data); GimpToolPreset *tool_preset = NULL; GimpData *data = NULL; const gchar *filename = NULL; if (context) { tool_preset = gimp_context_get_tool_preset (context); if (tool_preset) { data = GIMP_DATA (tool_preset); filename = gimp_data_get_filename (data); } } #define SET_SENSITIVE(action,condition) \ gimp_action_group_set_action_sensitive (group, action, (condition) != 0) SET_SENSITIVE ("tool-presets-edit", tool_preset); SET_SENSITIVE ("tool-presets-duplicate", tool_preset && GIMP_DATA_GET_CLASS (data)->duplicate); SET_SENSITIVE ("tool-presets-copy-location", tool_preset && filename); SET_SENSITIVE ("tool-presets-delete", tool_preset && gimp_data_is_deletable (data)); #undef SET_SENSITIVE }
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * libdatrie - Double-Array Trie Library * Copyright (C) 2006 Theppitak Karoonboonyanan <thep@linux.thai.net> * * 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 */ /* * fileutils.h - File utility functions * Created: 2006-08-15 * Author: Theppitak Karoonboonyanan <thep@linux.thai.net> */ #include <string.h> #include <stdlib.h> #include "fileutils.h" /* ==================== BEGIN IMPLEMENTATION PART ==================== */ /*--------------------------------* * FUNCTIONS IMPLEMENTATIONS * *--------------------------------*/ Bool file_read_int32 (FILE *file, int32 *o_val) { unsigned char buff[4]; if (fread (buff, 4, 1, file) == 1) { *o_val = (buff[0] << 24) | (buff[1] << 16) | (buff[2] << 8) | buff[3]; return TRUE; } return FALSE; } Bool file_write_int32 (FILE *file, int32 val) { unsigned char buff[4]; buff[0] = (val >> 24) & 0xff; buff[1] = (val >> 16) & 0xff; buff[2] = (val >> 8) & 0xff; buff[3] = val & 0xff; return (fwrite (buff, 4, 1, file) == 1); } Bool file_read_int16 (FILE *file, int16 *o_val) { unsigned char buff[2]; if (fread (buff, 2, 1, file) == 1) { *o_val = (buff[0] << 8) | buff[1]; return TRUE; } return FALSE; } Bool file_write_int16 (FILE *file, int16 val) { unsigned char buff[2]; buff[0] = val >> 8; buff[1] = val & 0xff; return (fwrite (buff, 2, 1, file) == 1); } Bool file_read_int8 (FILE *file, int8 *o_val) { return (fread (o_val, sizeof (int8), 1, file) == 1); } Bool file_write_int8 (FILE *file, int8 val) { return (fwrite (&val, sizeof (int8), 1, file) == 1); } Bool file_read_chars (FILE *file, char *buff, int len) { return (fread (buff, sizeof (char), len, file) == len); } Bool file_write_chars (FILE *file, const char *buff, int len) { return (fwrite (buff, sizeof (char), len, file) == len); } /* vi:ts=4:ai:expandtab */
/** * * Phantom OS * * Copyright (C) 2005-2011 Dmitry Zavalishin, dz@dz.ru * * Virtio block devices. * * **/ #ifndef _VIRTIO_BLK_H #define _VIRTIO_BLK_H /* This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. */ #include <phantom_types.h> #include <virtio_config.h> #include <sys/cdefs.h> /** \ingroup Virtio * @{ */ /* The ID for virtio_block */ #define VIRTIO_ID_BLOCK 2 /* Feature bits */ #define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */ #define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ #define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */ #define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */ #define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ struct virtio_blk_config { /* The capacity (in 512-byte sectors). */ u_int64_t capacity; /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */ u_int32_t size_max; /* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */ u_int32_t seg_max; /* geometry the device (if VIRTIO_BLK_F_GEOMETRY) */ struct virtio_blk_geometry { u_int16_t cylinders; u_int8_t heads; u_int8_t sectors; } geometry; /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ u_int32_t blk_size; } __packed; //} __attribute__((packed)); /* These two define direction. */ #define VIRTIO_BLK_T_IN 0 #define VIRTIO_BLK_T_OUT 1 /* This bit says it's a scsi command, not an actual read or write. */ #define VIRTIO_BLK_T_SCSI_CMD 2 /* Barrier before this op. */ #define VIRTIO_BLK_T_BARRIER 0x80000000 /* This is the first element of the read scatter-gather list. */ struct virtio_blk_outhdr { /* VIRTIO_BLK_T* */ u_int32_t type; /* io priority. */ u_int32_t ioprio; /* Sector (ie. 512 byte offset) */ u_int64_t sector; } __packed; /* And this is the final byte of the write scatter-gather list. */ #define VIRTIO_BLK_S_OK 0 #define VIRTIO_BLK_S_IOERR 1 #define VIRTIO_BLK_S_UNSUPP 2 struct virtio_blk_inhdr { unsigned char status; } __packed; #endif /* _VIRTIO_BLK_H */ /** @} */
#if 0 /* Copyright (C) 1996-1997 Id Software, 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. 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. */ // in_null.c -- for systems without a mouse #include "quakedef.h" void IN_Init (void) { } void IN_Shutdown (void) { } void IN_Commands (void) { } void IN_Move (usercmd_t *cmd) { } #endif
/* Copyright (c) 2016 PaddlePaddle 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 __PADDLE_CAPI_VECTOR_H__ #define __PADDLE_CAPI_VECTOR_H__ #include <stdbool.h> #include <stdint.h> #include "config.h" #include "error.h" #ifdef __cplusplus extern "C" { #endif /** * Int Vector Functions. Return will be a paddle_error type. */ typedef void* paddle_ivector; /** * @brief Create an none int vector. It just a handler and store nothing. Used * to get output from other api. * @return None int vector. */ PD_API paddle_ivector paddle_ivector_create_none(); /** * @brief paddle_ivector_create create a paddle int vector * @param array: input array. * @param size: input array size. * @param copy: memory copy or just use same memory. True if copy. * @param useGPU: True if use GPU * @return paddle_error */ PD_API paddle_ivector paddle_ivector_create(int* array, uint64_t size, bool copy, bool useGPU); /** * @brief paddle_ivector_destroy destory an int vector. * @param ivec vector to be destoried. * @return paddle_error */ PD_API paddle_error paddle_ivector_destroy(paddle_ivector ivec); /** * @brief paddle_ivector_get get raw buffer stored inside this int vector. It * could be GPU memory if this int vector is stored in GPU. * @param [in] ivec int vector * @param [out] buffer the return buffer pointer. * @return paddle_error */ PD_API paddle_error paddle_ivector_get(paddle_ivector ivec, int** buffer); /** * @brief paddle_ivector_resize resize the int vector. * @param [in] ivec: int vector * @param [in] size: size to change * @return paddle_error */ PD_API paddle_error paddle_ivector_resize(paddle_ivector ivec, uint64_t size); /** * @brief paddle_ivector_get_size get the size of int vector. * @param [in] ivec: int vector * @param [out] size: return size of this int vector. * @return paddle_error */ PD_API paddle_error paddle_ivector_get_size(paddle_ivector ivec, uint64_t* size); #ifdef __cplusplus } #endif #endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the files COPYING and Copyright.html. COPYING can be found at the root * * of the source code distribution tree; Copyright.html can be found at the * * root level of an installed copy of the electronic HDF5 document set and * * is linked from the top-level documents page. It can also be found at * * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef _H5LTprivate_H #define _H5LTprivate_H /* High-level library internal header file */ #include "H5HLprivate2.h" /* public LT prototypes */ #include "H5LTpublic.h" /*------------------------------------------------------------------------- * Private functions *------------------------------------------------------------------------- */ H5_HLDLL herr_t H5LT_get_attribute_disk( hid_t obj_id, const char *attr_name, void *data ); H5_HLDLL herr_t H5LT_set_attribute_numerical( hid_t loc_id, const char *obj_name, const char *attr_name, size_t size, hid_t type_id, const void *data ); H5_HLDLL herr_t H5LT_set_attribute_string( hid_t dset_id, const char *name, const char *buf ); H5_HLDLL herr_t H5LT_find_attribute( hid_t loc_id, const char *name ); H5_HLDLL char* H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hbool_t no_user_buf); #endif
/* * Copyright (c) 2017 Justin Watson * Copyright (c) 2016 Intel Corporation. * Copyright (c) 2013-2015 Wind River Systems, Inc. * * SPDX-License-Identifier: Apache-2.0 */ /** * @file * @brief Atmel SAM4S MCU series initialization code * * This module provides routines to initialize and support board-level hardware * for the Atmel SAM4S series processor. */ #include <device.h> #include <init.h> #include <soc.h> #include <arch/cpu.h> #include <cortex_m/exc.h> /** * @brief Setup various clock on SoC at boot time. * * Setup the SoC clocks according to section 28.12 in datasheet. * * Setup Slow, Main, PLLA, Processor and Master clocks during the device boot. * It is assumed that the relevant registers are at their reset value. */ static ALWAYS_INLINE void clock_init(void) { u32_t reg_val; #ifdef CONFIG_SOC_ATMEL_SAM4S_EXT_SLCK /* Switch slow clock to the external 32 KHz crystal oscillator. */ SUPC->SUPC_CR = SUPC_CR_KEY_PASSWD | SUPC_CR_XTALSEL_CRYSTAL_SEL; /* Wait for oscillator to be stabilized. */ while (!(SUPC->SUPC_SR & SUPC_SR_OSCSEL)) { ; } #endif /* CONFIG_SOC_ATMEL_SAM4S_EXT_SLCK */ #ifdef CONFIG_SOC_ATMEL_SAM4S_EXT_MAINCK /* * Setup main external crystal oscillator. */ /* Start the external crystal oscillator. */ PMC->CKGR_MOR = CKGR_MOR_KEY_PASSWD /* Fast RC oscillator frequency is at 4 MHz. */ | CKGR_MOR_MOSCRCF_4_MHz /* * We select maximum setup time. While start up time * could be shortened this optimization is not deemed * critical right now. */ | CKGR_MOR_MOSCXTST(0xFFu) /* RC oscillator must stay on. */ | CKGR_MOR_MOSCRCEN | CKGR_MOR_MOSCXTEN; /* Wait for oscillator to be stabilized. */ while (!(PMC->PMC_SR & PMC_SR_MOSCXTS)) { ; } /* Select the external crystal oscillator as the main clock source. */ PMC->CKGR_MOR = CKGR_MOR_KEY_PASSWD | CKGR_MOR_MOSCRCF_4_MHz | CKGR_MOR_MOSCRCEN | CKGR_MOR_MOSCXTEN | CKGR_MOR_MOSCXTST(0xFFu) | CKGR_MOR_MOSCSEL; /* Wait for external oscillator to be selected. */ while (!(PMC->PMC_SR & PMC_SR_MOSCSELS)) { ; } /* Turn off RC oscillator, not used any longer, to save power */ PMC->CKGR_MOR = CKGR_MOR_KEY_PASSWD | CKGR_MOR_MOSCSEL | CKGR_MOR_MOSCXTST(0xFFu) | CKGR_MOR_MOSCXTEN; /* Wait for the RC oscillator to be turned off. */ while (PMC->PMC_SR & PMC_SR_MOSCRCS) { ; } #ifdef CONFIG_SOC_ATMEL_SAM4S_WAIT_MODE /* * Instruct CPU to enter Wait mode instead of Sleep mode to * keep Processor Clock (HCLK) and thus be able to debug * CPU using JTAG. */ PMC->PMC_FSMR |= PMC_FSMR_LPM; #endif #else /* Setup main fast RC oscillator. */ /* * NOTE: MOSCRCF must be changed only if MOSCRCS is set in the PMC_SR * register, should normally be the case. */ while (!(PMC->PMC_SR & PMC_SR_MOSCRCS)) { ; } /* Set main fast RC oscillator to 12 MHz. */ PMC->CKGR_MOR = CKGR_MOR_KEY_PASSWD | CKGR_MOR_MOSCRCF_12_MHz | CKGR_MOR_MOSCRCEN; /* Wait for RC oscillator to stabilize. */ while (!(PMC->PMC_SR & PMC_SR_MOSCRCS)) { ; } #endif /* CONFIG_SOC_ATMEL_SAM4S_EXT_MAINCK */ /* * Setup PLLA */ /* Switch MCK (Master Clock) to the main clock first. */ reg_val = PMC->PMC_MCKR & ~PMC_MCKR_CSS_Msk; PMC->PMC_MCKR = reg_val | PMC_MCKR_CSS_MAIN_CLK; /* Wait for clock selection to complete. */ while (!(PMC->PMC_SR & PMC_SR_MCKRDY)) { ; } /* Setup PLLA. */ PMC->CKGR_PLLAR = CKGR_PLLAR_ONE | CKGR_PLLAR_MULA(CONFIG_SOC_ATMEL_SAM4S_PLLA_MULA) | CKGR_PLLAR_PLLACOUNT(0x3Fu) | CKGR_PLLAR_DIVA(CONFIG_SOC_ATMEL_SAM4S_PLLA_DIVA); /* * NOTE: Both MULA and DIVA must be set to a value greater than 0 or * otherwise PLL will be disabled. In this case we would get stuck in * the following loop. */ /* Wait for PLL lock. */ while (!(PMC->PMC_SR & PMC_SR_LOCKA)) { ; } /* * Final setup of the Master Clock */ /* * NOTE: PMC_MCKR must not be programmed in a single write operation. * If CSS or PRES are modified we must wait for MCKRDY bit to be * set again. */ /* Setup prescaler - PLLA Clock / Processor Clock (HCLK). */ reg_val = PMC->PMC_MCKR & ~PMC_MCKR_PRES_Msk; PMC->PMC_MCKR = reg_val | PMC_MCKR_PRES_CLK_1; /* Wait for Master Clock setup to complete */ while (!(PMC->PMC_SR & PMC_SR_MCKRDY)) { ; } /* Finally select PLL as Master Clock source. */ reg_val = PMC->PMC_MCKR & ~PMC_MCKR_CSS_Msk; PMC->PMC_MCKR = reg_val | PMC_MCKR_CSS_PLLA_CLK; /* Wait for Master Clock setup to complete. */ while (!(PMC->PMC_SR & PMC_SR_MCKRDY)) { ; } } /** * @brief Perform basic hardware initialization at boot. * * This needs to be run from the very beginning. * So the init priority has to be 0 (zero). * * @return 0 */ static int atmel_sam4s_init(struct device *arg) { u32_t key; ARG_UNUSED(arg); key = irq_lock(); /* Clear all faults. */ _ClearFaults(); /* * Set FWS (Flash Wait State) value before increasing Master Clock * (MCK) frequency. Look at table 44.73 in the SAM4S datasheet. * This is set to the highest number of read cycles because it won't * hurt lower clock frequencies. However, a high frequency with too * few read cycles could cause flash read problems. FWS 5 (6 cycles) * is the safe setting for all of this SoCs usable frequencies. * TODO: Add code to handle SAM4SD devices that have 2 EFCs. */ EFC0->EEFC_FMR = EEFC_FMR_FWS(5); /* Setup system clocks. */ clock_init(); /* * Install default handler that simply resets the CPU * if configured in the kernel, NOP otherwise. */ NMI_INIT(); irq_unlock(key); return 0; } SYS_INIT(atmel_sam4s_init, PRE_KERNEL_1, 0);
#pragma once namespace SharedChannelTable { struct ChannelTableItem; } void Gc(SharedChannelTable::ChannelTableItem * item);
/* * Copyright (C) 2013 Google 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: * * * 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 Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER 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 NavigatorEvents_h #define NavigatorEvents_h #include "wtf/Allocator.h" namespace blink { class Navigator; class NavigatorEvents { STATIC_ONLY(NavigatorEvents); public: static long maxTouchPoints(Navigator&); }; } // namespace blink #endif // NavigatorEvents_h
/*++ Copyright (c) Microsoft Corporation Module Name: Sora control registers initial value table. Abstract: The file includes Sora register configuration entry for specical purpose, i.e, Tx, Rx. History: 3/12/2009: Created by senxiang --*/ #include "sora.h" const __PHY_CHANNEL_SELECTOR __gc_Phy_2dot4GHz_ChannelSelectors[] = { {1,0X00A03,0X33334,0X18225}, {2,0X20A13,0X08884,0X18225}, {3,0X30A13,0X1DDD4,0X18225}, {4,0X00A13,0X33334,0X18225}, {5,0X20A23,0X08884,0X18225}, {6,0X30A23,0X1DDD4,0X18225}, {7,0X00A23,0X33334,0X18225}, {8,0X20A33,0X08884,0X18225}, {9,0X30A33,0X1DDD4,0X18225}, {10,0X00A33,0X33334,0X18225}, {11,0X20A43,0X08884,0X18225}, {12,0X30A43,0X1DDD4,0X18225}, {13,0X00A43,0X33334,0X18225}, {14,0X10A53,0X26664,0X18225} }; const __PHY_CHANNEL_SELECTOR __gc_Phy_5GHz_ChannelSelectors[] = { {36,0X30CF3,0X0CCC4,0X18235}, {37,0X20CF3,0X19994,0X18235}, {38,0X10CF3,0X26664,0X18235}, {39,0X00CF3,0X33334,0X18235}, {40,0X00D03,0X00004,0X18235}, {41,0X30D03,0X0CCC4,0X18235}, {42,0X20D03,0X19994,0X18235}, {43,0X10D03,0X26664,0X18235}, {44,0X00D03,0X33334,0X18235}, {45,0X00D13,0X00004,0X18235}, {46,0X30D13,0X0CCC4,0X18235}, {47,0X20D13,0X19994,0X18235}, {48,0X10D13,0X26664,0X18235}, {49,0X00D13,0X33334,0X18235}, {50,0X00D23,0X00004,0X18235}, {51,0X30D23,0X0CCC4,0X18235}, {52,0X20D23,0X19994,0X18235}, {53,0X10D23,0X26664,0X18235}, {54,0X00D23,0X33334,0X18235}, {55,0X00D33,0X00004,0X18235}, {56,0X30D33,0X0CCC4,0X18235}, {57,0X20D33,0X19994,0X18235}, {58,0X10D33,0X26664,0X18235}, {59,0X00D33,0X33334,0X18235}, {60,0X00D43,0X00004,0X18235}, {61,0X30D43,0X0CCC4,0X18235}, {62,0X20D43,0X19994,0X18235}, {63,0X10D43,0X26664,0X18235}, {64,0X00D43,0X330F4/*0X33334*/,0X18235}, // FOE {65,0X00D53,0X00004,0X18235}, {66,0X30D53,0X0CCC4,0X18235}, {67,0X20D53,0X19994,0X18235}, {68,0X10D53,0X26664,0X18235}, {69,0X00D53,0X33334,0X18235}, {70,0X00D63,0X00004,0X18235}, {71,0X30D63,0X0CCC4,0X18235}, {72,0X20D63,0X19994,0X18235}, {73,0X10D63,0X26664,0X18235}, {74,0X00D63,0X33334,0X18235}, {75,0X00D73,0X00004,0X18235}, {76,0X30D73,0X0CCC4,0X18235}, {77,0X20D73,0X19994,0X18235}, {78,0X10D73,0X26664,0X18235}, {79,0X00D73,0X33334,0X18235}, {80,0X00D83,0X00004,0X18235}, {81,0X30D83,0X0CCC4,0X18235}, {82,0X20D83,0X19994,0X18235}, {83,0X10D83,0X26664,0X18235}, {84,0X00D83,0X33334,0X18235}, {85,0X00D93,0X00004,0X18235}, {86,0X30D93,0X0CCC4,0X18235}, {87,0X20D93,0X19994,0X18235}, {88,0X10D93,0X26664,0X18235}, {89,0X00D93,0X33334,0X18235}, {90,0X00DA3,0X00004,0X18235}, {91,0X30DA3,0X0CCC4,0X18235}, {92,0X20DA3,0X19994,0X18235}, {93,0X10DA3,0X26664,0X18235}, {94,0X00DA3,0X33334,0X18235}, {95,0X00DB3,0X00004,0X18235}, {96,0X30DB3,0X0CCC4,0X18235}, {97,0X20DB3,0X19994,0X18235}, {98,0X10DB3,0X26664,0X18235}, {99,0X00DB3,0X33334,0X18235}, {100,0X00DC3,0X00004,0X18235}, {101,0X30DC3,0X0CCC4,0X18235}, {102,0X20DC3,0X19994,0X18235}, {103,0X10DC3,0X26664,0X18235}, {104,0X00DC3,0X33334,0X18235}, {105,0X00DD3,0X00004,0X18235}, {106,0X30DD3,0X0CCC4,0X18235}, {107,0X20DD3,0X19994,0X18235}, {108,0X10DD3,0X26664,0X18235}, {109,0X00DD3,0X33334,0X18235}, {110,0X00DE3,0X00004,0X18235}, {111,0X30DE3,0X0CCC4,0X18235}, {112,0X20DE3,0X19994,0X18235}, {113,0X10DE3,0X26664,0X18235}, {114,0X00DE3,0X33334,0X18235}, {115,0X00DF3,0X00004,0X18235}, {116,0X30DF3,0X0CCC4,0X18235}, {117,0X20DF3,0X19994,0X18235}, {118,0X10DF3,0X26664,0X18235}, {119,0X00DF3,0X33334,0X18235}, {120,0X00E03,0X00004,0X18235}, {121,0X30E03,0X0CCC4,0X18235}, {122,0X20E03,0X19994,0X18235}, {123,0X10E03,0X26664,0X18235}, {124,0X00E03,0X33334,0X18235}, {125,0X00E13,0X00004,0X18235}, {126,0X30E13,0X0CCC4,0X18235}, {127,0X20E13,0X19994,0X18235}, {128,0X10E13,0X26664,0X18235}, {129,0X00E13,0X33334,0X18235}, {130,0X00E23,0X00004,0X18235}, {131,0X30E23,0X0CCC4,0X18235}, {132,0X20E23,0X19994,0X18235}, {133,0X10E23,0X26664,0X18235}, {134,0X00E23,0X33334,0X18235}, {135,0X00E33,0X00004,0X18235}, {136,0X30E33,0X0CCC4,0X18235}, {137,0X20E33,0X19994,0X18235}, {138,0X10E33,0X26664,0X18235}, {139,0X00E33,0X33334,0X18235}, {140,0X00E43,0X00004,0X18235}, {141,0X30E43,0X0CCC4,0X18235}, {142,0X20E43,0X19994,0X18235}, {143,0X10E43,0X26664,0X18235}, {144,0X00E43,0X33334,0X18235}, {145,0X00E53,0X00004,0X18235}, {146,0X30E53,0X0CCC4,0X18235}, {147,0X20E53,0X19994,0X18235}, {148,0X10E53,0X26664,0X18235}, {149,0X00E53,0X33334,0X18235}, {150,0X00E63,0X00004,0X18235}, {151,0X30E63,0X0CCC4,0X18235}, {152,0X20E63,0X19994,0X18235}, {153,0X10E63,0X26664,0X18235}, {154,0X00E63,0X33334,0X18235}, {155,0X00E73,0X00004,0X18235}, {156,0X30E73,0X0CCC4,0X18235}, {157,0X20E73,0X19994,0X18235}, {158,0X10E73,0X26664,0X18235}, {159,0X00E73,0X33334,0X18235}, {160,0X00D243,0X00004,0X18235}, {161,0X30D243,0X0CCC4,0X18235} };
/* * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement * retains certain rights in this software. * * 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 Sandia Corporation 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 * OWNER 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. * */ /* Id */ #include "exodusII.h" #include "exodusII_int.h" #include <stdlib.h> /* for free() */ /*! * writes the connectivity array for an element block * \param exoid exodus file id * \param elem_blk_id element block id * \param *connect connectivity array * \deprecated Use ex_put_conn()(exoid, EX_ELEM_BLOCK, elem_blk_id, connect, 0, 0) */ int ex_put_elem_conn (int exoid, int elem_blk_id, const int *connect) { return ex_put_conn(exoid, EX_ELEM_BLOCK, elem_blk_id, connect, 0, 0); }