text
stringlengths
4
6.14k
/* * probes/lttng-probe-btrfs.c * * LTTng btrfs probes. * * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> * Copyright (C) 2012 Mentor Graphics Corp. * * 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; only * version 2.1 of the License. * * 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 */ #include <linux/module.h> #include <linux/fs.h> #include <../fs/btrfs/ctree.h> #include <../fs/btrfs/transaction.h> #include <../fs/btrfs/volumes.h> #include <linux/dcache.h> /* * Create the tracepoint static inlines from the kernel to validate that our * trace event macros match the kernel we run on. */ #include <trace/events/btrfs.h> /* * Create LTTng tracepoint probes. */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS #define TRACE_INCLUDE_PATH ../instrumentation/events/lttng-module #include "../instrumentation/events/lttng-module/btrfs.h" MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Andrew Gabbasov <andrew_gabbasov@mentor.com>"); MODULE_DESCRIPTION("LTTng btrfs probes");
/* * * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> * * 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 * * 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 "pvrusb2-audio.h" #include "pvrusb2-hdw-internal.h" #include "pvrusb2-debug.h" #include <linux/videodev2.h> #include <media/msp3400.h> #include <media/v4l2-common.h> struct routing_scheme { const int *def; unsigned int cnt; }; static const int routing_scheme0[] = { [PVR2_CVAL_INPUT_TV] = MSP_INPUT_DEFAULT, [PVR2_CVAL_INPUT_RADIO] = MSP_INPUT(MSP_IN_SCART2, MSP_IN_TUNER1, MSP_DSP_IN_SCART, MSP_DSP_IN_SCART), [PVR2_CVAL_INPUT_COMPOSITE] = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, MSP_DSP_IN_SCART, MSP_DSP_IN_SCART), [PVR2_CVAL_INPUT_SVIDEO] = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, MSP_DSP_IN_SCART, MSP_DSP_IN_SCART), }; static const struct routing_scheme routing_def0 = { .def = routing_scheme0, .cnt = ARRAY_SIZE(routing_scheme0), }; static const struct routing_scheme *routing_schemes[] = { [PVR2_ROUTING_SCHEME_HAUPPAUGE] = &routing_def0, }; void pvr2_msp3400_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) { if (hdw->input_dirty || hdw->force_dirty) { const struct routing_scheme *sp; unsigned int sid = hdw->hdw_desc->signal_routing_scheme; u32 input; pvr2_trace(PVR2_TRACE_CHIPS, "subdev msp3400 v4l2 set_stereo"); if ((sid < ARRAY_SIZE(routing_schemes)) && ((sp = routing_schemes[sid]) != NULL) && (hdw->input_val >= 0) && (hdw->input_val < sp->cnt)) { input = sp->def[hdw->input_val]; } else { pvr2_trace(PVR2_TRACE_ERROR_LEGS, "*** WARNING *** subdev msp3400 set_input:" " Invalid routing scheme (%u)" " and/or input (%d)", sid, hdw->input_val); return; } sd->ops->audio->s_routing(sd, input, MSP_OUTPUT(MSP_SC_IN_DSP_SCART1), 0); } } /* Stuff for Emacs to see, in order to encourage consistent editing style: *** Local Variables: *** *** mode: c *** *** fill-column: 70 *** *** tab-width: 8 *** *** c-basic-offset: 8 *** *** End: *** */
/* GStreamer * Copyright (C) <2007> Leandro Melo de Sales <leandroal@gmail.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef __GST_DCCP_H__ #define __GST_DCCP_H__ #include <gst/gst.h> #include <gst/base/gstadapter.h> #include "gstdccp_common.h" /* DCCP socket general options */ #define DCCP_BACKLOG 5 #ifndef SOCK_DCCP #define SOCK_DCCP 6 #endif #ifndef IPPROTO_DCCP #define IPPROTO_DCCP 33 #endif #ifndef SOL_DCCP #define SOL_DCCP 269 #endif /* dccp socket specific options */ #define DCCP_SOCKOPT_PACKET_SIZE 1 /* XXX deprecated, without effect */ #define DCCP_SOCKOPT_SERVICE 2 #define DCCP_SOCKOPT_CHANGE_L 3 #define DCCP_SOCKOPT_CHANGE_R 4 #define DCCP_SOCKOPT_GET_CUR_MPS 5 #define DCCP_SOCKOPT_SERVER_TIMEWAIT 6 #define DCCP_SOCKOPT_SEND_CSCOV 10 #define DCCP_SOCKOPT_RECV_CSCOV 11 #define DCCP_SOCKOPT_AVAILABLE_CCIDS 12 #define DCCP_SOCKOPT_CCID 13 #define DCCP_SOCKOPT_TX_CCID 14 #define DCCP_SOCKOPT_RX_CCID 15 #define DCCP_SOCKOPT_CCID_RX_INFO 128 #define DCCP_SOCKOPT_CCID_TX_INFO 192 /* Default parameters for the gst dccp element property */ #define DCCP_DEFAULT_PORT 5001 #define DCCP_DEFAULT_SOCK_FD -1 #define DCCP_DEFAULT_CLIENT_SOCK_FD -1 #define DCCP_DEFAULT_CLOSED TRUE #define DCCP_DEFAULT_WAIT_CONNECTIONS FALSE #define DCCP_DEFAULT_HOST "127.0.0.1" #define DCCP_DEFAULT_CCID 2 #define DCCP_DELTA 100 gchar *gst_dccp_host_to_ip (GstElement * element, const gchar * host); GstFlowReturn gst_dccp_read_buffer (GstElement * this, int socket, GstBuffer ** buf); gint gst_dccp_create_new_socket (GstElement * element); gboolean gst_dccp_connect_to_server (GstElement * element, struct sockaddr_in server_sin, int sock_fd); gint gst_dccp_server_wait_connections (GstElement * element, int server_sock_fd); gboolean gst_dccp_bind_server_socket (GstElement * element, int server_sock_fd, struct sockaddr_in server_sin); gboolean gst_dccp_listen_server_socket (GstElement * element, int server_sock_fd); gboolean gst_dccp_set_ccid (GstElement * element, int sock_fd, uint8_t ccid); gint gst_dccp_get_max_packet_size(GstElement * element, int sock); GstFlowReturn gst_dccp_send_buffer (GstElement * element, GstBuffer * buffer, int client_sock_fd, int packet_size); gboolean gst_dccp_make_address_reusable (GstElement * element, int sock_fd); void gst_dccp_socket_close (GstElement * element, int * socket); #endif /* __GST_DCCP_H__ */
/* * Copyright (C) Xiaozhe Wang (chaoslawful) * Copyright (C) Yichun Zhang (agentzh) */ #ifndef DDEBUG #define DDEBUG 0 #endif #include "ddebug.h" #include "ngx_http_lua_uri.h" #include "ngx_http_lua_util.h" static int ngx_http_lua_ngx_req_set_uri(lua_State *L); void ngx_http_lua_inject_req_uri_api(ngx_log_t *log, lua_State *L) { lua_pushcfunction(L, ngx_http_lua_ngx_req_set_uri); lua_setfield(L, -2, "set_uri"); } static int ngx_http_lua_ngx_req_set_uri(lua_State *L) { ngx_http_request_t *r; size_t len; u_char *p; int n; int jump = 0; ngx_http_lua_ctx_t *ctx; n = lua_gettop(L); if (n != 1 && n != 2) { return luaL_error(L, "expecting 1 or 2 arguments but seen %d", n); } r = ngx_http_lua_get_req(L); if (r == NULL) { return luaL_error(L, "no request found"); } ngx_http_lua_check_fake_request(L, r); p = (u_char *) luaL_checklstring(L, 1, &len); if (len == 0) { return luaL_error(L, "attempt to use zero-length uri"); } if (n == 2) { luaL_checktype(L, 2, LUA_TBOOLEAN); jump = lua_toboolean(L, 2); if (jump) { ctx = ngx_http_get_module_ctx(r, ngx_http_lua_module); if (ctx == NULL) { return luaL_error(L, "no ctx found"); } dd("rewrite: %d, access: %d, content: %d", (int) ctx->entered_rewrite_phase, (int) ctx->entered_access_phase, (int) ctx->entered_content_phase); ngx_http_lua_check_context(L, ctx, NGX_HTTP_LUA_CONTEXT_REWRITE); ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "lua set uri jump to \"%*s\"", len, p); ngx_http_lua_check_if_abortable(L, ctx); } } r->uri.data = ngx_palloc(r->pool, len); if (r->uri.data == NULL) { return luaL_error(L, "no memory"); } ngx_memcpy(r->uri.data, p, len); r->uri.len = len; r->internal = 1; r->valid_unparsed_uri = 0; ngx_http_set_exten(r); if (jump) { r->uri_changed = 1; return lua_yield(L, 0); } r->valid_location = 0; r->uri_changed = 0; return 0; } /* vi:set ft=c ts=4 sw=4 et fdm=marker: */
#ifndef HEADER_OPENSSLV_H #define HEADER_OPENSSLV_H /* Numeric release version identifier: * MNNFFPPS: major minor fix patch status * The status nibble has one of the values 0 for development, 1 to e for betas * 1 to 14, and f for release. The patch level is exactly that. * For example: * 0.9.3-dev 0x00903000 * 0.9.3-beta1 0x00903001 * 0.9.3-beta2-dev 0x00903002 * 0.9.3-beta2 0x00903002 (same as ...beta2-dev) * 0.9.3 0x0090300f * 0.9.3a 0x0090301f * 0.9.4 0x0090400f * 1.2.3z 0x102031af * * For continuity reasons (because 0.9.5 is already out, and is coded * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level * part is slightly different, by setting the highest bit. This means * that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start * with 0x0090600S... * * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.) * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ #define OPENSSL_VERSION_NUMBER 0x1000102fL #ifdef OPENSSL_FIPS #define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1b-fips 26 Apr 2012" #else #define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1b 26 Apr 2012" #endif #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT /* The macros below are to be used for shared library (.so, .dll, ...) * versioning. That kind of versioning works a bit differently between * operating systems. The most usual scheme is to set a major and a minor * number, and have the runtime loader check that the major number is equal * to what it was at application link time, while the minor number has to * be greater or equal to what it was at application link time. With this * scheme, the version number is usually part of the file name, like this: * * libcrypto.so.0.9 * * Some unixen also make a softlink with the major verson number only: * * libcrypto.so.0 * * On Tru64 and IRIX 6.x it works a little bit differently. There, the * shared library version is stored in the file, and is actually a series * of versions, separated by colons. The rightmost version present in the * library when linking an application is stored in the application to be * matched at run time. When the application is run, a check is done to * see if the library version stored in the application matches any of the * versions in the version string of the library itself. * This version string can be constructed in any way, depending on what * kind of matching is desired. However, to implement the same scheme as * the one used in the other unixen, all compatible versions, from lowest * to highest, should be part of the string. Consecutive builds would * give the following versions strings: * * 3.0 * 3.0:3.1 * 3.0:3.1:3.2 * 4.0 * 4.0:4.1 * * Notice how version 4 is completely incompatible with version, and * therefore give the breach you can see. * * There may be other schemes as well that I haven't yet discovered. * * So, here's the way it works here: first of all, the library version * number doesn't need at all to match the overall OpenSSL version. * However, it's nice and more understandable if it actually does. * The current library version is stored in the macro SHLIB_VERSION_NUMBER, * which is just a piece of text in the format "M.m.e" (Major, minor, edit). * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways, * we need to keep a history of version numbers, which is done in the * macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and * should only keep the versions that are binary compatible with the current. */ #define SHLIB_VERSION_HISTORY "" #define SHLIB_VERSION_NUMBER "1.0.0" #endif /* HEADER_OPENSSLV_H */
/* cmtcmd.c -- routines for the moxc side of the command interface */ #include "switches.h" #include "stdio.h" #ifdef AMIGA #include "exec/types.h" #include "exec/exec.h" #endif #include "cmtcmd.h" #include "cext.h" #include "userio.h" #include "string.h" #define HASHELEM(p) ((p).symbol_name) #define HASHVAL 50 #define HASHENTRIES 50 #define HASHENTER lookup #define HASHNOCOPY #include "hashrout.h" void defvar(name, addr) char *name; int *addr; { int i = lookup(name); HASHENTRY(i).symb_type = var_symb_type; HASHENTRY(i).ptr.intptr = addr; } void defun(name, addr) char *name; int (*addr)(); { int i = lookup(name); HASHENTRY(i).symb_type = fn_symb_type; HASHENTRY(i).ptr.routine = addr; } void defvec(name, addr, size) char *name; int *addr; int size; { int i = lookup(name); HASHENTRY(i).symb_type = vec_symb_type; HASHENTRY(i).size = size; HASHENTRY(i).ptr.intptr = addr; }
/* -*- c-basic-offset: 2 -*- */ /* Copyright(C) 2014 Brazil 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. 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 */ #include "../grn_ctx_impl.h" #ifdef GRN_WITH_MRUBY #include <mruby.h> #include <mruby/class.h> #include <mruby/data.h> #include <mruby/variable.h> #include <mruby/string.h> #include "../grn_mrb.h" #include "mrb_logger.h" static mrb_value logger_need_log_p(mrb_state *mrb, mrb_value self) { grn_ctx *ctx = (grn_ctx *)mrb->ud; mrb_int level; mrb_get_args(mrb, "i", &level); return mrb_bool_value(grn_logger_pass(ctx, level)); } static mrb_value logger_log(mrb_state *mrb, mrb_value self) { grn_ctx *ctx = (grn_ctx *)mrb->ud; mrb_int level; char *file; mrb_int line; char *method; char *message; mrb_int message_size; mrb_get_args(mrb, "izizs", &level, &file, &line, &method, &message, &message_size); grn_logger_put(ctx, level, file, line, method, "%.*s", message_size, message); return self; } void grn_mrb_logger_init(grn_ctx *ctx) { grn_mrb_data *data = &(ctx->impl->mrb); mrb_state *mrb = data->state; struct RClass *module = data->module; struct RClass *klass; klass = mrb_define_class_under(mrb, module, "Logger", mrb->object_class); mrb_define_method(mrb, klass, "need_log?", logger_need_log_p, MRB_ARGS_REQ(1)); mrb_define_method(mrb, klass, "log", logger_log, MRB_ARGS_REQ(5)); grn_mrb_load(ctx, "logger/level.rb"); grn_mrb_load(ctx, "logger.rb"); } #endif
//===-- XCoreFrameLowering.h - Frame info for XCore Target ------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file contains XCore frame information that doesn't fit anywhere else // cleanly... // //===----------------------------------------------------------------------===// #ifndef LLVM_LIB_TARGET_XCORE_XCOREFRAMELOWERING_H #define LLVM_LIB_TARGET_XCORE_XCOREFRAMELOWERING_H #include "llvm/CodeGen/TargetFrameLowering.h" #include "llvm/Target/TargetMachine.h" namespace llvm { class XCoreSubtarget; class XCoreFrameLowering: public TargetFrameLowering { public: XCoreFrameLowering(const XCoreSubtarget &STI); /// emitProlog/emitEpilog - These methods insert prolog and epilog code into /// the function. void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override; void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override; bool spillCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector<CalleeSavedInfo> &CSI, const TargetRegisterInfo *TRI) const override; bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, std::vector<CalleeSavedInfo> &CSI, const TargetRegisterInfo *TRI) const override; MachineBasicBlock::iterator eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const override; bool hasFP(const MachineFunction &MF) const override; void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS = nullptr) const override; void processFunctionBeforeFrameFinalized(MachineFunction &MF, RegScavenger *RS = nullptr) const override; //! Stack slot size (4 bytes) static int stackSlotSize() { return 4; } }; } #endif
/* { dg-do compile } */ /* { dg-options "-O2" } */ /* { dg-options "-O2 -msse2" { target { i?86-*-* x86_64-*-* } } } */ /* { dg-options "-O2 -maltivec" { target { powerpc*-*-linux* && powerpc_altivec_ok } } } */ typedef unsigned __attribute__ ((__mode__ (__pointer__))) uintptr_t; #undef __vector #define __vector __attribute__ ((__vector_size__ (16))) typedef __vector signed char qword; typedef __vector uintptr_t VU; extern short g[192 + 16]; void f (qword); void f1 (unsigned ctr) { VU pin; pin = (VU){(uintptr_t) &g[16]}; do { f ((qword) pin); ctr--; } while (ctr); } /* Ignore a warning that is irrelevant to the purpose of this test. */ /* { dg-prune-output ".*GCC vector passed by reference.*" } */
// 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 CSPDirective_h #define CSPDirective_h #include "wtf/text/WTFString.h" namespace blink { class ContentSecurityPolicy; class CSPDirective { WTF_MAKE_NONCOPYABLE(CSPDirective); public: CSPDirective(const String& name, const String& value, ContentSecurityPolicy* policy) : m_name(name) , m_text(name + ' ' + value) , m_policy(policy) { } const String& text() const { return m_text; } protected: ContentSecurityPolicy* policy() const { return m_policy; } private: String m_name; String m_text; ContentSecurityPolicy* m_policy; }; } // namespace blink #endif
// // ______ ______ ______ // /\ __ \ /\ ___\ /\ ___\ // \ \ __< \ \ __\_ \ \ __\_ // \ \_____\ \ \_____\ \ \_____\ // \/_____/ \/_____/ \/_____/ // // // Copyright (c) 2014-2015, Geek Zoo Studio // http://www.bee-framework.com // // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR) #import "Bee_UIDataBinding.h" #import "Bee_UIZoomImageView.h" @interface BeeUIZoomImageView(UIDataBinding) @end #endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
/* Handle shared libraries for GDB, the GNU Debugger. Copyright (C) 2000-2013 Free Software Foundation, Inc. This file is part of GDB. 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/>. */ #ifndef SOLIB_SVR4_H #define SOLIB_SVR4_H struct objfile; struct target_so_ops; extern struct target_so_ops svr4_so_ops; /* Critical offsets and sizes which describe struct r_debug and struct link_map on SVR4-like targets. All offsets and sizes are in bytes unless otherwise specified. */ struct link_map_offsets { /* Offset and size of r_debug.r_version. */ int r_version_offset, r_version_size; /* Offset of r_debug.r_map. */ int r_map_offset; /* Offset of r_debug.r_brk. */ int r_brk_offset; /* Offset of r_debug.r_ldsomap. */ int r_ldsomap_offset; /* Size of struct link_map (or equivalent), or at least enough of it to be able to obtain the fields below. */ int link_map_size; /* Offset to l_addr field in struct link_map. */ int l_addr_offset; /* Offset to l_ld field in struct link_map. */ int l_ld_offset; /* Offset to l_next field in struct link_map. */ int l_next_offset; /* Offset to l_prev field in struct link_map. */ int l_prev_offset; /* Offset to l_name field in struct link_map. */ int l_name_offset; }; /* set_solib_svr4_fetch_link_map_offsets() is intended to be called by a <arch>_gdbarch_init() function. It is used to establish an architecture specific link_map_offsets fetcher for the architecture being defined. */ extern void set_solib_svr4_fetch_link_map_offsets (struct gdbarch *gdbarch, struct link_map_offsets *(*func) (void)); /* This function is called by thread_db.c. Return the address of the link map for the given objfile. */ extern CORE_ADDR svr4_fetch_objfile_link_map (struct objfile *objfile); /* Fetch (and possibly build) an appropriate `struct link_map_offsets' for ILP32 and LP64 SVR4 systems. */ extern struct link_map_offsets *svr4_ilp32_fetch_link_map_offsets (void); extern struct link_map_offsets *svr4_lp64_fetch_link_map_offsets (void); /* Return 1 if PC lies in the dynamic symbol resolution code of the SVR4 run time loader. */ int svr4_in_dynsym_resolve_code (CORE_ADDR pc); #endif /* solib-svr4.h */
/******************************************************************************* * Copyright 2011 Broadcom Corporation. All rights reserved. * * Unless you and Broadcom execute a separate written software license * agreement governing use of this software, this software is licensed to you * under terms of the GNU General Public License version 2, available at * http://www.gnu.org/copyleft/gpl.html (the "GPL"). * * Notwithstanding the above, under no circumstances may you combine this * software in any way with any other Broadcom software provided under a * license * * other than the GPL, without Broadcom's express prior written consent. * *****************************************************************************/ #include "i2c-kona.h" #define BCMNFC_MAGIC 0xFA /* * BCMNFC power control via ioctl * BCMNFC_POWER_CTL(0): power off * BCMNFC_POWER_CTL(1): power on * BCMNFC_WAKE_CTL(0): wake off * BCMNFC_WAKE_CTL(1): wake on */ #define BCMNFC_POWER_CTL _IO(BCMNFC_MAGIC, 0x01) #define BCMNFC_CHANGE_ADDR _IO(BCMNFC_MAGIC, 0x02) #define BCMNFC_READ_FULL_PACKET _IO(BCMNFC_MAGIC, 0x03) #define BCMNFC_SET_WAKE_ACTIVE_STATE _IO(BCMNFC_MAGIC, 0x04) #define BCMNFC_WAKE_CTL _IO(BCMNFC_MAGIC, 0x05) #define BCMNFC_READ_MULTI_PACKETS _IO(BCMNFC_MAGIC, 0x06) struct bcmi2cnfc_i2c_platform_data { struct i2c_slave_platform_data i2c_pdata; unsigned int irq_gpio; unsigned int en_gpio; unsigned int wake_gpio; int (*init)(void *); int (*reset)(void *); };
/* { dg-do compile } */ /* { dg-additional-options "-O2 -fdump-ipa-cgraph" } */ /* RTL-level CSE shouldn't introduce LCO (for the string) into varpool */ char *p; void foo () { p = "abc\n"; while (*p != '\n') p++; } /* { dg-final { scan-ipa-dump-not "LC0" "cgraph" } } */
/* * linux/arch/arm/mach-mmp/pxa168.c * * Code specific to PXA168 * * 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/module.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/list.h> #include <linux/io.h> #include <linux/clk.h> #include <linux/platform_device.h> #include <linux/platform_data/mv_usb.h> #include <asm/mach/time.h> #include <asm/system_misc.h> #include <mach/cputype.h> #include <mach/addr-map.h> #include <mach/regs-apbc.h> #include <mach/regs-apmu.h> #include <mach/irqs.h> #include <mach/dma.h> #include <mach/devices.h> #include <mach/mfp.h> #include <linux/dma-mapping.h> #include <mach/pxa168.h> #include <mach/regs-usb.h> #include "common.h" #include "clock.h" #define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000) static struct mfp_addr_map pxa168_mfp_addr_map[] __initdata = { MFP_ADDR_X(GPIO0, GPIO36, 0x04c), MFP_ADDR_X(GPIO37, GPIO55, 0x000), MFP_ADDR_X(GPIO56, GPIO123, 0x0e0), MFP_ADDR_X(GPIO124, GPIO127, 0x0f4), MFP_ADDR_END, }; void __init pxa168_init_irq(void) { icu_init_irq(); } static int __init pxa168_init(void) { if (cpu_is_pxa168()) { mfp_init_base(MFPR_VIRT_BASE); mfp_init_addr(pxa168_mfp_addr_map); pxa_init_dma(IRQ_PXA168_DMA_INT0, 32); pxa168_clk_init(); } return 0; } postcore_initcall(pxa168_init); /* system timer - clock enabled, 3.25MHz */ #define TIMER_CLK_RST (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(3)) #define APBC_TIMERS APBC_REG(0x34) void __init pxa168_timer_init(void) { /* this is early, we have to initialize the CCU registers by * ourselves instead of using clk_* API. Clock rate is defined * by APBC_TIMERS_CLK_RST (3.25MHz) and enabled free-running */ __raw_writel(APBC_APBCLK | APBC_RST, APBC_TIMERS); /* 3.25MHz, bus/functional clock enabled, release reset */ __raw_writel(TIMER_CLK_RST, APBC_TIMERS); timer_init(IRQ_PXA168_TIMER1); } void pxa168_clear_keypad_wakeup(void) { uint32_t val; uint32_t mask = APMU_PXA168_KP_WAKE_CLR; /* wake event clear is needed in order to clear keypad interrupt */ val = __raw_readl(APMU_WAKE_CLR); __raw_writel(val | mask, APMU_WAKE_CLR); } /* on-chip devices */ PXA168_DEVICE(uart1, "pxa2xx-uart", 0, UART1, 0xd4017000, 0x30, 21, 22); PXA168_DEVICE(uart2, "pxa2xx-uart", 1, UART2, 0xd4018000, 0x30, 23, 24); PXA168_DEVICE(uart3, "pxa2xx-uart", 2, UART3, 0xd4026000, 0x30, 23, 24); PXA168_DEVICE(twsi0, "pxa2xx-i2c", 0, TWSI0, 0xd4011000, 0x28); PXA168_DEVICE(twsi1, "pxa2xx-i2c", 1, TWSI1, 0xd4025000, 0x28); PXA168_DEVICE(pwm1, "pxa168-pwm", 0, NONE, 0xd401a000, 0x10); PXA168_DEVICE(pwm2, "pxa168-pwm", 1, NONE, 0xd401a400, 0x10); PXA168_DEVICE(pwm3, "pxa168-pwm", 2, NONE, 0xd401a800, 0x10); PXA168_DEVICE(pwm4, "pxa168-pwm", 3, NONE, 0xd401ac00, 0x10); PXA168_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x80, 97, 99); PXA168_DEVICE(ssp1, "pxa168-ssp", 0, SSP1, 0xd401b000, 0x40, 52, 53); PXA168_DEVICE(ssp2, "pxa168-ssp", 1, SSP2, 0xd401c000, 0x40, 54, 55); PXA168_DEVICE(ssp3, "pxa168-ssp", 2, SSP3, 0xd401f000, 0x40, 56, 57); PXA168_DEVICE(ssp4, "pxa168-ssp", 3, SSP4, 0xd4020000, 0x40, 58, 59); PXA168_DEVICE(ssp5, "pxa168-ssp", 4, SSP5, 0xd4021000, 0x40, 60, 61); PXA168_DEVICE(fb, "pxa168-fb", -1, LCD, 0xd420b000, 0x1c8); PXA168_DEVICE(keypad, "pxa27x-keypad", -1, KEYPAD, 0xd4012000, 0x4c); PXA168_DEVICE(eth, "pxa168-eth", -1, MFU, 0xc0800000, 0x0fff); struct resource pxa168_resource_gpio[] = { { .start = 0xd4019000, .end = 0xd4019fff, .flags = IORESOURCE_MEM, }, { .start = IRQ_PXA168_GPIOX, .end = IRQ_PXA168_GPIOX, .name = "gpio_mux", .flags = IORESOURCE_IRQ, }, }; struct platform_device pxa168_device_gpio = { .name = "mmp-gpio", .id = -1, .num_resources = ARRAY_SIZE(pxa168_resource_gpio), .resource = pxa168_resource_gpio, }; struct resource pxa168_usb_host_resources[] = { /* USB Host conroller register base */ [0] = { .start = PXA168_U2H_REGBASE + U2x_CAPREGS_OFFSET, .end = PXA168_U2H_REGBASE + USB_REG_RANGE, .flags = IORESOURCE_MEM, .name = "capregs", }, /* USB PHY register base */ [1] = { .start = PXA168_U2H_PHYBASE, .end = PXA168_U2H_PHYBASE + USB_PHY_RANGE, .flags = IORESOURCE_MEM, .name = "phyregs", }, [2] = { .start = IRQ_PXA168_USB2, .end = IRQ_PXA168_USB2, .flags = IORESOURCE_IRQ, }, }; static u64 pxa168_usb_host_dmamask = DMA_BIT_MASK(32); struct platform_device pxa168_device_usb_host = { .name = "pxa-sph", .id = -1, .dev = { .dma_mask = &pxa168_usb_host_dmamask, .coherent_dma_mask = DMA_BIT_MASK(32), }, .num_resources = ARRAY_SIZE(pxa168_usb_host_resources), .resource = pxa168_usb_host_resources, }; int __init pxa168_add_usb_host(struct mv_usb_platform_data *pdata) { pxa168_device_usb_host.dev.platform_data = pdata; return platform_device_register(&pxa168_device_usb_host); } void pxa168_restart(enum reboot_mode mode, const char *cmd) { soft_restart(0xffff0000); }
/* * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #include <dirent.h> #include <errno.h> #include <unistd.h> #include "dirstream.h" /* rewinddir() just does an lseek(fd,0,0) - see close for comments */ void rewinddir(DIR * dir) { if (!dir) { __set_errno(EBADF); return; } __UCLIBC_MUTEX_LOCK(dir->dd_lock); lseek(dir->dd_fd, 0, SEEK_SET); dir->dd_nextoff = dir->dd_nextloc = dir->dd_size = 0; __UCLIBC_MUTEX_UNLOCK(dir->dd_lock); }
#ifndef _CRIS_ARCH_DELAY_H #define _CRIS_ARCH_DELAY_H static inline void __delay(int loops) { __asm__ __volatile__ ( "move.d %0,$r9\n\t" "beq 2f\n\t" "subq 1,$r9\n\t" "1:\n\t" "bne 1b\n\t" "subq 1,$r9\n" "2:" : : "g" (loops) : "r9"); } #endif
/************************************************************************** * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * **************************************************************************/ #ifndef CELL_SPU #define CELL_SPU #include <libspe2.h> #include <pthread.h> #include "cell/common.h" #include "cell_context.h" /** * Global vars, for now anyway. */ struct cell_global_info { /** * SPU/SPE handles, etc */ spe_context_ptr_t spe_contexts[CELL_MAX_SPUS]; pthread_t spe_threads[CELL_MAX_SPUS]; /** * Data sent to SPUs at start-up */ struct cell_init_info inits[CELL_MAX_SPUS]; }; extern struct cell_global_info cell_global; /** This is the handle for the actual SPE code */ extern spe_program_handle_t g3d_spu; extern void send_mbox_message(spe_context_ptr_t ctx, unsigned int msg); extern uint wait_mbox_message(spe_context_ptr_t ctx); extern void cell_start_spus(struct cell_context *cell); extern void cell_spu_exit(struct cell_context *cell); #endif /* CELL_SPU */
/* * Stack tracing support * * Copyright (C) 2012 ARM Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <linux/kernel.h> #include <linux/export.h> #include <linux/ftrace.h> #include <linux/sched.h> #include <linux/sched/debug.h> #include <linux/sched/task_stack.h> #include <linux/stacktrace.h> #include <asm/irq.h> #include <asm/stack_pointer.h> #include <asm/stacktrace.h> /* * AArch64 PCS assigns the frame pointer to x29. * * A simple function prologue looks like this: * sub sp, sp, #0x10 * stp x29, x30, [sp] * mov x29, sp * * A simple function epilogue looks like this: * mov sp, x29 * ldp x29, x30, [sp] * add sp, sp, #0x10 */ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame) { unsigned long fp = frame->fp; if (fp & 0xf) return -EINVAL; if (!tsk) tsk = current; if (!on_accessible_stack(tsk, fp, NULL)) return -EINVAL; frame->fp = READ_ONCE_NOCHECK(*(unsigned long *)(fp)); frame->pc = READ_ONCE_NOCHECK(*(unsigned long *)(fp + 8)); #ifdef CONFIG_FUNCTION_GRAPH_TRACER if (tsk->ret_stack && (frame->pc == (unsigned long)return_to_handler)) { if (WARN_ON_ONCE(frame->graph == -1)) return -EINVAL; if (frame->graph < -1) frame->graph += FTRACE_NOTRACE_DEPTH; /* * This is a case where function graph tracer has * modified a return address (LR) in a stack frame * to hook a function return. * So replace it to an original value. */ frame->pc = tsk->ret_stack[frame->graph--].ret; } #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ /* * Frames created upon entry from EL0 have NULL FP and PC values, so * don't bother reporting these. Frames created by __noreturn functions * might have a valid FP even if PC is bogus, so only terminate where * both are NULL. */ if (!frame->fp && !frame->pc) return -EINVAL; return 0; } void notrace walk_stackframe(struct task_struct *tsk, struct stackframe *frame, int (*fn)(struct stackframe *, void *), void *data) { while (1) { int ret; if (fn(frame, data)) break; ret = unwind_frame(tsk, frame); if (ret < 0) break; } } #ifdef CONFIG_STACKTRACE struct stack_trace_data { struct stack_trace *trace; unsigned int no_sched_functions; unsigned int skip; }; static int save_trace(struct stackframe *frame, void *d) { struct stack_trace_data *data = d; struct stack_trace *trace = data->trace; unsigned long addr = frame->pc; if (data->no_sched_functions && in_sched_functions(addr)) return 0; if (data->skip) { data->skip--; return 0; } trace->entries[trace->nr_entries++] = addr; return trace->nr_entries >= trace->max_entries; } void save_stack_trace_regs(struct pt_regs *regs, struct stack_trace *trace) { struct stack_trace_data data; struct stackframe frame; data.trace = trace; data.skip = trace->skip; data.no_sched_functions = 0; frame.fp = regs->regs[29]; frame.pc = regs->pc; #ifdef CONFIG_FUNCTION_GRAPH_TRACER frame.graph = current->curr_ret_stack; #endif walk_stackframe(current, &frame, save_trace, &data); if (trace->nr_entries < trace->max_entries) trace->entries[trace->nr_entries++] = ULONG_MAX; } static noinline void __save_stack_trace(struct task_struct *tsk, struct stack_trace *trace, unsigned int nosched) { struct stack_trace_data data; struct stackframe frame; if (!try_get_task_stack(tsk)) return; data.trace = trace; data.skip = trace->skip; data.no_sched_functions = nosched; if (tsk != current) { frame.fp = thread_saved_fp(tsk); frame.pc = thread_saved_pc(tsk); } else { /* We don't want this function nor the caller */ data.skip += 2; frame.fp = (unsigned long)__builtin_frame_address(0); frame.pc = (unsigned long)__save_stack_trace; } #ifdef CONFIG_FUNCTION_GRAPH_TRACER frame.graph = tsk->curr_ret_stack; #endif walk_stackframe(tsk, &frame, save_trace, &data); if (trace->nr_entries < trace->max_entries) trace->entries[trace->nr_entries++] = ULONG_MAX; put_task_stack(tsk); } EXPORT_SYMBOL_GPL(save_stack_trace_tsk); void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace) { __save_stack_trace(tsk, trace, 1); } void save_stack_trace(struct stack_trace *trace) { __save_stack_trace(current, trace, 0); } EXPORT_SYMBOL_GPL(save_stack_trace); #endif
/* Copyright 2019 Takuya Urakawa (dm9records.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include "quantum.h" #define LAYOUT_plaid_mit( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ ) \ { \ { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ { k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b } \ } #define LAYOUT_plaid_grid( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ ) \ { \ { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ } // Used to create a keymap using only KC_ prefixed keys #define KC_KEYMAP( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ ) \ LAYOUT_plaid_grid( \ KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ ) #define KEYMAP LAYOUT_plaid_grid #define LAYOUT_ortho_4x12 LAYOUT_plaid_grid #define LAYOUT_planck_mit LAYOUT_plaid_mit #define LAYOUT_kc_ortho_4x12 KC_KEYMAP #define KC_LAYOUT_ortho_4x12 KC_KEYMAP #define LED_RED C5 #define LED_GREEN C4
/* * (C) Copyright 2011 * Graeme Russ, <graeme.russ@gmail.com> * * See file CREDITS for list of people who contributed to this * project. * * 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 <common.h> #include <command.h> #include <stdio_dev.h> #include <version.h> #include <malloc.h> #include <net.h> #include <ide.h> #include <serial.h> #include <status_led.h> #include <asm/processor.h> #include <asm/u-boot-x86.h> #include <asm/init_helpers.h> DECLARE_GLOBAL_DATA_PTR; /************************************************************************ * Init Utilities * ************************************************************************ * Some of this code should be moved into the core functions, * or dropped completely, * but let's get it working (again) first... */ int display_banner(void) { printf("\n\n%s\n\n", version_string); return 0; } int display_dram_config(void) { int i; puts("DRAM Configuration:\n"); for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) { printf("Bank #%d: %08lx ", i, gd->bd->bi_dram[i].start); print_size(gd->bd->bi_dram[i].size, "\n"); } return 0; } int init_baudrate_f(void) { gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE); return 0; } int calculate_relocation_address(void) { ulong text_start = (ulong)&__text_start; ulong bss_end = (ulong)&__bss_end; ulong dest_addr; /* * NOTE: All destination address are rounded down to 16-byte * boundary to satisfy various worst-case alignment * requirements */ /* Global Data is at top of available memory */ dest_addr = gd->ram_size; dest_addr -= GENERATED_GBL_DATA_SIZE; dest_addr &= ~15; gd->new_gd_addr = dest_addr; /* GDT is below Global Data */ dest_addr -= X86_GDT_SIZE; dest_addr &= ~15; gd->gdt_addr = dest_addr; /* Stack is below GDT */ gd->start_addr_sp = dest_addr; /* U-Boot is below the stack */ dest_addr -= CONFIG_SYS_STACK_SIZE; dest_addr -= (bss_end - text_start); dest_addr &= ~15; gd->relocaddr = dest_addr; gd->reloc_off = (dest_addr - text_start); return 0; } int copy_gd_to_ram_f_r(void) { gd_t *ram_gd; /* * Global data is still in temporary memory (the CPU cache). * calculate_relocation_address() has set gd->new_gd_addr to * where the global data lives in RAM but getting it there * safely is a bit tricky due to the 'F-Segment Hack' that * we need to use for x86 */ ram_gd = (gd_t *)gd->new_gd_addr; memcpy((void *)ram_gd, gd, sizeof(gd_t)); /* * Reload the Global Descriptor Table so FS points to the * in-RAM copy of Global Data (calculate_relocation_address() * has already calculated the in-RAM location of the GDT) */ ram_gd->gd_addr = (ulong)ram_gd; init_gd(ram_gd, (u64 *)gd->gdt_addr); return 0; } int init_cache_f_r(void) { /* Initialise the CPU cache(s) */ return init_cache(); } int set_reloc_flag_r(void) { gd->flags = GD_FLG_RELOC; return 0; } int mem_malloc_init_r(void) { mem_malloc_init(((gd->relocaddr - CONFIG_SYS_MALLOC_LEN)+3)&~3, CONFIG_SYS_MALLOC_LEN); return 0; } bd_t bd_data; int init_bd_struct_r(void) { gd->bd = &bd_data; memset(gd->bd, 0, sizeof(bd_t)); return 0; } #ifndef CONFIG_SYS_NO_FLASH int flash_init_r(void) { ulong size; puts("Flash: "); /* configure available FLASH banks */ size = flash_init(); print_size(size, "\n"); return 0; } #endif #ifdef CONFIG_STATUS_LED int status_led_set_r(void) { status_led_set(STATUS_LED_BOOT, STATUS_LED_BLINKING); return 0; } #endif int set_load_addr_r(void) { /* Initialize from environment */ load_addr = getenv_ulong("loadaddr", 16, load_addr); return 0; }
// // IFlySpeechRecognizerDelegate.h // MSC // // Created by ypzhao on 13-3-27. // Copyright (c) 2013年 iflytek. All rights reserved. // #import <Foundation/Foundation.h> @class IFlySpeechError; /*! * 构建语法结束回调 * * @param grammarId 语法id * @param error 错误描述 */ typedef void(^IFlyOnBuildFinishCompletionHandler)(NSString* grammarId,IFlySpeechError * error); /*! * 语音识别协议 * 在使用语音识别时,需要实现这个协议中的方法. */ @protocol IFlySpeechRecognizerDelegate <NSObject> @required /*! * 识别结果回调 * 在进行语音识别过程中的任何时刻都有可能回调此函数,你可以根据errorCode进行相应的处理, * 当errorCode没有错误时,表示此次会话正常结束;否则,表示此次会话有错误发生。特别的当调用 * `cancel`函数时,引擎不会自动结束,需要等到回调此函数,才表示此次会话结束。在没有回调此函数 * 之前如果重新调用了`startListenging`函数则会报错误。 * * @param errorCode 错误描述 */ - (void) onError:(IFlySpeechError *) errorCode; /*! * 识别结果回调 * 在识别过程中可能会多次回调此函数,你最好不要在此回调函数中进行界面的更改等操作,只需要将回调的结果保存起来。 * 使用results的示例如下: * <pre><code> * - (void) onResults:(NSArray *) results{ * NSMutableString *result = [[NSMutableString alloc] init]; * NSDictionary *dic = [results objectAtIndex:0]; * for (NSString *key in dic){ * [result appendFormat:@"%@",key];//合并结果 * } * } * </code></pre> * * @param results -[out] 识别结果,NSArray的第一个元素为NSDictionary,NSDictionary的key为识别结果,sc为识别结果的置信度。 * @param isLast -[out] 是否最后一个结果 */ - (void) onResults:(NSArray *) results isLast:(BOOL)isLast; @optional /*! * 音量变化回调 * 在录音过程中,回调音频的音量。 * * @param volume -[out] 音量,范围从0-30 */ - (void) onVolumeChanged: (int)volume; /*! * 开始录音回调 * 当调用了`startListening`函数之后,如果没有发生错误则会回调此函数。 * 如果发生错误则回调onError:函数 */ - (void) onBeginOfSpeech; /*! * 停止录音回调 * 当调用了`stopListening`函数或者引擎内部自动检测到断点,如果没有发生错误则回调此函数。 * 如果发生错误则回调onError:函数 */ - (void) onEndOfSpeech; /*! * 取消识别回调 * 当调用了`cancel`函数之后,会回调此函数,在调用了cancel函数和回调onError之前会有一个 * 短暂时间,您可以在此函数中实现对这段时间的界面显示。 */ - (void) onCancel; #ifdef _EDUCATION_ /** * 返回音频Key * * @param key 音频Key */ - (void) getAudioKey:(NSString *)key; #endif /** * 扩展事件回调 * 根据事件类型返回额外的数据 * * @param eventType 事件类型,具体参见IFlySpeechEventType的IFlySpeechEventTypeVoiceChangeResult枚举。 * @param arg0 arg0 * @param arg1 arg1 * @param eventData 事件数据 */ - (void) onEvent:(int)eventType arg0:(int)arg0 arg1:(int)arg1 data:(NSData *)eventData; @end
/* * Copyright 2004-2013 Freescale Semiconductor, Inc. All Rights Reserved. */ /* * The code contained herein is licensed under the GNU General Public * License. You may obtain a copy of the GNU General Public License * Version 2 or later at the following locations: * * http://www.opensource.org/licenses/gpl-license.html * http://www.gnu.org/copyleft/gpl.html */ /*! * @defgroup MXC_V4L2_CAPTURE MXC V4L2 Video Capture Driver */ /*! * @file mxc_v4l2_capture.h * * @brief mxc V4L2 capture device API Header file * * It include all the defines for frame operations, also three structure defines * use case ops structure, common v4l2 driver structure and frame structure. * * @ingroup MXC_V4L2_CAPTURE */ #ifndef __MXC_V4L2_CAPTURE_H__ #define __MXC_V4L2_CAPTURE_H__ #include <linux/uaccess.h> #include <linux/list.h> #include <linux/mxc_v4l2.h> #include <linux/completion.h> #include <linux/dmaengine.h> #include <linux/pxp_dma.h> #include <linux/ipu-v3.h> #include <linux/platform_data/dma-imx.h> #include <media/v4l2-dev.h> #include <media/v4l2-int-device.h> #define FRAME_NUM 10 #define MXC_SENSOR_NUM 2 enum imx_v4l2_devtype { IMX5_V4L2, IMX6_V4L2, }; /*! * v4l2 frame structure. */ struct mxc_v4l_frame { u32 paddress; void *vaddress; int count; int width; int height; struct v4l2_buffer buffer; struct list_head queue; int index; union { int ipu_buf_num; int csi_buf_num; }; }; /* Only for old version. Will go away soon. */ typedef struct { u8 clk_mode; u8 ext_vsync; u8 Vsync_pol; u8 Hsync_pol; u8 pixclk_pol; u8 data_pol; u8 data_width; u8 pack_tight; u8 force_eof; u8 data_en_pol; u16 width; u16 height; u32 pixel_fmt; u32 mclk; u16 active_width; u16 active_height; } sensor_interface; /* Sensor control function */ /* Only for old version. Will go away soon. */ struct camera_sensor { void (*set_color) (int bright, int saturation, int red, int green, int blue); void (*get_color) (int *bright, int *saturation, int *red, int *green, int *blue); void (*set_ae_mode) (int ae_mode); void (*get_ae_mode) (int *ae_mode); sensor_interface *(*config) (int *frame_rate, int high_quality); sensor_interface *(*reset) (void); void (*get_std) (v4l2_std_id *std); void (*set_std) (v4l2_std_id std); unsigned int csi; }; /*! * common v4l2 driver structure. */ typedef struct _cam_data { struct video_device *video_dev; int device_type; /* semaphore guard against SMP multithreading */ struct semaphore busy_lock; int open_count; /* params lock for this camera */ struct semaphore param_lock; /* Encoder */ struct list_head ready_q; struct list_head done_q; struct list_head working_q; int ping_pong_csi; spinlock_t queue_int_lock; spinlock_t dqueue_int_lock; struct mxc_v4l_frame frame[FRAME_NUM]; struct mxc_v4l_frame dummy_frame; wait_queue_head_t enc_queue; int enc_counter; dma_addr_t rot_enc_bufs[2]; void *rot_enc_bufs_vaddr[2]; int rot_enc_buf_size[2]; enum v4l2_buf_type type; /* still image capture */ wait_queue_head_t still_queue; int still_counter; dma_addr_t still_buf[2]; void *still_buf_vaddr; /* overlay */ struct v4l2_window win; struct v4l2_framebuffer v4l2_fb; dma_addr_t vf_bufs[2]; void *vf_bufs_vaddr[2]; int vf_bufs_size[2]; dma_addr_t rot_vf_bufs[2]; void *rot_vf_bufs_vaddr[2]; int rot_vf_buf_size[2]; bool overlay_active; int output; struct fb_info *overlay_fb; int fb_origin_std; struct work_struct csi_work_struct; /* v4l2 format */ struct v4l2_format v2f; int rotation; /* for IPUv1 and IPUv3, this means encoder rotation */ int vf_rotation; /* viewfinder rotation only for IPUv1 and IPUv3 */ struct v4l2_mxc_offset offset; /* V4l2 control bit */ int bright; int hue; int contrast; int saturation; int red; int green; int blue; int ae_mode; /* standard */ struct v4l2_streamparm streamparm; struct v4l2_standard standard; bool standard_autodetect; /* crop */ struct v4l2_rect crop_bounds; struct v4l2_rect crop_defrect; struct v4l2_rect crop_current; int (*enc_update_eba) (struct ipu_soc *ipu, dma_addr_t eba, int *bufferNum); int (*enc_enable) (void *private); int (*enc_disable) (void *private); int (*enc_enable_csi) (void *private); int (*enc_disable_csi) (void *private); void (*enc_callback) (u32 mask, void *dev); int (*vf_start_adc) (void *private); int (*vf_stop_adc) (void *private); int (*vf_start_sdc) (void *private); int (*vf_stop_sdc) (void *private); int (*vf_enable_csi) (void *private); int (*vf_disable_csi) (void *private); int (*csi_start) (void *private); int (*csi_stop) (void *private); /* misc status flag */ bool overlay_on; bool capture_on; int overlay_pid; int capture_pid; bool low_power; wait_queue_head_t power_queue; unsigned int ipu_id; unsigned int csi; u8 mclk_source; bool mclk_on[2]; /* two mclk sources at most now */ int current_input; int local_buf_num; /* camera sensor interface */ struct camera_sensor *cam_sensor; /* old version */ struct v4l2_int_device *all_sensors[MXC_SENSOR_NUM]; struct v4l2_int_device *sensor; struct v4l2_int_device *self; int sensor_index; void *ipu; enum imx_v4l2_devtype devtype; /* v4l2 buf elements related to PxP DMA */ struct completion pxp_tx_cmpl; struct pxp_channel *pxp_chan; struct pxp_config_data pxp_conf; struct dma_async_tx_descriptor *txd; dma_cookie_t cookie; struct scatterlist sg[2]; } cam_data; struct sensor_data { const struct ov5642_platform_data *platform_data; struct v4l2_int_device *v4l2_int_device; struct i2c_client *i2c_client; struct v4l2_pix_format pix; struct v4l2_captureparm streamcap; bool on; /* control settings */ int brightness; int hue; int contrast; int saturation; int red; int green; int blue; int ae_mode; u32 mclk; u8 mclk_source; struct clk *sensor_clk; int csi; void (*io_init)(void); }; void set_mclk_rate(uint32_t *p_mclk_freq, uint32_t csi); #endif /* __MXC_V4L2_CAPTURE_H__ */
/* Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _RPC_AUTH_DES_H #define _RPC_AUTH_DES_H 1 #include <sys/cdefs.h> #include <rpc/auth.h> __BEGIN_DECLS /* There are two kinds of "names": fullnames and nicknames */ enum authdes_namekind { ADN_FULLNAME, ADN_NICKNAME }; /* A fullname contains the network name of the client, a conversation key and the window */ struct authdes_fullname { char *name; /* network name of client, up to MAXNETNAMELEN */ des_block key; /* conversation key */ uint32_t window; /* associated window */ }; /* A credential */ struct authdes_cred { enum authdes_namekind adc_namekind; struct authdes_fullname adc_fullname; uint32_t adc_nickname; }; /* A timeval replacement for !32bit platforms */ struct rpc_timeval { uint32_t tv_sec; /* Seconds. */ uint32_t tv_usec; /* Microseconds. */ }; /* A des authentication verifier */ struct authdes_verf { union { struct rpc_timeval adv_ctime; /* clear time */ des_block adv_xtime; /* crypt time */ } adv_time_u; uint32_t adv_int_u; }; /* des authentication verifier: client variety adv_timestamp is the current time. adv_winverf is the credential window + 1. Both are encrypted using the conversation key. */ #define adv_timestamp adv_time_u.adv_ctime #define adv_xtimestamp adv_time_u.adv_xtime #define adv_winverf adv_int_u /* des authentication verifier: server variety adv_timeverf is the client's timestamp + client's window adv_nickname is the server's nickname for the client. adv_timeverf is encrypted using the conversation key. */ #define adv_timeverf adv_time_u.adv_ctime #define adv_xtimeverf adv_time_u.adv_xtime #define adv_nickname adv_int_u /* Map a des credential into a unix cred. */ extern int authdes_getucred (const struct authdes_cred * __adc, uid_t * __uid, gid_t * __gid, short *__grouplen, gid_t * __groups) __THROW; /* Get the public key for NAME and place it in KEY. NAME can only be up to MAXNETNAMELEN bytes long and the destination buffer KEY should have HEXKEYBYTES + 1 bytes long to fit all characters from the key. */ extern int getpublickey (const char *__name, char *__key) __THROW; /* Get the secret key for NAME and place it in KEY. PASSWD is used to decrypt the encrypted key stored in the database. NAME can only be up to MAXNETNAMELEN bytes long and the destination buffer KEY should have HEXKEYBYTES + 1 bytes long to fit all characters from the key. */ extern int getsecretkey (const char *__name, char *__key, const char *__passwd) __THROW; extern int rtime (struct sockaddr_in *__addrp, struct rpc_timeval *__timep, struct rpc_timeval *__timeout) __THROW; __END_DECLS #endif /* rpc/auth_des.h */
/* * Copyright (C) 2015 Eistec AB * * 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. */ /** * @ingroup cpu_k60 * @{ * * @file * @brief Compatibility definitions between MK60D10.h and MK60DZ10.h * * @author Joakim Gebart <joakim.gebart@eistec.se> */ #ifndef MK60_COMP_H_ #define MK60_COMP_H_ #ifdef __cplusplus extern "C" { #endif #if K60_CPU_REV == 1 /* Some compatibility defines to minimize the ifdefs needed for the register * name changes */ #define SIM_SCGC6_SPI0_MASK SIM_SCGC6_DSPI0_MASK #define SIM_SCGC6_SPI0_SHIFT SIM_SCGC6_DSPI0_SHIFT #define MCG_C2_RANGE0_MASK MCG_C2_RANGE_MASK #define MCG_C5_PRDIV0_MASK MCG_C5_PRDIV_MASK #define MCG_C6_VDIV0_MASK MCG_C6_VDIV_MASK #define UART_BASES { UART0, UART1, UART2, UART3, UART4, UART5 } #define LPTMR0_IRQn LPTimer_IRQn /* Rev 2.x made the OSC32KSEL field into a bitfield (is a single bit in 1.x) */ #define SIM_SOPT1_OSC32KSEL(a) (SIM_SOPT1_OSC32KSEL_MASK) #endif /* K60_CPU_REV == 1 */ /* Compatibility defines for compatibility with differing module names between * MK60 and MKW22 headers */ #define SIM_SCGC5_LPTMR_MASK SIM_SCGC5_LPTIMER_MASK #define SIM_SCGC5_LPTMR_SHIFT SIM_SCGC5_LPTIMER_SHIFT #ifndef OSC0 /* Compatibility definition */ #define OSC0 OSC #endif #ifndef MCG_C2_RANGE0 /* Rev 2 parts renamed the parameter RANGE -> RANGE0 */ #define MCG_C2_RANGE0 MCG_C2_RANGE #endif #ifdef __cplusplus } #endif #endif /* MK60_COMP_H_ */ /** @} */
/* See through some simple data-flow. */ /* { dg-options "-mrelax-pic-calls" } */ /* { dg-final { scan-assembler-times "\\.reloc\t1f,R_MIPS_JALR,g\n1:\tjalrs?\t" 2 } } */ extern void g (void); int NOMIPS16 f () { g (); g (); return 1; }
extern int v3p_netlib_zgecon_( char *norm, v3p_netlib_integer *n, v3p_netlib_doublecomplex *a, v3p_netlib_integer *lda, v3p_netlib_doublereal *anorm, v3p_netlib_doublereal *rcond, v3p_netlib_doublecomplex *work, v3p_netlib_doublereal *rwork, v3p_netlib_integer *info, v3p_netlib_ftnlen norm_len );
/* $Id: guid.c 4208 2012-07-18 07:52:33Z ming $ */ /* * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.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 */ #include <pj/ctype.h> #include <pj/guid.h> #include <pj/pool.h> PJ_DEF(pj_str_t*) pj_generate_unique_string_lower(pj_str_t *str) { int i; pj_generate_unique_string(str); for (i = 0; i < str->slen; i++) str->ptr[i] = (char)pj_tolower(str->ptr[i]); return str; } PJ_DEF(void) pj_create_unique_string(pj_pool_t *pool, pj_str_t *str) { str->ptr = (char*)pj_pool_alloc(pool, PJ_GUID_STRING_LENGTH); pj_generate_unique_string(str); } PJ_DEF(void) pj_create_unique_string_lower(pj_pool_t *pool, pj_str_t *str) { int i; pj_create_unique_string(pool, str); for (i = 0; i < str->slen; i++) str->ptr[i] = (char)pj_tolower(str->ptr[i]); }
#ifndef _LINUX_VIRTIO_IDS_H #define _LINUX_VIRTIO_IDS_H /* * Virtio IDs * * This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. * * 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 IBM 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 IBM 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. */ #define VIRTIO_ID_NET 1 /* virtio net */ #define VIRTIO_ID_BLOCK 2 /* virtio block */ #define VIRTIO_ID_CONSOLE 3 /* virtio console */ #define VIRTIO_ID_RNG 4 /* virtio rng */ #define VIRTIO_ID_BALLOON 5 /* virtio balloon */ #define VIRTIO_ID_IOMEM 6 /* virtio ioMemory */ #define VIRTIO_ID_RPMSG 7 /* virtio remote processor messaging */ #define VIRTIO_ID_SCSI 8 /* virtio scsi */ #define VIRTIO_ID_9P 9 /* 9p virtio console */ #define VIRTIO_ID_MAC80211_WLAN 10 /* virtio WLAN MAC */ #define VIRTIO_ID_RPROC_SERIAL 11 /* virtio remoteproc serial link */ #define VIRTIO_ID_CAIF 12 /* Virtio caif */ #define VIRTIO_ID_MEMORY_BALLOON 13 /* virtio memory balloon */ #define VIRTIO_ID_GPU 16 /* virtio GPU */ #define VIRTIO_ID_CLOCK 17 /* virtio clock/timer */ #define VIRTIO_ID_INPUT 18 /* virtio input */ #define VIRTIO_ID_VSOCK 19 /* virtio vsock transport */ #define VIRTIO_ID_CRYPTO 20 /* virtio crypto */ #define VIRTIO_ID_SIGNAL_DIST 21 /* virtio signal distribution device */ #define VIRTIO_ID_PSTORE 22 /* virtio pstore device */ #define VIRTIO_ID_IOMMU 23 /* virtio IOMMU */ #define VIRTIO_ID_MEM 24 /* virtio mem */ #define VIRTIO_ID_FS 26 /* virtio filesystem */ #define VIRTIO_ID_PMEM 27 /* virtio pmem */ #define VIRTIO_ID_MAC80211_HWSIM 29 /* virtio mac80211-hwsim */ #endif /* _LINUX_VIRTIO_IDS_H */
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_TEST_CHANNEL_ID_TEST_UTIL_H_ #define NET_TEST_CHANNEL_ID_TEST_UTIL_H_ #include <string> #include "base/compiler_specific.h" #include "testing/gtest/include/gtest/gtest.h" namespace crypto { class ECPrivateKey; } // namespace crypto namespace net { ::testing::AssertionResult KeysEqual(crypto::ECPrivateKey* key1, crypto::ECPrivateKey* key2) WARN_UNUSED_RESULT; } // namespace net #endif // NET_TEST_CHANNEL_ID_TEST_UTIL_H_
// Copyright (c) 2012- PPSSPP Project. // 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.0 or later versions. // 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 2.0 for more details. // A copy of the GPL 2.0 should have been included with the program. // If not, see http://www.gnu.org/licenses/ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #pragma once #include "Core/Dialog/PSPDialog.h" #include "Core/MemMap.h" struct SceUtilityScreenshotParams; class PSPScreenshotDialog : public PSPDialog { public: PSPScreenshotDialog(); virtual ~PSPScreenshotDialog(); virtual int Init(u32 paramAddr); virtual int Update(int animSpeed) override; virtual int ContStart(); virtual void DoState(PointerWrap &p) override; protected: int mode; PSPPointer<SceUtilityScreenshotParams> params_; };
/* * Flash and EPROM on Hitachi Solution Engine and similar boards. * * (C) 2001 Red Hat, Inc. * * GPL'd */ #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/init.h> #include <asm/io.h> #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> #include <linux/mtd/partitions.h> #include <linux/errno.h> static struct mtd_info *flash_mtd; static struct mtd_info *eprom_mtd; static struct mtd_partition *parsed_parts; struct map_info soleng_eprom_map = { .name = "Solution Engine EPROM", .size = 0x400000, .bankwidth = 4, }; struct map_info soleng_flash_map = { .name = "Solution Engine FLASH", .size = 0x400000, .bankwidth = 4, }; static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; #ifdef CONFIG_MTD_SUPERH_RESERVE static struct mtd_partition superh_se_partitions[] = { /* Reserved for boot code, read-only */ { .name = "flash_boot", .offset = 0x00000000, .size = CONFIG_MTD_SUPERH_RESERVE, .mask_flags = MTD_WRITEABLE, }, /* All else is writable (e.g. JFFS) */ { .name = "Flash FS", .offset = MTDPART_OFS_NXTBLK, .size = MTDPART_SIZ_FULL, } }; #endif /* CONFIG_MTD_SUPERH_RESERVE */ static int __init init_soleng_maps(void) { int nr_parts = 0; /* First probe at offset 0 */ soleng_flash_map.phys = 0; soleng_flash_map.virt = (void __iomem *)P2SEGADDR(0); soleng_eprom_map.phys = 0x01000000; soleng_eprom_map.virt = (void __iomem *)P1SEGADDR(0x01000000); simple_map_init(&soleng_eprom_map); simple_map_init(&soleng_flash_map); printk(KERN_NOTICE "Probing for flash chips at 0x00000000:\n"); flash_mtd = do_map_probe("cfi_probe", &soleng_flash_map); if (!flash_mtd) { /* Not there. Try swapping */ printk(KERN_NOTICE "Probing for flash chips at 0x01000000:\n"); soleng_flash_map.phys = 0x01000000; soleng_flash_map.virt = P2SEGADDR(0x01000000); soleng_eprom_map.phys = 0; soleng_eprom_map.virt = P1SEGADDR(0); flash_mtd = do_map_probe("cfi_probe", &soleng_flash_map); if (!flash_mtd) { /* Eep. */ printk(KERN_NOTICE "Flash chips not detected at either possible location.\n"); return -ENXIO; } } printk(KERN_NOTICE "Solution Engine: Flash at 0x%08lx, EPROM at 0x%08lx\n", soleng_flash_map.phys & 0x1fffffff, soleng_eprom_map.phys & 0x1fffffff); flash_mtd->owner = THIS_MODULE; eprom_mtd = do_map_probe("map_rom", &soleng_eprom_map); if (eprom_mtd) { eprom_mtd->owner = THIS_MODULE; add_mtd_device(eprom_mtd); } nr_parts = parse_mtd_partitions(flash_mtd, probes, &parsed_parts, 0); #ifdef CONFIG_MTD_SUPERH_RESERVE if (nr_parts <= 0) { printk(KERN_NOTICE "Using configured partition at 0x%08x.\n", CONFIG_MTD_SUPERH_RESERVE); parsed_parts = superh_se_partitions; nr_parts = sizeof(superh_se_partitions)/sizeof(*parsed_parts); } #endif /* CONFIG_MTD_SUPERH_RESERVE */ if (nr_parts > 0) add_mtd_partitions(flash_mtd, parsed_parts, nr_parts); else add_mtd_device(flash_mtd); return 0; } static void __exit cleanup_soleng_maps(void) { if (eprom_mtd) { del_mtd_device(eprom_mtd); map_destroy(eprom_mtd); } if (parsed_parts) del_mtd_partitions(flash_mtd); else del_mtd_device(flash_mtd); map_destroy(flash_mtd); } module_init(init_soleng_maps); module_exit(cleanup_soleng_maps); MODULE_LICENSE("GPL"); MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>"); MODULE_DESCRIPTION("MTD map driver for Hitachi SolutionEngine (and similar) boards");
/* Copyright 2013-2014 Free Software Foundation, Inc. This file is part of GDB. 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/>. */ int main (void) { return 0; }
/*************************************************************************/ /*! @File @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved @License Dual MIT/GPLv2 The contents of this file are subject to the MIT license as set out below. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. Alternatively, the contents of this file may be used under the terms of the GNU General Public License Version 2 ("GPL") in which case the provisions of GPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of GPL, and not to allow others to use your version of this file under the terms of the MIT license, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by GPL as set out in the file called "GPL-COPYING" included in this distribution. If you do not delete the provisions above, a recipient may use your version of this file under the terms of either the MIT license or GPL. This License is also included in this distribution in the file called "MIT-COPYING". EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) 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; AND (B) IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ #include <linux/version.h> #include <linux/fs.h> #include <linux/file.h> #include <linux/dcache.h> #include <linux/mount.h> #include <linux/sched.h> #include <linux/cred.h> #include "img_types.h" #include "ossecure_export.h" #include "env_connection.h" #include "private_data.h" #include "pvr_debug.h" #include "driverlock.h" #if defined(SUPPORT_DRM) #include "pvr_drm.h" #endif PVRSRV_ERROR OSSecureExport(CONNECTION_DATA *psConnection, IMG_PVOID pvData, IMG_SECURE_TYPE *phSecure, CONNECTION_DATA **ppsSecureConnection) { ENV_CONNECTION_DATA *psEnvConnection; CONNECTION_DATA *psSecureConnection; struct file *connection_file; struct file *secure_file; struct dentry *secure_dentry; struct vfsmount *secure_mnt; int secure_fd; IMG_BOOL bPmrUnlocked = IMG_FALSE; PVRSRV_ERROR eError; /* Obtain the current connections struct file */ psEnvConnection = PVRSRVConnectionPrivateData(psConnection); connection_file = LinuxFileFromEnvConnection(psEnvConnection); /* Allocate a fd number */ secure_fd = get_unused_fd(); if (secure_fd < 0) { eError = PVRSRV_ERROR_OUT_OF_MEMORY; goto e0; } /* Get a reference to the dentry so when close is called we don't drop the last reference too early and delete the file */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) secure_dentry = dget(connection_file->f_path.dentry); secure_mnt = mntget(connection_file->f_path.mnt); #else secure_dentry = dget(connection_file->f_dentry); secure_mnt = mntget(connection_file->f_vfsmnt); #endif /* PMR lock needs to be released before bridge lock to keep lock hierarchy * and avoid deadlock situation. * OSSecureExport() can be called from functions that are not acquiring * PMR lock (e.g. by PVRSRVSyncPrimServerSecureExportKM()) so we have to * check if PMR lock is locked. */ if (PMRIsLockedByMe()) { PMRUnlock(); bPmrUnlocked = IMG_TRUE; } OSReleaseBridgeLock(); /* Open our device (using the file information from our current connection) */ secure_file = dentry_open( #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) &connection_file->f_path, #else connection_file->f_dentry, connection_file->f_vfsmnt, #endif connection_file->f_flags, current_cred()); OSAcquireBridgeLock(); if (bPmrUnlocked) PMRLock(); /* Bail if the open failed */ if (IS_ERR(secure_file)) { put_unused_fd(secure_fd); eError = PVRSRV_ERROR_OUT_OF_MEMORY; goto e0; } /* Bind our struct file with it's fd number */ fd_install(secure_fd, secure_file); /* Return the new services connection our secure data created */ #if defined(SUPPORT_DRM) psSecureConnection = LinuxConnectionFromFile(PVR_DRM_FILE_FROM_FILE(secure_file)); #else psSecureConnection = LinuxConnectionFromFile(secure_file); #endif /* Save the private data */ PVR_ASSERT(psSecureConnection->hSecureData == IMG_NULL); psSecureConnection->hSecureData = pvData; *phSecure = secure_fd; *ppsSecureConnection = psSecureConnection; return PVRSRV_OK; e0: PVR_ASSERT(eError != PVRSRV_OK); return eError; } PVRSRV_ERROR OSSecureImport(IMG_SECURE_TYPE hSecure, IMG_PVOID *ppvData) { struct file *secure_file; CONNECTION_DATA *psSecureConnection; PVRSRV_ERROR eError; secure_file = fget(hSecure); if (!secure_file) { eError = PVRSRV_ERROR_INVALID_PARAMS; goto err_out; } #if defined(SUPPORT_DRM) psSecureConnection = LinuxConnectionFromFile(PVR_DRM_FILE_FROM_FILE(secure_file)); #else psSecureConnection = LinuxConnectionFromFile(secure_file); #endif if (psSecureConnection->hSecureData == IMG_NULL) { eError = PVRSRV_ERROR_INVALID_PARAMS; goto err_fput; } *ppvData = psSecureConnection->hSecureData; fput(secure_file); return PVRSRV_OK; err_fput: fput(secure_file); err_out: PVR_ASSERT(eError != PVRSRV_OK); return eError; }
/* * RTP muxer chaining code * Copyright (c) 2010 Martin Storsjo * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "avformat.h" #include "avio_internal.h" #include "rtpenc_chain.h" #include "avio_internal.h" #include "libavutil/opt.h" AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st, URLContext *handle, int packet_size) { AVFormatContext *rtpctx; int ret; AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL); if (!rtp_format) return NULL; /* Allocate an AVFormatContext for each output stream */ rtpctx = avformat_alloc_context(); if (!rtpctx) return NULL; rtpctx->oformat = rtp_format; if (!av_new_stream(rtpctx, 0)) { av_free(rtpctx); return NULL; } /* Copy the max delay setting; the rtp muxer reads this. */ rtpctx->max_delay = s->max_delay; /* Copy other stream parameters. */ rtpctx->streams[0]->sample_aspect_ratio = st->sample_aspect_ratio; rtpctx->flags |= s->flags & AVFMT_FLAG_MP4A_LATM; av_set_parameters(rtpctx, NULL); /* Copy the rtpflags values straight through */ if (s->oformat->priv_class && av_find_opt(s->priv_data, "rtpflags", NULL, 0, 0)) av_set_int(rtpctx->priv_data, "rtpflags", av_get_int(s->priv_data, "rtpflags", NULL)); /* Set the synchronized start time. */ rtpctx->start_time_realtime = s->start_time_realtime; avcodec_copy_context(rtpctx->streams[0]->codec, st->codec); if (handle) { ffio_fdopen(&rtpctx->pb, handle); } else ffio_open_dyn_packet_buf(&rtpctx->pb, packet_size); ret = avformat_write_header(rtpctx, NULL); if (ret) { if (handle) { avio_close(rtpctx->pb); } else { uint8_t *ptr; avio_close_dyn_buf(rtpctx->pb, &ptr); av_free(ptr); } avformat_free_context(rtpctx); return NULL; } return rtpctx; }
// 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_CHROMEOS_LOGIN_SCREENS_HID_DETECTION_MODEL_H_ #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_HID_DETECTION_MODEL_H_ #include "base/callback_forward.h" #include "chrome/browser/chromeos/login/screens/base_screen.h" namespace chromeos { class BaseScreenDelegate; class HIDDetectionView; class HIDDetectionModel : public BaseScreen { public: static const char kContextKeyKeyboardState[]; static const char kContextKeyMouseState[]; static const char kContextKeyNumKeysEnteredExpected[]; static const char kContextKeyNumKeysEnteredPinCode[]; static const char kContextKeyPinCode[]; static const char kContextKeyMouseDeviceName[]; static const char kContextKeyKeyboardDeviceName[]; static const char kContextKeyKeyboardLabel[]; static const char kContextKeyContinueButtonEnabled[]; explicit HIDDetectionModel(BaseScreenDelegate* base_screen_delegate); ~HIDDetectionModel() override; // BaseScreen implementation: std::string GetName() const override; // Called when continue button was clicked. virtual void OnContinueButtonClicked() = 0; // Checks if we should show the screen or enough devices already present. // Calls corresponding set of actions based on the bool result. virtual void CheckIsScreenRequired( const base::Callback<void(bool)>& on_check_done) = 0; // This method is called, when view is being destroyed. Note, if model // is destroyed earlier then it has to call Unbind(). virtual void OnViewDestroyed(HIDDetectionView* view) = 0; }; } // namespace chromeos #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_HID_DETECTION_MODEL_H_
/*- * See the file LICENSE for redistribution information. * * Copyright (c) 2001-2009 Oracle. All rights reserved. * * $Id$ */ #include "db_config.h" #include "db_int.h" /* * __os_id -- * Return the current process ID. * * PUBLIC: void __os_id __P((DB_ENV *, pid_t *, db_threadid_t*)); */ void __os_id(dbenv, pidp, tidp) DB_ENV *dbenv; pid_t *pidp; db_threadid_t *tidp; { /* * We can't depend on dbenv not being NULL, this routine is called * from places where there's no DB_ENV handle. * * We cache the pid in the ENV handle, getting the process ID is a * fairly slow call on lots of systems. */ if (pidp != NULL) { if (dbenv == NULL) { #if defined(HAVE_VXWORKS) *pidp = taskIdSelf(); #else *pidp = getpid(); #endif } else *pidp = dbenv->env->pid_cache; } if (tidp != NULL) { #if defined(DB_WIN32) *tidp = GetCurrentThreadId(); #elif defined(HAVE_MUTEX_UI_THREADS) *tidp = thr_self(); #elif defined(HAVE_PTHREAD_SELF) *tidp = pthread_self(); #else /* * Default to just getpid. */ *tidp = 0; #endif } }
#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_ergodox( KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_EQL, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_LCTL, KC_F4, KC_F5, KC_LGUI,KC_LALT, KC_C, KC_V, KC_PGUP, KC_BSPC, KC_BSPC, KC_DEL, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_Y, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_N , KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, KC_RGUI, KC_RALT, KC_A, KC_PGDN, KC_RCTL, KC_ENT, KC_SPC ), };
/**************************************************************************** * * Copyright (c) 2009 Broadcom Corporation * * Unless you and Broadcom execute a separate written software license * agreement governing use of this software, this software is licensed to you * under the terms of the GNU General Public License version 2, available * at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html (the "GPL"). * * Notwithstanding the above, under no circumstances may you combine this *software in any way with any other Broadcom software provided under a license * other than the GPL, without Broadcom's express prior written consent. * ****************************************************************************/ #ifndef __MQUEUE_H #define __MQUEUE_H struct tag_MsgQueueHandle_t; #define MAX_NM_LEN 64 typedef int (*MsgQueueThreadFn_t) (struct tag_MsgQueueHandle_t *mHandle, void *data); typedef struct tag_MsgQueueHandle_t { struct list_head mList; spinlock_t mLock; wait_queue_head_t mWaitQ; int mAvailData; struct task_struct *mThread; MsgQueueThreadFn_t mFn; int valid; char name[MAX_NM_LEN+1]; #if defined(CONFIG_HAS_WAKELOCK) && defined(MQUEUE_RPC_WAKELOCK) struct wake_lock mq_wake_lock; #endif } MsgQueueHandle_t; typedef struct { struct list_head mList; void *data; } MsgQueueElement_t; int MsgQueueInit(MsgQueueHandle_t *mHandle, MsgQueueThreadFn_t fn, char *name, unsigned int optionType, void *optionData, char* wk_name); int MsgQueueAdd(MsgQueueHandle_t *mHandle, void *data); int MsgQueueRemove(MsgQueueHandle_t *mHandle, void **outData); int MsgQueueDeInit(MsgQueueHandle_t *mhandle); int MsgQueueIsEmpty(MsgQueueHandle_t *mHandle); int MsgQueueDebugList(MsgQueueHandle_t *mHandle, RpcOutputContext_t *c); void *MsgQueueGet(MsgQueueHandle_t *mHandle); int MsgQueueCount(MsgQueueHandle_t *mHandle); #endif
/* * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef _ASM_ARC_ATOMIC_H #define _ASM_ARC_ATOMIC_H #ifdef __KERNEL__ #ifndef __ASSEMBLY__ #include <linux/types.h> #include <linux/compiler.h> #include <asm/cmpxchg.h> #include <asm/barrier.h> #include <asm/smp.h> #define atomic_read(v) ((v)->counter) #ifdef CONFIG_ARC_HAS_LLSC #define atomic_set(v, i) (((v)->counter) = (i)) static inline void atomic_add(int i, atomic_t *v) { unsigned int temp; __asm__ __volatile__( "1: llock %0, [%1] \n" " add %0, %0, %2 \n" " scond %0, [%1] \n" " bnz 1b \n" : "=&r"(temp) /* Early clobber, to prevent reg reuse */ : "r"(&v->counter), "ir"(i) : "cc"); } static inline void atomic_sub(int i, atomic_t *v) { unsigned int temp; __asm__ __volatile__( "1: llock %0, [%1] \n" " sub %0, %0, %2 \n" " scond %0, [%1] \n" " bnz 1b \n" : "=&r"(temp) : "r"(&v->counter), "ir"(i) : "cc"); } /* add and also return the new value */ static inline int atomic_add_return(int i, atomic_t *v) { unsigned int temp; __asm__ __volatile__( "1: llock %0, [%1] \n" " add %0, %0, %2 \n" " scond %0, [%1] \n" " bnz 1b \n" : "=&r"(temp) : "r"(&v->counter), "ir"(i) : "cc"); return temp; } static inline int atomic_sub_return(int i, atomic_t *v) { unsigned int temp; __asm__ __volatile__( "1: llock %0, [%1] \n" " sub %0, %0, %2 \n" " scond %0, [%1] \n" " bnz 1b \n" : "=&r"(temp) : "r"(&v->counter), "ir"(i) : "cc"); return temp; } static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) { unsigned int temp; __asm__ __volatile__( "1: llock %0, [%1] \n" " bic %0, %0, %2 \n" " scond %0, [%1] \n" " bnz 1b \n" : "=&r"(temp) : "r"(addr), "ir"(mask) : "cc"); } #else /* !CONFIG_ARC_HAS_LLSC */ #ifndef CONFIG_SMP /* violating atomic_xxx API locking protocol in UP for optimization sake */ #define atomic_set(v, i) (((v)->counter) = (i)) #else static inline void atomic_set(atomic_t *v, int i) { /* * Independent of hardware support, all of the atomic_xxx() APIs need * to follow the same locking rules to make sure that a "hardware" * atomic insn (e.g. LD) doesn't clobber an "emulated" atomic insn * sequence * * Thus atomic_set() despite being 1 insn (and seemingly atomic) * requires the locking. */ unsigned long flags; atomic_ops_lock(flags); v->counter = i; atomic_ops_unlock(flags); } #endif /* * Non hardware assisted Atomic-R-M-W * Locking would change to irq-disabling only (UP) and spinlocks (SMP) */ static inline void atomic_add(int i, atomic_t *v) { unsigned long flags; atomic_ops_lock(flags); v->counter += i; atomic_ops_unlock(flags); } static inline void atomic_sub(int i, atomic_t *v) { unsigned long flags; atomic_ops_lock(flags); v->counter -= i; atomic_ops_unlock(flags); } static inline int atomic_add_return(int i, atomic_t *v) { unsigned long flags; unsigned long temp; atomic_ops_lock(flags); temp = v->counter; temp += i; v->counter = temp; atomic_ops_unlock(flags); return temp; } static inline int atomic_sub_return(int i, atomic_t *v) { unsigned long flags; unsigned long temp; atomic_ops_lock(flags); temp = v->counter; temp -= i; v->counter = temp; atomic_ops_unlock(flags); return temp; } static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) { unsigned long flags; atomic_ops_lock(flags); *addr &= ~mask; atomic_ops_unlock(flags); } #endif /* !CONFIG_ARC_HAS_LLSC */ #define smp_mb__before_atomic_dec() barrier() #define smp_mb__after_atomic_dec() barrier() #define smp_mb__before_atomic_inc() barrier() #define smp_mb__after_atomic_inc() barrier() /** * __atomic_add_unless - add unless the number is a given value * @v: pointer of type atomic_t * @a: the amount to add to v... * @u: ...unless v is equal to u. * * Atomically adds @a to @v, so long as it was not @u. * Returns the old value of @v */ #define __atomic_add_unless(v, a, u) \ ({ \ int c, old; \ c = atomic_read(v); \ while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c)\ c = old; \ c; \ }) #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) #define atomic_inc(v) atomic_add(1, v) #define atomic_dec(v) atomic_sub(1, v) #define atomic_inc_and_test(v) (atomic_add_return(1, v) == 0) #define atomic_dec_and_test(v) (atomic_sub_return(1, v) == 0) #define atomic_inc_return(v) atomic_add_return(1, (v)) #define atomic_dec_return(v) atomic_sub_return(1, (v)) #define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0) #define atomic_add_negative(i, v) (atomic_add_return(i, v) < 0) #define ATOMIC_INIT(i) { (i) } #include <asm-generic/atomic64.h> #endif #endif #endif
/* * Copyright 2012 Red Hat Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Authors: Ben Skeggs */ #include "nv04.h" static inline int nv44_graph_class(struct nv04_instmem_priv *priv) { if ((nv_device(priv)->chipset & 0xf0) == 0x60) return 1; return !(0x0baf & (1 << (nv_device(priv)->chipset & 0x0f))); } static int nv40_instmem_ctor(struct nouveau_object *parent, struct nouveau_object *engine, struct nouveau_oclass *oclass, void *data, u32 size, struct nouveau_object **pobject) { struct nouveau_device *device = nv_device(parent); struct pci_dev *pdev = device->pdev; struct nv04_instmem_priv *priv; int ret, bar, vs; ret = nouveau_instmem_create(parent, engine, oclass, &priv); *pobject = nv_object(priv); if (ret) return ret; /* map bar */ if (pci_resource_len(pdev, 2)) bar = 2; else bar = 3; priv->iomem = ioremap(pci_resource_start(pdev, bar), pci_resource_len(pdev, bar)); if (!priv->iomem) { nv_error(priv, "unable to map PRAMIN BAR\n"); return -EFAULT; } /* PRAMIN aperture maps over the end of vram, reserve enough space * to fit graphics contexts for every channel, the magics come * from engine/graph/nv40.c */ vs = hweight8((nv_rd32(priv, 0x001540) & 0x0000ff00) >> 8); if (device->chipset == 0x40) priv->base.reserved = 0x6aa0 * vs; else if (device->chipset < 0x43) priv->base.reserved = 0x4f00 * vs; else if (nv44_graph_class(priv)) priv->base.reserved = 0x4980 * vs; else priv->base.reserved = 0x4a40 * vs; priv->base.reserved += 16 * 1024; priv->base.reserved *= 32; /* per-channel */ priv->base.reserved += 512 * 1024; /* pci(e)gart table */ priv->base.reserved += 512 * 1024; /* object storage */ priv->base.reserved = round_up(priv->base.reserved, 4096); priv->base.alloc = nv04_instmem_alloc; ret = nouveau_mm_init(&priv->heap, 0, priv->base.reserved, 1); if (ret) return ret; /* 0x00000-0x10000: reserve for probable vbios image */ ret = nouveau_gpuobj_new(parent, NULL, 0x10000, 0, 0, &priv->vbios); if (ret) return ret; /* 0x10000-0x18000: reserve for RAMHT */ ret = nouveau_ramht_new(parent, NULL, 0x08000, 0, &priv->ramht); if (ret) return ret; /* 0x18000-0x18200: reserve for RAMRO * 0x18200-0x20000: padding */ ret = nouveau_gpuobj_new(parent, NULL, 0x08000, 0, 0, &priv->ramro); if (ret) return ret; /* 0x20000-0x21000: reserve for RAMFC * 0x21000-0x40000: padding and some unknown crap */ ret = nouveau_gpuobj_new(parent, NULL, 0x20000, 0, NVOBJ_FLAG_ZERO_ALLOC, &priv->ramfc); if (ret) return ret; priv->created = true; return 0; } static u32 nv40_instmem_rd32(struct nouveau_object *object, u32 addr) { struct nv04_instmem_priv *priv = (void *)object; return ioread32_native(priv->iomem + addr); } static void nv40_instmem_wr32(struct nouveau_object *object, u32 addr, u32 data) { struct nv04_instmem_priv *priv = (void *)object; iowrite32_native(data, priv->iomem + addr); } struct nouveau_oclass nv40_instmem_oclass = { .handle = NV_SUBDEV(INSTMEM, 0x40), .ofuncs = &(struct nouveau_ofuncs) { .ctor = nv40_instmem_ctor, .dtor = nv04_instmem_dtor, .init = _nouveau_instmem_init, .fini = _nouveau_instmem_fini, .rd32 = nv40_instmem_rd32, .wr32 = nv40_instmem_wr32, }, };
/* * Backlight Driver for Dialog DA9052 PMICs * * Copyright(c) 2012 Dialog Semiconductor Ltd. * * Author: David Dajun Chen <dchen@diasemi.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. * */ #include <linux/backlight.h> #include <linux/delay.h> #include <linux/fb.h> #include <linux/module.h> #include <linux/platform_device.h> #include <linux/mfd/da9052/da9052.h> #include <linux/mfd/da9052/reg.h> #define DA9052_MAX_BRIGHTNESS 0xFF enum { DA9052_WLEDS_OFF, DA9052_WLEDS_ON, }; enum { DA9052_TYPE_WLED1, DA9052_TYPE_WLED2, DA9052_TYPE_WLED3, }; static unsigned char wled_bank[] = { DA9052_LED1_CONF_REG, DA9052_LED2_CONF_REG, DA9052_LED3_CONF_REG, }; struct da9052_bl { struct da9052 *da9052; uint brightness; uint state; uint led_reg; }; static int da9052_adjust_wled_brightness(struct da9052_bl *wleds) { unsigned char boost_en; unsigned char i_sink; int ret; boost_en = 0x3F; i_sink = 0xFF; if (wleds->state == DA9052_WLEDS_OFF) { boost_en = 0x00; i_sink = 0x00; } ret = da9052_reg_write(wleds->da9052, DA9052_BOOST_REG, boost_en); if (ret < 0) return ret; ret = da9052_reg_write(wleds->da9052, DA9052_LED_CONT_REG, i_sink); if (ret < 0) return ret; ret = da9052_reg_write(wleds->da9052, wled_bank[wleds->led_reg], 0x0); if (ret < 0) return ret; usleep_range(10000, 11000); if (wleds->brightness) { ret = da9052_reg_write(wleds->da9052, wled_bank[wleds->led_reg], wleds->brightness); if (ret < 0) return ret; } return 0; } static int da9052_backlight_update_status(struct backlight_device *bl) { int brightness = bl->props.brightness; struct da9052_bl *wleds = bl_get_data(bl); wleds->brightness = brightness; wleds->state = DA9052_WLEDS_ON; return da9052_adjust_wled_brightness(wleds); } static int da9052_backlight_get_brightness(struct backlight_device *bl) { struct da9052_bl *wleds = bl_get_data(bl); return wleds->brightness; } static const struct backlight_ops da9052_backlight_ops = { .update_status = da9052_backlight_update_status, .get_brightness = da9052_backlight_get_brightness, }; static int da9052_backlight_probe(struct platform_device *pdev) { struct backlight_device *bl; struct backlight_properties props; struct da9052_bl *wleds; wleds = devm_kzalloc(&pdev->dev, sizeof(struct da9052_bl), GFP_KERNEL); if (!wleds) return -ENOMEM; wleds->da9052 = dev_get_drvdata(pdev->dev.parent); wleds->brightness = 0; wleds->led_reg = platform_get_device_id(pdev)->driver_data; wleds->state = DA9052_WLEDS_OFF; props.type = BACKLIGHT_RAW; props.max_brightness = DA9052_MAX_BRIGHTNESS; bl = backlight_device_register(pdev->name, wleds->da9052->dev, wleds, &da9052_backlight_ops, &props); if (IS_ERR(bl)) { dev_err(&pdev->dev, "Failed to register backlight\n"); return PTR_ERR(bl); } bl->props.max_brightness = DA9052_MAX_BRIGHTNESS; bl->props.brightness = 0; platform_set_drvdata(pdev, bl); return da9052_adjust_wled_brightness(wleds); } static int da9052_backlight_remove(struct platform_device *pdev) { struct backlight_device *bl = platform_get_drvdata(pdev); struct da9052_bl *wleds = bl_get_data(bl); wleds->brightness = 0; wleds->state = DA9052_WLEDS_OFF; da9052_adjust_wled_brightness(wleds); backlight_device_unregister(bl); return 0; } static struct platform_device_id da9052_wled_ids[] = { { .name = "da9052-wled1", .driver_data = DA9052_TYPE_WLED1, }, { .name = "da9052-wled2", .driver_data = DA9052_TYPE_WLED2, }, { .name = "da9052-wled3", .driver_data = DA9052_TYPE_WLED3, }, }; static struct platform_driver da9052_wled_driver = { .probe = da9052_backlight_probe, .remove = da9052_backlight_remove, .id_table = da9052_wled_ids, .driver = { .name = "da9052-wled", .owner = THIS_MODULE, }, }; module_platform_driver(da9052_wled_driver); MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>"); MODULE_DESCRIPTION("Backlight driver for DA9052 PMIC"); MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:da9052-backlight");
// // Licensed under the terms in License.txt // // Copyright 2010 Allen Ding. All rights reserved. // #import "KiwiConfiguration.h" @protocol KWInvocationCapturerDelegate; @interface KWInvocationCapturer : NSProxy { @private id delegate; NSDictionary *userInfo; } #pragma mark - #pragma mark Initializing - (id)initWithDelegate:(id)aDelegate; - (id)initWithDelegate:(id)aDelegate userInfo:(NSDictionary *)aUserInfo; + (id)invocationCapturerWithDelegate:(id)aDelegate; + (id)invocationCapturerWithDelegate:(id)aDelegate userInfo:(NSDictionary *)aUserInfo; #pragma mark - #pragma mark Properties @property (nonatomic, readonly) id delegate; @property (nonatomic, readonly) NSDictionary *userInfo; @end @protocol KWInvocationCapturerDelegate #pragma mark - #pragma mark Capturing Invocations - (NSMethodSignature *)invocationCapturer:(KWInvocationCapturer *)anInvocationCapturer methodSignatureForSelector:(SEL)aSelector; - (void)invocationCapturer:(KWInvocationCapturer *)anInvocationCapturer didCaptureInvocation:(NSInvocation *)anInvocation; @end
/* * Copyright (C) 2009 Apple Inc. All rights reserved. * Copyright (C) 2009 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: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef Float32Array_h #define Float32Array_h #include "TypedArrayBase.h" #include <wtf/MathExtras.h> namespace WebCore { class Float32Array : public TypedArrayBase<float> { public: static PassRefPtr<Float32Array> create(unsigned length); static PassRefPtr<Float32Array> create(const float* array, unsigned length); static PassRefPtr<Float32Array> create(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset, unsigned length); // Can’t use "using" here due to a bug in the RVCT compiler. void set(TypedArrayBase<float>* array, unsigned offset, ExceptionCode& ec) { return TypedArrayBase<float>::set(array, offset, ec); } void set(unsigned index, double value) { if (index >= TypedArrayBase<float>::m_length) return; TypedArrayBase<float>::data()[index] = static_cast<float>(value); } // Invoked by the indexed getter. Does not perform range checks; caller // is responsible for doing so and returning undefined as necessary. float item(unsigned index) const { ASSERT(index < TypedArrayBase<float>::m_length); float result = TypedArrayBase<float>::data()[index]; return result; } PassRefPtr<Float32Array> subarray(int start) const; PassRefPtr<Float32Array> subarray(int start, int end) const; private: Float32Array(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset, unsigned length); // Make constructor visible to superclass. friend class TypedArrayBase<float>; // Overridden from ArrayBufferView. virtual bool isFloatArray() const { return true; } }; } // namespace WebCore #endif // Float32Array_h
/* linux/arch/arm/mach-exynos/init.c * * Copyright (c) 2010 Samsung Electronics Co., Ltd. * http://www.samsung.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/serial_core.h> #include <plat/cpu.h> #include <plat/devs.h> #include <plat/regs-serial.h> static struct s3c24xx_uart_clksrc exynos_serial_clocks[] = { [0] = { .name = "uclk1", .divisor = 1, .min_baud = 0, .max_baud = 0, }, }; /* uart registration process */ void __init exynos_common_init_uarts(struct s3c2410_uartcfg *cfg, int no) { struct s3c2410_uartcfg *tcfg = cfg; u32 ucnt; for (ucnt = 0; ucnt < no; ucnt++, tcfg++) { if (!tcfg->clocks) { tcfg->has_fracval = 1; tcfg->clocks = exynos_serial_clocks; tcfg->clocks_size = ARRAY_SIZE(exynos_serial_clocks); } tcfg->flags |= NO_NEED_CHECK_CLKSRC; } s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no); }
/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef USE_PRAGMA_INTERFACE #pragma interface /* gcc class implementation */ #endif #include "thr_lock.h" /* THR_LOCK */ #include "handler.h" /* handler */ #include "table.h" /* TABLE_SHARE */ /* Shared structure for correct LOCK operation */ struct st_blackhole_share { THR_LOCK lock; uint use_count; uint table_name_length; char table_name[1]; }; /* Class definition for the blackhole storage engine "Dumbest named feature ever" */ class ha_blackhole: public handler { THR_LOCK_DATA lock; /* MySQL lock */ st_blackhole_share *share; public: ha_blackhole(handlerton *hton, TABLE_SHARE *table_arg); ~ha_blackhole() { } /* The name of the index type that will be used for display don't implement this method unless you really have indexes */ const char *index_type(uint key_number); ulonglong table_flags() const { return(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER | HA_BINLOG_STMT_CAPABLE | HA_BINLOG_ROW_CAPABLE | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY | HA_FILE_BASED | HA_CAN_GEOMETRY | HA_CAN_INSERT_DELAYED); } ulong index_flags(uint inx, uint part, bool all_parts) const { return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ? 0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | HA_READ_ORDER | HA_KEYREAD_ONLY); } /* The following defines can be increased if necessary */ #define BLACKHOLE_MAX_KEY 64 /* Max allowed keys */ #define BLACKHOLE_MAX_KEY_SEG 16 /* Max segments for key */ #define BLACKHOLE_MAX_KEY_LENGTH 1000 uint max_supported_keys() const { return BLACKHOLE_MAX_KEY; } uint max_supported_key_length() const { return BLACKHOLE_MAX_KEY_LENGTH; } uint max_supported_key_part_length() const { return BLACKHOLE_MAX_KEY_LENGTH; } int open(const char *name, int mode, uint test_if_locked); int close(void); int truncate(); int rnd_init(bool scan); int rnd_next(uchar *buf); int rnd_pos(uchar * buf, uchar *pos); int index_read_map(uchar * buf, const uchar * key, key_part_map keypart_map, enum ha_rkey_function find_flag); int index_read_idx_map(uchar * buf, uint idx, const uchar * key, key_part_map keypart_map, enum ha_rkey_function find_flag); int index_read_last_map(uchar * buf, const uchar * key, key_part_map keypart_map); int index_next(uchar * buf); int index_prev(uchar * buf); int index_first(uchar * buf); int index_last(uchar * buf); void position(const uchar *record); int info(uint flag); int external_lock(THD *thd, int lock_type); int create(const char *name, TABLE *table_arg, HA_CREATE_INFO *create_info); THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type); private: virtual int write_row(uchar *buf); virtual int update_row(const uchar *old_data, uchar *new_data); virtual int delete_row(const uchar *buf); };
#ifndef __LINUX_UMH_H__ #define __LINUX_UMH_H__ #include <linux/gfp.h> #include <linux/stddef.h> #include <linux/errno.h> #include <linux/compiler.h> #include <linux/workqueue.h> #include <linux/sysctl.h> struct cred; struct file; #define UMH_NO_WAIT 0 /* don't wait at all */ #define UMH_WAIT_EXEC 1 /* wait for the exec, but not the process */ #define UMH_WAIT_PROC 2 /* wait for the process to complete */ #define UMH_KILLABLE 4 /* wait for EXEC/PROC killable */ struct subprocess_info { struct work_struct work; struct completion *complete; const char *path; char **argv; char **envp; struct file *file; int wait; int retval; pid_t pid; int (*init)(struct subprocess_info *info, struct cred *new); void (*cleanup)(struct subprocess_info *info); void *data; } __randomize_layout; extern int call_usermodehelper(const char *path, char **argv, char **envp, int wait); extern struct subprocess_info * call_usermodehelper_setup(const char *path, char **argv, char **envp, gfp_t gfp_mask, int (*init)(struct subprocess_info *info, struct cred *new), void (*cleanup)(struct subprocess_info *), void *data); struct subprocess_info *call_usermodehelper_setup_file(struct file *file, int (*init)(struct subprocess_info *info, struct cred *new), void (*cleanup)(struct subprocess_info *), void *data); struct umh_info { struct file *pipe_to_umh; struct file *pipe_from_umh; pid_t pid; }; int fork_usermode_blob(void *data, size_t len, struct umh_info *info); extern int call_usermodehelper_exec(struct subprocess_info *info, int wait); extern struct ctl_table usermodehelper_table[]; enum umh_disable_depth { UMH_ENABLED = 0, UMH_FREEZING, UMH_DISABLED, }; extern int __usermodehelper_disable(enum umh_disable_depth depth); extern void __usermodehelper_set_disable_depth(enum umh_disable_depth depth); static inline int usermodehelper_disable(void) { return __usermodehelper_disable(UMH_DISABLED); } static inline void usermodehelper_enable(void) { __usermodehelper_set_disable_depth(UMH_ENABLED); } extern int usermodehelper_read_trylock(void); extern long usermodehelper_read_lock_wait(long timeout); extern void usermodehelper_read_unlock(void); #endif /* __LINUX_UMH_H__ */
/* * cocos2d for iPhone: http://www.cocos2d-iphone.org * * Copyright (c) 2013 Apportable Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #import "cocos2d.h" #import "CCControl.h" #ifdef __CC_PLATFORM_IOS /** The CCTextField is used for editing text by encapsulating a native text field (NSTextField on Mac and UITextField on iOS). An action callback will be sent when the text finishes editing or if the return key is pressed. @warning The native text field is only translated, no other transformations are applied. The text field may not be displayed correctly if rotated or scaled. */ @interface CCTextField : CCControl <UITextFieldDelegate> #elif defined(__CC_PLATFORM_MAC) @interface CCTextField : CCControl <NSTextFieldDelegate> #endif { CCSprite9Slice* _background; CGFloat _scaleMultiplier; #ifdef __CC_PLATFORM_IOS BOOL _keyboardIsShown; float _keyboardHeight; #endif } /** * Creates a new text field with the specified sprite frame used as its background. * * @param frame Sprite frame to use as the text fields background. * * @return Returns a new text field. */ + (id) textFieldWithSpriteFrame:(CCSpriteFrame*)frame; /** * Initializes a text field with the specified sprite frame used as its background. * * @param frame Sprite frame to use as the text fields background. * * @return Returns a new text field. */ - (id) initWithSpriteFrame:(CCSpriteFrame*)frame; #ifdef __CC_PLATFORM_IOS /** iOS: UITextField used by the CCTextField. */ @property (nonatomic,readonly) UITextField* textField; #elif defined(__CC_PLATFORM_MAC) /** Mac: NSTextField used by the CCTextField. */ @property (nonatomic,readonly) NSTextField* textField; #endif /** The sprite frame used to render the text field's background. */ @property (nonatomic,strong) CCSpriteFrame* backgroundSpriteFrame; /** The font size of the text field, defined in the unit specified by the heightUnit component of the contentSizeType. */ @property (nonatomic,assign) float fontSize; /* The font size of the text field in points. */ @property (nonatomic,readonly) float fontSizeInPoints; /** Padding from the edge of the text field's background to the native text field component. */ @property (nonatomic,assign) float padding; /** The text displayed by the text field. */ @property (nonatomic,strong) NSString* string; @end
/* SPDX-License-Identifier: GPL-2.0-only */ /* * OV9650/OV9652 camera sensors driver * * Copyright (C) 2013 Sylwester Nawrocki <sylvester.nawrocki@gmail.com> */ #ifndef OV9650_H_ #define OV9650_H_ /** * struct ov9650_platform_data - ov9650 driver platform data * @mclk_frequency: the sensor's master clock frequency in Hz * @gpio_pwdn: number of a GPIO connected to OV965X PWDN pin * @gpio_reset: number of a GPIO connected to OV965X RESET pin * * If any of @gpio_pwdn or @gpio_reset are unused then they should be * set to a negative value. @mclk_frequency must always be specified. */ struct ov9650_platform_data { unsigned long mclk_frequency; int gpio_pwdn; int gpio_reset; }; #endif /* OV9650_H_ */
/* * Copyright (C) 2008-2009 Texas Instruments 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 */ #ifndef _VPFE_CAPTURE_H #define _VPFE_CAPTURE_H #ifdef __KERNEL__ /* Header files */ #include <media/v4l2-dev.h> #include <linux/videodev2.h> #include <linux/clk.h> #include <linux/i2c.h> #include <media/v4l2-fh.h> #include <media/v4l2-ioctl.h> #include <media/v4l2-device.h> #include <media/videobuf-dma-contig.h> #include <media/davinci/vpfe_types.h> #define VPFE_CAPTURE_NUM_DECODERS 5 /* Macros */ #define VPFE_MAJOR_RELEASE 0 #define VPFE_MINOR_RELEASE 0 #define VPFE_BUILD 1 #define VPFE_CAPTURE_VERSION_CODE ((VPFE_MAJOR_RELEASE << 16) | \ (VPFE_MINOR_RELEASE << 8) | \ VPFE_BUILD) #define CAPTURE_DRV_NAME "vpfe-capture" struct vpfe_pixel_format { struct v4l2_fmtdesc fmtdesc; /* bytes per pixel */ int bpp; }; struct vpfe_std_info { int active_pixels; int active_lines; /* current frame format */ int frame_format; }; struct vpfe_route { u32 input; u32 output; }; struct vpfe_subdev_info { /* Sub device name */ char name[32]; /* Sub device group id */ int grp_id; /* Number of inputs supported */ int num_inputs; /* inputs available at the sub device */ struct v4l2_input *inputs; /* Sub dev routing information for each input */ struct vpfe_route *routes; /* check if sub dev supports routing */ int can_route; /* ccdc bus/interface configuration */ struct vpfe_hw_if_param ccdc_if_params; /* i2c subdevice board info */ struct i2c_board_info board_info; }; struct vpfe_config { /* Number of sub devices connected to vpfe */ int num_subdevs; /* i2c bus adapter no */ int i2c_adapter_id; /* information about each subdev */ struct vpfe_subdev_info *sub_devs; /* evm card info */ char *card_name; /* ccdc name */ char *ccdc; /* vpfe clock */ struct clk *vpssclk; struct clk *slaveclk; /* Function for Clearing the interrupt */ void (*clr_intr)(int vdint); }; struct vpfe_device { /* V4l2 specific parameters */ /* Identifies video device for this channel */ struct video_device video_dev; /* sub devices */ struct v4l2_subdev **sd; /* vpfe cfg */ struct vpfe_config *cfg; /* V4l2 device */ struct v4l2_device v4l2_dev; /* parent device */ struct device *pdev; /* number of open instances of the channel */ u32 usrs; /* Indicates id of the field which is being displayed */ u32 field_id; /* flag to indicate whether decoder is initialized */ u8 initialized; /* current interface type */ struct vpfe_hw_if_param vpfe_if_params; /* ptr to currently selected sub device */ struct vpfe_subdev_info *current_subdev; /* current input at the sub device */ int current_input; /* Keeps track of the information about the standard */ struct vpfe_std_info std_info; /* std index into std table */ int std_index; /* CCDC IRQs used when CCDC/ISIF output to SDRAM */ unsigned int ccdc_irq0; unsigned int ccdc_irq1; /* number of buffers in fbuffers */ u32 numbuffers; /* List of buffer pointers for storing frames */ u8 *fbuffers[VIDEO_MAX_FRAME]; /* Pointer pointing to current v4l2_buffer */ struct videobuf_buffer *cur_frm; /* Pointer pointing to next v4l2_buffer */ struct videobuf_buffer *next_frm; /* * This field keeps track of type of buffer exchange mechanism * user has selected */ enum v4l2_memory memory; /* Used to store pixel format */ struct v4l2_format fmt; /* * used when IMP is chained to store the crop window which * is different from the image window */ struct v4l2_rect crop; /* Buffer queue used in video-buf */ struct videobuf_queue buffer_queue; /* Queue of filled frames */ struct list_head dma_queue; /* Used in video-buf */ spinlock_t irqlock; /* IRQ lock for DMA queue */ spinlock_t dma_queue_lock; /* lock used to access this structure */ struct mutex lock; /* number of users performing IO */ u32 io_usrs; /* Indicates whether streaming started */ u8 started; /* * offset where second field starts from the starting of the * buffer for field separated YCbCr formats */ u32 field_off; }; /* File handle structure */ struct vpfe_fh { struct v4l2_fh fh; struct vpfe_device *vpfe_dev; /* Indicates whether this file handle is doing IO */ u8 io_allowed; }; struct vpfe_config_params { u8 min_numbuffers; u8 numbuffers; u32 min_bufsize; u32 device_bufsize; }; #endif /* End of __KERNEL__ */ /** * VPFE_CMD_S_CCDC_RAW_PARAMS - EXPERIMENTAL IOCTL to set raw capture params * This can be used to configure modules such as defect pixel correction, * color space conversion, culling etc. This is an experimental ioctl that * will change in future kernels. So use this ioctl with care ! * TODO: This is to be split into multiple ioctls and also explore the * possibility of extending the v4l2 api to include this **/ #define VPFE_CMD_S_CCDC_RAW_PARAMS _IOW('V', BASE_VIDIOC_PRIVATE + 1, \ void *) #endif /* _DAVINCI_VPFE_H */
/* * Hauppauge HD PVR USB driver - video 4 linux 2 interface * * Copyright (C) 2008 Janne Grunau (j@jannau.net) * * 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. * */ #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/usb.h> #include <linux/mutex.h> #include <linux/videodev2.h> #include <media/v4l2-common.h> #include "hdpvr.h" int hdpvr_config_call(struct hdpvr_device *dev, uint value, u8 valbuf) { int ret; char request_type = 0x38, snd_request = 0x01; mutex_lock(&dev->usbc_mutex); dev->usbc_buf[0] = valbuf; ret = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), snd_request, 0x00 | request_type, value, CTRL_DEFAULT_INDEX, dev->usbc_buf, 1, 10000); mutex_unlock(&dev->usbc_mutex); v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev, "config call request for value 0x%x returned %d\n", value, ret); return ret < 0 ? ret : 0; } struct hdpvr_video_info *get_video_info(struct hdpvr_device *dev) { struct hdpvr_video_info *vidinf = NULL; #ifdef HDPVR_DEBUG char print_buf[15]; #endif int ret; vidinf = kzalloc(sizeof(struct hdpvr_video_info), GFP_KERNEL); if (!vidinf) { v4l2_err(&dev->v4l2_dev, "out of memory\n"); goto err; } mutex_lock(&dev->usbc_mutex); ret = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0), 0x81, 0x80 | 0x38, 0x1400, 0x0003, dev->usbc_buf, 5, 1000); if (ret == 5) { vidinf->width = dev->usbc_buf[1] << 8 | dev->usbc_buf[0]; vidinf->height = dev->usbc_buf[3] << 8 | dev->usbc_buf[2]; vidinf->fps = dev->usbc_buf[4]; } #ifdef HDPVR_DEBUG if (hdpvr_debug & MSG_INFO) { hex_dump_to_buffer(dev->usbc_buf, 5, 16, 1, print_buf, sizeof(print_buf), 0); v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev, "get video info returned: %d, %s\n", ret, print_buf); } #endif mutex_unlock(&dev->usbc_mutex); if (!vidinf->width || !vidinf->height || !vidinf->fps) { kfree(vidinf); vidinf = NULL; } err: return vidinf; } int get_input_lines_info(struct hdpvr_device *dev) { #ifdef HDPVR_DEBUG char print_buf[9]; #endif int ret, lines; mutex_lock(&dev->usbc_mutex); ret = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0), 0x81, 0x80 | 0x38, 0x1800, 0x0003, dev->usbc_buf, 3, 1000); #ifdef HDPVR_DEBUG if (hdpvr_debug & MSG_INFO) { hex_dump_to_buffer(dev->usbc_buf, 3, 16, 1, print_buf, sizeof(print_buf), 0); v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev, "get input lines info returned: %d, %s\n", ret, print_buf); } #endif lines = dev->usbc_buf[1] << 8 | dev->usbc_buf[0]; mutex_unlock(&dev->usbc_mutex); return lines; } int hdpvr_set_bitrate(struct hdpvr_device *dev) { int ret; mutex_lock(&dev->usbc_mutex); memset(dev->usbc_buf, 0, 4); dev->usbc_buf[0] = dev->options.bitrate; dev->usbc_buf[2] = dev->options.peak_bitrate; ret = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), 0x01, 0x38, CTRL_BITRATE_VALUE, CTRL_DEFAULT_INDEX, dev->usbc_buf, 4, 1000); mutex_unlock(&dev->usbc_mutex); return ret; } int hdpvr_set_audio(struct hdpvr_device *dev, u8 input, enum v4l2_mpeg_audio_encoding codec) { int ret = 0; if (dev->flags & HDPVR_FLAG_AC3_CAP) { mutex_lock(&dev->usbc_mutex); memset(dev->usbc_buf, 0, 2); dev->usbc_buf[0] = input; if (codec == V4L2_MPEG_AUDIO_ENCODING_AAC) dev->usbc_buf[1] = 0; else if (codec == V4L2_MPEG_AUDIO_ENCODING_AC3) dev->usbc_buf[1] = 1; else { mutex_unlock(&dev->usbc_mutex); v4l2_err(&dev->v4l2_dev, "invalid audio codec %d\n", codec); ret = -EINVAL; goto error; } ret = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), 0x01, 0x38, CTRL_AUDIO_INPUT_VALUE, CTRL_DEFAULT_INDEX, dev->usbc_buf, 2, 1000); mutex_unlock(&dev->usbc_mutex); if (ret == 2) ret = 0; } else ret = hdpvr_config_call(dev, CTRL_AUDIO_INPUT_VALUE, input); error: return ret; } int hdpvr_set_options(struct hdpvr_device *dev) { hdpvr_config_call(dev, CTRL_VIDEO_STD_TYPE, dev->options.video_std); hdpvr_config_call(dev, CTRL_VIDEO_INPUT_VALUE, dev->options.video_input+1); hdpvr_set_audio(dev, dev->options.audio_input+1, dev->options.audio_codec); hdpvr_set_bitrate(dev); hdpvr_config_call(dev, CTRL_BITRATE_MODE_VALUE, dev->options.bitrate_mode); hdpvr_config_call(dev, CTRL_GOP_MODE_VALUE, dev->options.gop_mode); hdpvr_config_call(dev, CTRL_BRIGHTNESS, dev->options.brightness); hdpvr_config_call(dev, CTRL_CONTRAST, dev->options.contrast); hdpvr_config_call(dev, CTRL_HUE, dev->options.hue); hdpvr_config_call(dev, CTRL_SATURATION, dev->options.saturation); hdpvr_config_call(dev, CTRL_SHARPNESS, dev->options.sharpness); return 0; }
#include "nameparse.h" int nameparse(unsigned char *s,const char *x) { long long pos; long long j; if (!x) return 0; for (pos = 0;pos < 256;++pos) s[pos] = 0; pos = 0; while (*x) { if (*x == '.') { ++x; continue; } for (j = 0;x[j];++j) if (x[j] == '.') break; if (j > 63) return 0; if (pos < 0 || pos >= 256) return 0; s[pos++] = j; while (j > 0) { if (pos < 0 || pos >= 256) return 0; s[pos++] = *x++; --j; } } if (pos < 0 || pos >= 256) return 0; s[pos++] = 0; return 1; }
/* SPDX-License-Identifier: GPL-2.0-only */ /* * Based on arch/arm/include/asm/tlb.h * * Copyright (C) 2002 Russell King * Copyright (C) 2012 ARM Ltd. */ #ifndef __ASM_TLB_H #define __ASM_TLB_H #include <linux/pagemap.h> #include <linux/swap.h> static inline void __tlb_remove_table(void *_table) { free_page_and_swap_cache((struct page *)_table); } #define tlb_flush tlb_flush static void tlb_flush(struct mmu_gather *tlb); #include <asm-generic/tlb.h> /* * get the tlbi levels in arm64. Default value is 0 if more than one * of cleared_* is set or neither is set. * Arm64 doesn't support p4ds now. */ static inline int tlb_get_level(struct mmu_gather *tlb) { /* The TTL field is only valid for the leaf entry. */ if (tlb->freed_tables) return 0; if (tlb->cleared_ptes && !(tlb->cleared_pmds || tlb->cleared_puds || tlb->cleared_p4ds)) return 3; if (tlb->cleared_pmds && !(tlb->cleared_ptes || tlb->cleared_puds || tlb->cleared_p4ds)) return 2; if (tlb->cleared_puds && !(tlb->cleared_ptes || tlb->cleared_pmds || tlb->cleared_p4ds)) return 1; return 0; } static inline void tlb_flush(struct mmu_gather *tlb) { struct vm_area_struct vma = TLB_FLUSH_VMA(tlb->mm, 0); bool last_level = !tlb->freed_tables; unsigned long stride = tlb_get_unmap_size(tlb); int tlb_level = tlb_get_level(tlb); /* * If we're tearing down the address space then we only care about * invalidating the walk-cache, since the ASID allocator won't * reallocate our ASID without invalidating the entire TLB. */ if (tlb->fullmm) { if (!last_level) flush_tlb_mm(tlb->mm); return; } __flush_tlb_range(&vma, tlb->start, tlb->end, stride, last_level, tlb_level); } static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte, unsigned long addr) { pgtable_pte_page_dtor(pte); tlb_remove_table(tlb, pte); } #if CONFIG_PGTABLE_LEVELS > 2 static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmdp, unsigned long addr) { struct page *page = virt_to_page(pmdp); pgtable_pmd_page_dtor(page); tlb_remove_table(tlb, page); } #endif #if CONFIG_PGTABLE_LEVELS > 3 static inline void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pudp, unsigned long addr) { tlb_remove_table(tlb, virt_to_page(pudp)); } #endif #endif
/* SPDX-License-Identifier: GPL-2.0-only */ /************************************************************************** * Copyright (c) 2007-2011, Intel Corporation. * All Rights Reserved. * Copyright (c) 2008, Tungsten Graphics Inc. Cedar Park, TX., USA. * All Rights Reserved. * **************************************************************************/ #ifndef _GMA_DRM_H_ #define _GMA_DRM_H_ #endif
// 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 COMPONENTS_WALLPAPER_EXPORT_H_ #define COMPONENTS_WALLPAPER_EXPORT_H_ // Defines WALLPAPER_EXPORT so that functionality implemented by the wallpaper // module can be exported to consumers. #if defined(COMPONENT_BUILD) #if defined(WIN32) #if defined(WALLPAPER_IMPLEMENTATION) #define WALLPAPER_EXPORT __declspec(dllexport) #else #define WALLPAPER_EXPORT __declspec(dllimport) #endif // defined(WALLPAPER_IMPLEMENTATION) #else // defined(WIN32) #if defined(WALLPAPER_IMPLEMENTATION) #define WALLPAPER_EXPORT __attribute__((visibility("default"))) #else #define WALLPAPER_EXPORT #endif #endif #else // defined(COMPONENT_BUILD) #define WALLPAPER_EXPORT #endif #endif // COMPONENTS_WALLPAPER_EXPORT_H_
#include <linux/dma-mapping.h> #include <asm/iommu_table.h> #include <linux/string.h> #include <linux/kallsyms.h> #define DEBUG 1 static struct iommu_table_entry * __init find_dependents_of(struct iommu_table_entry *start, struct iommu_table_entry *finish, struct iommu_table_entry *q) { struct iommu_table_entry *p; if (!q) return NULL; for (p = start; p < finish; p++) if (p->detect == q->depend) return p; return NULL; } void __init sort_iommu_table(struct iommu_table_entry *start, struct iommu_table_entry *finish) { struct iommu_table_entry *p, *q, tmp; for (p = start; p < finish; p++) { again: q = find_dependents_of(start, finish, p); /* We are bit sneaky here. We use the memory address to figure * out if the node we depend on is past our point, if so, swap. */ if (q > p) { tmp = *p; memmove(p, q, sizeof(*p)); *q = tmp; goto again; } } } #ifdef DEBUG void __init check_iommu_entries(struct iommu_table_entry *start, struct iommu_table_entry *finish) { struct iommu_table_entry *p, *q, *x; /* Simple cyclic dependency checker. */ for (p = start; p < finish; p++) { q = find_dependents_of(start, finish, p); x = find_dependents_of(start, finish, q); if (p == x) { printk(KERN_ERR "CYCLIC DEPENDENCY FOUND! %pS depends on %pS and vice-versa. BREAKING IT.\n", p->detect, q->detect); /* Heavy handed way..*/ x->depend = 0; } } for (p = start; p < finish; p++) { q = find_dependents_of(p, finish, p); if (q && q > p) { printk(KERN_ERR "EXECUTION ORDER INVALID! %pS should be called before %pS!\n", p->detect, q->detect); } } } #else void __init check_iommu_entries(struct iommu_table_entry *start, struct iommu_table_entry *finish) { } #endif
/* * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _GUILDMGR_H #define _GUILDMGR_H #include "Guild.h" class GuildMgr { friend class ACE_Singleton<GuildMgr, ACE_Null_Mutex>; private: GuildMgr(); ~GuildMgr(); public: typedef UNORDERED_MAP<uint32, Guild*> GuildContainer; Guild* GetGuildByLeader(uint64 guid) const; Guild* GetGuildById(uint32 guildId) const; Guild* GetGuildByName(const std::string& guildName) const; std::string GetGuildNameById(uint32 guildId) const; void LoadGuilds(); void AddGuild(Guild* guild); void RemoveGuild(uint32 guildId); uint32 GenerateGuildId(); void SetNextGuildId(uint32 Id) { NextGuildId = Id; } protected: uint32 NextGuildId; GuildContainer GuildStore; }; #define sGuildMgr ACE_Singleton<GuildMgr, ACE_Null_Mutex>::instance() #endif
/* Simple DirectMedia Layer Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org> 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. */ #include "SDL_config.h" #if SDL_VIDEO_DRIVER_DUMMY #include "../SDL_sysvideo.h" #include "SDL_nullframebuffer_c.h" #define DUMMY_SURFACE "_SDL_DummySurface" int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch) { SDL_Surface *surface; const Uint32 surface_format = SDL_PIXELFORMAT_RGB888; int w, h; int bpp; Uint32 Rmask, Gmask, Bmask, Amask; /* Free the old framebuffer surface */ surface = (SDL_Surface *) SDL_GetWindowData(window, DUMMY_SURFACE); if (surface) { SDL_FreeSurface(surface); } /* Create a new one */ SDL_PixelFormatEnumToMasks(surface_format, &bpp, &Rmask, &Gmask, &Bmask, &Amask); SDL_GetWindowSize(window, &w, &h); surface = SDL_CreateRGBSurface(0, w, h, bpp, Rmask, Gmask, Bmask, Amask); if (!surface) { return -1; } /* Save the info and return! */ SDL_SetWindowData(window, DUMMY_SURFACE, surface); *format = surface_format; *pixels = surface->pixels; *pitch = surface->pitch; return 0; } int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, SDL_Rect * rects, int numrects) { static int frame_number; SDL_Surface *surface; surface = (SDL_Surface *) SDL_GetWindowData(window, DUMMY_SURFACE); if (!surface) { SDL_SetError("Couldn't find dummy surface for window"); return -1; } /* Send the data to the display */ if (SDL_getenv("SDL_VIDEO_DUMMY_SAVE_FRAMES")) { char file[128]; SDL_snprintf(file, sizeof(file), "SDL_window%d-%8.8d.bmp", SDL_GetWindowID(window), ++frame_number); SDL_SaveBMP(surface, file); } return 0; } void SDL_DUMMY_DestroyWindowFramebuffer(_THIS, SDL_Window * window) { SDL_Surface *surface; surface = (SDL_Surface *) SDL_SetWindowData(window, DUMMY_SURFACE, NULL); if (surface) { SDL_FreeSurface(surface); } } #endif /* SDL_VIDEO_DRIVER_DUMMY */ /* vi: set ts=4 sw=4 expandtab: */
/* * (C) Copyright 2011-2013 * Texas Instruments, <www.ti.com> * * SPDX-License-Identifier: GPL-2.0+ * * For more details, please see the TRM at http://www.ti.com/product/tps65910 */ #ifndef __POWER_TPS65910_H__ #define __POWER_TPS65910_H__ #define MPU 0 #define CORE 1 #define TPS65910_SR_I2C_ADDR 0x12 #define TPS65910_CTRL_I2C_ADDR 0x2D /* PMIC Register offsets */ enum { TPS65910_VDD1_REG = 0x21, TPS65910_VDD1_OP_REG = 0x22, TPS65910_VDD2_REG = 0x24, TPS65910_VDD2_OP_REG = 0x25, TPS65910_DEVCTRL_REG = 0x3F, }; /* VDD2 & VDD1 control register (VDD2_REG & VDD1_REG) */ #define TPS65910_VGAIN_SEL_MASK (0x3 << 6) #define TPS65910_ILMAX_MASK (0x1 << 5) #define TPS65910_TSTEP_MASK (0x7 << 2) #define TPS65910_ST_MASK (0x3) #define TPS65910_REG_VGAIN_SEL_X1 (0x0 << 6) #define TPS65910_REG_VGAIN_SEL_X1_0 (0x1 << 6) #define TPS65910_REG_VGAIN_SEL_X3 (0x2 << 6) #define TPS65910_REG_VGAIN_SEL_X4 (0x3 << 6) #define TPS65910_REG_ILMAX_1_0_A (0x0 << 5) #define TPS65910_REG_ILMAX_1_5_A (0x1 << 5) #define TPS65910_REG_TSTEP_ (0x0 << 2) #define TPS65910_REG_TSTEP_12_5 (0x1 << 2) #define TPS65910_REG_TSTEP_9_4 (0x2 << 2) #define TPS65910_REG_TSTEP_7_5 (0x3 << 2) #define TPS65910_REG_TSTEP_6_25 (0x4 << 2) #define TPS65910_REG_TSTEP_4_7 (0x5 << 2) #define TPS65910_REG_TSTEP_3_12 (0x6 << 2) #define TPS65910_REG_TSTEP_2_5 (0x7 << 2) #define TPS65910_REG_ST_OFF (0x0) #define TPS65910_REG_ST_ON_HI_POW (0x1) #define TPS65910_REG_ST_OFF_1 (0x2) #define TPS65910_REG_ST_ON_LOW_POW (0x3) /* VDD2 & VDD1 voltage selection register. (VDD2_OP_REG & VDD1_OP_REG) */ #define TPS65910_OP_REG_SEL (0x7F) #define TPS65910_OP_REG_CMD_MASK (0x1 << 7) #define TPS65910_OP_REG_CMD_OP (0x0 << 7) #define TPS65910_OP_REG_CMD_SR (0x1 << 7) #define TPS65910_OP_REG_SEL_MASK (0x7F) #define TPS65910_OP_REG_SEL_0_9_5 (0x1F) /* 0.9500 V */ #define TPS65910_OP_REG_SEL_1_1_3 (0x2E) /* 1.1375 V */ #define TPS65910_OP_REG_SEL_1_2_0 (0x33) /* 1.2000 V */ #define TPS65910_OP_REG_SEL_1_2_6 (0x38) /* 1.2625 V */ #define TPS65910_OP_REG_SEL_1_3_2_5 (0x3D) /* 1.3250 V */ /* Device control register . (DEVCTRL_REG) */ #define TPS65910_DEVCTRL_REG_SR_CTL_I2C_MASK (0x1 << 4) #define TPS65910_DEVCTRL_REG_SR_CTL_I2C_SEL_SR_I2C (0x0 << 4) #define TPS65910_DEVCTRL_REG_SR_CTL_I2C_SEL_CTL_I2C (0x1 << 4) int tps65910_set_i2c_control(void); int tps65910_voltage_update(unsigned int module, unsigned char vddx_op_vol_sel); #endif /* __POWER_TPS65910_H__ */
// Copyright 2009 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // AsteriskFilter uses filtering pattern with asterisk for blob match. // An asaterisk (*) could match any number of consecutive characters, including // zero character. For example, "/*.html" can match "/.html" and // "/view?page=a.html", but can't match "/a.html?key=value". // This class is thread-safe. #ifndef SITEMAPSERVIE_H__ #define SITEMAPSERVIE_H__ #include <string> #include "common/patternfinder.h" #include "sitemapservice/urlfilter.h" // This class is implemented as an "Adapter" adapting PatternFinder to // UrlFilter interface. class AsteriskFilter : public UrlFilter { public: // Construct with given filtering pattern. // The pattern could contains zero or more asterisks in it. All the other // characters don't have special meaning. AsteriskFilter(const std::string& pattern); // Destructor. virtual ~AsteriskFilter(); // Check whether given URL is acceptted by this filter. virtual bool Accept(const char* url, int len); private: // This instance does the actual pattern matching job. PatternFinder* finder_; }; #endif // SITEMAPSERVIE_H__
/* Windows TermIO * * copyright (C) 2003 Sascha Sommer * * This file is part of MPlayer. * * MPlayer 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. * * MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ // See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/UserInput/VirtualKeyCodes.asp // for additional virtual keycodes #include "config.h" #include <stdio.h> #include <stdint.h> #include <string.h> #include <windows.h> #include "keycodes.h" #include "input/input.h" #include "mp_fifo.h" #include "getch2.h" int mp_input_slave_cmd_func(int fd,char* dest,int size){ DWORD retval; HANDLE in = GetStdHandle(STD_INPUT_HANDLE); if(PeekNamedPipe(in, NULL, size, &retval, NULL, NULL)){ if (size > retval) size = retval; } else { if (WaitForSingleObject(in, 0)) size = 0; } if(!size){ return MP_INPUT_NOTHING; } ReadFile(in, dest, size, &retval, NULL); if(retval)return retval; return MP_INPUT_NOTHING; } int screen_width=80; int screen_height=24; char * erase_to_end_of_line = NULL; void get_screen_size(void){ } static HANDLE in; static int getch2_status=0; static int getch2_internal(void) { INPUT_RECORD eventbuffer[128]; DWORD retval; int i=0; if(!getch2_status){ // supports e.g. MinGW xterm, unfortunately keys are only received after // enter was pressed. uint8_t c; if (!PeekNamedPipe(in, NULL, 1, &retval, NULL, NULL) || !retval) return -1; ReadFile(in, &c, 1, &retval, NULL); return retval == 1 ? c : -1; } /*check if there are input events*/ if(!GetNumberOfConsoleInputEvents(in,&retval)) { printf("getch2: can't get number of input events: %i\n",GetLastError()); return -1; } if(retval<=0)return -1; /*read all events*/ if(!ReadConsoleInput(in,eventbuffer,128,&retval)) { printf("getch: can't read input events\n"); return -1; } /*filter out keyevents*/ for (i = 0; i < retval; i++) { switch(eventbuffer[i].EventType) { case KEY_EVENT: /*only a pressed key is interresting for us*/ if(eventbuffer[i].Event.KeyEvent.bKeyDown == TRUE) { /*check for special keys*/ switch(eventbuffer[i].Event.KeyEvent.wVirtualKeyCode) { case VK_HOME: return KEY_HOME; case VK_END: return KEY_END; case VK_DELETE: return KEY_DEL; case VK_INSERT: return KEY_INS; case VK_BACK: return KEY_BS; case VK_PRIOR: return KEY_PGUP; case VK_NEXT: return KEY_PGDWN; case VK_RETURN: return KEY_ENTER; case VK_ESCAPE: return KEY_ESC; case VK_LEFT: return KEY_LEFT; case VK_UP: return KEY_UP; case VK_RIGHT: return KEY_RIGHT; case VK_DOWN: return KEY_DOWN; case VK_SHIFT: continue; } /*check for function keys*/ if(0x87 >= eventbuffer[i].Event.KeyEvent.wVirtualKeyCode && eventbuffer[i].Event.KeyEvent.wVirtualKeyCode >= 0x70) return KEY_F + 1 + eventbuffer[i].Event.KeyEvent.wVirtualKeyCode - 0x70; /*only characters should be remaining*/ //printf("getch2: YOU PRESSED \"%c\" \n",eventbuffer[i].Event.KeyEvent.uChar.AsciiChar); return eventbuffer[i].Event.KeyEvent.uChar.AsciiChar; } break; case MOUSE_EVENT: case WINDOW_BUFFER_SIZE_EVENT: case FOCUS_EVENT: case MENU_EVENT: default: //printf("getch2: unsupported event type"); break; } } return -1; } void getch2(void) { int r = getch2_internal(); if (r >= 0) mplayer_put_key(r); } void getch2_enable(void) { DWORD retval; in = GetStdHandle(STD_INPUT_HANDLE); if(!GetNumberOfConsoleInputEvents(in,&retval)) { printf("getch2: %i can't get number of input events [disabling console input]\n",GetLastError()); getch2_status = 0; } else getch2_status=1; } void getch2_disable(void) { if(!getch2_status) return; // already disabled / never enabled getch2_status=0; } #ifdef CONFIG_ICONV static const struct { unsigned cp; char* alias; } cp_alias[] = { { 20127, "ASCII" }, { 20866, "KOI8-R" }, { 21866, "KOI8-RU" }, { 28591, "ISO-8859-1" }, { 28592, "ISO-8859-2" }, { 28593, "ISO-8859-3" }, { 28594, "ISO-8859-4" }, { 28595, "ISO-8859-5" }, { 28596, "ISO-8859-6" }, { 28597, "ISO-8859-7" }, { 28598, "ISO-8859-8" }, { 28599, "ISO-8859-9" }, { 28605, "ISO-8859-15" }, { 65001, "UTF-8" }, { 0, NULL } }; char* get_term_charset(void) { char codepage[10]; unsigned i, cpno = GetConsoleOutputCP(); if (!cpno) cpno = GetACP(); if (!cpno) return NULL; for (i = 0; cp_alias[i].cp; i++) if (cpno == cp_alias[i].cp) return strdup(cp_alias[i].alias); snprintf(codepage, sizeof(codepage), "CP%u", cpno); return strdup(codepage); } #endif
#include "apilib.h" void HariMain(void) { api_putchar('A'); api_end(); }
/* * Copyright (C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org> * Copyright (C) 2008 Renesas Solutions Corp. * * See file CREDITS for list of people who contributed to this * project. * * 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 <common.h> #include <command.h> #include <asm/processor.h> #include <asm/io.h> #define STBCR4 0xFFFE040C #define cmt_clock_enable() do {\ writeb(readb(STBCR4) & ~0x04, STBCR4);\ } while (0) #define scif0_enable() do {\ writeb(readb(STBCR4) & ~0x80, STBCR4);\ } while (0) int checkcpu(void) { #if defined(CONFIG_SH2A) puts("CPU: SH2A\n"); #else puts("CPU: SH2\n"); #endif return 0; } int cpu_init(void) { /* SCIF enable */ scif0_enable(); /* CMT clock enable */ cmt_clock_enable() ; return 0; } int cleanup_before_linux(void) { disable_interrupts(); return 0; } int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { disable_interrupts(); reset_cpu(0); return 0; } void flush_cache(unsigned long addr, unsigned long size) { } void icache_enable(void) { } void icache_disable(void) { } int icache_status(void) { return 0; } void dcache_enable(void) { } void dcache_disable(void) { } int dcache_status(void) { return 0; }
/* * BCM47XX NAND flash driver * * Copyright (C) 2012 Rafał Miłecki <zajec5@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * */ #include "bcm47xxnflash.h" #include <linux/module.h> #include <linux/kernel.h> #include <linux/slab.h> #include <linux/platform_device.h> #include <linux/bcma/bcma.h> MODULE_DESCRIPTION("NAND flash driver for BCMA bus"); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Rafał Miłecki"); static const char *probes[] = { "bcm47xxpart", NULL }; static int bcm47xxnflash_probe(struct platform_device *pdev) { struct bcma_nflash *nflash = dev_get_platdata(&pdev->dev); struct bcm47xxnflash *b47n; int err = 0; b47n = devm_kzalloc(&pdev->dev, sizeof(*b47n), GFP_KERNEL); if (!b47n) return -ENOMEM; b47n->nand_chip.priv = b47n; b47n->mtd.owner = THIS_MODULE; b47n->mtd.priv = &b47n->nand_chip; /* Required */ b47n->cc = container_of(nflash, struct bcma_drv_cc, nflash); if (b47n->cc->core->bus->chipinfo.id == BCMA_CHIP_ID_BCM4706) { err = bcm47xxnflash_ops_bcm4706_init(b47n); } else { pr_err("Device not supported\n"); err = -ENOTSUPP; } if (err) { pr_err("Initialization failed: %d\n", err); return err; } err = mtd_device_parse_register(&b47n->mtd, probes, NULL, NULL, 0); if (err) { pr_err("Failed to register MTD device: %d\n", err); return err; } return 0; } static int bcm47xxnflash_remove(struct platform_device *pdev) { struct bcma_nflash *nflash = dev_get_platdata(&pdev->dev); if (nflash->mtd) mtd_device_unregister(nflash->mtd); return 0; } static struct platform_driver bcm47xxnflash_driver = { .probe = bcm47xxnflash_probe, .remove = bcm47xxnflash_remove, .driver = { .name = "bcma_nflash", }, }; module_platform_driver(bcm47xxnflash_driver);
#ifndef _ASM_POWERPC_SOCKET_H #define _ASM_POWERPC_SOCKET_H /* * 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. */ #include <asm/sockios.h> /* For setsockopt(2) */ #define SOL_SOCKET 1 #define SO_DEBUG 1 #define SO_REUSEADDR 2 #define SO_TYPE 3 #define SO_ERROR 4 #define SO_DONTROUTE 5 #define SO_BROADCAST 6 #define SO_SNDBUF 7 #define SO_RCVBUF 8 #define SO_SNDBUFFORCE 32 #define SO_RCVBUFFORCE 33 #define SO_KEEPALIVE 9 #define SO_OOBINLINE 10 #define SO_NO_CHECK 11 #define SO_PRIORITY 12 #define SO_LINGER 13 #define SO_BSDCOMPAT 14 /* To add :#define SO_REUSEPORT 15 */ #define SO_RCVLOWAT 16 #define SO_SNDLOWAT 17 #define SO_RCVTIMEO 18 #define SO_SNDTIMEO 19 #define SO_PASSCRED 20 #define SO_PEERCRED 21 /* Security levels - as per NRL IPv6 - don't actually do anything */ #define SO_SECURITY_AUTHENTICATION 22 #define SO_SECURITY_ENCRYPTION_TRANSPORT 23 #define SO_SECURITY_ENCRYPTION_NETWORK 24 #define SO_BINDTODEVICE 25 /* Socket filtering */ #define SO_ATTACH_FILTER 26 #define SO_DETACH_FILTER 27 #define SO_PEERNAME 28 #define SO_TIMESTAMP 29 #define SCM_TIMESTAMP SO_TIMESTAMP #define SO_ACCEPTCONN 30 #define SO_PEERSEC 31 #define SO_PASSSEC 34 #define SO_TIMESTAMPNS 35 #define SCM_TIMESTAMPNS SO_TIMESTAMPNS #endif /* _ASM_POWERPC_SOCKET_H */
// OCMockito by Jon Reid, http://qualitycoding.org/about/ // Copyright 2015 Jonathan M. Reid. See LICENSE.txt @protocol HCMatcher; /** Ability to specify OCHamcrest matchers for primitive numeric arguments. */ @protocol MKTPrimitiveArgumentMatching /** Specifies OCHamcrest matcher for a specific argument of a method. For methods arguments that take objects, just pass the matcher directly as a method call. But for arguments that take primitive numeric types, call this to specify the matcher before passing in a dummy value. Upon verification, the actual numeric argument received will be converted to an NSNumber before being checked by the matcher. The argument index is 0-based, so the first argument of a method has index 0. Example: @code [[verify(mockArray) withMatcher:greaterThan([NSNumber numberWithInt:1]) forArgument:0] removeObjectAtIndex:0]; @endcode This verifies that @c removeObjectAtIndex: was called with a number greater than 1. */ - (id)withMatcher:(id <HCMatcher>)matcher forArgument:(NSUInteger)index; /** Specifies OCHamcrest matcher for the first argument of a method. Equivalent to <code>withMatcher:matcher forArgument:0</code>. Example: @code [[verify(mockArray) withMatcher:greaterThan([NSNumber numberWithInt:1]) forArgument:0] removeObjectAtIndex:0]; @endcode This verifies that @c removeObjectAtIndex: was called with a number greater than 1. */ - (id)withMatcher:(id <HCMatcher>)matcher; @end
// Copyright (c) 2010 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_CHROMEOS_PANELS_PANEL_SCROLLER_CONTAINER_H_ #define CHROME_BROWSER_CHROMEOS_PANELS_PANEL_SCROLLER_CONTAINER_H_ #pragma once #include "base/basictypes.h" #include "views/view.h" class PanelScroller; // This class wraps the contents of a panel in the panel scroller. It currently // doesn't do anything useful, but it just a placeholder. class PanelScrollerContainer : public views::View { public: PanelScrollerContainer(PanelScroller* scroller, views::View* contents); virtual ~PanelScrollerContainer(); int HeaderSize() const; // view::View overrides. virtual gfx::Size GetPreferredSize(); virtual void Layout(); virtual void OnPaint(gfx::Canvas* canvas); private: // Non-owning pointer to our parent scroller object. PanelScroller* scroller_; views::View* contents_; DISALLOW_COPY_AND_ASSIGN(PanelScrollerContainer); }; #endif // CHROME_BROWSER_CHROMEOS_PANELS_PANEL_SCROLLER_CONTAINER_H_
/* * Copyright (C) 2011-2014 MediaTek Inc. * * This program is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with this program. * If not, see <http://www.gnu.org/licenses/>. */ #ifndef __LOGGER_CUSTOM_H #define __LOGGER_CUSTOM_H #include <generated/autoconf.h> #define __MAIN_BUF_SIZE 64*1024 #define __EVENTS_BUF_SIZE 256*1024 #define __RADIO_BUF_SIZE 64*1024 #define __SYSTEM_BUF_SIZE 64*1024 #endif /* __LOGGER_CUSTOM_H */
/* * Copyright 2006 IBM Corporation. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #ifndef _PSERIES_PSERIES_H #define _PSERIES_PSERIES_H #include <linux/interrupt.h> #include <asm/rtas.h> struct device_node; extern void request_event_sources_irqs(struct device_node *np, irq_handler_t handler, const char *name); #include <linux/of.h> struct pt_regs; extern int pSeries_system_reset_exception(struct pt_regs *regs); extern int pSeries_machine_check_exception(struct pt_regs *regs); #ifdef CONFIG_SMP extern void smp_init_pseries(void); /* Get state of physical CPU from query_cpu_stopped */ int smp_query_cpu_stopped(unsigned int pcpu); #define QCSS_STOPPED 0 #define QCSS_STOPPING 1 #define QCSS_NOT_STOPPED 2 #define QCSS_HARDWARE_ERROR -1 #define QCSS_HARDWARE_BUSY -2 #else static inline void smp_init_pseries(void) { }; #endif extern void pseries_kexec_cpu_down(int crash_shutdown, int secondary); extern void pSeries_final_fixup(void); /* Poweron flag used for enabling auto ups restart */ extern unsigned long rtas_poweron_auto; /* Provided by HVC VIO */ extern void hvc_vio_init_early(void); /* Dynamic logical Partitioning/Mobility */ extern void dlpar_free_cc_nodes(struct device_node *); extern void dlpar_free_cc_property(struct property *); extern struct device_node *dlpar_configure_connector(__be32, struct device_node *); extern int dlpar_attach_node(struct device_node *, struct device_node *); extern int dlpar_detach_node(struct device_node *); extern int dlpar_acquire_drc(u32 drc_index); extern int dlpar_release_drc(u32 drc_index); void queue_hotplug_event(struct pseries_hp_errorlog *hp_errlog, struct completion *hotplug_done, int *rc); #ifdef CONFIG_MEMORY_HOTPLUG int dlpar_memory(struct pseries_hp_errorlog *hp_elog); #else static inline int dlpar_memory(struct pseries_hp_errorlog *hp_elog) { return -EOPNOTSUPP; } #endif #ifdef CONFIG_HOTPLUG_CPU int dlpar_cpu(struct pseries_hp_errorlog *hp_elog); #else static inline int dlpar_cpu(struct pseries_hp_errorlog *hp_elog) { return -EOPNOTSUPP; } #endif /* PCI root bridge prepare function override for pseries */ struct pci_host_bridge; int pseries_root_bridge_prepare(struct pci_host_bridge *bridge); extern struct pci_controller_ops pseries_pci_controller_ops; unsigned long pseries_memory_block_size(void); extern int CMO_PrPSP; extern int CMO_SecPSP; extern unsigned long CMO_PageSize; static inline int cmo_get_primary_psp(void) { return CMO_PrPSP; } static inline int cmo_get_secondary_psp(void) { return CMO_SecPSP; } static inline unsigned long cmo_get_page_size(void) { return CMO_PageSize; } int dlpar_workqueue_init(void); void pseries_setup_rfi_flush(void); #endif /* _PSERIES_PSERIES_H */
// // AVOSCloudSNS.h // paas // // Created by Travis on 13-10-15. // Copyright (c) 2013年 AVOS. All rights reserved. // #import <Foundation/Foundation.h> /** * AVOSCloudSNS目前支持的平台类型 */ typedef NS_ENUM(int, AVOSCloudSNSType){ /// 新浪微博 AVOSCloudSNSSinaWeibo =1, /// QQ AVOSCloudSNSQQ =2, } ; /** * AVOSCloudSNS错误码 */ typedef NS_ENUM(int, AVOSCloudSNSErrorCode){ /// 用户取消 AVOSCloudSNSErrorUserCancel =1, /// 登录失败 AVOSCloudSNSErrorLoginFail =2, /// 无绑定用户 AVOSCloudSNSErrorNeedLogin =3, /// Token过期 AVOSCloudSNSErrorTokenExpired=4, }; /** * AVOSCloudSNS错误域 */ extern NSString * const AVOSCloudSNSErrorDomain; /** * AVOSCloudSNS请求回调 * * @param object 请求成功返回的内容 * @param error 请求失败返回的内容 */ typedef void (^AVSNSResultBlock)(id object, NSError *error); typedef void (^AVSNSProgressBlock)(float percent); /** * AVOSCloudSNS 是一个轻量级的社交平台助手 * 几行代码就可以实现登录和发布内容 */ @interface AVOSCloudSNS : NSObject /** * 设置平台所需要的参数 * * @warning 如果不进行设置, 则用`AVOSCloud`进行登录认证. * * @param type 平台类型 * @param appkey 该平台分配的AppKey * @param appsec 该平台分配的AppSecret * @param redirect_uri 该平台上设置的回调地址 (QQ可以nil, 因为QQ没有这个设置选项. 新浪微博必填!) */ +(void)setupPlatform:(AVOSCloudSNSType)type withAppKey:(NSString*)appkey andAppSecret:(NSString*)appsec andRedirectURI:(NSString*)redirect_uri; /** * 用社交平台登录, 并获取手动显示登录界面 * @warning 需要在回调后手动关闭此UIViewController. * @param callback 登录结果回调 * * @return 用于显示登录界面的UIViewController,如果可以SSO登录 则返回nil. */ +(UIViewController*)loginManualyWithCallback:(AVSNSResultBlock)callback; /** * 用指定的社交平台登录, 并获取手动显示登录界面 * @warning 需要在回调后手动关闭此UIViewController. * @param type 指定平台类型 * @param callback 登录结果回调 * * @return 用于显示登录界面的UIViewController,如果可以SSO登录 则返回nil. */ +(UIViewController*)loginManualyWithCallback:(AVSNSResultBlock)callback toPlatform:(AVOSCloudSNSType)type; /** * 用社会化平台登录,并自动弹出登录界面 * * @discussion 如果配置了SSO的相关数据会自动尝试用SSO来打开官方应用登录,如果不成功则用传统的方式在本App界面中完成登录过程 * @warning 如果主窗口有`rootViewController`,则会自动通过presentModalViewController打开. **注意:** presentModalViewController与正在进行的其它系统动画同时出现时会在Log里出现`Warning: ... while a presentation or dismiss is in progress!`类似的警告,但是不会影响使用 * @param callback 登录结果回调 * */ +(void)loginWithCallback:(AVSNSResultBlock)callback; /** * 用指定的社交平台登录,并自动弹出登录界面 * * @warning 如果主窗口有`rootViewController`,则会自动通过presentModalViewController打开. **注意:** presentModalViewController与正在进行的其它系统动画同时出现时会在Log里出现`Warning: ... while a presentation or dismiss is in progress!`类似的警告,但是不会影响使用 * @param type 指定平台类型 * @param callback 登录结果回调 * */ +(void)loginWithCallback:(AVSNSResultBlock)callback toPlatform:(AVOSCloudSNSType)type; /** * 分享文字到指定社交平台 * @warning 目前只支持新浪微博 * * @param text 文字内容 * @param linkUrl 链接地址(可选) * @param type 指定平台类型 * @param callback 结果回调 * @param progressBlock 进度回调(可选) * */ +(void)shareText:(NSString*)text andLink:(NSString*)linkUrl toPlatform:(AVOSCloudSNSType)type withCallback:(AVSNSResultBlock)callback andProgress:(AVSNSProgressBlock)progressBlock; /** * 分享文字和图片到指定社交平台 * @warning 目前只支持新浪微博 * * @param text 文字内容 * @param linkUrl 链接地址(可选) * @param image 图片 (将会被JPEG压缩0.8) * @param type 指定平台类型 * @param callback 结果回调 * @param progressBlock 进度回调(可选) * */ +(void)shareText:(NSString*)text andLink:(NSString*)linkUrl andImage:(UIImage*)image toPlatform:(AVOSCloudSNSType)type withCallback:(AVSNSResultBlock)callback andProgress:(AVSNSProgressBlock)progressBlock; /** * 注销指定的社交平台绑定的账号 * * @param type 指定平台类型 * */ +(void)logout:(AVOSCloudSNSType)type; /** * 捕获SSO登录后返回数据 * * @param url 回调本app的URL */ +(BOOL)handleOpenURL:(NSURL *)url; /** * 获取指定的社交平台已经缓存的用户信息 * * @param type 指定平台类型 * @return 包含用户信息的字典, 如果返回nil则没有绑定的用户. 包括常用字段, 用户ID:`id`, 用户名:`username`, 平台类型:`type`, 头像:`avatar`, 过期时间:`expires_at`, token:`access_token`, 用户原始信息:`raw-user` */ +(NSDictionary*)userInfo:(AVOSCloudSNSType)type; /** * 判断指定的社交平台已经缓存的用户信息是否过期 * * @param type 指定平台类型 * @return 是否过期 */ +(BOOL)doesUserExpireOfPlatform:(AVOSCloudSNSType)type; /** * 刷新用户授权时间 * @discussion 如果当前用户授权没有过期,则无需用户操作, 登录过程一闪而过. 如果授权过期,则需要用户重新授权 * * @param type 指定平台类型 * @param callback 登录结果回调 */ +(void)refreshToken:(AVOSCloudSNSType)type withCallback:(AVSNSResultBlock)callback; @end
/* Copyright (c) 2000, 2003, 2004 MySQL AB Use is subject to license terms This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifdef __WIN__ #include <windows.h> #endif #include <stdio.h> #include <stdlib.h> #include "mysql.h" #define SELECT_QUERY "select name from test where num = %d" int main(int argc, char **argv) { int count, num; MYSQL mysql,*sock; MYSQL_RES *res; char qbuf[160]; if (argc != 2) { fprintf(stderr,"usage : select_test <dbname>\n\n"); exit(1); } if (!(sock = mysql_connect(&mysql,NULL,0,0))) { fprintf(stderr,"Couldn't connect to engine!\n%s\n\n",mysql_error(&mysql)); perror(""); exit(1); } mysql.reconnect= 1; if (mysql_select_db(sock,argv[1]) < 0) { fprintf(stderr,"Couldn't select database %s!\n%s\n",argv[1], mysql_error(sock)); exit(1); } if (!(res=mysql_list_dbs(sock,NULL))) { fprintf(stderr,"Couldn't list dbs!\n%s\n",mysql_error(sock)); exit(1); } mysql_free_result(res); if (!(res=mysql_list_tables(sock,NULL))) { fprintf(stderr,"Couldn't list tables!\n%s\n",mysql_error(sock)); exit(1); } mysql_free_result(res); mysql_close(sock); exit(0); return 0; }
/* * Copyright(c) 2011-2016 Intel Corporation. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Authors: * Ke Yu * Kevin Tian <kevin.tian@intel.com> * Dexuan Cui * * Contributors: * Tina Zhang <tina.zhang@intel.com> * Min He <min.he@intel.com> * Niu Bing <bing.niu@intel.com> * Zhi Wang <zhi.a.wang@intel.com> * */ #ifndef _GVT_MMIO_H_ #define _GVT_MMIO_H_ struct intel_gvt; struct intel_vgpu; #define D_BDW (1 << 0) #define D_SKL (1 << 1) #define D_KBL (1 << 2) #define D_GEN9PLUS (D_SKL | D_KBL) #define D_GEN8PLUS (D_BDW | D_SKL | D_KBL) #define D_SKL_PLUS (D_SKL | D_KBL) #define D_BDW_PLUS (D_BDW | D_SKL | D_KBL) #define D_PRE_SKL (D_BDW) #define D_ALL (D_BDW | D_SKL | D_KBL) typedef int (*gvt_mmio_func)(struct intel_vgpu *, unsigned int, void *, unsigned int); struct intel_gvt_mmio_info { u32 offset; u64 ro_mask; u32 device; gvt_mmio_func read; gvt_mmio_func write; u32 addr_range; struct hlist_node node; }; unsigned long intel_gvt_get_device_type(struct intel_gvt *gvt); bool intel_gvt_match_device(struct intel_gvt *gvt, unsigned long device); int intel_gvt_setup_mmio_info(struct intel_gvt *gvt); void intel_gvt_clean_mmio_info(struct intel_gvt *gvt); #define INTEL_GVT_MMIO_OFFSET(reg) ({ \ typeof(reg) __reg = reg; \ u32 *offset = (u32 *)&__reg; \ *offset; \ }) int intel_vgpu_init_mmio(struct intel_vgpu *vgpu); void intel_vgpu_reset_mmio(struct intel_vgpu *vgpu, bool dmlr); void intel_vgpu_clean_mmio(struct intel_vgpu *vgpu); int intel_vgpu_gpa_to_mmio_offset(struct intel_vgpu *vgpu, u64 gpa); int intel_vgpu_emulate_mmio_read(struct intel_vgpu *vgpu, u64 pa, void *p_data, unsigned int bytes); int intel_vgpu_emulate_mmio_write(struct intel_vgpu *vgpu, u64 pa, void *p_data, unsigned int bytes); int intel_vgpu_default_mmio_read(struct intel_vgpu *vgpu, unsigned int offset, void *p_data, unsigned int bytes); int intel_vgpu_default_mmio_write(struct intel_vgpu *vgpu, unsigned int offset, void *p_data, unsigned int bytes); bool intel_gvt_in_force_nonpriv_whitelist(struct intel_gvt *gvt, unsigned int offset); int intel_vgpu_mmio_reg_rw(struct intel_vgpu *vgpu, unsigned int offset, void *pdata, unsigned int bytes, bool is_read); #endif
// // ViewController.h // With Spaces // // Created by Felix Krause on 11/08/15. // Copyright © 2015 Felix Krause. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
/** * \file * <!-- * This file is part of BeRTOS. * * Bertos 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 St, Fifth Floor, Boston, MA 02110-1301 USA * * As a special exception, you may use this file as part of a free software * library without restriction. Specifically, if other files instantiate * templates or use macros or inline functions from this file, or you compile * this file and link it with other files to produce an executable, this * file does not by itself cause the resulting executable to be covered by * the GNU General Public License. This exception does not however * invalidate any other reasons why the executable file might be covered by * the GNU General Public License. * * Copyright 2006 Develer S.r.l. (http://www.develer.com/) * All Rights Reserved. * --> * * \brief FT245RL USB interface hardware-specific definitions * * * \author Francesco Sacchi <batt@develer.com> */ #ifndef HW_FT245RL_H #define HW_FT245RL_H #warning TODO:This is an example implementation, you must implement it! #define FT245RL_DATA_IN() /* Implement me! */ #define FT245RL_DATA_OUT() /* Implement me! */ #define WR_HI /* Implement me! */ #define WR_LO /* Implement me! */ #define RD_HI /* Implement me! */ #define RD_LO /* Implement me! */ #define FT245RL_INIT() \ do \ { \ /* Implement me! */ \ } while(0) #define FT245RL_DATA_RDY() (/* Implement me! */ false) #define FT245RL_GETDATA() ({/* Implement me! */ (0);}) #define FT245RL_TX_ALLOWED() (/* Implement me! */ false) #define FT245RL_SETDATA(data) do {/* Implement me! */ (void)((data)); } while(0) #endif /* HW_FT245RL_H */
#ifndef _LINUX_STRING_H_ #define _LINUX_STRING_H_ #include <linux/compiler.h> /* for inline */ #include <linux/types.h> /* for size_t */ #include <linux/stddef.h> /* for NULL */ #include <stdarg.h> #include <uapi/linux/string.h> extern char *strndup_user(const char __user *, long); extern void *memdup_user(const void __user *, size_t); /* * Include machine specific inline routines */ #include <asm/string.h> #ifndef __HAVE_ARCH_STRCPY extern char * strcpy(char *,const char *); #endif #ifndef __HAVE_ARCH_STRNCPY extern char * strncpy(char *,const char *, __kernel_size_t); #endif #ifndef __HAVE_ARCH_STRLCPY size_t strlcpy(char *, const char *, size_t); #endif #ifndef __HAVE_ARCH_STRCAT extern char * strcat(char *, const char *); #endif #ifndef __HAVE_ARCH_STRNCAT extern char * strncat(char *, const char *, __kernel_size_t); #endif #ifndef __HAVE_ARCH_STRLCAT extern size_t strlcat(char *, const char *, __kernel_size_t); #endif #ifndef __HAVE_ARCH_STRCMP extern int strcmp(const char *,const char *); #endif #ifndef __HAVE_ARCH_STRNCMP extern int strncmp(const char *,const char *,__kernel_size_t); #endif #ifndef __HAVE_ARCH_STRNICMP extern int strnicmp(const char *, const char *, __kernel_size_t); #endif #ifndef __HAVE_ARCH_STRCASECMP extern int strcasecmp(const char *s1, const char *s2); #endif #ifndef __HAVE_ARCH_STRNCASECMP extern int strncasecmp(const char *s1, const char *s2, size_t n); #endif #ifndef __HAVE_ARCH_STRCHR extern char * strchr(const char *,int); #endif #ifndef __HAVE_ARCH_STRNCHR extern char * strnchr(const char *, size_t, int); #endif #ifndef __HAVE_ARCH_STRRCHR extern char * strrchr(const char *,int); #endif extern char * __must_check skip_spaces(const char *); extern char *strim(char *); static inline __must_check char *strstrip(char *str) { return strim(str); } #ifndef __HAVE_ARCH_STRSTR extern char * strstr(const char *, const char *); #endif #ifndef __HAVE_ARCH_STRNSTR extern char * strnstr(const char *, const char *, size_t); #endif #ifndef __HAVE_ARCH_STRLEN extern __kernel_size_t strlen(const char *); #endif #ifndef __HAVE_ARCH_STRNLEN extern __kernel_size_t strnlen(const char *,__kernel_size_t); #endif #ifndef __HAVE_ARCH_STRPBRK extern char * strpbrk(const char *,const char *); #endif #ifndef __HAVE_ARCH_STRSEP extern char * strsep(char **,const char *); #endif #ifndef __HAVE_ARCH_STRSPN extern __kernel_size_t strspn(const char *,const char *); #endif #ifndef __HAVE_ARCH_STRCSPN extern __kernel_size_t strcspn(const char *,const char *); #endif #ifndef __HAVE_ARCH_MEMSET extern void * memset(void *,int,__kernel_size_t); #endif #ifndef __HAVE_ARCH_MEMCPY extern void * memcpy(void *,const void *,__kernel_size_t); #endif #ifndef __HAVE_ARCH_MEMMOVE extern void * memmove(void *,const void *,__kernel_size_t); #endif #ifndef __HAVE_ARCH_MEMSCAN extern void * memscan(void *,int,__kernel_size_t); #endif #ifndef __HAVE_ARCH_MEMCMP extern int memcmp(const void *,const void *,__kernel_size_t); #endif #ifndef __HAVE_ARCH_MEMCHR extern void * memchr(const void *,int,__kernel_size_t); #endif void *memchr_inv(const void *s, int c, size_t n); extern char *kstrdup(const char *s, gfp_t gfp); extern char *kstrndup(const char *s, size_t len, gfp_t gfp); extern void *kmemdup(const void *src, size_t len, gfp_t gfp); extern char **argv_split(gfp_t gfp, const char *str, int *argcp); extern void argv_free(char **argv); extern bool sysfs_streq(const char *s1, const char *s2); extern int strtobool(const char *s, bool *res); #ifdef CONFIG_BINARY_PRINTF int vbin_printf(u32 *bin_buf, size_t size, const char *fmt, va_list args); int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf); int bprintf(u32 *bin_buf, size_t size, const char *fmt, ...) __printf(3, 4); #endif extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos, const void *from, size_t available); /** * strstarts - does @str start with @prefix? * @str: string to examine * @prefix: prefix to look for. */ static inline bool strstarts(const char *str, const char *prefix) { return strncmp(str, prefix, strlen(prefix)) == 0; } size_t memweight(const void *ptr, size_t bytes); void memzero_explicit(void *s, size_t count); /** * kbasename - return the last part of a pathname. * * @path: path to extract the filename from. */ static inline const char *kbasename(const char *path) { const char *tail = strrchr(path, '/'); return tail ? tail + 1 : path; } #endif /* _LINUX_STRING_H_ */
/* * Support for LGDT3302 and LGDT3303 - VSB/QAM * * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net> * * 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. * */ #ifndef LGDT330X_H #define LGDT330X_H #include <linux/dvb/frontend.h> typedef enum lg_chip_t { UNDEFINED, LGDT3302, LGDT3303 }lg_chip_type; struct lgdt330x_config { /* The demodulator's i2c address */ u8 demod_address; /* LG demodulator chip LGDT3302 or LGDT3303 */ lg_chip_type demod_chip; /* MPEG hardware interface - 0:parallel 1:serial */ int serial_mpeg; /* PLL interface */ int (*pll_rf_set) (struct dvb_frontend* fe, int index); /* Need to set device param for start_dma */ int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured); /* Flip the polarity of the mpeg data transfer clock using alternate init data * This option applies ONLY to LGDT3303 - 0:disabled (default) 1:enabled */ int clock_polarity_flip; }; #if defined(CONFIG_DVB_LGDT330X) || (defined(CONFIG_DVB_LGDT330X_MODULE) && defined(MODULE)) extern struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config, struct i2c_adapter* i2c); #else static inline struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config, struct i2c_adapter* i2c) { printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__); return NULL; } #endif // CONFIG_DVB_LGDT330X #endif /* LGDT330X_H */ /* * Local variables: * c-basic-offset: 8 * End: */
/* * arch/arm/mach-ep93xx/edb9315a.c * Cirrus Logic EDB9315A support. * * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.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. */ #include <linux/kernel.h> #include <linux/init.h> #include <linux/mm.h> #include <linux/sched.h> #include <linux/interrupt.h> #include <linux/ioport.h> #include <linux/mtd/physmap.h> #include <linux/platform_device.h> #include <asm/io.h> #include <asm/hardware.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> static struct physmap_flash_data edb9315a_flash_data = { .width = 2, }; static struct resource edb9315a_flash_resource = { .start = 0x60000000, .end = 0x60ffffff, .flags = IORESOURCE_MEM, }; static struct platform_device edb9315a_flash = { .name = "physmap-flash", .id = 0, .dev = { .platform_data = &edb9315a_flash_data, }, .num_resources = 1, .resource = &edb9315a_flash_resource, }; static struct ep93xx_eth_data edb9315a_eth_data = { .phy_id = 1, }; static struct resource edb9315a_eth_resource[] = { { .start = EP93XX_ETHERNET_PHYS_BASE, .end = EP93XX_ETHERNET_PHYS_BASE + 0xffff, .flags = IORESOURCE_MEM, }, { .start = IRQ_EP93XX_ETHERNET, .end = IRQ_EP93XX_ETHERNET, .flags = IORESOURCE_IRQ, } }; static struct platform_device edb9315a_eth_device = { .name = "ep93xx-eth", .id = -1, .dev = { .platform_data = &edb9315a_eth_data, }, .num_resources = 2, .resource = edb9315a_eth_resource, }; static void __init edb9315a_init_machine(void) { ep93xx_init_devices(); platform_device_register(&edb9315a_flash); memcpy(edb9315a_eth_data.dev_addr, (void *)(EP93XX_ETHERNET_BASE + 0x50), 6); platform_device_register(&edb9315a_eth_device); } MACHINE_START(EDB9315A, "Cirrus Logic EDB9315A Evaluation Board") /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */ .phys_io = EP93XX_APB_PHYS_BASE, .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc, .boot_params = 0xc0000100, .map_io = ep93xx_map_io, .init_irq = ep93xx_init_irq, .timer = &ep93xx_timer, .init_machine = edb9315a_init_machine, MACHINE_END
/* linux/arch/arm/plat-s3c64xx/dev-adc.c * * Copyright 2010 Maurus Cuelenaere * * S3C64xx series device definition for ADC device * * 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/string.h> #include <linux/platform_device.h> #include <mach/irqs.h> #include <mach/map.h> #include <plat/adc.h> #include <plat/devs.h> #include <plat/cpu.h> static struct resource s3c_adc_resource[] = { [0] = { .start = S3C64XX_PA_ADC, .end = S3C64XX_PA_ADC + SZ_256 - 1, .flags = IORESOURCE_MEM, }, [1] = { .start = IRQ_TC, .end = IRQ_TC, .flags = IORESOURCE_IRQ, }, [2] = { .start = IRQ_ADC, .end = IRQ_ADC, .flags = IORESOURCE_IRQ, }, }; struct platform_device s3c_device_adc = { .name = "s3c64xx-adc", .id = -1, .num_resources = ARRAY_SIZE(s3c_adc_resource), .resource = s3c_adc_resource, };
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_POWERPC_BOOK3S_32_PGALLOC_H #define _ASM_POWERPC_BOOK3S_32_PGALLOC_H #include <linux/threads.h> #include <linux/slab.h> /* * Functions that deal with pagetables that could be at any level of * the table need to be passed an "index_size" so they know how to * handle allocation. For PTE pages (which are linked to a struct * page for now, and drawn from the main get_free_pages() pool), the * allocation size will be (2^index_size * sizeof(pointer)) and * allocations are drawn from the kmem_cache in PGT_CACHE(index_size). * * The maximum index size needs to be big enough to allow any * pagetable sizes we need, but small enough to fit in the low bits of * any page table pointer. In other words all pagetables, even tiny * ones, must be aligned to allow at least enough low 0 bits to * contain this value. This value is also used as a mask, so it must * be one less than a power of two. */ #define MAX_PGTABLE_INDEX_SIZE 0xf extern void __bad_pte(pmd_t *pmd); extern struct kmem_cache *pgtable_cache[]; #define PGT_CACHE(shift) ({ \ BUG_ON(!(shift)); \ pgtable_cache[(shift) - 1]; \ }) static inline pgd_t *pgd_alloc(struct mm_struct *mm) { return kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE), pgtable_gfp_flags(mm, GFP_KERNEL)); } static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) { kmem_cache_free(PGT_CACHE(PGD_INDEX_SIZE), pgd); } /* * We don't have any real pmd's, and this code never triggers because * the pgd will always be present.. */ /* #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) */ #define pmd_free(mm, x) do { } while (0) #define __pmd_free_tlb(tlb,x,a) do { } while (0) /* #define pgd_populate(mm, pmd, pte) BUG() */ #ifndef CONFIG_BOOKE static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *pte) { *pmdp = __pmd(__pa(pte) | _PMD_PRESENT); } static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmdp, pgtable_t pte_page) { *pmdp = __pmd((page_to_pfn(pte_page) << PAGE_SHIFT) | _PMD_PRESENT); } #define pmd_pgtable(pmd) pmd_page(pmd) #else static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *pte) { *pmdp = __pmd((unsigned long)pte | _PMD_PRESENT); } static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmdp, pgtable_t pte_page) { *pmdp = __pmd((unsigned long)lowmem_page_address(pte_page) | _PMD_PRESENT); } #define pmd_pgtable(pmd) pmd_page(pmd) #endif extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); extern pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long addr); static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) { free_page((unsigned long)pte); } static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage) { pgtable_page_dtor(ptepage); __free_page(ptepage); } static inline void pgtable_free(void *table, unsigned index_size) { if (!index_size) { free_page((unsigned long)table); } else { BUG_ON(index_size > MAX_PGTABLE_INDEX_SIZE); kmem_cache_free(PGT_CACHE(index_size), table); } } #define check_pgt_cache() do { } while (0) #ifdef CONFIG_SMP static inline void pgtable_free_tlb(struct mmu_gather *tlb, void *table, int shift) { unsigned long pgf = (unsigned long)table; BUG_ON(shift > MAX_PGTABLE_INDEX_SIZE); pgf |= shift; tlb_remove_table(tlb, (void *)pgf); } static inline void __tlb_remove_table(void *_table) { void *table = (void *)((unsigned long)_table & ~MAX_PGTABLE_INDEX_SIZE); unsigned shift = (unsigned long)_table & MAX_PGTABLE_INDEX_SIZE; pgtable_free(table, shift); } #else static inline void pgtable_free_tlb(struct mmu_gather *tlb, void *table, int shift) { pgtable_free(table, shift); } #endif static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, unsigned long address) { pgtable_page_dtor(table); pgtable_free_tlb(tlb, page_address(table), 0); } #endif /* _ASM_POWERPC_BOOK3S_32_PGALLOC_H */
/***************************************************************************/ /* * linux/arch/m68knommu/platform/528x/config.c * * Sub-architcture dependent initialization code for the Freescale * 5280, 5281 and 5282 CPUs. * * Copyright (C) 1999-2003, Greg Ungerer (gerg@snapgear.com) * Copyright (C) 2001-2003, SnapGear Inc. (www.snapgear.com) */ /***************************************************************************/ #include <linux/kernel.h> #include <linux/param.h> #include <linux/init.h> #include <linux/platform_device.h> #include <linux/io.h> #include <asm/machdep.h> #include <asm/coldfire.h> #include <asm/mcfsim.h> #include <asm/mcfuart.h> /***************************************************************************/ #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) static void __init m528x_qspi_init(void) { /* setup Port QS for QSPI with gpio CS control */ __raw_writeb(0x07, MCFGPIO_PQSPAR); } #endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */ /***************************************************************************/ static void __init m528x_uarts_init(void) { u8 port; /* make sure PUAPAR is set for UART0 and UART1 */ port = readb(MCF5282_GPIO_PUAPAR); port |= 0x03 | (0x03 << 2); writeb(port, MCFGPIO_PUAPAR); } /***************************************************************************/ static void __init m528x_fec_init(void) { u16 v16; /* Set multi-function pins to ethernet mode for fec0 */ v16 = readw(MCF_IPSBAR + 0x100056); writew(v16 | 0xf00, MCF_IPSBAR + 0x100056); writeb(0xc0, MCF_IPSBAR + 0x100058); } /***************************************************************************/ #ifdef CONFIG_WILDFIRE void wildfire_halt(void) { writeb(0, 0x30000007); writeb(0x2, 0x30000007); } #endif #ifdef CONFIG_WILDFIREMOD void wildfiremod_halt(void) { printk(KERN_INFO "WildFireMod hibernating...\n"); /* Set portE.5 to Digital IO */ MCF5282_GPIO_PEPAR &= ~(1 << (5 * 2)); /* Make portE.5 an output */ MCF5282_GPIO_DDRE |= (1 << 5); /* Now toggle portE.5 from low to high */ MCF5282_GPIO_PORTE &= ~(1 << 5); MCF5282_GPIO_PORTE |= (1 << 5); printk(KERN_EMERG "Failed to hibernate. Halting!\n"); } #endif void __init config_BSP(char *commandp, int size) { #ifdef CONFIG_WILDFIRE mach_halt = wildfire_halt; #endif #ifdef CONFIG_WILDFIREMOD mach_halt = wildfiremod_halt; #endif mach_sched_init = hw_timer_init; m528x_uarts_init(); m528x_fec_init(); #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) m528x_qspi_init(); #endif } /***************************************************************************/
/* * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc. * All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it would 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 the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __XFS_DIR2_H__ #define __XFS_DIR2_H__ struct xfs_bmap_free; struct xfs_da_args; struct xfs_inode; struct xfs_mount; struct xfs_trans; struct xfs_dir2_sf_hdr; struct xfs_dir2_sf_entry; struct xfs_dir2_data_hdr; struct xfs_dir2_data_entry; struct xfs_dir2_data_unused; extern struct xfs_name xfs_name_dotdot; /* * Generic directory interface routines */ extern void xfs_dir_startup(void); extern void xfs_dir_mount(struct xfs_mount *mp); extern int xfs_dir_isempty(struct xfs_inode *dp); extern int xfs_dir_init(struct xfs_trans *tp, struct xfs_inode *dp, struct xfs_inode *pdp); extern int xfs_dir_createname(struct xfs_trans *tp, struct xfs_inode *dp, struct xfs_name *name, xfs_ino_t inum, xfs_fsblock_t *first, struct xfs_bmap_free *flist, xfs_extlen_t tot); extern int xfs_dir_lookup(struct xfs_trans *tp, struct xfs_inode *dp, struct xfs_name *name, xfs_ino_t *inum, struct xfs_name *ci_name); extern int xfs_dir_removename(struct xfs_trans *tp, struct xfs_inode *dp, struct xfs_name *name, xfs_ino_t ino, xfs_fsblock_t *first, struct xfs_bmap_free *flist, xfs_extlen_t tot); extern int xfs_dir_replace(struct xfs_trans *tp, struct xfs_inode *dp, struct xfs_name *name, xfs_ino_t inum, xfs_fsblock_t *first, struct xfs_bmap_free *flist, xfs_extlen_t tot); extern int xfs_dir_canenter(struct xfs_trans *tp, struct xfs_inode *dp, struct xfs_name *name, uint resblks); /* * Direct call from the bmap code, bypassing the generic directory layer. */ extern int xfs_dir2_sf_to_block(struct xfs_da_args *args); /* * Interface routines used by userspace utilities */ extern xfs_ino_t xfs_dir2_sf_get_parent_ino(struct xfs_dir2_sf_hdr *sfp); extern void xfs_dir2_sf_put_parent_ino(struct xfs_dir2_sf_hdr *sfp, xfs_ino_t ino); extern xfs_ino_t xfs_dir3_sfe_get_ino(struct xfs_mount *mp, struct xfs_dir2_sf_hdr *sfp, struct xfs_dir2_sf_entry *sfep); extern void xfs_dir3_sfe_put_ino(struct xfs_mount *mp, struct xfs_dir2_sf_hdr *hdr, struct xfs_dir2_sf_entry *sfep, xfs_ino_t ino); extern int xfs_dir2_isblock(struct xfs_trans *tp, struct xfs_inode *dp, int *r); extern int xfs_dir2_isleaf(struct xfs_trans *tp, struct xfs_inode *dp, int *r); extern int xfs_dir2_shrink_inode(struct xfs_da_args *args, xfs_dir2_db_t db, struct xfs_buf *bp); extern void xfs_dir2_data_freescan(struct xfs_mount *mp, struct xfs_dir2_data_hdr *hdr, int *loghead); extern void xfs_dir2_data_log_entry(struct xfs_trans *tp, struct xfs_buf *bp, struct xfs_dir2_data_entry *dep); extern void xfs_dir2_data_log_header(struct xfs_trans *tp, struct xfs_buf *bp); extern void xfs_dir2_data_log_unused(struct xfs_trans *tp, struct xfs_buf *bp, struct xfs_dir2_data_unused *dup); extern void xfs_dir2_data_make_free(struct xfs_trans *tp, struct xfs_buf *bp, xfs_dir2_data_aoff_t offset, xfs_dir2_data_aoff_t len, int *needlogp, int *needscanp); extern void xfs_dir2_data_use_free(struct xfs_trans *tp, struct xfs_buf *bp, struct xfs_dir2_data_unused *dup, xfs_dir2_data_aoff_t offset, xfs_dir2_data_aoff_t len, int *needlogp, int *needscanp); extern struct xfs_dir2_data_free *xfs_dir2_data_freefind( struct xfs_dir2_data_hdr *hdr, struct xfs_dir2_data_unused *dup); extern const struct xfs_buf_ops xfs_dir3_block_buf_ops; extern const struct xfs_buf_ops xfs_dir3_leafn_buf_ops; extern const struct xfs_buf_ops xfs_dir3_leaf1_buf_ops; extern const struct xfs_buf_ops xfs_dir3_free_buf_ops; extern const struct xfs_buf_ops xfs_dir3_data_buf_ops; #endif /* __XFS_DIR2_H__ */
#include <linux/gfp.h> #include <linux/types.h> #include <linux/radix-tree.h> #include <linux/rcupdate.h> struct item { unsigned long index; unsigned int order; }; struct item *item_create(unsigned long index, unsigned int order); int __item_insert(struct radix_tree_root *root, struct item *item); int item_insert(struct radix_tree_root *root, unsigned long index); int item_insert_order(struct radix_tree_root *root, unsigned long index, unsigned order); int item_delete(struct radix_tree_root *root, unsigned long index); struct item *item_lookup(struct radix_tree_root *root, unsigned long index); void item_check_present(struct radix_tree_root *root, unsigned long index); void item_check_absent(struct radix_tree_root *root, unsigned long index); void item_gang_check_present(struct radix_tree_root *root, unsigned long start, unsigned long nr, int chunk, int hop); void item_full_scan(struct radix_tree_root *root, unsigned long start, unsigned long nr, int chunk); void item_kill_tree(struct radix_tree_root *root); int tag_tagged_items(struct radix_tree_root *, pthread_mutex_t *, unsigned long start, unsigned long end, unsigned batch, unsigned iftag, unsigned thentag); unsigned long find_item(struct radix_tree_root *, void *item); void tag_check(void); void multiorder_checks(void); void iteration_test(unsigned order, unsigned duration); void benchmark(void); void idr_checks(void); void ida_checks(void); void ida_thread_tests(void); struct item * item_tag_set(struct radix_tree_root *root, unsigned long index, int tag); struct item * item_tag_clear(struct radix_tree_root *root, unsigned long index, int tag); int item_tag_get(struct radix_tree_root *root, unsigned long index, int tag); void tree_verify_min_height(struct radix_tree_root *root, int maxindex); void verify_tag_consistency(struct radix_tree_root *root, unsigned int tag); extern int nr_allocated; /* Normally private parts of lib/radix-tree.c */ struct radix_tree_node *entry_to_node(void *ptr); void radix_tree_dump(struct radix_tree_root *root); int root_tag_get(struct radix_tree_root *root, unsigned int tag); unsigned long node_maxindex(struct radix_tree_node *); unsigned long shift_maxindex(unsigned int shift); int radix_tree_cpu_dead(unsigned int cpu); struct radix_tree_preload { unsigned nr; struct radix_tree_node *nodes; }; extern struct radix_tree_preload radix_tree_preloads;
/* *************************************************************************** * Ralink Tech Inc. * 4F, No. 2 Technology 5th Rd. * Science-based Industrial Park * Hsin-chu, Taiwan, R.O.C. * * (c) Copyright 2002-2009, Ralink Technology, Inc. * * All rights reserved. Ralink's source code is an unpublished work and the * use of a copyright notice does not imply otherwise. This source code * contains confidential trade secret material of Ralink Tech. Any attemp * or participation in deciphering, decoding, reverse engineering or in any * way altering the source code is stricitly prohibited, unless the prior * written consent of Ralink Technology, Inc. is obtained. *************************************************************************** Module Name: misc.h Abstract: Handling Misc Problem Revision History: Who When What -------- ---------- ---------------------------------------------- Sean Wang 2009-08-12 Create John Li 2009-12-23 Modified */
//===--- ScratchBuffer.h - Scratch space for forming tokens -----*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines the ScratchBuffer interface. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_LEX_SCRATCHBUFFER_H #define LLVM_CLANG_LEX_SCRATCHBUFFER_H #include "clang/Basic/SourceLocation.h" namespace clang { class SourceManager; /// ScratchBuffer - This class exposes a simple interface for the dynamic /// construction of tokens. This is used for builtin macros (e.g. __LINE__) as /// well as token pasting, etc. class ScratchBuffer { SourceManager &SourceMgr; char *CurBuffer; SourceLocation BufferStartLoc; unsigned BytesUsed; public: ScratchBuffer(SourceManager &SM); /// getToken - Splat the specified text into a temporary MemoryBuffer and /// return a SourceLocation that refers to the token. This is just like the /// previous method, but returns a location that indicates the physloc of the /// token. SourceLocation getToken(const char *Buf, unsigned Len, const char *&DestPtr); private: void AllocScratchBuffer(unsigned RequestLen); }; } // end namespace clang #endif
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ /*** This file is part of systemd. Copyright 2014 Tom Gundersen <teg@jklm.no> systemd 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. systemd 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 systemd; If not, see <http://www.gnu.org/licenses/>. ***/ #pragma once typedef struct Dummy Dummy; #include "networkd-netdev.h" struct Dummy { NetDev meta; }; extern const NetDevVTable dummy_vtable;
#include "nldbl-compat.h" double attribute_hidden exp10l (double x) { return exp10 (x); }
/* * linux/fs/proc/root.c * * Copyright (C) 1991, 1992 Linus Torvalds * * proc root directory handling functions */ #include <asm/uaccess.h> #include <linux/errno.h> #include <linux/time.h> #include <linux/proc_fs.h> #include <linux/stat.h> #include <linux/init.h> #include <linux/sched.h> #include <linux/module.h> #include <linux/bitops.h> #include <linux/user_namespace.h> #include <linux/mount.h> #include <linux/pid_namespace.h> #include <linux/parser.h> #include "internal.h" static int proc_test_super(struct super_block *sb, void *data) { return sb->s_fs_info == data; } static int proc_set_super(struct super_block *sb, void *data) { int err = set_anon_super(sb, NULL); if (!err) { struct pid_namespace *ns = (struct pid_namespace *)data; sb->s_fs_info = get_pid_ns(ns); } return err; } enum { Opt_gid, Opt_hidepid, Opt_err, }; static const match_table_t tokens = { {Opt_hidepid, "hidepid=%u"}, {Opt_gid, "gid=%u"}, {Opt_err, NULL}, }; static int proc_parse_options(char *options, struct pid_namespace *pid) { char *p; substring_t args[MAX_OPT_ARGS]; int option; if (!options) return 1; while ((p = strsep(&options, ",")) != NULL) { int token; if (!*p) continue; args[0].to = args[0].from = NULL; token = match_token(p, tokens, args); switch (token) { case Opt_gid: if (match_int(&args[0], &option)) return 0; pid->pid_gid = make_kgid(current_user_ns(), option); break; case Opt_hidepid: if (match_int(&args[0], &option)) return 0; if (option < 0 || option > 2) { pr_err("proc: hidepid value must be between 0 and 2.\n"); return 0; } pid->hide_pid = option; break; default: pr_err("proc: unrecognized mount option \"%s\" " "or missing value\n", p); return 0; } } return 1; } int proc_remount(struct super_block *sb, int *flags, char *data) { struct pid_namespace *pid = sb->s_fs_info; sync_filesystem(sb); return !proc_parse_options(data, pid); } static struct dentry *proc_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { int err; struct super_block *sb; struct pid_namespace *ns; char *options; if (flags & MS_KERNMOUNT) { ns = (struct pid_namespace *)data; options = NULL; } else { ns = task_active_pid_ns(current); options = data; /* Does the mounter have privilege over the pid namespace? */ if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN)) return ERR_PTR(-EPERM); } sb = sget(fs_type, proc_test_super, proc_set_super, flags, ns); if (IS_ERR(sb)) return ERR_CAST(sb); /* * procfs isn't actually a stacking filesystem; however, there is * too much magic going on inside it to permit stacking things on * top of it */ sb->s_stack_depth = FILESYSTEM_MAX_STACK_DEPTH; if (!proc_parse_options(options, ns)) { deactivate_locked_super(sb); return ERR_PTR(-EINVAL); } if (!sb->s_root) { err = proc_fill_super(sb); if (err) { deactivate_locked_super(sb); return ERR_PTR(err); } sb->s_flags |= MS_ACTIVE; } return dget(sb->s_root); } static void proc_kill_sb(struct super_block *sb) { struct pid_namespace *ns; ns = (struct pid_namespace *)sb->s_fs_info; if (ns->proc_self) dput(ns->proc_self); if (ns->proc_thread_self) dput(ns->proc_thread_self); kill_anon_super(sb); put_pid_ns(ns); } static struct file_system_type proc_fs_type = { .name = "proc", .mount = proc_mount, .kill_sb = proc_kill_sb, .fs_flags = FS_USERNS_VISIBLE | FS_USERNS_MOUNT, }; void __init proc_root_init(void) { int err; proc_init_inodecache(); err = register_filesystem(&proc_fs_type); if (err) return; proc_self_init(); proc_thread_self_init(); proc_symlink("mounts", NULL, "self/mounts"); proc_net_init(); #ifdef CONFIG_SYSVIPC proc_mkdir("sysvipc", NULL); #endif proc_mkdir("fs", NULL); proc_mkdir("driver", NULL); proc_mkdir("fs/nfsd", NULL); /* somewhere for the nfsd filesystem to be mounted */ #if defined(CONFIG_SUN_OPENPROMFS) || defined(CONFIG_SUN_OPENPROMFS_MODULE) /* just give it a mountpoint */ proc_mkdir("openprom", NULL); #endif proc_tty_init(); proc_mkdir("bus", NULL); proc_sys_init(); } static int proc_root_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat ) { generic_fillattr(dentry->d_inode, stat); stat->nlink = proc_root.nlink + nr_processes(); return 0; } static struct dentry *proc_root_lookup(struct inode * dir, struct dentry * dentry, unsigned int flags) { if (!proc_pid_lookup(dir, dentry, flags)) return NULL; return proc_lookup(dir, dentry, flags); } static int proc_root_readdir(struct file *file, struct dir_context *ctx) { if (ctx->pos < FIRST_PROCESS_ENTRY) { int error = proc_readdir(file, ctx); if (unlikely(error <= 0)) return error; ctx->pos = FIRST_PROCESS_ENTRY; } return proc_pid_readdir(file, ctx); } /* * The root /proc directory is special, as it has the * <pid> directories. Thus we don't use the generic * directory handling functions for that.. */ static const struct file_operations proc_root_operations = { .read = generic_read_dir, .iterate = proc_root_readdir, .llseek = default_llseek, }; /* * proc root can do almost nothing.. */ static const struct inode_operations proc_root_inode_operations = { .lookup = proc_root_lookup, .getattr = proc_root_getattr, }; /* * This is the root "inode" in the /proc tree.. */ struct proc_dir_entry proc_root = { .low_ino = PROC_ROOT_INO, .namelen = 5, .mode = S_IFDIR | S_IRUGO | S_IXUGO, .nlink = 2, .count = ATOMIC_INIT(1), .proc_iops = &proc_root_inode_operations, .proc_fops = &proc_root_operations, .parent = &proc_root, .name = "/proc", }; int pid_ns_prepare_proc(struct pid_namespace *ns) { struct vfsmount *mnt; mnt = kern_mount_data(&proc_fs_type, ns); if (IS_ERR(mnt)) return PTR_ERR(mnt); ns->proc_mnt = mnt; return 0; } void pid_ns_release_proc(struct pid_namespace *ns) { kern_unmount(ns->proc_mnt); }
/* * Generic library functions for the MSF (Media and Switch Fabric) unit * found on the Intel IXP2400 network processor. * * Copyright (C) 2004, 2005 Lennert Buytenhek <buytenh@wantstofly.org> * Dedicated to Marija Kulikova. * * This program 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. */ #include <linux/kernel.h> #include <linux/init.h> #include <asm/hardware.h> #include <asm/arch/ixp2000-regs.h> #include <asm/delay.h> #include <asm/io.h> #include "ixp2400-msf.h" /* * This is the Intel recommended PLL init procedure as described on * page 340 of the IXP2400/IXP2800 Programmer's Reference Manual. */ static void ixp2400_pll_init(struct ixp2400_msf_parameters *mp) { int rx_dual_clock; int tx_dual_clock; u32 value; /* * If the RX mode is not 1x32, we have to enable both RX PLLs * (#0 and #1.) The same thing for the TX direction. */ rx_dual_clock = !!(mp->rx_mode & IXP2400_RX_MODE_WIDTH_MASK); tx_dual_clock = !!(mp->tx_mode & IXP2400_TX_MODE_WIDTH_MASK); /* * Read initial value. */ value = ixp2000_reg_read(IXP2000_MSF_CLK_CNTRL); /* * Put PLLs in powerdown and bypass mode. */ value |= 0x0000f0f0; ixp2000_reg_write(IXP2000_MSF_CLK_CNTRL, value); /* * Set single or dual clock mode bits. */ value &= ~0x03000000; value |= (rx_dual_clock << 24) | (tx_dual_clock << 25); /* * Set multipliers. */ value &= ~0x00ff0000; value |= mp->rxclk01_multiplier << 16; value |= mp->rxclk23_multiplier << 18; value |= mp->txclk01_multiplier << 20; value |= mp->txclk23_multiplier << 22; /* * And write value. */ ixp2000_reg_write(IXP2000_MSF_CLK_CNTRL, value); /* * Disable PLL bypass mode. */ value &= ~(0x00005000 | rx_dual_clock << 13 | tx_dual_clock << 15); ixp2000_reg_write(IXP2000_MSF_CLK_CNTRL, value); /* * Turn on PLLs. */ value &= ~(0x00000050 | rx_dual_clock << 5 | tx_dual_clock << 7); ixp2000_reg_write(IXP2000_MSF_CLK_CNTRL, value); /* * Wait for PLLs to lock. There are lock status bits, but IXP2400 * erratum #65 says that these lock bits should not be relied upon * as they might not accurately reflect the true state of the PLLs. */ udelay(100); } /* * Needed according to p480 of Programmer's Reference Manual. */ static void ixp2400_msf_free_rbuf_entries(struct ixp2400_msf_parameters *mp) { int size_bits; int i; /* * Work around IXP2400 erratum #69 (silent RBUF-to-DRAM transfer * corruption) in the Intel-recommended way: do not add the RBUF * elements susceptible to corruption to the freelist. */ size_bits = mp->rx_mode & IXP2400_RX_MODE_RBUF_SIZE_MASK; if (size_bits == IXP2400_RX_MODE_RBUF_SIZE_64) { for (i = 1; i < 128; i++) { if (i == 9 || i == 18 || i == 27) continue; ixp2000_reg_write(IXP2000_MSF_RBUF_ELEMENT_DONE, i); } } else if (size_bits == IXP2400_RX_MODE_RBUF_SIZE_128) { for (i = 1; i < 64; i++) { if (i == 4 || i == 9 || i == 13) continue; ixp2000_reg_write(IXP2000_MSF_RBUF_ELEMENT_DONE, i); } } else if (size_bits == IXP2400_RX_MODE_RBUF_SIZE_256) { for (i = 1; i < 32; i++) { if (i == 2 || i == 4 || i == 6) continue; ixp2000_reg_write(IXP2000_MSF_RBUF_ELEMENT_DONE, i); } } } static u32 ixp2400_msf_valid_channels(u32 reg) { u32 channels; channels = 0; switch (reg & IXP2400_RX_MODE_WIDTH_MASK) { case IXP2400_RX_MODE_1x32: channels = 0x1; if (reg & IXP2400_RX_MODE_MPHY && !(reg & IXP2400_RX_MODE_MPHY_32)) channels = 0xf; break; case IXP2400_RX_MODE_2x16: channels = 0x5; break; case IXP2400_RX_MODE_4x8: channels = 0xf; break; case IXP2400_RX_MODE_1x16_2x8: channels = 0xd; break; } return channels; } static void ixp2400_msf_enable_rx(struct ixp2400_msf_parameters *mp) { u32 value; value = ixp2000_reg_read(IXP2000_MSF_RX_CONTROL) & 0x0fffffff; value |= ixp2400_msf_valid_channels(mp->rx_mode) << 28; ixp2000_reg_write(IXP2000_MSF_RX_CONTROL, value); } static void ixp2400_msf_enable_tx(struct ixp2400_msf_parameters *mp) { u32 value; value = ixp2000_reg_read(IXP2000_MSF_TX_CONTROL) & 0x0fffffff; value |= ixp2400_msf_valid_channels(mp->tx_mode) << 28; ixp2000_reg_write(IXP2000_MSF_TX_CONTROL, value); } void ixp2400_msf_init(struct ixp2400_msf_parameters *mp) { u32 value; int i; /* * Init the RX/TX PLLs based on the passed parameter block. */ ixp2400_pll_init(mp); /* * Reset MSF. Bit 7 in IXP_RESET_0 resets the MSF. */ value = ixp2000_reg_read(IXP2000_RESET0); ixp2000_reg_write(IXP2000_RESET0, value | 0x80); ixp2000_reg_write(IXP2000_RESET0, value & ~0x80); /* * Initialise the RX section. */ ixp2000_reg_write(IXP2000_MSF_RX_MPHY_POLL_LIMIT, mp->rx_poll_ports - 1); ixp2000_reg_write(IXP2000_MSF_RX_CONTROL, mp->rx_mode); for (i = 0; i < 4; i++) { ixp2000_reg_write(IXP2000_MSF_RX_UP_CONTROL_0 + i, mp->rx_channel_mode[i]); } ixp2400_msf_free_rbuf_entries(mp); ixp2400_msf_enable_rx(mp); /* * Initialise the TX section. */ ixp2000_reg_write(IXP2000_MSF_TX_MPHY_POLL_LIMIT, mp->tx_poll_ports - 1); ixp2000_reg_write(IXP2000_MSF_TX_CONTROL, mp->tx_mode); for (i = 0; i < 4; i++) { ixp2000_reg_write(IXP2000_MSF_TX_UP_CONTROL_0 + i, mp->tx_channel_mode[i]); } ixp2400_msf_enable_tx(mp); }
/* * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all * copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* * Copyright (c) 2012, The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all * copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ #if !defined( __WLAN_QCT_PAL_MSG_H ) #define __WLAN_QCT_PAL_MSG_H /**========================================================================= \file wlan_qct_pal_msg.h \brief define general message APIs PAL exports to support legacy UMAC. wpt = (Wlan Pal Type) wpal = (Wlan PAL) Definitions for platform dependent. Only work with legacy UMAC. Copyright 2010 (c) Qualcomm, Incorporated. All Rights Reserved. Qualcomm Confidential and Proprietary. ========================================================================*/ #include "wlan_qct_pal_type.h" #include "wlan_qct_pal_status.h" /* Random signature to detect SMD OPEN NOTIFY */ #define WPAL_MC_MSG_SMD_NOTIF_OPEN_SIG 0x09E2 /* Random signature to detect SMD DATA NOTIFY */ #define WPAL_MC_MSG_SMD_NOTIF_DATA_SIG 0xDA7A typedef struct swpt_msg wpt_msg; typedef void (*wpal_msg_callback)(wpt_msg *pMsg); struct swpt_msg { wpt_uint16 type; wpt_uint16 reserved; void *ptr; wpt_uint32 val; wpal_msg_callback callback; void *pContext; }; /*--------------------------------------------------------------------------- wpalPostCtrlMsg – Post a message to control context so it can be processed in that context. Param: pPalContext – A PAL context pMsg – a pointer to called allocated object; Caller retain the ownership after this API returns. ---------------------------------------------------------------------------*/ wpt_status wpalPostCtrlMsg(void *pPalContext, wpt_msg *pMsg); /*--------------------------------------------------------------------------- wpalPostTxMsg – Post a message to TX context so it can be processed in that context. Param: pPalContext – A PAL context pMsg – a pointer to called allocated object; Caller retain the ownership after this API returns. ---------------------------------------------------------------------------*/ wpt_status wpalPostTxMsg(void *pPalContext, wpt_msg *pMsg); /*--------------------------------------------------------------------------- wpalPostRxMsg – Post a message to RX context so it can be processed in that context. Param: pPalContext – A PAL context pMsg – a pointer to called allocated object; Caller retain the ownership after this API returns. ---------------------------------------------------------------------------*/ wpt_status wpalPostRxMsg(void *pPalContext, wpt_msg *pMsg); #endif // __WLAN_QCT_PAL_API_H
/* Simple DirectMedia Layer Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org> 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. */ #include "../../SDL_internal.h" #if SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED #include "SDL_render.h" #ifdef __cplusplus extern "C" { #endif void * D3D11_GetCoreWindowFromSDLRenderer(SDL_Renderer * renderer); DXGI_MODE_ROTATION D3D11_GetCurrentRotation(); #ifdef __cplusplus } #endif #endif /* SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED */ /* vi: set ts=4 sw=4 expandtab: */
/* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef __KGSL_PWRCTRL_H #define __KGSL_PWRCTRL_H #define KGSL_PWRFLAGS_ON 1 #define KGSL_PWRFLAGS_OFF 0 #define KGSL_PWRLEVEL_TURBO 0 #define KGSL_PWRLEVEL_NOMINAL 1 #define KGSL_PWRLEVEL_LAST_OFFSET 2 #define KGSL_MAX_CLKS 5 struct platform_device; struct kgsl_clk_stats { unsigned int old_clock_time[KGSL_MAX_PWRLEVELS]; unsigned int clock_time[KGSL_MAX_PWRLEVELS]; unsigned int on_time_old; ktime_t start; ktime_t stop; unsigned int no_nap_cnt; unsigned int elapsed; unsigned int elapsed_old; }; struct kgsl_pwrctrl { int interrupt_num; struct clk *ebi1_clk; struct clk *grp_clks[KGSL_MAX_CLKS]; unsigned long power_flags; struct kgsl_pwrlevel pwrlevels[KGSL_MAX_PWRLEVELS]; unsigned int active_pwrlevel; int thermal_pwrlevel; unsigned int default_pwrlevel; unsigned int max_pwrlevel; unsigned int min_pwrlevel; unsigned int num_pwrlevels; unsigned int interval_timeout; bool strtstp_sleepwake; struct regulator *gpu_reg; struct regulator *gpu_cx; uint32_t pcl; unsigned int nap_allowed; unsigned int idle_needed; const char *irq_name; s64 time; unsigned int restore_slumber; struct kgsl_clk_stats clk_stats; }; void kgsl_pwrctrl_irq(struct kgsl_device *device, int state); int kgsl_pwrctrl_init(struct kgsl_device *device); void kgsl_pwrctrl_close(struct kgsl_device *device); void kgsl_timer(unsigned long data); void kgsl_idle_check(struct work_struct *work); void kgsl_pre_hwaccess(struct kgsl_device *device); int kgsl_pwrctrl_sleep(struct kgsl_device *device); int kgsl_pwrctrl_wake(struct kgsl_device *device); void kgsl_pwrctrl_pwrlevel_change(struct kgsl_device *device, unsigned int level); int kgsl_pwrctrl_init_sysfs(struct kgsl_device *device); void kgsl_pwrctrl_uninit_sysfs(struct kgsl_device *device); void kgsl_pwrctrl_enable(struct kgsl_device *device); void kgsl_pwrctrl_disable(struct kgsl_device *device); bool kgsl_pwrctrl_isenabled(struct kgsl_device *device); static inline unsigned long kgsl_get_clkrate(struct clk *clk) { return (clk != NULL) ? clk_get_rate(clk) : 0; } void kgsl_pwrctrl_set_state(struct kgsl_device *device, unsigned int state); void kgsl_pwrctrl_request_state(struct kgsl_device *device, unsigned int state); int kgsl_active_count_get(struct kgsl_device *device); int kgsl_active_count_get_light(struct kgsl_device *device); void kgsl_active_count_put(struct kgsl_device *device); void kgsl_active_count_wait(struct kgsl_device *device); #endif
/* SPDX-License-Identifier: GPL-2.0-only */ /* * include/asm-xtensa/pgalloc.h * * Copyright (C) 2001-2007 Tensilica Inc. */ #ifndef _XTENSA_PGALLOC_H #define _XTENSA_PGALLOC_H #include <linux/highmem.h> #include <linux/slab.h> /* * Allocating and freeing a pmd is trivial: the 1-entry pmd is * inside the pgd, so has no extra memory associated with it. */ #define pmd_populate_kernel(mm, pmdp, ptep) \ (pmd_val(*(pmdp)) = ((unsigned long)ptep)) #define pmd_populate(mm, pmdp, page) \ (pmd_val(*(pmdp)) = ((unsigned long)page_to_virt(page))) #define pmd_pgtable(pmd) pmd_page(pmd) static inline pgd_t* pgd_alloc(struct mm_struct *mm) { return (pgd_t*) __get_free_pages(GFP_KERNEL | __GFP_ZERO, PGD_ORDER); } static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) { free_page((unsigned long)pgd); } static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm) { pte_t *ptep; int i; ptep = (pte_t *)__get_free_page(GFP_KERNEL); if (!ptep) return NULL; for (i = 0; i < 1024; i++) pte_clear(NULL, 0, ptep + i); return ptep; } static inline pgtable_t pte_alloc_one(struct mm_struct *mm) { pte_t *pte; struct page *page; pte = pte_alloc_one_kernel(mm); if (!pte) return NULL; page = virt_to_page(pte); if (!pgtable_pte_page_ctor(page)) { __free_page(page); return NULL; } return page; } static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) { free_page((unsigned long)pte); } static inline void pte_free(struct mm_struct *mm, pgtable_t pte) { pgtable_pte_page_dtor(pte); __free_page(pte); } #define pmd_pgtable(pmd) pmd_page(pmd) #endif /* _XTENSA_PGALLOC_H */
// SPDX-License-Identifier: GPL-2.0+ /* * Driver for CPM (SCC/SMC) serial ports; CPM1 definitions * * Maintainer: Kumar Gala (galak@kernel.crashing.org) (CPM2) * Pantelis Antoniou (panto@intracom.gr) (CPM1) * * Copyright (C) 2004 Freescale Semiconductor, Inc. * (C) 2004 Intracom, S.A. * (C) 2006 MontaVista Software, Inc. * Vitaly Bordug <vbordug@ru.mvista.com> */ #include <linux/module.h> #include <linux/tty.h> #include <linux/gfp.h> #include <linux/ioport.h> #include <linux/serial.h> #include <linux/console.h> #include <linux/sysrq.h> #include <linux/device.h> #include <linux/memblock.h> #include <linux/dma-mapping.h> #include <asm/io.h> #include <asm/irq.h> #include <asm/fs_pd.h> #include <linux/serial_core.h> #include <linux/kernel.h> #include <linux/of.h> #include <linux/of_address.h> #include "cpm_uart.h" /**************************************************************/ void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd) { cpm_command(port->command, cmd); } void __iomem *cpm_uart_map_pram(struct uart_cpm_port *port, struct device_node *np) { return of_iomap(np, 1); } void cpm_uart_unmap_pram(struct uart_cpm_port *port, void __iomem *pram) { iounmap(pram); } /* * Allocate DP-Ram and memory buffers. We need to allocate a transmit and * receive buffer descriptors from dual port ram, and a character * buffer area from host mem. If we are allocating for the console we need * to do it from bootmem */ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) { int dpmemsz, memsz; u8 *dp_mem; unsigned long dp_offset; u8 *mem_addr; dma_addr_t dma_addr = 0; pr_debug("CPM uart[%d]:allocbuf\n", pinfo->port.line); dpmemsz = sizeof(cbd_t) * (pinfo->rx_nrfifos + pinfo->tx_nrfifos); dp_offset = cpm_dpalloc(dpmemsz, 8); if (IS_ERR_VALUE(dp_offset)) { printk(KERN_ERR "cpm_uart_cpm1.c: could not allocate buffer descriptors\n"); return -ENOMEM; } dp_mem = cpm_dpram_addr(dp_offset); memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) + L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize); if (is_con) { /* was hostalloc but changed cause it blows away the */ /* large tlb mapping when pinning the kernel area */ mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8)); dma_addr = (u32)cpm_dpram_phys(mem_addr); } else mem_addr = dma_alloc_coherent(pinfo->port.dev, memsz, &dma_addr, GFP_KERNEL); if (mem_addr == NULL) { cpm_dpfree(dp_offset); printk(KERN_ERR "cpm_uart_cpm1.c: could not allocate coherent memory\n"); return -ENOMEM; } pinfo->dp_addr = dp_offset; pinfo->mem_addr = mem_addr; /* virtual address*/ pinfo->dma_addr = dma_addr; /* physical address*/ pinfo->mem_size = memsz; pinfo->rx_buf = mem_addr; pinfo->tx_buf = pinfo->rx_buf + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize); pinfo->rx_bd_base = (cbd_t __iomem __force *)dp_mem; pinfo->tx_bd_base = pinfo->rx_bd_base + pinfo->rx_nrfifos; return 0; } void cpm_uart_freebuf(struct uart_cpm_port *pinfo) { dma_free_coherent(pinfo->port.dev, L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) + L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize), pinfo->mem_addr, pinfo->dma_addr); cpm_dpfree(pinfo->dp_addr); }
// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright © 2008 Ingo Molnar */ #include <asm/iomap.h> #include <asm/memtype.h> #include <linux/export.h> #include <linux/highmem.h> static int is_io_mapping_possible(resource_size_t base, unsigned long size) { #if !defined(CONFIG_X86_PAE) && defined(CONFIG_PHYS_ADDR_T_64BIT) /* There is no way to map greater than 1 << 32 address without PAE */ if (base + size > 0x100000000ULL) return 0; #endif return 1; } int iomap_create_wc(resource_size_t base, unsigned long size, pgprot_t *prot) { enum page_cache_mode pcm = _PAGE_CACHE_MODE_WC; int ret; if (!is_io_mapping_possible(base, size)) return -EINVAL; ret = memtype_reserve_io(base, base + size, &pcm); if (ret) return ret; *prot = __pgprot(__PAGE_KERNEL | cachemode2protval(pcm)); /* Filter out unsupported __PAGE_KERNEL* bits: */ pgprot_val(*prot) &= __default_kernel_pte_mask; return 0; } EXPORT_SYMBOL_GPL(iomap_create_wc); void iomap_free(resource_size_t base, unsigned long size) { memtype_free_io(base, base + size); } EXPORT_SYMBOL_GPL(iomap_free); void __iomem *__iomap_local_pfn_prot(unsigned long pfn, pgprot_t prot) { /* * For non-PAT systems, translate non-WB request to UC- just in * case the caller set the PWT bit to prot directly without using * pgprot_writecombine(). UC- translates to uncached if the MTRR * is UC or WC. UC- gets the real intention, of the user, which is * "WC if the MTRR is WC, UC if you can't do that." */ if (!pat_enabled() && pgprot2cachemode(prot) != _PAGE_CACHE_MODE_WB) prot = __pgprot(__PAGE_KERNEL | cachemode2protval(_PAGE_CACHE_MODE_UC_MINUS)); /* Filter out unsupported __PAGE_KERNEL* bits: */ pgprot_val(prot) &= __default_kernel_pte_mask; return (void __force __iomem *)__kmap_local_pfn_prot(pfn, prot); } EXPORT_SYMBOL_GPL(__iomap_local_pfn_prot);
/* * This file is part of the WebKit open source project. * This file has been generated by generate-bindings.pl. DO NOT MODIFY! * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import <WebCore/DOMTestCallback.h> #if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_LATEST namespace WebCore { class TestCallback; } WebCore::TestCallback* core(DOMTestCallback *); DOMTestCallback *kit(WebCore::TestCallback*); #endif
/* This file is part of the WebKit open source project. This file has been generated by generate-bindings.pl. DO NOT MODIFY! This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef WebKitDOMTestTypedefsPrivate_h #define WebKitDOMTestTypedefsPrivate_h #include "TestTypedefs.h" #include <webkitdom/WebKitDOMTestTypedefs.h> namespace WebKit { WebKitDOMTestTypedefs* wrapTestTypedefs(WebCore::TestTypedefs*); WebKitDOMTestTypedefs* kit(WebCore::TestTypedefs*); WebCore::TestTypedefs* core(WebKitDOMTestTypedefs*); } // namespace WebKit #endif /* WebKitDOMTestTypedefsPrivate_h */
/* This file is part of the WebKit open source project. This file has been generated by generate-bindings.pl. DO NOT MODIFY! This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef WebKitDOMTestSerializedScriptValueInterfacePrivate_h #define WebKitDOMTestSerializedScriptValueInterfacePrivate_h #include "TestSerializedScriptValueInterface.h" #include <webkitdom/WebKitDOMTestSerializedScriptValueInterface.h> #if ENABLE(Condition1) || ENABLE(Condition2) namespace WebKit { WebKitDOMTestSerializedScriptValueInterface* wrapTestSerializedScriptValueInterface(WebCore::TestSerializedScriptValueInterface*); WebKitDOMTestSerializedScriptValueInterface* kit(WebCore::TestSerializedScriptValueInterface*); WebCore::TestSerializedScriptValueInterface* core(WebKitDOMTestSerializedScriptValueInterface*); } // namespace WebKit #endif /* ENABLE(Condition1) || ENABLE(Condition2) */ #endif /* WebKitDOMTestSerializedScriptValueInterfacePrivate_h */
/* * Linux Wireless Extensions support * * Copyright (C) 1999-2012, Broadcom Corporation * * Unless you and Broadcom execute a separate written software license * agreement governing use of this software, this software is licensed to you * under the terms of the GNU General Public License version 2 (the "GPL"), * available at http://www.broadcom.com/licenses/GPLv2.php, with the * following added to such license: * * As a special exception, the copyright holders of this software give you * permission to link this software with independent modules, and to copy and * distribute the resulting executable under terms of your choice, provided that * you also meet, for each linked independent module, the terms and conditions of * the license of that module. An independent module is a module which is not * derived from this software. The special exception does not apply to any * modifications of the software. * * Notwithstanding the above, under no circumstances may you combine this * software in any way with any other Broadcom software provided under a license * other than the GPL, without Broadcom's express prior written consent. * * $Id: wl_iw.h 291086 2011-10-21 01:17:24Z $ */ #ifndef _wl_iw_h_ #define _wl_iw_h_ #include <linux/wireless.h> #include <typedefs.h> #include <proto/ethernet.h> #include <wlioctl.h> #define WL_SCAN_PARAMS_SSID_MAX 10 #define GET_SSID "SSID=" #define GET_CHANNEL "CH=" #define GET_NPROBE "NPROBE=" #define GET_ACTIVE_ASSOC_DWELL "ACTIVE=" #define GET_PASSIVE_ASSOC_DWELL "PASSIVE=" #define GET_HOME_DWELL "HOME=" #define GET_SCAN_TYPE "TYPE=" #define BAND_GET_CMD "GETBAND" #define BAND_SET_CMD "SETBAND" #define DTIM_SKIP_GET_CMD "DTIMSKIPGET" #define DTIM_SKIP_SET_CMD "DTIMSKIPSET" #define SETSUSPEND_CMD "SETSUSPENDOPT" #define PNOSSIDCLR_SET_CMD "PNOSSIDCLR" /* Lin - Is the extra space needed? */ #define PNOSETUP_SET_CMD "PNOSETUP " /* TLV command has extra end space */ #define PNOENABLE_SET_CMD "PNOFORCE" #define PNODEBUG_SET_CMD "PNODEBUG" #define TXPOWER_SET_CMD "TXPOWER" #define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] #define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" /* Structure to keep global parameters */ typedef struct wl_iw_extra_params { int target_channel; /* target channel */ } wl_iw_extra_params_t; struct cntry_locales_custom { char iso_abbrev[WLC_CNTRY_BUF_SZ]; /* ISO 3166-1 country abbreviation */ char custom_locale[WLC_CNTRY_BUF_SZ]; /* Custom firmware locale */ int32 custom_locale_rev; /* Custom local revisin default -1 */ }; /* ============================================== */ /* Defines from wlc_pub.h */ #define WL_IW_RSSI_MINVAL -200 /* Low value, e.g. for forcing roam */ #define WL_IW_RSSI_NO_SIGNAL -91 /* NDIS RSSI link quality cutoffs */ #define WL_IW_RSSI_VERY_LOW -80 /* Very low quality cutoffs */ #define WL_IW_RSSI_LOW -70 /* Low quality cutoffs */ #define WL_IW_RSSI_GOOD -68 /* Good quality cutoffs */ #define WL_IW_RSSI_VERY_GOOD -58 /* Very good quality cutoffs */ #define WL_IW_RSSI_EXCELLENT -57 /* Excellent quality cutoffs */ #define WL_IW_RSSI_INVALID 0 /* invalid RSSI value */ #define MAX_WX_STRING 80 #define SSID_FMT_BUF_LEN ((4 * 32) + 1) #define isprint(c) bcm_isprint(c) #define WL_IW_SET_ACTIVE_SCAN (SIOCIWFIRSTPRIV+1) #define WL_IW_GET_RSSI (SIOCIWFIRSTPRIV+3) #define WL_IW_SET_PASSIVE_SCAN (SIOCIWFIRSTPRIV+5) #define WL_IW_GET_LINK_SPEED (SIOCIWFIRSTPRIV+7) #define WL_IW_GET_CURR_MACADDR (SIOCIWFIRSTPRIV+9) #define WL_IW_SET_STOP (SIOCIWFIRSTPRIV+11) #define WL_IW_SET_START (SIOCIWFIRSTPRIV+13) #define G_SCAN_RESULTS 8*1024 #define WE_ADD_EVENT_FIX 0x80 #define G_WLAN_SET_ON 0 #define G_WLAN_SET_OFF 1 typedef struct wl_iw { char nickname[IW_ESSID_MAX_SIZE]; struct iw_statistics wstats; int spy_num; uint32 pwsec; /* pairwise wsec setting */ uint32 gwsec; /* group wsec setting */ bool privacy_invoked; /* IW_AUTH_PRIVACY_INVOKED setting */ struct ether_addr spy_addr[IW_MAX_SPY]; struct iw_quality spy_qual[IW_MAX_SPY]; void *wlinfo; } wl_iw_t; struct wl_ctrl { struct timer_list *timer; struct net_device *dev; long sysioc_pid; struct semaphore sysioc_sem; struct completion sysioc_exited; }; #if WIRELESS_EXT > 12 #include <net/iw_handler.h> extern const struct iw_handler_def wl_iw_handler_def; #endif /* WIRELESS_EXT > 12 */ extern int wl_iw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); extern void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data); extern int wl_iw_get_wireless_stats(struct net_device *dev, struct iw_statistics *wstats); int wl_iw_attach(struct net_device *dev, void * dhdp); int wl_iw_send_priv_event(struct net_device *dev, char *flag); void wl_iw_detach(void); #define CSCAN_COMMAND "CSCAN " #define CSCAN_TLV_PREFIX 'S' #define CSCAN_TLV_VERSION 1 #define CSCAN_TLV_SUBVERSION 0 #define CSCAN_TLV_TYPE_SSID_IE 'S' #define CSCAN_TLV_TYPE_CHANNEL_IE 'C' #define CSCAN_TLV_TYPE_NPROBE_IE 'N' #define CSCAN_TLV_TYPE_ACTIVE_IE 'A' #define CSCAN_TLV_TYPE_PASSIVE_IE 'P' #define CSCAN_TLV_TYPE_HOME_IE 'H' #define CSCAN_TLV_TYPE_STYPE_IE 'T' #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) #define IWE_STREAM_ADD_EVENT(info, stream, ends, iwe, extra) \ iwe_stream_add_event(info, stream, ends, iwe, extra) #define IWE_STREAM_ADD_VALUE(info, event, value, ends, iwe, event_len) \ iwe_stream_add_value(info, event, value, ends, iwe, event_len) #define IWE_STREAM_ADD_POINT(info, stream, ends, iwe, extra) \ iwe_stream_add_point(info, stream, ends, iwe, extra) #else #define IWE_STREAM_ADD_EVENT(info, stream, ends, iwe, extra) \ iwe_stream_add_event(stream, ends, iwe, extra) #define IWE_STREAM_ADD_VALUE(info, event, value, ends, iwe, event_len) \ iwe_stream_add_value(event, value, ends, iwe, event_len) #define IWE_STREAM_ADD_POINT(info, stream, ends, iwe, extra) \ iwe_stream_add_point(stream, ends, iwe, extra) #endif #endif /* _wl_iw_h_ */
/* * Internal header to deal with irq_desc->status which will be renamed * to irq_desc->settings. */ enum { _IRQ_DEFAULT_INIT_FLAGS = IRQ_DEFAULT_INIT_FLAGS, _IRQ_PER_CPU = IRQ_PER_CPU, _IRQ_LEVEL = IRQ_LEVEL, _IRQ_NOPROBE = IRQ_NOPROBE, _IRQ_NOREQUEST = IRQ_NOREQUEST, _IRQ_NOTHREAD = IRQ_NOTHREAD, _IRQ_NOAUTOEN = IRQ_NOAUTOEN, _IRQ_MOVE_PCNTXT = IRQ_MOVE_PCNTXT, _IRQ_NO_BALANCING = IRQ_NO_BALANCING, _IRQ_NESTED_THREAD = IRQ_NESTED_THREAD, _IRQF_MODIFY_MASK = IRQF_MODIFY_MASK, }; #define IRQ_PER_CPU GOT_YOU_MORON #define IRQ_NO_BALANCING GOT_YOU_MORON #define IRQ_LEVEL GOT_YOU_MORON #define IRQ_NOPROBE GOT_YOU_MORON #define IRQ_NOREQUEST GOT_YOU_MORON #define IRQ_NOTHREAD GOT_YOU_MORON #define IRQ_NOAUTOEN GOT_YOU_MORON #define IRQ_NESTED_THREAD GOT_YOU_MORON #undef IRQF_MODIFY_MASK #define IRQF_MODIFY_MASK GOT_YOU_MORON static inline void irq_settings_clr_and_set(struct irq_desc *desc, u32 clr, u32 set) { desc->status_use_accessors &= ~(clr & _IRQF_MODIFY_MASK); desc->status_use_accessors |= (set & _IRQF_MODIFY_MASK); } static inline bool irq_settings_is_per_cpu(struct irq_desc *desc) { return desc->status_use_accessors & _IRQ_PER_CPU; } static inline void irq_settings_set_per_cpu(struct irq_desc *desc) { desc->status_use_accessors |= _IRQ_PER_CPU; } static inline void irq_settings_set_no_balancing(struct irq_desc *desc) { desc->status_use_accessors |= _IRQ_NO_BALANCING; } static inline bool irq_settings_has_no_balance_set(struct irq_desc *desc) { return desc->status_use_accessors & _IRQ_NO_BALANCING; } static inline u32 irq_settings_get_trigger_mask(struct irq_desc *desc) { return desc->status_use_accessors & IRQ_TYPE_SENSE_MASK; } static inline void irq_settings_set_trigger_mask(struct irq_desc *desc, u32 mask) { desc->status_use_accessors &= ~IRQ_TYPE_SENSE_MASK; desc->status_use_accessors |= mask & IRQ_TYPE_SENSE_MASK; } static inline bool irq_settings_is_level(struct irq_desc *desc) { return desc->status_use_accessors & _IRQ_LEVEL; } static inline void irq_settings_clr_level(struct irq_desc *desc) { desc->status_use_accessors &= ~_IRQ_LEVEL; } static inline void irq_settings_set_level(struct irq_desc *desc) { desc->status_use_accessors |= _IRQ_LEVEL; } static inline bool irq_settings_can_request(struct irq_desc *desc) { return !(desc->status_use_accessors & _IRQ_NOREQUEST); } static inline void irq_settings_clr_norequest(struct irq_desc *desc) { desc->status_use_accessors &= ~_IRQ_NOREQUEST; } static inline void irq_settings_set_norequest(struct irq_desc *desc) { desc->status_use_accessors |= _IRQ_NOREQUEST; } static inline bool irq_settings_can_thread(struct irq_desc *desc) { return !(desc->status_use_accessors & _IRQ_NOTHREAD); } static inline void irq_settings_clr_nothread(struct irq_desc *desc) { desc->status_use_accessors &= ~_IRQ_NOTHREAD; } static inline void irq_settings_set_nothread(struct irq_desc *desc) { desc->status_use_accessors |= _IRQ_NOTHREAD; } static inline bool irq_settings_can_probe(struct irq_desc *desc) { return !(desc->status_use_accessors & _IRQ_NOPROBE); } static inline void irq_settings_clr_noprobe(struct irq_desc *desc) { desc->status_use_accessors &= ~_IRQ_NOPROBE; } static inline void irq_settings_set_noprobe(struct irq_desc *desc) { desc->status_use_accessors |= _IRQ_NOPROBE; } static inline bool irq_settings_can_move_pcntxt(struct irq_desc *desc) { return desc->status_use_accessors & _IRQ_MOVE_PCNTXT; } static inline bool irq_settings_can_autoenable(struct irq_desc *desc) { return !(desc->status_use_accessors & _IRQ_NOAUTOEN); } static inline bool irq_settings_is_nested_thread(struct irq_desc *desc) { return desc->status_use_accessors & _IRQ_NESTED_THREAD; }
// SPDX-License-Identifier: GPL-2.0 // Copyright (c) 2018 Facebook #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <fcntl.h> #include <syscall.h> #include <unistd.h> #include <linux/perf_event.h> #include <sys/ioctl.h> #include <sys/time.h> #include <sys/types.h> #include <sys/stat.h> #include <linux/bpf.h> #include <bpf/bpf.h> #include <bpf/libbpf.h> #include "cgroup_helpers.h" #include "bpf_rlimit.h" #define CHECK(condition, tag, format...) ({ \ int __ret = !!(condition); \ if (__ret) { \ printf("%s:FAIL:%s ", __func__, tag); \ printf(format); \ } else { \ printf("%s:PASS:%s\n", __func__, tag); \ } \ __ret; \ }) static int bpf_find_map(const char *test, struct bpf_object *obj, const char *name) { struct bpf_map *map; map = bpf_object__find_map_by_name(obj, name); if (!map) return -1; return bpf_map__fd(map); } #define TEST_CGROUP "/test-bpf-get-cgroup-id/" int main(int argc, char **argv) { const char *probe_name = "syscalls/sys_enter_nanosleep"; const char *file = "get_cgroup_id_kern.o"; int err, bytes, efd, prog_fd, pmu_fd; int cgroup_fd, cgidmap_fd, pidmap_fd; struct perf_event_attr attr = {}; struct bpf_object *obj; __u64 kcgid = 0, ucgid; __u32 key = 0, pid; int exit_code = 1; char buf[256]; const struct timespec req = { .tv_sec = 1, .tv_nsec = 0, }; cgroup_fd = cgroup_setup_and_join(TEST_CGROUP); if (CHECK(cgroup_fd < 0, "cgroup_setup_and_join", "err %d errno %d\n", cgroup_fd, errno)) return 1; err = bpf_prog_load(file, BPF_PROG_TYPE_TRACEPOINT, &obj, &prog_fd); if (CHECK(err, "bpf_prog_load", "err %d errno %d\n", err, errno)) goto cleanup_cgroup_env; cgidmap_fd = bpf_find_map(__func__, obj, "cg_ids"); if (CHECK(cgidmap_fd < 0, "bpf_find_map", "err %d errno %d\n", cgidmap_fd, errno)) goto close_prog; pidmap_fd = bpf_find_map(__func__, obj, "pidmap"); if (CHECK(pidmap_fd < 0, "bpf_find_map", "err %d errno %d\n", pidmap_fd, errno)) goto close_prog; pid = getpid(); bpf_map_update_elem(pidmap_fd, &key, &pid, 0); snprintf(buf, sizeof(buf), "/sys/kernel/debug/tracing/events/%s/id", probe_name); efd = open(buf, O_RDONLY, 0); if (CHECK(efd < 0, "open", "err %d errno %d\n", efd, errno)) goto close_prog; bytes = read(efd, buf, sizeof(buf)); close(efd); if (CHECK(bytes <= 0 || bytes >= sizeof(buf), "read", "bytes %d errno %d\n", bytes, errno)) goto close_prog; attr.config = strtol(buf, NULL, 0); attr.type = PERF_TYPE_TRACEPOINT; attr.sample_type = PERF_SAMPLE_RAW; attr.sample_period = 1; attr.wakeup_events = 1; /* attach to this pid so the all bpf invocations will be in the * cgroup associated with this pid. */ pmu_fd = syscall(__NR_perf_event_open, &attr, getpid(), -1, -1, 0); if (CHECK(pmu_fd < 0, "perf_event_open", "err %d errno %d\n", pmu_fd, errno)) goto close_prog; err = ioctl(pmu_fd, PERF_EVENT_IOC_ENABLE, 0); if (CHECK(err, "perf_event_ioc_enable", "err %d errno %d\n", err, errno)) goto close_pmu; err = ioctl(pmu_fd, PERF_EVENT_IOC_SET_BPF, prog_fd); if (CHECK(err, "perf_event_ioc_set_bpf", "err %d errno %d\n", err, errno)) goto close_pmu; /* trigger some syscalls */ syscall(__NR_nanosleep, &req, NULL); err = bpf_map_lookup_elem(cgidmap_fd, &key, &kcgid); if (CHECK(err, "bpf_map_lookup_elem", "err %d errno %d\n", err, errno)) goto close_pmu; ucgid = get_cgroup_id(TEST_CGROUP); if (CHECK(kcgid != ucgid, "compare_cgroup_id", "kern cgid %llx user cgid %llx", kcgid, ucgid)) goto close_pmu; exit_code = 0; printf("%s:PASS\n", argv[0]); close_pmu: close(pmu_fd); close_prog: bpf_object__close(obj); cleanup_cgroup_env: cleanup_cgroup_environment(); return exit_code; }