text
stringlengths
4
6.14k
/* This testcase is part of GDB, the GNU debugger. Copyright 2009-2014 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 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/>. */ extern void func_nofb (void); extern void func_loopfb (void); int main (void) { int main_var = 1; func_nofb (); func_loopfb (); return 0; }
/** * This header file contains data structures and * function declarations of 802.11d */ #ifndef _WLAN_11D_ #define _WLAN_11D_ #include "types.h" #include "defs.h" #define UNIVERSAL_REGION_CODE 0xff /** (Beaconsize(256)-5(IEId,len,contrystr(3))/3(FirstChan,NoOfChan,MaxPwr) */ #define MRVDRV_MAX_SUBBAND_802_11D 83 #define COUNTRY_CODE_LEN 3 #define MAX_NO_OF_CHAN 40 struct cmd_ds_command; /** Data structure for Country IE*/ struct ieeetypes_subbandset { u8 firstchan; u8 nrchan; u8 maxtxpwr; } __attribute__ ((packed)); struct ieeetypes_countryinfoset { u8 element_id; u8 len; u8 countrycode[COUNTRY_CODE_LEN]; struct ieeetypes_subbandset subband[1]; }; struct ieeetypes_countryinfofullset { u8 element_id; u8 len; u8 countrycode[COUNTRY_CODE_LEN]; struct ieeetypes_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D]; } __attribute__ ((packed)); struct mrvlietypes_domainparamset { struct mrvlietypesheader header; u8 countrycode[COUNTRY_CODE_LEN]; struct ieeetypes_subbandset subband[1]; } __attribute__ ((packed)); struct cmd_ds_802_11d_domain_info { __le16 action; struct mrvlietypes_domainparamset domain; } __attribute__ ((packed)); /** domain regulatory information */ struct wlan_802_11d_domain_reg { /** country Code*/ u8 countrycode[COUNTRY_CODE_LEN]; /** No. of subband*/ u8 nr_subband; struct ieeetypes_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D]; }; struct chan_power_11d { u8 chan; u8 pwr; } __attribute__ ((packed)); struct parsed_region_chan_11d { u8 band; u8 region; s8 countrycode[COUNTRY_CODE_LEN]; struct chan_power_11d chanpwr[MAX_NO_OF_CHAN]; u8 nr_chan; } __attribute__ ((packed)); struct region_code_mapping { u8 region[COUNTRY_CODE_LEN]; u8 code; }; u8 libertas_get_scan_type_11d(u8 chan, struct parsed_region_chan_11d *parsed_region_chan); u32 libertas_chan_2_freq(u8 chan, u8 band); enum state_11d libertas_get_state_11d(wlan_private * priv); void libertas_init_11d(wlan_private * priv); int libertas_set_universaltable(wlan_private * priv, u8 band); int libertas_cmd_802_11d_domain_info(wlan_private * priv, struct cmd_ds_command *cmd, u16 cmdno, u16 cmdOption); int libertas_cmd_enable_11d(wlan_private * priv, struct iwreq *wrq); int libertas_ret_802_11d_domain_info(wlan_private * priv, struct cmd_ds_command *resp); struct bss_descriptor; int libertas_parse_dnld_countryinfo_11d(wlan_private * priv, struct bss_descriptor * bss); int libertas_create_dnld_countryinfo_11d(wlan_private * priv); #endif /* _WLAN_11D_ */
#ifndef ALIRSNVALUE_H #define ALIRSNVALUE_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ //////////////////////////////////////////////////////////////////////////////// // // Collection of all values which can be computed within the package // //////////////////////////////////////////////////////////////////////////////// #include "TArrayD.h" #include "AliRsnTarget.h" class AliRsnValue : public AliRsnTarget { public: AliRsnValue(const char *name = "", AliRsnTarget::ETargetType type = AliRsnTarget::kTargetTypes); AliRsnValue(const AliRsnValue &copy); AliRsnValue &operator=(const AliRsnValue &copy); virtual ~AliRsnValue() { } TArrayD &GetArray() {return fBinArray;} const Double_t *GetArrayValues() const {return fBinArray.GetArray();} Double_t GetComputedValue() const {return fComputedValue;} void SetUseMCInfo(Bool_t yn = kTRUE) {fUseMCInfo = yn;} void SetBins(Int_t n, Double_t min, Double_t max); void SetBins(Int_t n, Double_t *array); void SetBins(Double_t min, Double_t max, Double_t step); virtual Bool_t Eval(TObject *object); virtual void Print(Option_t *option = "") const; protected: Bool_t fUseMCInfo; // flag to choose MC info when choice is possible Double_t fComputedValue; // computed value TArrayD fBinArray; // array of bins (when used for a histogram axis) ClassDef(AliRsnValue, 3) // AliRsnValue base class }; #endif
#ifndef MYSYS_MY_HANDLER_ERRORS_INCLUDED #define MYSYS_MY_HANDLER_ERRORS_INCLUDED /* Copyright (c) 2008, 2012, 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 Street, Suite 500, Boston, MA 02110-1335 USA */ /* Errors a handler can give you */ static const char *handler_error_messages[]= { "Didn't find key on read or update", "Duplicate key on write or update", "Internal (unspecified) error in handler", "Someone has changed the row since it was read (while the table was locked to prevent it)", "Wrong index given to function", "Undefined handler error 125", "Index file is crashed", "Record file is crashed", "Out of memory in engine", "Undefined handler error 129", "Incorrect file format", "Command not supported by database", "Old database file", "No record read before update", "Record was already deleted (or record file crashed)", "No more room in record file", "No more room in index file", "No more records (read after end of file)", "Unsupported extension used for table", "Too big row", "Wrong create options", "Duplicate unique key or constraint on write or update", "Unknown character set used in table", "Conflicting table definitions in sub-tables of MERGE table", "Table is crashed and last repair failed", "Table was marked as crashed and should be repaired", "Lock timed out; Retry transaction", "Lock table is full; Restart program with a larger locktable", "Updates are not allowed under a read only transactions", "Lock deadlock; Retry transaction", "Foreign key constraint is incorrectly formed", "Cannot add a child row", "Cannot delete a parent row", "No savepoint with that name", "Non unique key block size", "The table does not exist in engine", "The table already existed in storage engine", "Could not connect to storage engine", "Unexpected null pointer found when using spatial index", "The table changed in storage engine", "There's no partition in table for the given value", "Row-based binlogging of row failed", "Index needed in foreign key constraint", "Upholding foreign key constraints would lead to a duplicate key error in " "some other table", "Table needs to be upgraded before it can be used", "Table is read only", "Failed to get next auto increment value", "Failed to set row auto increment value", "Unknown (generic) error from engine", "Record is the same", "It is not possible to log this statement", "The event was corrupt, leading to illegal data being read", "The table is of a new format not supported by this version", "The event could not be processed no other hanlder error happened", "Got a fatal error during initialzaction of handler", "File to short; Expected more data in file", "Read page with wrong checksum", "Too many active concurrent transactions", "Record not matching the given partition set", "Index column length exceeds limit", "Index corrupted", "Undo record too big", "Invalid InnoDB FTS Doc ID", "Table is being used in foreign key check", "Tablespace already exists", "Too many columns" }; extern void my_handler_error_register(void); extern void my_handler_error_unregister(void); #endif /* MYSYS_MY_HANDLER_ERRORS_INCLUDED */
/* Copyright 2020 DmNosachev * * 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/>. */ #include "t111.h"
/* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> #ifndef __gnu_java_awt_peer_qt_QtFontMetrics__ #define __gnu_java_awt_peer_qt_QtFontMetrics__ #ifdef __cplusplus extern "C" { #endif JNIEXPORT void JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_init (JNIEnv *env, jobject, jobject); JNIEXPORT void JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_initGraphics (JNIEnv *env, jobject, jobject, jobject); JNIEXPORT void JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_dispose (JNIEnv *env, jobject); JNIEXPORT jobject JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_getStringBounds (JNIEnv *env, jobject, jstring); JNIEXPORT jboolean JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_canDisplay (JNIEnv *env, jobject, jint); JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_getAscent (JNIEnv *env, jobject); JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_getDescent (JNIEnv *env, jobject); JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_getHeight (JNIEnv *env, jobject); JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_getLeading (JNIEnv *env, jobject); JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_getMaxAdvance (JNIEnv *env, jobject); JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_charWidth (JNIEnv *env, jobject, jchar); JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_stringWidth (JNIEnv *env, jobject, jstring); #ifdef __cplusplus } #endif #endif /* __gnu_java_awt_peer_qt_QtFontMetrics__ */
/* GStreamer * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef __GST_MASK_H__ #define __GST_MASK_H__ #include <gst/gst.h> typedef struct _GstMask GstMask; typedef struct _GstMaskDefinition GstMaskDefinition; typedef void (*GstMaskDrawFunc) (GstMask *mask); typedef void (*GstMaskDestroyFunc) (GstMask *mask); struct _GstMaskDefinition { gint type; const gchar *short_name; const gchar *long_name; GstMaskDrawFunc draw_func; GstMaskDestroyFunc destroy_func; gconstpointer user_data; }; struct _GstMask { gint type; guint32 *data; gconstpointer user_data; gint width; gint height; gint bpp; GstMaskDestroyFunc destroy_func; }; void _gst_mask_init (void); void _gst_mask_register (const GstMaskDefinition *definition); void _gst_mask_default_destroy (GstMask *mask); const GList* gst_mask_get_definitions (void); GstMask* gst_mask_factory_new (gint type, gboolean invert, gint bpp, gint width, gint height); void gst_mask_destroy (GstMask *mask); void _gst_barboxwipes_register (void); #endif /* __GST_MASK_H__ */
/* * Copyright Gavin Shan, IBM Corporation 2016. * * 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/module.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/netdevice.h> #include <linux/skbuff.h> #include <net/ncsi.h> #include <net/net_namespace.h> #include <net/sock.h> #include "internal.h" #include "ncsi-pkt.h" static int ncsi_validate_aen_pkt(struct ncsi_aen_pkt_hdr *h, const unsigned short payload) { u32 checksum; __be32 *pchecksum; if (h->common.revision != NCSI_PKT_REVISION) return -EINVAL; if (ntohs(h->common.length) != payload) return -EINVAL; /* Validate checksum, which might be zeroes if the * sender doesn't support checksum according to NCSI * specification. */ pchecksum = (__be32 *)((void *)(h + 1) + payload - 4); if (ntohl(*pchecksum) == 0) return 0; checksum = ncsi_calculate_checksum((unsigned char *)h, sizeof(*h) + payload - 4); if (*pchecksum != htonl(checksum)) return -EINVAL; return 0; } static int ncsi_aen_handler_lsc(struct ncsi_dev_priv *ndp, struct ncsi_aen_pkt_hdr *h) { struct ncsi_aen_lsc_pkt *lsc; struct ncsi_channel *nc; struct ncsi_channel_mode *ncm; bool chained; int state; unsigned long old_data, data; unsigned long flags; /* Find the NCSI channel */ ncsi_find_package_and_channel(ndp, h->common.channel, NULL, &nc); if (!nc) return -ENODEV; /* Update the link status */ lsc = (struct ncsi_aen_lsc_pkt *)h; spin_lock_irqsave(&nc->lock, flags); ncm = &nc->modes[NCSI_MODE_LINK]; old_data = ncm->data[2]; data = ntohl(lsc->status); ncm->data[2] = data; ncm->data[4] = ntohl(lsc->oem_status); netdev_info(ndp->ndev.dev, "NCSI: LSC AEN - channel %u state %s\n", nc->id, data & 0x1 ? "up" : "down"); chained = !list_empty(&nc->link); state = nc->state; spin_unlock_irqrestore(&nc->lock, flags); if (!((old_data ^ data) & 0x1) || chained) return 0; if (!(state == NCSI_CHANNEL_INACTIVE && (data & 0x1)) && !(state == NCSI_CHANNEL_ACTIVE && !(data & 0x1))) return 0; if (!(ndp->flags & NCSI_DEV_HWA) && state == NCSI_CHANNEL_ACTIVE) ndp->flags |= NCSI_DEV_RESHUFFLE; ncsi_stop_channel_monitor(nc); spin_lock_irqsave(&ndp->lock, flags); list_add_tail_rcu(&nc->link, &ndp->channel_queue); spin_unlock_irqrestore(&ndp->lock, flags); return ncsi_process_next_channel(ndp); } static int ncsi_aen_handler_cr(struct ncsi_dev_priv *ndp, struct ncsi_aen_pkt_hdr *h) { struct ncsi_channel *nc; unsigned long flags; /* Find the NCSI channel */ ncsi_find_package_and_channel(ndp, h->common.channel, NULL, &nc); if (!nc) return -ENODEV; spin_lock_irqsave(&nc->lock, flags); if (!list_empty(&nc->link) || nc->state != NCSI_CHANNEL_ACTIVE) { spin_unlock_irqrestore(&nc->lock, flags); return 0; } spin_unlock_irqrestore(&nc->lock, flags); ncsi_stop_channel_monitor(nc); spin_lock_irqsave(&nc->lock, flags); nc->state = NCSI_CHANNEL_INVISIBLE; spin_unlock_irqrestore(&nc->lock, flags); spin_lock_irqsave(&ndp->lock, flags); nc->state = NCSI_CHANNEL_INACTIVE; list_add_tail_rcu(&nc->link, &ndp->channel_queue); spin_unlock_irqrestore(&ndp->lock, flags); return ncsi_process_next_channel(ndp); } static int ncsi_aen_handler_hncdsc(struct ncsi_dev_priv *ndp, struct ncsi_aen_pkt_hdr *h) { struct ncsi_channel *nc; struct ncsi_channel_mode *ncm; struct ncsi_aen_hncdsc_pkt *hncdsc; unsigned long flags; /* Find the NCSI channel */ ncsi_find_package_and_channel(ndp, h->common.channel, NULL, &nc); if (!nc) return -ENODEV; spin_lock_irqsave(&nc->lock, flags); ncm = &nc->modes[NCSI_MODE_LINK]; hncdsc = (struct ncsi_aen_hncdsc_pkt *)h; ncm->data[3] = ntohl(hncdsc->status); spin_unlock_irqrestore(&nc->lock, flags); netdev_printk(KERN_DEBUG, ndp->ndev.dev, "NCSI: host driver %srunning on channel %u\n", ncm->data[3] & 0x1 ? "" : "not ", nc->id); return 0; } static struct ncsi_aen_handler { unsigned char type; int payload; int (*handler)(struct ncsi_dev_priv *ndp, struct ncsi_aen_pkt_hdr *h); } ncsi_aen_handlers[] = { { NCSI_PKT_AEN_LSC, 12, ncsi_aen_handler_lsc }, { NCSI_PKT_AEN_CR, 4, ncsi_aen_handler_cr }, { NCSI_PKT_AEN_HNCDSC, 8, ncsi_aen_handler_hncdsc } }; int ncsi_aen_handler(struct ncsi_dev_priv *ndp, struct sk_buff *skb) { struct ncsi_aen_pkt_hdr *h; struct ncsi_aen_handler *nah = NULL; int i, ret; /* Find the handler */ h = (struct ncsi_aen_pkt_hdr *)skb_network_header(skb); for (i = 0; i < ARRAY_SIZE(ncsi_aen_handlers); i++) { if (ncsi_aen_handlers[i].type == h->type) { nah = &ncsi_aen_handlers[i]; break; } } if (!nah) { netdev_warn(ndp->ndev.dev, "Invalid AEN (0x%x) received\n", h->type); return -ENOENT; } ret = ncsi_validate_aen_pkt(h, nah->payload); if (ret) { netdev_warn(ndp->ndev.dev, "NCSI: 'bad' packet ignored for AEN type 0x%x\n", h->type); goto out; } ret = nah->handler(ndp, h); if (ret) netdev_err(ndp->ndev.dev, "NCSI: Handler for AEN type 0x%x returned %d\n", h->type, ret); out: consume_skb(skb); return ret; }
/* { dg-do compile } */ /* { dg-additional-options "-Wno-pedantic -Wno-long-long -m64" } */ /* Struct return. Returned via pointer. */ typedef struct {char a;} one; typedef struct {short a;} two; typedef struct {int a;} four; typedef struct {long long a;} eight; typedef struct {int a, b[12];} big; /* { dg-final { scan-assembler-times ".extern .func dcl_rone \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */ one dcl_rone (void); /* { dg-final { scan-assembler-times ".extern .func dcl_rtwo \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */ two dcl_rtwo (void); /* { dg-final { scan-assembler-times ".extern .func dcl_rfour \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */ four dcl_rfour (void); /* { dg-final { scan-assembler-times ".extern .func dcl_reight \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */ eight dcl_reight (void); /* { dg-final { scan-assembler-times ".extern .func dcl_rbig \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */ big dcl_rbig (void); void test_1 (void) { dcl_rone (); dcl_rtwo (); dcl_rfour (); dcl_reight (); dcl_rbig (); } #define M(T, v) ({T t; t.a = v; t;}) /* { dg-final { scan-assembler-times ".visible .func dfn_rone \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */ one dfn_rone (void) { return M (one, 1); } /* { dg-final { scan-assembler-times ".visible .func dfn_rtwo \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */ two dfn_rtwo (void) { return M (two, 2); } /* { dg-final { scan-assembler-times ".visible .func dfn_rfour \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */ four dfn_rfour (void) { return M (four, 3); } /* { dg-final { scan-assembler-times ".visible .func dfn_reight \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */ eight dfn_reight (void) { return M (eight, 4); } /* { dg-final { scan-assembler-times ".visible .func dfn_rbig \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */ big dfn_rbig (void) { return M (big, 5); }
/* * Copyright 2006 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkAnimateSet_DEFINED #define SkAnimateSet_DEFINED #include "SkAnimate.h" class SkSet : public SkAnimate { DECLARE_MEMBER_INFO(Set); SkSet(); #ifdef SK_DUMP_ENABLED virtual void dump(SkAnimateMaker* ); #endif virtual void onEndElement(SkAnimateMaker& ); virtual void refresh(SkAnimateMaker& ); private: typedef SkAnimate INHERITED; }; #endif // SkAnimateSet_DEFINED
/* { dg-require-effective-target size32plus } */ /* Formerly known as ltrans-1.c */ #define DEBUG 0 #if DEBUG #include <stdio.h> #endif double u[25]; static int __attribute__((noinline)) foo (int N) { int i, j; double sum = 0.0; /* These two loops should be interchanged. */ for (i = 0; i < N; i++) { for (j = 0; j < N; j++) sum = sum + u[i + 5 * j]; u[6 * i] *= 2; } return sum + N + u[6]; } extern void abort (); int main (void) { int i, j, res; for (i = 0; i < 25; i++) u[i] = 2; res = foo (5); #if DEBUG fprintf (stderr, "res = %d \n", res); #endif if (res != 59) abort (); return 0; }
/* This testcase is part of GDB, the GNU debugger. Copyright 2009-2015 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 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/>. Contributed by Markus Deuling <deuling@de.ibm.com> */ #include <stdio.h> #include <ea.h> int main (unsigned long long speid, unsigned long long argp, unsigned long long envp) { int a; __ea int *myarray = malloc_ea (3 * sizeof (int)); memset_ea (myarray, 0, 3 * sizeof (int)); a = ++myarray[0]; /* Marker SPUEA1 */ printf("a: %d, myarray[0]: %d\n", a, myarray[0]); /* Marker SPUEA2 */ return 0; }
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef DRACI_BARCHIVE_H #define DRACI_BARCHIVE_H #include "common/str.h" #include "common/file.h" namespace Draci { /** * Represents individual files inside the archive. */ struct BAFile { uint _compLength; ///< Compressed length (the same as _length if the file is uncompressed) uint _length; ///< Uncompressed length uint32 _offset; ///< Offset of file inside archive byte *_data; byte _crc; byte _stopper; ///< Not used in BAR files, needed for DFW /** Releases the file data (for memory considerations) */ void close() { delete[] _data; _data = NULL; } }; class BArchive { public: BArchive() : _files(NULL), _fileCount(0), _opened(false) {} BArchive(const Common::String &path) : _files(NULL), _fileCount(0), _opened(false) { openArchive(path); } ~BArchive() { closeArchive(); } void openArchive(const Common::String &path); void closeArchive(); uint size() const { return _fileCount; } /** * Checks whether there is an archive opened. Should be called before reading * from the archive to check whether openArchive() succeeded. */ bool isOpen() const { return _opened; } void clearCache(); const BAFile *getFile(uint i); private: // Archive header data static const char _magicNumber[]; static const char _dfwMagicNumber[]; static const uint _archiveHeaderSize = 10; // File stream header data static const uint _fileHeaderSize = 6; Common::String _path; ///< Path to file BAFile *_files; ///< Internal array of files uint _fileCount; ///< Number of files in archive bool _isDFW; ///< True if the archive is in DFW format, false otherwise bool _opened; ///< True if the archive is opened, false otherwise Common::File _f; ///< Opened file handle void openDFW(const Common::String &path); BAFile *loadFileDFW(uint i); BAFile *loadFileBAR(uint i); }; } // End of namespace Draci #endif // DRACI_BARCHIVE_H
#ifndef _PIL_Q6V5_MSS_DEBUG_H_ #define _PIL_Q6V5_MSS_DEBUG_H_ extern void modem_read_spmi_setting(int ramdump_enable); #endif //_PIL_Q6V5_MSS_DEBUG_H_
/* ========================================================================= zrex - work with regular expressions Copyright (c) the Contributors as noted in the AUTHORS file. This file is part of CZMQ, the high-level C binding for 0MQ: http://czmq.zeromq.org. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. ========================================================================= */ #ifndef __ZREX_H_INCLUDED__ #define __ZREX_H_INCLUDED__ #ifdef __cplusplus extern "C" { #endif // @interface // Constructor. Optionally, sets an expression against which we can match // text and capture hits. If there is an error in the expression, reports // zrex_valid() as false and provides the error in zrex_strerror(). If you // set a pattern, you can call zrex_matches() to test it against text. CZMQ_EXPORT zrex_t * zrex_new (const char *expression); // Destructor CZMQ_EXPORT void zrex_destroy (zrex_t **self_p); // Return true if the expression was valid and compiled without errors. CZMQ_EXPORT bool zrex_valid (zrex_t *self); // Return the error message generated during compilation of the expression. CZMQ_EXPORT const char * zrex_strerror (zrex_t *self); // Returns true if the text matches the previously compiled expression. // Use this method to compare one expression against many strings. CZMQ_EXPORT bool zrex_matches (zrex_t *self, const char *text); // Returns true if the text matches the supplied expression. Use this // method to compare one string against several expressions. CZMQ_EXPORT bool zrex_eq (zrex_t *self, const char *text, const char *expression); // Returns number of hits from last zrex_matches or zrex_eq. If the text // matched, returns 1 plus the number of capture groups. If the text did // not match, returns zero. To retrieve individual capture groups, call // zrex_hit (). CZMQ_EXPORT int zrex_hits (zrex_t *self); // Returns the Nth capture group from the last expression match, where // N is 0 to the value returned by zrex_hits(). Capture group 0 is the // whole matching string. Sequence 1 is the first capture group, if any, // and so on. CZMQ_EXPORT const char * zrex_hit (zrex_t *self, uint index); // Fetches hits into string variables provided by caller; this makes for // nicer code than accessing hits by index. Caller should not modify nor // free the returned values. Returns number of strings returned. This // method starts at hit 1, i.e. first capture group, as hit 0 is always // the original matched string. CZMQ_EXPORT int zrex_fetch (zrex_t *self, const char **string_p, ...); // Self test of this class CZMQ_EXPORT void zrex_test (bool verbose); // @end #ifdef __cplusplus } #endif #endif
/* * arch/arm/mach-tegra/board-harmony.c * * Copyright (C) 2010 Google, Inc. * Copyright (C) 2011 NVIDIA, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> #include <linux/serial_8250.h> #include <linux/clk.h> #include <linux/dma-mapping.h> #include <linux/pda_power.h> #include <linux/io.h> #include <linux/gpio.h> #include <linux/i2c.h> #include <linux/i2c-tegra.h> #include <sound/wm8903.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/time.h> #include <asm/setup.h> #include <mach/harmony_audio.h> #include <mach/iomap.h> #include <mach/irqs.h> #include <mach/sdhci.h> #include "board.h" #include "board-harmony.h" #include "clock.h" #include "devices.h" #include "gpio-names.h" static struct plat_serial8250_port debug_uart_platform_data[] = { { .membase = IO_ADDRESS(TEGRA_UARTD_BASE), .mapbase = TEGRA_UARTD_BASE, .irq = INT_UARTD, .flags = UPF_BOOT_AUTOCONF, .iotype = UPIO_MEM, .regshift = 2, .uartclk = 216000000, }, { .flags = 0 } }; static struct platform_device debug_uart = { .name = "serial8250", .id = PLAT8250_DEV_PLATFORM, .dev = { .platform_data = debug_uart_platform_data, }, }; static struct harmony_audio_platform_data harmony_audio_pdata = { .gpio_spkr_en = TEGRA_GPIO_SPKR_EN, .gpio_hp_det = TEGRA_GPIO_HP_DET, .gpio_int_mic_en = TEGRA_GPIO_INT_MIC_EN, .gpio_ext_mic_en = TEGRA_GPIO_EXT_MIC_EN, }; static struct platform_device harmony_audio_device = { .name = "tegra-snd-harmony", .id = 0, .dev = { .platform_data = &harmony_audio_pdata, }, }; static struct tegra_i2c_platform_data harmony_i2c1_platform_data = { .bus_clk_rate = 400000, }; static struct tegra_i2c_platform_data harmony_i2c2_platform_data = { .bus_clk_rate = 400000, }; static struct tegra_i2c_platform_data harmony_i2c3_platform_data = { .bus_clk_rate = 400000, }; static struct tegra_i2c_platform_data harmony_dvc_platform_data = { .bus_clk_rate = 400000, }; static struct wm8903_platform_data harmony_wm8903_pdata = { .irq_active_low = 0, .micdet_cfg = 0, .micdet_delay = 100, .gpio_base = HARMONY_GPIO_WM8903(0), .gpio_cfg = { WM8903_GPIO_NO_CONFIG, WM8903_GPIO_NO_CONFIG, 0, WM8903_GPIO_NO_CONFIG, WM8903_GPIO_NO_CONFIG, }, }; static struct i2c_board_info __initdata wm8903_board_info = { I2C_BOARD_INFO("wm8903", 0x1a), .platform_data = &harmony_wm8903_pdata, .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_CDC_IRQ), }; static void __init harmony_i2c_init(void) { tegra_i2c_device1.dev.platform_data = &harmony_i2c1_platform_data; tegra_i2c_device2.dev.platform_data = &harmony_i2c2_platform_data; tegra_i2c_device3.dev.platform_data = &harmony_i2c3_platform_data; tegra_i2c_device4.dev.platform_data = &harmony_dvc_platform_data; platform_device_register(&tegra_i2c_device1); platform_device_register(&tegra_i2c_device2); platform_device_register(&tegra_i2c_device3); platform_device_register(&tegra_i2c_device4); i2c_register_board_info(0, &wm8903_board_info, 1); } static struct platform_device *harmony_devices[] __initdata = { &debug_uart, &tegra_sdhci_device1, &tegra_sdhci_device2, &tegra_sdhci_device4, &tegra_i2s_device1, &tegra_das_device, &tegra_pcm_device, &harmony_audio_device, }; static void __init tegra_harmony_fixup(struct machine_desc *desc, struct tag *tags, char **cmdline, struct meminfo *mi) { mi->nr_banks = 2; mi->bank[0].start = PHYS_OFFSET; mi->bank[0].size = 448 * SZ_1M; mi->bank[1].start = SZ_512M; mi->bank[1].size = SZ_512M; } static __initdata struct tegra_clk_init_table harmony_clk_init_table[] = { /* name parent rate enabled */ { "uartd", "pll_p", 216000000, true }, { "pll_a", "pll_p_out1", 56448000, true }, { "pll_a_out0", "pll_a", 11289600, true }, { "cdev1", NULL, 0, true }, { "i2s1", "pll_a_out0", 11289600, false}, { NULL, NULL, 0, 0}, }; static struct tegra_sdhci_platform_data sdhci_pdata1 = { .cd_gpio = -1, .wp_gpio = -1, .power_gpio = -1, }; static struct tegra_sdhci_platform_data sdhci_pdata2 = { .cd_gpio = TEGRA_GPIO_SD2_CD, .wp_gpio = TEGRA_GPIO_SD2_WP, .power_gpio = TEGRA_GPIO_SD2_POWER, }; static struct tegra_sdhci_platform_data sdhci_pdata4 = { .cd_gpio = TEGRA_GPIO_SD4_CD, .wp_gpio = TEGRA_GPIO_SD4_WP, .power_gpio = TEGRA_GPIO_SD4_POWER, .is_8bit = 1, }; static void __init tegra_harmony_init(void) { tegra_clk_init_from_table(harmony_clk_init_table); harmony_pinmux_init(); tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1; tegra_sdhci_device2.dev.platform_data = &sdhci_pdata2; tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4; platform_add_devices(harmony_devices, ARRAY_SIZE(harmony_devices)); harmony_i2c_init(); harmony_regulator_init(); } MACHINE_START(HARMONY, "harmony") .boot_params = 0x00000100, .fixup = tegra_harmony_fixup, .map_io = tegra_map_common_io, .init_early = tegra_init_early, .init_irq = tegra_init_irq, .timer = &tegra_timer, .init_machine = tegra_harmony_init, MACHINE_END
// SPDX-License-Identifier: GPL-2.0-only /* * sha2-ce-glue.c - SHA-224/SHA-256 using ARMv8 Crypto Extensions * * Copyright (C) 2014 - 2017 Linaro Ltd <ard.biesheuvel@linaro.org> */ #include <asm/neon.h> #include <asm/simd.h> #include <asm/unaligned.h> #include <crypto/internal/hash.h> #include <crypto/internal/simd.h> #include <crypto/sha.h> #include <crypto/sha256_base.h> #include <linux/cpufeature.h> #include <linux/crypto.h> #include <linux/module.h> MODULE_DESCRIPTION("SHA-224/SHA-256 secure hash using ARMv8 Crypto Extensions"); MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@linaro.org>"); MODULE_LICENSE("GPL v2"); struct sha256_ce_state { struct sha256_state sst; u32 finalize; }; asmlinkage void sha2_ce_transform(struct sha256_ce_state *sst, u8 const *src, int blocks); const u32 sha256_ce_offsetof_count = offsetof(struct sha256_ce_state, sst.count); const u32 sha256_ce_offsetof_finalize = offsetof(struct sha256_ce_state, finalize); asmlinkage void sha256_block_data_order(u32 *digest, u8 const *src, int blocks); static int sha256_ce_update(struct shash_desc *desc, const u8 *data, unsigned int len) { struct sha256_ce_state *sctx = shash_desc_ctx(desc); if (!crypto_simd_usable()) return sha256_base_do_update(desc, data, len, (sha256_block_fn *)sha256_block_data_order); sctx->finalize = 0; kernel_neon_begin(); sha256_base_do_update(desc, data, len, (sha256_block_fn *)sha2_ce_transform); kernel_neon_end(); return 0; } static int sha256_ce_finup(struct shash_desc *desc, const u8 *data, unsigned int len, u8 *out) { struct sha256_ce_state *sctx = shash_desc_ctx(desc); bool finalize = !sctx->sst.count && !(len % SHA256_BLOCK_SIZE) && len; if (!crypto_simd_usable()) { if (len) sha256_base_do_update(desc, data, len, (sha256_block_fn *)sha256_block_data_order); sha256_base_do_finalize(desc, (sha256_block_fn *)sha256_block_data_order); return sha256_base_finish(desc, out); } /* * Allow the asm code to perform the finalization if there is no * partial data and the input is a round multiple of the block size. */ sctx->finalize = finalize; kernel_neon_begin(); sha256_base_do_update(desc, data, len, (sha256_block_fn *)sha2_ce_transform); if (!finalize) sha256_base_do_finalize(desc, (sha256_block_fn *)sha2_ce_transform); kernel_neon_end(); return sha256_base_finish(desc, out); } static int sha256_ce_final(struct shash_desc *desc, u8 *out) { struct sha256_ce_state *sctx = shash_desc_ctx(desc); if (!crypto_simd_usable()) { sha256_base_do_finalize(desc, (sha256_block_fn *)sha256_block_data_order); return sha256_base_finish(desc, out); } sctx->finalize = 0; kernel_neon_begin(); sha256_base_do_finalize(desc, (sha256_block_fn *)sha2_ce_transform); kernel_neon_end(); return sha256_base_finish(desc, out); } static struct shash_alg algs[] = { { .init = sha224_base_init, .update = sha256_ce_update, .final = sha256_ce_final, .finup = sha256_ce_finup, .descsize = sizeof(struct sha256_ce_state), .digestsize = SHA224_DIGEST_SIZE, .base = { .cra_name = "sha224", .cra_driver_name = "sha224-ce", .cra_priority = 200, .cra_blocksize = SHA256_BLOCK_SIZE, .cra_module = THIS_MODULE, } }, { .init = sha256_base_init, .update = sha256_ce_update, .final = sha256_ce_final, .finup = sha256_ce_finup, .descsize = sizeof(struct sha256_ce_state), .digestsize = SHA256_DIGEST_SIZE, .base = { .cra_name = "sha256", .cra_driver_name = "sha256-ce", .cra_priority = 200, .cra_blocksize = SHA256_BLOCK_SIZE, .cra_module = THIS_MODULE, } } }; static int __init sha2_ce_mod_init(void) { return crypto_register_shashes(algs, ARRAY_SIZE(algs)); } static void __exit sha2_ce_mod_fini(void) { crypto_unregister_shashes(algs, ARRAY_SIZE(algs)); } module_cpu_feature_match(SHA2, sha2_ce_mod_init); module_exit(sha2_ce_mod_fini);
/* Copyright 2012 Jun Wako <wakojun@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "hal.h" #include "led.h" void led_set(uint8_t usb_led) { if (usb_led & (1<<USB_LED_CAPS_LOCK)) { /* generic STM32F103C8T6 board */ #ifdef BOARD_GENERIC_STM32_F103 palClearPad(GPIOC, 13); #endif /* Maple Mini */ #ifdef BOARD_MAPLEMINI_STM32_F103 palSetPad(GPIOB, 1); #endif } else { /* generic STM32F103C8T6 board */ #ifdef BOARD_GENERIC_STM32_F103 palSetPad(GPIOC, 13); #endif /* Maple Mini */ #ifdef BOARD_MAPLEMINI_STM32_F103 palClearPad(GPIOB,1); #endif } }
/* Test the vqdmlsl_lane_s16 AArch64 SIMD intrinsic. */ /* { dg-do compile } */ /* { dg-options "-save-temps -O3 -fno-inline" } */ #include "arm_neon.h" int32x4_t t_vqdmlsl_lane_s16 (int32x4_t a, int16x4_t b, int16x4_t c) { return vqdmlsl_lane_s16 (a, b, c, 0); } /* { dg-final { scan-assembler-times "sqdmlsl\[ \t\]+\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.4\[hH\], ?\[vV\]\[0-9\]+\.\[hH\]\\\[0\\\]\n" 1 } } */ /* { dg-final { cleanup-saved-temps } } */
/* * GRUB -- GRand Unified Bootloader * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 * 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * GRUB is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GRUB. If not, see <http://www.gnu.org/licenses/>. */ #include <grub/crypto.h> #include <grub/mm.h> #include <grub/term.h> #include <windows.h> #include <stdlib.h> #include <string.h> #include <stdio.h> int grub_password_get (char buf[], unsigned buf_size) { HANDLE hStdin = GetStdHandle (STD_INPUT_HANDLE); DWORD mode = 0; char *ptr; grub_refresh (); GetConsoleMode (hStdin, &mode); SetConsoleMode (hStdin, mode & (~ENABLE_ECHO_INPUT)); fgets (buf, buf_size, stdin); ptr = buf + strlen (buf) - 1; while (buf <= ptr && (*ptr == '\n' || *ptr == '\r')) *ptr-- = 0; SetConsoleMode (hStdin, mode); grub_refresh (); return 1; }
/////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_ILMTHREADNAMESPACE_H #define INCLUDED_ILMTHREADNAMESPACE_H // // The purpose of this file is to make it possible to specify an // ILMTHREAD_INTERNAL_NAMESPACE as a preprocessor definition and have all of // the IlmThread symbols defined within that namespace rather than the // standard IlmThread namespace. Those symbols are made available to client // code through the ILMTHREAD_NAMESPACE in addition to the // ILMTHREAD_INTERNAL_NAMESPACE. // // To ensure source code compatibility, the ILMTHREAD_NAMESPACE defaults to // IlmThread and then "using namespace ILMTHREAD_INTERNAL_NAMESPACE;" brings // all of the declarations from the ILMTHREAD_INTERNAL_NAMESPACE into the // ILMTHREAD_NAMESPACE. This means that client code can continue to use // syntax like IlmThread::Thread, but at link time it will resolve to a // mangled symbol based on the ILMTHREAD_INTERNAL_NAMESPACE. // // As an example, if one needed to build against a newer version of IlmThread // and have it run alongside an older version in the same application, it is // now possible to use an internal namespace to prevent collisions between // the older versions of IlmThread symbols and the newer ones. To do this, // the following could be defined at build time: // // ILMTHREAD_INTERNAL_NAMESPACE = IlmThread_v2 // // This means that declarations inside IlmThread headers look like this // (after the preprocessor has done its work): // // namespace IlmThread_v2 { // ... // class declarations // ... // } // // namespace IlmThread { // using namespace IlmThread_v2; // } // // // Open Source version of this file pulls in the IlmBaseConfig.h file // for the configure time options. // #include "IlmBaseConfig.h" #ifndef ILMTHREAD_NAMESPACE #define ILMTHREAD_NAMESPACE IlmThread #endif #ifndef ILMTHREAD_INTERNAL_NAMESPACE #define ILMTHREAD_INTERNAL_NAMESPACE ILMTHREAD_NAMESPACE #endif // // We need to be sure that we import the internal namespace into the public one. // To do this, we use the small bit of code below which initially defines // ILMTHREAD_INTERNAL_NAMESPACE (so it can be referenced) and then defines // ILMTHREAD_NAMESPACE and pulls the internal symbols into the public // namespace. // namespace ILMTHREAD_INTERNAL_NAMESPACE {} namespace ILMTHREAD_NAMESPACE { using namespace ILMTHREAD_INTERNAL_NAMESPACE; } // // There are identical pairs of HEADER/SOURCE ENTER/EXIT macros so that // future extension to the namespace mechanism is possible without changing // project source code. // #define ILMTHREAD_INTERNAL_NAMESPACE_HEADER_ENTER namespace ILMTHREAD_INTERNAL_NAMESPACE { #define ILMTHREAD_INTERNAL_NAMESPACE_HEADER_EXIT } #define ILMTHREAD_INTERNAL_NAMESPACE_SOURCE_ENTER namespace ILMTHREAD_INTERNAL_NAMESPACE { #define ILMTHREAD_INTERNAL_NAMESPACE_SOURCE_EXIT } #endif // INCLUDED_ILMTHREADNAMESPACE_H
/***************************************************************************** * Project: RooFit * * Package: RooFitCore * * File: $Id: RooDirItem.h,v 1.6 2007/05/11 09:11:30 verkerke Exp $ * Authors: * * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu * * DK, David Kirkby, UC Irvine, dkirkby@uci.edu * * * * Copyright (c) 2000-2005, Regents of the University of California * * and Stanford University. All rights reserved. * * * * Redistribution and use in source and binary forms, * * with or without modification, are permitted according to the terms * * listed in LICENSE (http://roofit.sourceforge.net/license.txt) * *****************************************************************************/ #ifndef ROO_DIR_ITEM #define ROO_DIR_ITEM #include "Rtypes.h" class TDirectory ; class RooDirItem { public: RooDirItem() ; RooDirItem(const RooDirItem& other) ; virtual ~RooDirItem() ; protected: void appendToDir(TObject* obj, Bool_t forceMemoryResident=kFALSE) ; void removeFromDir(TObject* obj) ; TDirectory* _dir ; //! Associated directory ClassDef(RooDirItem,1) // Base class for RooFit objects that are listed TDirectories }; #endif
/* * Copyright (c) 2013-2014 TRUSTONIC LIMITED * All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #define MOBICORE_COMPONENT_BUILD_TAG \ "t-base-EXYNOS5433-Android-301-V008-2014-08-07_11-26-55_85"
// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // /*** *sprintf.c - print formatted to string * * *Purpose: * defines sprintf() and _snprintf() - print formatted data to string * *******************************************************************************/ #include <string.h> #include <errno.h> #include <limits.h> #include "internal_securecrt.h" #include "mbusafecrt_internal.h" /*** *ifndef _COUNT_ *int sprintf(string, format, ...) - print formatted data to string *else *int _snprintf(string, cnt, format, ...) - print formatted data to string *endif * *Purpose: * Prints formatted data to the using the format string to * format data and getting as many arguments as called for * Sets up a FILE so file i/o operations can be used, make * string look like a huge buffer to it, but _flsbuf will * refuse to flush it if it fills up. Appends '\0' to make * it a true string. _output does the real work here * * Allocate the 'fake' _iob[] entry statically instead of on * the stack so that other routines can assume that _iob[] * entries are in are in DGROUP and, thus, are near. * *ifdef _COUNT_ * The _snprintf() flavor takes a count argument that is * the max number of bytes that should be written to the * user's buffer. *endif * * Multi-thread: (1) Since there is no stream, this routine must * never try to get the stream lock (i.e., there is no stream * lock either). (2) Also, since there is only one statically * allocated 'fake' iob, we must lock/unlock to prevent collisions. * *Entry: * char *string - pointer to place to put output *ifdef _COUNT_ * size_t count - max number of bytes to put in buffer *endif * char *format - format string to control data format/number * of arguments followed by list of arguments, number and type * controlled by format string * *Exit: * returns number of characters printed * *Exceptions: * *******************************************************************************/ int sprintf_s ( char *string, size_t sizeInBytes, const char *format, ... ) { int ret; va_list arglist; va_start(arglist, format); ret = _vsprintf_s(string, sizeInBytes, format, arglist); va_end(arglist); return ret; } int _snprintf_s ( char *string, size_t sizeInBytes, size_t count, const char *format, ... ) { int ret; va_list arglist; va_start(arglist, format); ret = _vsnprintf_s(string, sizeInBytes, count, format, arglist); va_end(arglist); return ret; }
/** * @file cpu_type.c * CPU determination * * @remark Copyright 2002 OProfile authors * @remark Read the file COPYING * * @author John Levon * @author Philippe Elie */ #include "oprofile.h" #include "op_msr.h" #include <linux/smp.h> EXPORT_NO_SYMBOLS; MODULE_PARM(force_rtc, "i"); MODULE_PARM_DESC(force_rtc, "force RTC mode."); static int force_rtc; #ifndef HT_SUPPORT /** * p4_threads - determines the number of logical processor threads in a die * * returns number of threads in p4 die (1 for non-HT processors) */ static int p4_threads(void) { int processor_threads = 1; #ifdef CONFIG_SMP if (test_bit(X86_FEATURE_HT, &current_cpu_data.x86_capability)) { /* This it a Pentium 4 with HT, find number of threads */ int eax, ebx, ecx, edx; cpuid (1, &eax, &ebx, &ecx, &edx); processor_threads = (ebx >> 16) & 0xff; } #endif /* CONFIG_SMP */ return processor_threads; } #ifdef CONFIG_SMP /** * do_cpu_id - Call the cpuid instruction and fill in data at passed address * * We expect that data is pointing to an array of unsigned chars as big as there * are cpus in an smp system. */ static void do_cpu_id(void * data) { int eax, ebx, ecx, edx; unsigned char * ptr = (unsigned char *) data; cpuid(1, &eax, &ebx, &ecx, &edx); /* bits EBX[31:24] define APIC ID */ ptr[smp_processor_id()] = (unsigned char) ((ebx & 0xff000000) >> 24); } #endif /** * p4_ht_enabled - Determines if Hyper Threading is enabled or not. * * A P4 can be capable of HT, but not enabled via BIOS. The check for * this is unfortunately not simple and involves running cpuid on all * logical processors and checking for bits in the APIC_ID fields. * As per Intel docs. Returns 1 if enabled, 0 otherwise. * */ static int p4_ht_enabled(void) { #ifndef CONFIG_SMP return 0; #else int enabled, threads, i; unsigned char mask; unsigned char apic_id[smp_num_cpus]; unsigned int cpu; /* First check for capability */ threads = p4_threads(); if (threads == 1) return 0; /* Create mask for low order bits */ mask = 0xff; i = 1; while (i < threads) { i *= 2; mask <<= 1; } /* Get APIC_ID from all logial procs and self */ smp_call_function(do_cpu_id, apic_id, 1, 1); do_cpu_id(apic_id); /* If the low order bits are on, then HT is enabled */ enabled = 0; cpu = 0; do { if (apic_id[cpu] & ~mask) { enabled = 1; break; } cpu++; } while (cpu < smp_num_cpus); return enabled; #endif /* CONFIG_SMP */ } #endif /* !HT_SUPPORT */ op_cpu p4_cpu_type(void) { __u8 model = current_cpu_data.x86_model; if (model <= 4) { #ifdef HT_SUPPORT if (smp_num_siblings == 1) { return CPU_P4; } else if (smp_num_siblings == 2) { return CPU_P4_HT2; } else { printk(KERN_INFO "oprofile: P4 HT unsupported number of siblings" "processor, reverting to RTC\n"); return CPU_RTC; } #else /* Cannot handle enabled HT P4 hardware */ if ((p4_threads() > 1) && p4_ht_enabled()) { printk(KERN_INFO "oprofile: P4 HT enabled, reverting to RTC\n"); return CPU_RTC; } else return CPU_P4; #endif } else /* Do not know what it is */ return CPU_RTC; } __init op_cpu get_cpu_type(void) { __u8 vendor = current_cpu_data.x86_vendor; __u8 family = current_cpu_data.x86; __u8 model = current_cpu_data.x86_model; __u16 val; if (force_rtc) return CPU_RTC; switch (vendor) { case X86_VENDOR_AMD: if (family == 6) { /* certain models of K7 does not have apic. * Check if apic is really present before enabling it. * IA32 V3, 7.4.1 */ val = cpuid_edx(1); if (!(val & (1 << 9))) return CPU_RTC; return CPU_ATHLON; } if (family == 15) return CPU_HAMMER; return CPU_RTC; case X86_VENDOR_INTEL: switch (family) { default: return CPU_RTC; case 6: /* A P6-class processor */ if (model == 14) return CPU_CORE; if (model > 0xd) return CPU_RTC; if (model > 5) return CPU_PIII; else if (model > 2) return CPU_PII; return CPU_PPRO; case 0xf: return p4_cpu_type(); } default: return CPU_RTC; } }
/*- * * This software may be used and distributed according to the terms * of the GNU Public License, incorporated herein by reference. * * Module : sk_g16.h * Version : $Revision: 1.3 $ * * Author : M.Hipp (mhipp@student.uni-tuebingen.de) * changes by : Patrick J.D. Weichmann * * Date Created : 94/05/25 * * Description : In here are all necessary definitions of * the am7990 (LANCE) chip used for writing a * network device driver which uses this chip * * $Log: sk_g16.h,v $ * Revision 1.3 2000/07/29 19:22:54 okuji * update the network support to etherboot-4.6.4. * -*/ #ifndef SK_G16_H #define SK_G16_H /* * Control and Status Register 0 (CSR0) bit definitions * * (R=Readable) (W=Writeable) (S=Set on write) (C-Clear on write) * */ #define CSR0_ERR 0x8000 /* Error summary (R) */ #define CSR0_BABL 0x4000 /* Babble transmitter timeout error (RC) */ #define CSR0_CERR 0x2000 /* Collision Error (RC) */ #define CSR0_MISS 0x1000 /* Missed packet (RC) */ #define CSR0_MERR 0x0800 /* Memory Error (RC) */ #define CSR0_RINT 0x0400 /* Receiver Interrupt (RC) */ #define CSR0_TINT 0x0200 /* Transmit Interrupt (RC) */ #define CSR0_IDON 0x0100 /* Initialization Done (RC) */ #define CSR0_INTR 0x0080 /* Interrupt Flag (R) */ #define CSR0_INEA 0x0040 /* Interrupt Enable (RW) */ #define CSR0_RXON 0x0020 /* Receiver on (R) */ #define CSR0_TXON 0x0010 /* Transmitter on (R) */ #define CSR0_TDMD 0x0008 /* Transmit Demand (RS) */ #define CSR0_STOP 0x0004 /* Stop (RS) */ #define CSR0_STRT 0x0002 /* Start (RS) */ #define CSR0_INIT 0x0001 /* Initialize (RS) */ #define CSR0_CLRALL 0x7f00 /* mask for all clearable bits */ /* * Control and Status Register 3 (CSR3) bit definitions * */ #define CSR3_BSWAP 0x0004 /* Byte Swap (RW) */ #define CSR3_ACON 0x0002 /* ALE Control (RW) */ #define CSR3_BCON 0x0001 /* Byte Control (RW) */ /* * Initialization Block Mode operation Bit Definitions. */ #define MODE_PROM 0x8000 /* Promiscuous Mode */ #define MODE_INTL 0x0040 /* Internal Loopback */ #define MODE_DRTY 0x0020 /* Disable Retry */ #define MODE_COLL 0x0010 /* Force Collision */ #define MODE_DTCR 0x0008 /* Disable Transmit CRC) */ #define MODE_LOOP 0x0004 /* Loopback */ #define MODE_DTX 0x0002 /* Disable the Transmitter */ #define MODE_DRX 0x0001 /* Disable the Receiver */ #define MODE_NORMAL 0x0000 /* Normal operation mode */ /* * Receive message descriptor status bit definitions. */ #define RX_OWN 0x80 /* Owner bit 0 = host, 1 = lance */ #define RX_ERR 0x40 /* Error Summary */ #define RX_FRAM 0x20 /* Framing Error */ #define RX_OFLO 0x10 /* Overflow Error */ #define RX_CRC 0x08 /* CRC Error */ #define RX_BUFF 0x04 /* Buffer Error */ #define RX_STP 0x02 /* Start of Packet */ #define RX_ENP 0x01 /* End of Packet */ /* * Transmit message descriptor status bit definitions. */ #define TX_OWN 0x80 /* Owner bit 0 = host, 1 = lance */ #define TX_ERR 0x40 /* Error Summary */ #define TX_MORE 0x10 /* More the 1 retry needed to Xmit */ #define TX_ONE 0x08 /* One retry needed to Xmit */ #define TX_DEF 0x04 /* Deferred */ #define TX_STP 0x02 /* Start of Packet */ #define TX_ENP 0x01 /* End of Packet */ /* * Transmit status (2) (valid if TX_ERR == 1) */ #define TX_BUFF 0x8000 /* Buffering error (no ENP) */ #define TX_UFLO 0x4000 /* Underflow (late memory) */ #define TX_LCOL 0x1000 /* Late collision */ #define TX_LCAR 0x0400 /* Loss of Carrier */ #define TX_RTRY 0x0200 /* Failed after 16 retransmissions */ #define TX_TDR 0x003f /* Time-domain-reflectometer-value */ /* * Structures used for Communication with the LANCE */ /* LANCE Initialize Block */ struct init_block { unsigned short mode; /* Mode Register */ unsigned char paddr[6]; /* Physical Address (MAC) */ unsigned char laddr[8]; /* Logical Filter Address (not used) */ unsigned int rdrp; /* Receive Descriptor Ring pointer */ unsigned int tdrp; /* Transmit Descriptor Ring pointer */ }; /* Receive Message Descriptor Entry */ struct rmd { union rmd_u { unsigned long buffer; /* Address of buffer */ struct rmd_s { unsigned char unused[3]; unsigned volatile char status; /* Status Bits */ } s; } u; volatile short blen; /* Buffer Length (two's complement) */ unsigned short mlen; /* Message Byte Count */ }; /* Transmit Message Descriptor Entry */ struct tmd { union tmd_u { unsigned long buffer; /* Address of buffer */ struct tmd_s { unsigned char unused[3]; unsigned volatile char status; /* Status Bits */ } s; } u; unsigned short blen; /* Buffer Length (two's complement) */ unsigned volatile short status2; /* Error Status Bits */ }; #endif /* End of SK_G16_H */
// SPDX-License-Identifier: GPL-2.0-or-later /* * * Copyright (C) IBM Corporation, 2010 * * Author: Anton Blanchard <anton@au.ibm.com> */ #include <linux/export.h> #include <linux/compiler.h> #include <linux/types.h> #include <asm/checksum.h> #include <linux/uaccess.h> __wsum csum_and_copy_from_user(const void __user *src, void *dst, int len) { __wsum csum; might_sleep(); if (unlikely(!access_ok(src, len))) return 0; allow_read_from_user(src, len); csum = csum_partial_copy_generic((void __force *)src, dst, len); prevent_read_from_user(src, len); return csum; } EXPORT_SYMBOL(csum_and_copy_from_user); __wsum csum_and_copy_to_user(const void *src, void __user *dst, int len) { __wsum csum; might_sleep(); if (unlikely(!access_ok(dst, len))) return 0; allow_write_to_user(dst, len); csum = csum_partial_copy_generic(src, (void __force *)dst, len); prevent_write_to_user(dst, len); return csum; } EXPORT_SYMBOL(csum_and_copy_to_user);
/* * x86 feature check * * Copyright (C) 2013 Intel Corporation. All rights reserved. * Author: * Jim Kukunas * * For conditions of distribution and use, see copyright notice in zlib.h */ #include "x86.h" int x86_cpu_enable_simd = 0; #ifndef _MSC_VER #include <pthread.h> pthread_once_t cpu_check_inited_once = PTHREAD_ONCE_INIT; static void _x86_check_features(void); void x86_check_features(void) { pthread_once(&cpu_check_inited_once, _x86_check_features); } static void _x86_check_features(void) { int x86_cpu_has_sse2; int x86_cpu_has_sse42; int x86_cpu_has_pclmulqdq; unsigned eax, ebx, ecx, edx; eax = 1; #ifdef __i386__ __asm__ __volatile__ ( "xchg %%ebx, %1\n\t" "cpuid\n\t" "xchg %1, %%ebx\n\t" : "+a" (eax), "=S" (ebx), "=c" (ecx), "=d" (edx) ); #else __asm__ __volatile__ ( "cpuid\n\t" : "+a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) ); #endif /* (__i386__) */ x86_cpu_has_sse2 = edx & 0x4000000; x86_cpu_has_sse42 = ecx & 0x100000; x86_cpu_has_pclmulqdq = ecx & 0x2; x86_cpu_enable_simd = x86_cpu_has_sse2 && x86_cpu_has_sse42 && x86_cpu_has_pclmulqdq; } #else #include <intrin.h> #include <windows.h> #include <stdint.h> static volatile int32_t once_control = 0; static void _x86_check_features(void); static int fake_pthread_once(volatile int32_t *once_control, void (*init_routine)(void)); void x86_check_features(void) { fake_pthread_once(&once_control, _x86_check_features); } /* Copied from "perftools_pthread_once" in tcmalloc */ static int fake_pthread_once(volatile int32_t *once_control, void (*init_routine)(void)) { // Try for a fast path first. Note: this should be an acquire semantics read // It is on x86 and x64, where Windows runs. if (*once_control != 1) { while (1) { switch (InterlockedCompareExchange(once_control, 2, 0)) { case 0: init_routine(); InterlockedExchange(once_control, 1); return 0; case 1: // The initializer has already been executed return 0; default: // The initializer is being processed by another thread SwitchToThread(); } } } return 0; } static void _x86_check_features(void) { int x86_cpu_has_sse2; int x86_cpu_has_sse42; int x86_cpu_has_pclmulqdq; int regs[4]; __cpuid(regs, 1); x86_cpu_has_sse2 = regs[3] & 0x4000000; x86_cpu_has_sse42= regs[2] & 0x100000; x86_cpu_has_pclmulqdq = regs[2] & 0x2; x86_cpu_enable_simd = x86_cpu_has_sse2 && x86_cpu_has_sse42 && x86_cpu_has_pclmulqdq; } #endif /* _MSC_VER */
/* * * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org> * * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ /* #pragma GCC diagnostic warning "-Wmissing-declarations" */
/* Simple DirectMedia Layer Copyright (C) 1997-2014 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. */ /* Based on automated SDL_Surface tests originally written by Edgar Simo 'bobbens'. Rewritten for test lib by Andreas Schiffler. */ #include "SDL_config.h" #include "SDL_test.h" /* Counter for _CompareSurface calls; used for filename creation when comparisons fail */ static int _CompareSurfaceCount = 0; /* Compare surfaces */ int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error) { int ret; int i,j; int bpp, bpp_reference; Uint8 *p, *p_reference; int dist; Uint8 R, G, B, A; Uint8 Rd, Gd, Bd, Ad; char imageFilename[128]; char referenceFilename[128]; /* Validate input surfaces */ if (surface == NULL || referenceSurface == NULL) { return -1; } /* Make sure surface size is the same. */ if ((surface->w != referenceSurface->w) || (surface->h != referenceSurface->h)) { return -2; } /* Sanitize input value */ if (allowable_error<0) { allowable_error = 0; } SDL_LockSurface( surface ); SDL_LockSurface( referenceSurface ); ret = 0; bpp = surface->format->BytesPerPixel; bpp_reference = referenceSurface->format->BytesPerPixel; /* Compare image - should be same format. */ for (j=0; j<surface->h; j++) { for (i=0; i<surface->w; i++) { p = (Uint8 *)surface->pixels + j * surface->pitch + i * bpp; p_reference = (Uint8 *)referenceSurface->pixels + j * referenceSurface->pitch + i * bpp_reference; SDL_GetRGBA(*(Uint32*)p, surface->format, &R, &G, &B, &A); SDL_GetRGBA(*(Uint32*)p_reference, referenceSurface->format, &Rd, &Gd, &Bd, &Ad); dist = 0; dist += (R-Rd)*(R-Rd); dist += (G-Gd)*(G-Gd); dist += (B-Bd)*(B-Bd); /* Allow some difference in blending accuracy */ if (dist > allowable_error) { ret++; } } } SDL_UnlockSurface( surface ); SDL_UnlockSurface( referenceSurface ); /* Save test image and reference for analysis on failures */ _CompareSurfaceCount++; if (ret != 0) { SDL_snprintf(imageFilename, 127, "CompareSurfaces%04d_TestOutput.bmp", _CompareSurfaceCount); SDL_SaveBMP(surface, imageFilename); SDL_snprintf(referenceFilename, 127, "CompareSurfaces%04d_Reference.bmp", _CompareSurfaceCount); SDL_SaveBMP(referenceSurface, referenceFilename); SDLTest_LogError("Surfaces from failed comparison saved as '%s' and '%s'", imageFilename, referenceFilename); } return ret; }
// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2018, Microsoft Corporation. * * Author(s): Steve French <stfrench@microsoft.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. */ #define CREATE_TRACE_POINTS #include "trace.h"
/* { dg-do compile { target { *-*-linux* } } } */ /* { dg-options "-Wno-pedantic" } */ struct S { int a; int b[]; } S; struct S s = { 1, { 2, 3 } }; /* { dg-final { scan-assembler ".size\[\t \]*s, 12" } } */
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_COMPILER_XLA_SERVICE_CPU_IR_EMISSION_UTILS_H_ #define TENSORFLOW_COMPILER_XLA_SERVICE_CPU_IR_EMISSION_UTILS_H_ #include "tensorflow/compiler/xla/service/hlo_instruction.h" namespace xla { namespace cpu { bool PotentiallyImplementedAsEigenConvolution( const HloInstruction& convolution); bool PotentiallyImplementedAsEigenDot(const HloInstruction& dot); } // namespace cpu } // namespace xla #endif // TENSORFLOW_COMPILER_XLA_SERVICE_CPU_IR_EMISSION_UTILS_H_
/* * Copyright (C) 2012 Invensense, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ /** * @addtogroup DRIVERS * @brief Hardware drivers. * * @{ * @file inv_ami306_ring.c * @brief Invensense implementation for AMI306 * @details This driver currently works for the AMI306 */ #include <linux/module.h> #include <linux/init.h> #include <linux/slab.h> #include <linux/i2c.h> #include <linux/err.h> #include <linux/delay.h> #include <linux/sysfs.h> #include <linux/jiffies.h> #include <linux/irq.h> #include <linux/interrupt.h> #include <linux/kfifo.h> #include <linux/poll.h> #include <linux/miscdevice.h> #include "iio.h" #include "kfifo_buf.h" #include "trigger_consumer.h" #include "sysfs.h" #include "inv_ami306_iio.h" static int put_scan_to_buf(struct iio_dev *indio_dev, unsigned char *d, short *s, int scan_index) { struct iio_buffer *ring = indio_dev->buffer; int st; int i, d_ind; d_ind = 0; for (i = 0; i < 3; i++) { st = iio_scan_mask_query(indio_dev, ring, scan_index + i); if (st) { memcpy(&d[d_ind], &s[i], sizeof(s[i])); d_ind += sizeof(s[i]); } } return d_ind; } /** * inv_read_fifo() - Transfer data from FIFO to ring buffer. */ int inv_read_ami306_fifo(struct iio_dev *indio_dev) { struct inv_ami306_state_s *st = iio_priv(indio_dev); struct iio_buffer *ring = indio_dev->buffer; int result, status, d_ind; char b; char *tmp; s64 tmp_buf[2]; result = i2c_smbus_read_i2c_block_data(st->i2c, REG_AMI_STA1, 1, &b); if (result < 0) goto end_session; if (b & AMI_STA1_DRDY_BIT) { status = ami306_read_raw_data(st, st->compass_data); if (status) { pr_err("error reading raw\n"); goto end_session; } tmp = (unsigned char *)tmp_buf; d_ind = put_scan_to_buf(indio_dev, tmp, st->compass_data, INV_AMI306_SCAN_MAGN_X); if (ring->scan_timestamp) tmp_buf[(d_ind + 7)/8] = st->timestamp; ring->access->store_to(indio_dev->buffer, tmp, st->timestamp); } else if (b & AMI_STA1_DOR_BIT) pr_err("not ready\n"); end_session: b = AMI_CTRL3_FORCE_BIT; result = i2c_smbus_write_i2c_block_data(st->i2c, REG_AMI_CTRL3, 1, &b); return IRQ_HANDLED; } void inv_ami306_unconfigure_ring(struct iio_dev *indio_dev) { iio_kfifo_free(indio_dev->buffer); }; static int inv_ami306_postenable(struct iio_dev *indio_dev) { struct inv_ami306_state_s *st = iio_priv(indio_dev); struct iio_buffer *ring = indio_dev->buffer; int result; /* when all the outputs are disabled, even though buffer/enable is on, do nothing */ if (!(iio_scan_mask_query(indio_dev, ring, INV_AMI306_SCAN_MAGN_X) || iio_scan_mask_query(indio_dev, ring, INV_AMI306_SCAN_MAGN_Y) || iio_scan_mask_query(indio_dev, ring, INV_AMI306_SCAN_MAGN_Z))) return 0; result = set_ami306_enable(indio_dev, true); if (result) return result; schedule_delayed_work(&st->work, msecs_to_jiffies(st->delay)); return 0; } static int inv_ami306_predisable(struct iio_dev *indio_dev) { struct iio_buffer *ring = indio_dev->buffer; struct inv_ami306_state_s *st = iio_priv(indio_dev); cancel_delayed_work_sync(&st->work); clear_bit(INV_AMI306_SCAN_MAGN_X, ring->scan_mask); clear_bit(INV_AMI306_SCAN_MAGN_Y, ring->scan_mask); clear_bit(INV_AMI306_SCAN_MAGN_Z, ring->scan_mask); return 0; } static const struct iio_buffer_setup_ops inv_ami306_ring_setup_ops = { .preenable = &iio_sw_buffer_preenable, .postenable = &inv_ami306_postenable, .predisable = &inv_ami306_predisable, }; int inv_ami306_configure_ring(struct iio_dev *indio_dev) { int ret = 0; struct iio_buffer *ring; ring = iio_kfifo_allocate(indio_dev); if (!ring) { ret = -ENOMEM; return ret; } indio_dev->buffer = ring; /* setup ring buffer */ ring->scan_timestamp = true; indio_dev->setup_ops = &inv_ami306_ring_setup_ops; indio_dev->modes |= INDIO_BUFFER_TRIGGERED; return 0; } /** * @} */
/* Copyright 2018 Jason Williams (Wilba) * * 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/>. */
/* * fan53555.h - Fairchild Regulator FAN53555 Driver * * Copyright (C) 2012 Marvell Technology Ltd. * Yunfan Zhang <yfzhang@marvell.com> * * This package 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 __FAN53555_H__ /* VSEL ID */ enum { FAN53555_VSEL_ID_0 = 0, FAN53555_VSEL_ID_1, }; /* Transition slew rate limiting from a low to high voltage. * The slew rate values listed in this table are based on * 10 mV voltage scaling step. The actual slew rate has a * relationship between the slew rate based on 10 mV as its * voltage scaling step size and the actual voltage step size. * The formula for calculating the actual slew rate is: * actual_slew_rate = 10mv_based_slew_rate * scaling_step_size_mv / 10mV. * ----------------------- * Bin |Slew Rate(mV/uS) * ------|---------------- * 000 | 64.00 * ------|---------------- * 001 | 32.00 * ------|---------------- * 010 | 16.00 * ------|---------------- * 011 | 8.00 * ------|---------------- * 100 | 4.00 * ------|---------------- * 101 | 2.00 * ------|---------------- * 110 | 1.00 * ------|---------------- * 111 | 0.50 * ----------------------- */ enum { FAN53555_SLEW_RATE_64MV = 0, FAN53555_SLEW_RATE_32MV, FAN53555_SLEW_RATE_16MV, FAN53555_SLEW_RATE_8MV, FAN53555_SLEW_RATE_4MV, FAN53555_SLEW_RATE_2MV, FAN53555_SLEW_RATE_1MV, FAN53555_SLEW_RATE_0_5MV, }; struct fan53555_platform_data { struct regulator_init_data *regulator; unsigned int slew_rate; /* Sleep VSEL ID */ unsigned int sleep_vsel_id; }; #ifdef CONFIG_REGULATOR_FAN53555 int __init fan53555_regulator_init(void); #else static inline int __init fan53555_regulator_init(void) { return 0; } #endif #endif /* __FAN53555_H__ */
/* Copyright (c) 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. */ #include <linux/module.h> #include <media/rc-map.h> static struct rc_map_table philips[] = { { 0x00, KEY_NUMERIC_0 }, { 0x01, KEY_NUMERIC_1 }, { 0x02, KEY_NUMERIC_2 }, { 0x03, KEY_NUMERIC_3 }, { 0x04, KEY_NUMERIC_4 }, { 0x05, KEY_NUMERIC_5 }, { 0x06, KEY_NUMERIC_6 }, { 0x07, KEY_NUMERIC_7 }, { 0x08, KEY_NUMERIC_8 }, { 0x09, KEY_NUMERIC_9 }, { 0xF4, KEY_SOUND }, { 0xF3, KEY_SCREEN }, /* Picture */ { 0x10, KEY_VOLUMEUP }, { 0x11, KEY_VOLUMEDOWN }, { 0x0d, KEY_MUTE }, { 0x20, KEY_CHANNELUP }, { 0x21, KEY_CHANNELDOWN }, { 0x0A, KEY_BACK }, { 0x0f, KEY_INFO }, { 0x5c, KEY_OK }, { 0x58, KEY_UP }, { 0x59, KEY_DOWN }, { 0x5a, KEY_LEFT }, { 0x5b, KEY_RIGHT }, { 0xcc, KEY_PAUSE }, { 0x6d, KEY_PVR }, /* Demo */ { 0x40, KEY_EXIT }, { 0x6e, KEY_PROG1 }, /* Scenea */ { 0x6f, KEY_MODE }, /* Dual */ { 0x70, KEY_SLEEP }, { 0xf5, KEY_TUNER }, /* Format */ { 0x4f, KEY_TV }, { 0x3c, KEY_NEW }, /* USB */ { 0x38, KEY_COMPOSE }, /* Source */ { 0x54, KEY_MENU }, { 0x0C, KEY_POWER }, }; static struct rc_map_list rc6_philips_map = { .map = { .scan = philips, .size = ARRAY_SIZE(philips), .rc_type = RC_TYPE_RC6, .name = RC_MAP_RC6_PHILIPS, } }; static int __init init_rc_map_rc6_philips(void) { return rc_map_register(&rc6_philips_map); } static void __exit exit_rc_map_rc6_philips(void) { rc_map_unregister(&rc6_philips_map); } module_init(init_rc_map_rc6_philips) module_exit(exit_rc_map_rc6_philips) MODULE_DESCRIPTION("Philips Remote Keymap "); MODULE_LICENSE("GPL v2");
/**************************************************************************** Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #ifndef __CCTRANSFORMHELP_H__ #define __CCTRANSFORMHELP_H__ #include "cocostudio/CCArmatureDefine.h" #include "cocostudio/CCDatas.h" #include "cocostudio/CocosStudioExport.h" namespace cocostudio { /* * use to calculate the matrix of node from parent node * @js NA * @lua NA */ class CC_STUDIO_DLL TransformHelp { public: TransformHelp(); static void transformFromParent(BaseData &node, const BaseData &parentNode); static void transformToParent(BaseData &node, const BaseData &parentNode); static void transformFromParentWithoutScale(BaseData &node, const BaseData &parentNode); static void transformToParentWithoutScale(BaseData &node, const BaseData &parentNode); static void nodeToMatrix(const BaseData &_node, cocos2d::AffineTransform &_matrix); static void nodeToMatrix(const BaseData &node, cocos2d::Mat4 &matrix); static void matrixToNode(const cocos2d::AffineTransform &_matrix, BaseData &_node); static void matrixToNode(const cocos2d::Mat4 &_matrix, BaseData &_node); static void nodeConcat(BaseData &target, BaseData &source); static void nodeSub(BaseData &target, BaseData &source); public: static cocos2d::AffineTransform helpMatrix1; static cocos2d::AffineTransform helpMatrix2; static cocos2d::Vec2 helpPoint1; static cocos2d::Vec2 helpPoint2; }; } #endif /*__CCTRANSFORMHELP_H__*/
/* * Copyright (C) 2004, 2006, 2009, 2010 Texas Instruments Incorporated * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com) * * Updated for 2.6.34: Mark Salter <msalter@redhat.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_C6X_PTRACE_H #define _ASM_C6X_PTRACE_H #include <uapi/asm/ptrace.h> #ifndef __ASSEMBLY__ #ifdef _BIG_ENDIAN #else #endif #include <linux/linkage.h> #define user_mode(regs) ((((regs)->tsr) & 0x40) != 0) #define instruction_pointer(regs) ((regs)->pc) #define profile_pc(regs) instruction_pointer(regs) #define user_stack_pointer(regs) ((regs)->sp) extern void show_regs(struct pt_regs *); extern asmlinkage unsigned long syscall_trace_entry(struct pt_regs *regs); extern asmlinkage void syscall_trace_exit(struct pt_regs *regs); #endif /* __ASSEMBLY__ */ #endif /* _ASM_C6X_PTRACE_H */
/* { dg-do compile } */ /* { dg-options "-mavx512ifma -mavx512vl -O2" } */ /* { dg-final { scan-assembler-times "vpmadd52huq\[ \\t\]+\[^\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+" 3 } } */ /* { dg-final { scan-assembler-times "vpmadd52huq\[ \\t\]+\[^\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\[^\{\]" 1 } } */ /* { dg-final { scan-assembler-times "vpmadd52huq\[ \\t\]+\[^\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}" 1 } } */ /* { dg-final { scan-assembler-times "vpmadd52huq\[ \\t\]+\[^\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+" 3 } } */ /* { dg-final { scan-assembler-times "vpmadd52huq\[ \\t\]+\[^\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\[^\{\]" 1 } } */ /* { dg-final { scan-assembler-times "vpmadd52huq\[ \\t\]+\[^\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}" 1 } } */ /* { dg-final { scan-assembler-times "vpmadd52huq\[ \\t\]+\[^\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+" 3 } } */ /* { dg-final { scan-assembler-times "vpmadd52huq\[ \\t\]+\[^\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\[^\{\]" 1 } } */ /* { dg-final { scan-assembler-times "vpmadd52huq\[ \\t\]+\[^\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}" 1 } } */ #include <immintrin.h> volatile __m512i _x1, _y1, _z1; volatile __m256i _x2, _y2, _z2; volatile __m128i _x3, _y3, _z3; void extern avx512ifma_test (void) { _x3 = _mm_madd52hi_epu64 (_x3, _y3, _z3); _x3 = _mm_mask_madd52hi_epu64 (_x3, 2, _y3, _z3); _x3 = _mm_maskz_madd52hi_epu64 (2, _x3, _y3, _z3); _x2 = _mm256_madd52hi_epu64 (_x2, _y2, _z2); _x2 = _mm256_mask_madd52hi_epu64 (_x2, 3, _y2, _z2); _x2 = _mm256_maskz_madd52hi_epu64 (3, _x2, _y2, _z2); _x1 = _mm512_madd52hi_epu64 (_x1, _y1, _z1); _x1 = _mm512_mask_madd52hi_epu64 (_x1, 3, _y1, _z1); _x1 = _mm512_maskz_madd52hi_epu64 (3, _x1, _y1, _z1); }
/* Software floating-point emulation. Convert a 32bit unsigned integer to IEEE quad Copyright (C) 1997-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). 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. In addition to the permissions in the GNU Lesser General Public License, the Free Software Foundation gives you unlimited permission to link the compiled version of this file into combinations with other programs, and to distribute those combinations without any restriction coming from the use of this file. (The Lesser General Public License restrictions do apply in other respects; for example, they cover modification of the file, and distribution when not linked into a combine executable.) 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/>. */ #define FP_NO_EXCEPTIONS #include "soft-fp.h" #include "quad.h" TFtype __floatunsitf (USItype i) { FP_DECL_Q (A); TFtype a; FP_FROM_INT_Q (A, i, SI_BITS, USItype); FP_PACK_RAW_Q (a, A); return a; }
/* Set up combined include path for the preprocessor. Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ extern void split_quote_chain (void); extern void add_path (char *, int, int, bool); extern void register_include_chains (cpp_reader *, const char *, const char *, const char *, int, int, int); extern void add_cpp_dir_path (struct cpp_dir *, int); extern struct cpp_dir *get_added_cpp_dirs (int); struct target_c_incpath_s { /* Do extra includes processing. STDINC is false iff -nostdinc was given. */ void (*extra_pre_includes) (const char *, const char *, int); void (*extra_includes) (const char *, const char *, int); }; extern struct target_c_incpath_s target_c_incpath; enum { QUOTE = 0, BRACKET, SYSTEM, AFTER };
/* Copyright (c) 2002,2007-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 __Z80_REG_H #define __Z80_REG_H #define REG_VGC_IRQSTATUS__MH_MASK 0x00000001L #define REG_VGC_IRQSTATUS__G2D_MASK 0x00000002L #define REG_VGC_IRQSTATUS__FIFO_MASK 0x00000004L #define MH_ARBITER_CONFIG__SAME_PAGE_GRANULARITY__SHIFT 0x00000006 #define MH_ARBITER_CONFIG__L1_ARB_ENABLE__SHIFT 0x00000007 #define MH_ARBITER_CONFIG__L1_ARB_HOLD_ENABLE__SHIFT 0x00000008 #define MH_ARBITER_CONFIG__L2_ARB_CONTROL__SHIFT 0x00000009 #define MH_ARBITER_CONFIG__PAGE_SIZE__SHIFT 0x0000000a #define MH_ARBITER_CONFIG__TC_REORDER_ENABLE__SHIFT 0x0000000d #define MH_ARBITER_CONFIG__TC_ARB_HOLD_ENABLE__SHIFT 0x0000000e #define MH_ARBITER_CONFIG__IN_FLIGHT_LIMIT_ENABLE__SHIFT 0x0000000f #define MH_ARBITER_CONFIG__IN_FLIGHT_LIMIT__SHIFT 0x00000010 #define MH_ARBITER_CONFIG__CP_CLNT_ENABLE__SHIFT 0x00000016 #define MH_ARBITER_CONFIG__VGT_CLNT_ENABLE__SHIFT 0x00000017 #define MH_ARBITER_CONFIG__TC_CLNT_ENABLE__SHIFT 0x00000018 #define MH_ARBITER_CONFIG__RB_CLNT_ENABLE__SHIFT 0x00000019 #define MH_ARBITER_CONFIG__PA_CLNT_ENABLE__SHIFT 0x0000001a #define ADDR_VGC_MH_READ_ADDR 0x0510 #define ADDR_VGC_MH_DATA_ADDR 0x0518 #define ADDR_VGC_COMMANDSTREAM 0x0000 #define ADDR_VGC_IRQENABLE 0x0438 #define ADDR_VGC_IRQSTATUS 0x0418 #define ADDR_VGC_IRQ_ACTIVE_CNT 0x04E0 #define ADDR_VGC_MMUCOMMANDSTREAM 0x03FC #define ADDR_VGV3_CONTROL 0x0070 #define ADDR_VGV3_LAST 0x007F #define ADDR_VGV3_MODE 0x0071 #define ADDR_VGV3_NEXTADDR 0x0075 #define ADDR_VGV3_NEXTCMD 0x0076 #define ADDR_VGV3_WRITEADDR 0x0072 #define ADDR_VGC_VERSION 0x400 #define ADDR_VGC_SYSSTATUS 0x410 #define ADDR_VGC_CLOCKEN 0x508 #define ADDR_VGC_GPR0 0x520 #define ADDR_VGC_GPR1 0x528 #define ADDR_VGC_BUSYCNT 0x530 #define ADDR_VGC_FIFOFREE 0x7c0 #endif /* __Z180_REG_H */
#ifndef _POSIX_SYS_TCP_H_ #define _POSIX_SYS_TCP_H_ #include <lwip/tcp.h> #endif /* _POSIX_SYS_TCP_H_ */
/* linux/arch/arm/plat-s3c/include/plat/gpio-core.h * * Copyright 2008 Simtec Electronics * http://armlinux.simtec.co.uk/ * Ben Dooks <ben@simtec.co.uk> * * S3C Platform - GPIO core * * 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 __PLAT_SAMSUNG_GPIO_CORE_H #define __PLAT_SAMSUNG_GPIO_CORE_H #define GPIOCON_OFF (0x00) #define GPIODAT_OFF (0x04) #define con_4bit_shift(__off) ((__off) * 4) /* Define the core gpiolib support functions that the s3c platforms may * need to extend or change depending on the hardware and the s3c chip * selected at build or found at run time. * * These definitions are not intended for driver inclusion, there is * nothing here that should not live outside the platform and core * specific code. */ struct samsung_gpio_chip; /** * struct samsung_gpio_pm - power management (suspend/resume) information * @save: Routine to save the state of the GPIO block * @resume: Routine to resume the GPIO block. */ struct samsung_gpio_pm { void (*save)(struct samsung_gpio_chip *chip); void (*resume)(struct samsung_gpio_chip *chip); }; struct samsung_gpio_cfg; /** * struct samsung_gpio_chip - wrapper for specific implementation of gpio * @chip: The chip structure to be exported via gpiolib. * @base: The base pointer to the gpio configuration registers. * @group: The group register number for gpio interrupt support. * @irq_base: The base irq number. * @config: special function and pull-resistor control information. * @lock: Lock for exclusive access to this gpio bank. * @pm_save: Save information for suspend/resume support. * @bitmap_gpio_int: Bitmap for representing GPIO interrupt or not. * * This wrapper provides the necessary information for the Samsung * specific gpios being registered with gpiolib. * * The lock protects each gpio bank from multiple access of the shared * configuration registers, or from reading of data whilst another thread * is writing to the register set. * * Each chip has its own lock to avoid any contention between different * CPU cores trying to get one lock for different GPIO banks, where each * bank of GPIO has its own register space and configuration registers. */ struct samsung_gpio_chip { struct gpio_chip chip; struct samsung_gpio_cfg *config; struct samsung_gpio_pm *pm; void __iomem *base; int irq_base; int group; spinlock_t lock; #ifdef CONFIG_PM u32 pm_save[4]; #endif u32 bitmap_gpio_int; }; static inline struct samsung_gpio_chip *to_samsung_gpio(struct gpio_chip *gpc) { return container_of(gpc, struct samsung_gpio_chip, chip); } /** * samsung_gpiolib_to_irq - convert gpio pin to irq number * @chip: The gpio chip that the pin belongs to. * @offset: The offset of the pin in the chip. * * This helper returns the irq number calculated from the chip->irq_base and * the provided offset. */ extern int samsung_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset); /* exported for core SoC support to change */ extern struct samsung_gpio_cfg s3c24xx_gpiocfg_default; #ifdef CONFIG_S3C_GPIO_TRACK extern struct samsung_gpio_chip *s3c_gpios[S3C_GPIO_END]; static inline struct samsung_gpio_chip *samsung_gpiolib_getchip(unsigned int chip) { return (chip < S3C_GPIO_END) ? s3c_gpios[chip] : NULL; } #else /* machine specific code should provide samsung_gpiolib_getchip */ #include <mach/gpio-track.h> static inline void s3c_gpiolib_track(struct samsung_gpio_chip *chip) { } #endif #ifdef CONFIG_PM extern struct samsung_gpio_pm samsung_gpio_pm_1bit; extern struct samsung_gpio_pm samsung_gpio_pm_2bit; extern struct samsung_gpio_pm samsung_gpio_pm_4bit; #define __gpio_pm(x) x #else #define samsung_gpio_pm_1bit NULL #define samsung_gpio_pm_2bit NULL #define samsung_gpio_pm_4bit NULL #define __gpio_pm(x) NULL #endif /* CONFIG_PM */ /* locking wrappers to deal with multiple access to the same gpio bank */ #define samsung_gpio_lock(_oc, _fl) spin_lock_irqsave(&(_oc)->lock, _fl) #define samsung_gpio_unlock(_oc, _fl) spin_unlock_irqrestore(&(_oc)->lock, _fl) #endif /* __PLAT_SAMSUNG_GPIO_CORE_H */
/* sis.c -- sis driver -*- linux-c -*- * * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. * 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 * PRECISION INSIGHT 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. * */ #include "drmP.h" #include "sis_drm.h" #include "sis_drv.h" #include "drm_pciids.h" static struct pci_device_id pciidlist[] = { sisdrv_PCI_IDS }; static int sis_driver_load(struct drm_device *dev, unsigned long chipset) { drm_sis_private_t *dev_priv; int ret; dev_priv = kzalloc(sizeof(drm_sis_private_t), GFP_KERNEL); if (dev_priv == NULL) return -ENOMEM; dev->dev_private = (void *)dev_priv; dev_priv->chipset = chipset; ret = drm_sman_init(&dev_priv->sman, 2, 12, 8); if (ret) { kfree(dev_priv); } return ret; } static int sis_driver_unload(struct drm_device *dev) { drm_sis_private_t *dev_priv = dev->dev_private; drm_sman_takedown(&dev_priv->sman); kfree(dev_priv); return 0; } static struct drm_driver driver = { .driver_features = DRIVER_USE_AGP | DRIVER_USE_MTRR, .load = sis_driver_load, .unload = sis_driver_unload, .context_dtor = NULL, .dma_quiescent = sis_idle, .reclaim_buffers = NULL, .reclaim_buffers_idlelocked = sis_reclaim_buffers_locked, .lastclose = sis_lastclose, .get_map_ofs = drm_core_get_map_ofs, .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = sis_ioctls, .fops = { .owner = THIS_MODULE, .open = drm_open, .release = drm_release, .unlocked_ioctl = drm_ioctl, .mmap = drm_mmap, .poll = drm_poll, .fasync = drm_fasync, }, .pci_driver = { .name = DRIVER_NAME, .id_table = pciidlist, }, .name = DRIVER_NAME, .desc = DRIVER_DESC, .date = DRIVER_DATE, .major = DRIVER_MAJOR, .minor = DRIVER_MINOR, .patchlevel = DRIVER_PATCHLEVEL, }; static int __init sis_init(void) { driver.num_ioctls = sis_max_ioctl; return drm_init(&driver); } static void __exit sis_exit(void) { drm_exit(&driver); } module_init(sis_init); module_exit(sis_exit); MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL and additional rights");
/* Montage Technology DS3000 - DVBS/S2 Demodulator driver Copyright (C) 2009-2012 Konstantin Dimitrov <kosio.dimitrov@gmail.com> Copyright (C) 2009-2012 TurboSight.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef DS3000_H #define DS3000_H #include <linux/kconfig.h> #include <linux/dvb/frontend.h> struct ds3000_config { /* the demodulator's i2c address */ u8 demod_address; u8 ci_mode; /* Set device param to start dma */ int (*set_ts_params)(struct dvb_frontend *fe, int is_punctured); /* Hook for Lock LED */ void (*set_lock_led)(struct dvb_frontend *fe, int offon); }; #if IS_REACHABLE(CONFIG_DVB_DS3000) extern struct dvb_frontend *ds3000_attach(const struct ds3000_config *config, struct i2c_adapter *i2c); #else static inline struct dvb_frontend *ds3000_attach(const struct ds3000_config *config, struct i2c_adapter *i2c) { printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); return NULL; } #endif /* CONFIG_DVB_DS3000 */ #endif /* DS3000_H */
// // ALCaptureDevice.h // ObjectAL // // Created by Karl Stenerud on 10-01-11. // // Copyright (c) 2009 Karl Stenerud. 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 shall remain in place // in this source code. // // 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. // // Attribution is not required, but appreciated :) // #import <Foundation/Foundation.h> #import <OpenAL/alc.h> #pragma mark ALCaptureDevice /** * *UNIMPLEMENTED FOR IOS* An OpenAL device for capturing sound data. * Note: This functionality is NOT implemented in iOS OpenAL! <br> * This class is a placeholder in case such functionality is added in a future iOS SDK. */ @interface ALCaptureDevice : NSObject { ALCdevice* device; } #pragma mark Properties /** The number of capture samples available. */ @property(nonatomic,readonly,assign) int captureSamples; /** The OpenAL device pointer. */ @property(nonatomic,readonly,assign) ALCdevice* device; /** List of strings describing all extensions available on this device (NSString*). */ @property(nonatomic,readonly,retain) NSArray* extensions; /** The specification revision for this implementation (major version). */ @property(nonatomic,readonly,assign) int majorVersion; /** The specification revision for this implementation (minor version). */ @property(nonatomic,readonly,assign) int minorVersion; #pragma mark Object Management /** Open the specified device. * * @param deviceSpecifier The name of the device to open (nil = default device). * @param frequency The frequency to capture at. * @param format The audio format to capture as. * @param bufferSize The size of buffer that the device must allocate for audio capture. * @return A new capture device. */ + (id) deviceWithDeviceSpecifier:(NSString*) deviceSpecifier frequency:(ALCuint) frequency format:(ALCenum) format bufferSize:(ALCsizei) bufferSize; /** Open the specified device. * * @param deviceSpecifier The name of the device to open (nil = default device). * @param frequency The frequency to capture at. * @param format The audio format to capture as. * @param bufferSize The size of buffer that the device must allocate for audio capture. * @return The initialized capture device. */ - (id) initWithDeviceSpecifier:(NSString*) deviceSpecifier frequency:(ALCuint) frequency format:(ALCenum) format bufferSize:(ALCsizei) bufferSize; #pragma mark Audio Capture /** Start capturing samples. * * @return TRUE if the operation was successful. */ - (bool) startCapture; /** Stop capturing samples. * * @return TRUE if the operation was successful. */ - (bool) stopCapture; /** Move captured samples to the specified buffer. * This method will fail if less than the specified number of samples have been captured. * * @param numSamples The number of samples to move. * @param buffer the buffer to move the samples into. * @return TRUE if the operation was successful. */ - (bool) moveSamples:(ALCsizei) numSamples toBuffer:(ALCvoid*) buffer; #pragma mark Extensions /** Check if the specified extension is present. * * @param name The name of the extension to check. * @return TRUE if the extension is present. */ - (bool) isExtensionPresent:(NSString*) name; /** Get the address of the specified procedure (C function address). * * @param functionName The name of the procedure to get. * @return the procedure's address, or NULL if it wasn't found. */ - (void*) getProcAddress:(NSString*) functionName; @end
/*************************************************************************** * blitz/random.h Random number generator wrapper class * * $Id: random.h 1414 2005-11-01 22:04:59Z cookedm $ * * Copyright (C) 1997-2001 Todd Veldhuizen <tveldhui@oonumerics.org> * * This code was relicensed under the modified BSD license for use in SciPy * by Todd Veldhuizen (see LICENSE.txt in the weave directory). * * * Suggestions: blitz-dev@oonumerics.org * Bugs: blitz-bugs@oonumerics.org * * For more information, please see the Blitz++ Home Page: * http://oonumerics.org/blitz/ * ***************************************************************************/ #ifndef BZ_RANDOM_H #define BZ_RANDOM_H #ifndef BZ_BLITZ_H #include <blitz/blitz.h> #endif BZ_NAMESPACE(blitz) template<typename P_distribution> class Random { public: typedef P_distribution T_distribution; typedef _bz_typename T_distribution::T_numtype T_numtype; Random(double parm1=0.0, double parm2=1.0, double parm3=0.0) : generator_(parm1, parm2, parm3) { } void randomize() { generator_.randomize(); } T_numtype random() { return generator_.random(); } operator T_numtype() { return generator_.random(); } protected: T_distribution generator_; }; BZ_NAMESPACE_END #include <blitz/randref.h> #endif // BZ_RANDOM_H
/* * Copyright (C) 2012 - Virtual Open Systems and Columbia University * Copyright (C) 2013 - ARM Ltd * * Authors: Rusty Russell <rusty@rustcorp.au> * Christoffer Dall <c.dall@virtualopensystems.com> * Jonathan Austin <jonathan.austin@arm.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <linux/kvm_host.h> #include <asm/kvm_coproc.h> #include <asm/kvm_emulate.h> #include <linux/init.h> #include "coproc.h" /* * Cortex-A7 specific CP15 registers. * CRn denotes the primary register number, but is copied to the CRm in the * user space API for 64-bit register access in line with the terminology used * in the ARM ARM. * Important: Must be sorted ascending by CRn, CRM, Op1, Op2 and with 64-bit * registers preceding 32-bit ones. */ static const struct coproc_reg a7_regs[] = { /* SCTLR: swapped by interrupt.S. */ { CRn( 1), CRm( 0), Op1( 0), Op2( 0), is32, access_sctlr, reset_val, c1_SCTLR, 0x00C50878 }, }; static struct kvm_coproc_target_table a7_target_table = { .target = KVM_ARM_TARGET_CORTEX_A7, .table = a7_regs, .num = ARRAY_SIZE(a7_regs), }; static int __init coproc_a7_init(void) { kvm_register_target_coproc_table(&a7_target_table); return 0; } late_initcall(coproc_a7_init);
//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A //// PARTICULAR PURPOSE. //// //// Copyright (c) Microsoft Corporation. All rights reserved #pragma once namespace Microsoft { namespace Samples { namespace SimpleCommunication { namespace Network { interface DECLSPEC_UUID("D30E9A4E-31BD-484C-940D-0E5FF536036D") DECLSPEC_NOVTABLE IMediaBufferWrapper : public IUnknown { IFACEMETHOD_(IMFMediaBuffer *, GetMediaBuffer) () const = 0; IFACEMETHOD_(BYTE *, GetBuffer) () const = 0; IFACEMETHOD(SetOffset) (DWORD nOffset) = 0; IFACEMETHOD_(DWORD, GetOffset) () const = 0; IFACEMETHOD(GetCurrentLength) (DWORD *pcbCurrentLength) = 0; IFACEMETHOD(SetCurrentLength) (DWORD cbCurrentLength) = 0; IFACEMETHOD(TrimLeft) (DWORD cbSize) = 0; IFACEMETHOD(TrimRight) (DWORD cbSize, _Out_ IMediaBufferWrapper **pWrapper) = 0; IFACEMETHOD(Reset) () = 0; }; interface DECLSPEC_UUID("3FEBFE65-E515-4448-8DB4-10D7DBC030A8") DECLSPEC_NOVTABLE IBufferEnumerator : public IUnknown { IFACEMETHOD_(bool, IsValid) (); IFACEMETHOD(GetCurrent) (_Out_ IMediaBufferWrapper **ppBuffer); IFACEMETHOD(MoveNext) (); IFACEMETHOD(Reset) (); }; interface DECLSPEC_UUID("E6D1193E-8B68-4526-885A-9C858613807D") DECLSPEC_NOVTABLE IBufferPacket : public IUnknown { IFACEMETHOD(AddBuffer) (IMediaBufferWrapper *pBuffer) = 0; IFACEMETHOD(InsertBuffer) (unsigned int nIndex, _In_ IMediaBufferWrapper *pBuffer) = 0; IFACEMETHOD(RemoveBuffer) (unsigned int nIndex, _Outptr_ IMediaBufferWrapper **ppBuffer) = 0; IFACEMETHOD(Clear) () = 0; IFACEMETHOD_(size_t, GetBufferCount) () const = 0; IFACEMETHOD(GetTotalLength) (_Out_ DWORD *pcbTotalLength) = 0; IFACEMETHOD(CopyTo) (DWORD nOffset, DWORD cbSize, _In_reads_bytes_(cbSize) void *pDest, _Out_ DWORD *pcbCopied) = 0; IFACEMETHOD(MoveLeft) (DWORD cbSize, _Out_writes_bytes_(cbSize) void *pDest) = 0; IFACEMETHOD(TrimLeft) (DWORD cbSize) = 0; IFACEMETHOD(ToMFSample) (IMFSample **ppSample) = 0; IFACEMETHOD(GetEnumerator) (_Out_ IBufferEnumerator **pEnumerator) = 0; }; ref class INetworkChannel abstract { internal: virtual Windows::Foundation::IAsyncAction ^SendAsync(_In_ IBufferPacket *pPacket) = 0; virtual Windows::Foundation::IAsyncAction ^ReceiveAsync(_In_ IMediaBufferWrapper *pBuffer) = 0; virtual void Close() = 0; virtual void Disconnect() = 0; }; interface class INetworkServer { Windows::Foundation::IAsyncOperation<Windows::Networking::Sockets::StreamSocketInformation^>^ AcceptAsync(); }; interface class INetworkClient { Windows::Foundation::IAsyncAction ^ConnectAsync(String ^url, WORD wPort); }; HRESULT CreateMediaBufferWrapper(DWORD dwMaxLength, _Outptr_ IMediaBufferWrapper **ppMediaBufferWrapper); HRESULT CreateMediaBufferWrapper(_In_ IMFMediaBuffer *pMediaBuffer, _Outptr_ IMediaBufferWrapper **ppMediaBufferWrapper); HRESULT CreateBufferPacketFromMFSample(_In_ IMFSample *pSample, _Outptr_ IBufferPacket **ppBufferPacket); HRESULT CreateBufferPacket(_Outptr_ IBufferPacket **ppBufferPacket); INetworkServer ^CreateNetworkServer(unsigned short listeningPort); INetworkClient ^CreateNetworkClient(); }}}}
/* * arch/ubicom32/include/asm/ioctls.h * Definitions of ioctls for Ubicom32 architecture. * * (C) Copyright 2009, Ubicom, Inc. * * This file is part of the Ubicom32 Linux Kernel Port. * * The Ubicom32 Linux Kernel Port 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. * * The Ubicom32 Linux Kernel Port 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 the Ubicom32 Linux Kernel Port. If not, * see <http://www.gnu.org/licenses/>. * * Ubicom32 implementation derived from (with many thanks): * arch/m68knommu * arch/blackfin * arch/parisc */ #ifndef _ASM_UBICOM32_IOCTLS_H #define _ASM_UBICOM32_IOCTLS_H #include <asm/ioctl.h> /* 0x54 is just a magic number to make these relatively unique ('T') */ #define TCGETS 0x5401 #define TCSETS 0x5402 #define TCSETSW 0x5403 #define TCSETSF 0x5404 #define TCGETA 0x5405 #define TCSETA 0x5406 #define TCSETAW 0x5407 #define TCSETAF 0x5408 #define TCSBRK 0x5409 #define TCXONC 0x540A #define TCFLSH 0x540B #define TIOCEXCL 0x540C #define TIOCNXCL 0x540D #define TIOCSCTTY 0x540E #define TIOCGPGRP 0x540F #define TIOCSPGRP 0x5410 #define TIOCOUTQ 0x5411 #define TIOCSTI 0x5412 #define TIOCGWINSZ 0x5413 #define TIOCSWINSZ 0x5414 #define TIOCMGET 0x5415 #define TIOCMBIS 0x5416 #define TIOCMBIC 0x5417 #define TIOCMSET 0x5418 #define TIOCGSOFTCAR 0x5419 #define TIOCSSOFTCAR 0x541A #define FIONREAD 0x541B #define TIOCINQ FIONREAD #define TIOCLINUX 0x541C #define TIOCCONS 0x541D #define TIOCGSERIAL 0x541E #define TIOCSSERIAL 0x541F #define TIOCPKT 0x5420 #define FIONBIO 0x5421 #define TIOCNOTTY 0x5422 #define TIOCSETD 0x5423 #define TIOCGETD 0x5424 #define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ #define TIOCSBRK 0x5427 /* BSD compatibility */ #define TIOCCBRK 0x5428 /* BSD compatibility */ #define TIOCGSID 0x5429 /* Return the session ID of FD */ #define TCGETS2 _IOR('T',0x2A, struct termios2) #define TCSETS2 _IOW('T',0x2B, struct termios2) #define TCSETSW2 _IOW('T',0x2C, struct termios2) #define TCSETSF2 _IOW('T',0x2D, struct termios2) #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ #define FIOCLEX 0x5451 #define FIOASYNC 0x5452 #define TIOCSERCONFIG 0x5453 #define TIOCSERGWILD 0x5454 #define TIOCSERSWILD 0x5455 #define TIOCGLCKTRMIOS 0x5456 #define TIOCSLCKTRMIOS 0x5457 #define TIOCSERGSTRUCT 0x5458 /* For debugging only */ #define TIOCSERGETLSR 0x5459 /* Get line status register */ #define TIOCSERGETMULTI 0x545A /* Get multiport config */ #define TIOCSERSETMULTI 0x545B /* Set multiport config */ #define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ #define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ #define FIOQSIZE 0x545E /* Used for packet mode */ #define TIOCPKT_DATA 0 #define TIOCPKT_FLUSHREAD 1 #define TIOCPKT_FLUSHWRITE 2 #define TIOCPKT_STOP 4 #define TIOCPKT_START 8 #define TIOCPKT_NOSTOP 16 #define TIOCPKT_DOSTOP 32 #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ #endif /* _ASM_UBICOM32_IOCTLS_H */
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SKIA_EXT_BITMAP_PLATFORM_DEVICE_H_ #define SKIA_EXT_BITMAP_PLATFORM_DEVICE_H_ // This file provides an easy way to include the appropriate // BitmapPlatformDevice header file for your platform. #if defined(WIN32) #include "skia/ext/bitmap_platform_device_win.h" #elif defined(__APPLE__) #include "skia/ext/bitmap_platform_device_mac.h" #elif defined(USE_CAIRO) #include "skia/ext/bitmap_platform_device_cairo.h" #else #include "skia/ext/bitmap_platform_device_skia.h" #endif namespace skia { // Returns true if it is unsafe to attempt to allocate an offscreen buffer // given these dimensions. inline bool RasterDeviceTooBigToAllocate(int width, int height) { #ifndef SKIA_EXT_RASTER_DEVICE_ALLOCATION_MAX #define SKIA_EXT_RASTER_DEVICE_ALLOCATION_MAX (2 * 256 * 1024 * 1024) #endif int bytesPerPixel = 4; int64_t bytes = (int64_t)width * height * bytesPerPixel; return bytes > SKIA_EXT_RASTER_DEVICE_ALLOCATION_MAX; } } #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_H_
// SPDX-License-Identifier: GPL-2.0-or-later /* * netup_unidvb_spi.c * * Internal SPI driver for NetUP Universal Dual DVB-CI * * Copyright (C) 2014 NetUP Inc. * Copyright (C) 2014 Sergey Kozlov <serjk@netup.ru> * Copyright (C) 2014 Abylay Ospan <aospan@netup.ru> */ #include "netup_unidvb.h" #include <linux/spi/spi.h> #include <linux/spi/flash.h> #include <linux/mtd/partitions.h> #include <mtd/mtd-abi.h> #define NETUP_SPI_CTRL_IRQ 0x1000 #define NETUP_SPI_CTRL_IMASK 0x2000 #define NETUP_SPI_CTRL_START 0x8000 #define NETUP_SPI_CTRL_LAST_CS 0x4000 #define NETUP_SPI_TIMEOUT 6000 enum netup_spi_state { SPI_STATE_START, SPI_STATE_DONE, }; struct netup_spi_regs { __u8 data[1024]; __le16 control_stat; __le16 clock_divider; } __packed __aligned(1); struct netup_spi { struct device *dev; struct spi_master *master; struct netup_spi_regs __iomem *regs; u8 __iomem *mmio; spinlock_t lock; wait_queue_head_t waitq; enum netup_spi_state state; }; static char netup_spi_name[64] = "fpga"; static struct mtd_partition netup_spi_flash_partitions = { .name = netup_spi_name, .size = 0x1000000, /* 16MB */ .offset = 0, .mask_flags = MTD_CAP_ROM }; static struct flash_platform_data spi_flash_data = { .name = "netup0_m25p128", .parts = &netup_spi_flash_partitions, .nr_parts = 1, }; static struct spi_board_info netup_spi_board = { .modalias = "m25p128", .max_speed_hz = 11000000, .chip_select = 0, .mode = SPI_MODE_0, .platform_data = &spi_flash_data, }; irqreturn_t netup_spi_interrupt(struct netup_spi *spi) { u16 reg; unsigned long flags; if (!spi) return IRQ_NONE; spin_lock_irqsave(&spi->lock, flags); reg = readw(&spi->regs->control_stat); if (!(reg & NETUP_SPI_CTRL_IRQ)) { spin_unlock_irqrestore(&spi->lock, flags); dev_dbg(&spi->master->dev, "%s(): not mine interrupt\n", __func__); return IRQ_NONE; } writew(reg | NETUP_SPI_CTRL_IRQ, &spi->regs->control_stat); reg = readw(&spi->regs->control_stat); writew(reg & ~NETUP_SPI_CTRL_IMASK, &spi->regs->control_stat); spi->state = SPI_STATE_DONE; wake_up(&spi->waitq); spin_unlock_irqrestore(&spi->lock, flags); dev_dbg(&spi->master->dev, "%s(): SPI interrupt handled\n", __func__); return IRQ_HANDLED; } static int netup_spi_transfer(struct spi_master *master, struct spi_message *msg) { struct netup_spi *spi = spi_master_get_devdata(master); struct spi_transfer *t; int result = 0; u32 tr_size; /* reset CS */ writew(NETUP_SPI_CTRL_LAST_CS, &spi->regs->control_stat); writew(0, &spi->regs->control_stat); list_for_each_entry(t, &msg->transfers, transfer_list) { tr_size = t->len; while (tr_size) { u32 frag_offset = t->len - tr_size; u32 frag_size = (tr_size > sizeof(spi->regs->data)) ? sizeof(spi->regs->data) : tr_size; int frag_last = 0; if (list_is_last(&t->transfer_list, &msg->transfers) && frag_offset + frag_size == t->len) { frag_last = 1; } if (t->tx_buf) { memcpy_toio(spi->regs->data, t->tx_buf + frag_offset, frag_size); } else { memset_io(spi->regs->data, 0, frag_size); } spi->state = SPI_STATE_START; writew((frag_size & 0x3ff) | NETUP_SPI_CTRL_IMASK | NETUP_SPI_CTRL_START | (frag_last ? NETUP_SPI_CTRL_LAST_CS : 0), &spi->regs->control_stat); dev_dbg(&spi->master->dev, "%s(): control_stat 0x%04x\n", __func__, readw(&spi->regs->control_stat)); wait_event_timeout(spi->waitq, spi->state != SPI_STATE_START, msecs_to_jiffies(NETUP_SPI_TIMEOUT)); if (spi->state == SPI_STATE_DONE) { if (t->rx_buf) { memcpy_fromio(t->rx_buf + frag_offset, spi->regs->data, frag_size); } } else { if (spi->state == SPI_STATE_START) { dev_dbg(&spi->master->dev, "%s(): transfer timeout\n", __func__); } else { dev_dbg(&spi->master->dev, "%s(): invalid state %d\n", __func__, spi->state); } result = -EIO; goto done; } tr_size -= frag_size; msg->actual_length += frag_size; } } done: msg->status = result; spi_finalize_current_message(master); return result; } static int netup_spi_setup(struct spi_device *spi) { return 0; } int netup_spi_init(struct netup_unidvb_dev *ndev) { struct spi_master *master; struct netup_spi *nspi; master = devm_spi_alloc_master(&ndev->pci_dev->dev, sizeof(struct netup_spi)); if (!master) { dev_err(&ndev->pci_dev->dev, "%s(): unable to alloc SPI master\n", __func__); return -EINVAL; } nspi = spi_master_get_devdata(master); master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_LSB_FIRST; master->bus_num = -1; master->num_chipselect = 1; master->transfer_one_message = netup_spi_transfer; master->setup = netup_spi_setup; spin_lock_init(&nspi->lock); init_waitqueue_head(&nspi->waitq); nspi->master = master; nspi->regs = (struct netup_spi_regs __iomem *)(ndev->bmmio0 + 0x4000); writew(2, &nspi->regs->clock_divider); writew(NETUP_UNIDVB_IRQ_SPI, ndev->bmmio0 + REG_IMASK_SET); ndev->spi = nspi; if (spi_register_master(master)) { ndev->spi = NULL; dev_err(&ndev->pci_dev->dev, "%s(): unable to register SPI bus\n", __func__); return -EINVAL; } snprintf(netup_spi_name, sizeof(netup_spi_name), "fpga_%02x:%02x.%01x", ndev->pci_bus, ndev->pci_slot, ndev->pci_func); if (!spi_new_device(master, &netup_spi_board)) { spi_unregister_master(master); ndev->spi = NULL; dev_err(&ndev->pci_dev->dev, "%s(): unable to create SPI device\n", __func__); return -EINVAL; } dev_dbg(&ndev->pci_dev->dev, "%s(): SPI init OK\n", __func__); return 0; } void netup_spi_release(struct netup_unidvb_dev *ndev) { u16 reg; unsigned long flags; struct netup_spi *spi = ndev->spi; if (!spi) return; spi_unregister_master(spi->master); spin_lock_irqsave(&spi->lock, flags); reg = readw(&spi->regs->control_stat); writew(reg | NETUP_SPI_CTRL_IRQ, &spi->regs->control_stat); reg = readw(&spi->regs->control_stat); writew(reg & ~NETUP_SPI_CTRL_IMASK, &spi->regs->control_stat); spin_unlock_irqrestore(&spi->lock, flags); ndev->spi = NULL; }
/* cnode related routines for the coda kernel code (C) 1996 Peter Braam */ #include <linux/types.h> #include <linux/string.h> #include <linux/time.h> #include <linux/coda.h> #include <linux/coda_psdev.h> #include "coda_linux.h" static inline int coda_fideq(struct CodaFid *fid1, struct CodaFid *fid2) { return memcmp(fid1, fid2, sizeof(*fid1)) == 0; } static const struct inode_operations coda_symlink_inode_operations = { .readlink = generic_readlink, .follow_link = page_follow_link_light, .put_link = page_put_link, .setattr = coda_setattr, }; /* cnode.c */ static void coda_fill_inode(struct inode *inode, struct coda_vattr *attr) { coda_vattr_to_iattr(inode, attr); if (S_ISREG(inode->i_mode)) { inode->i_op = &coda_file_inode_operations; inode->i_fop = &coda_file_operations; } else if (S_ISDIR(inode->i_mode)) { inode->i_op = &coda_dir_inode_operations; inode->i_fop = &coda_dir_operations; } else if (S_ISLNK(inode->i_mode)) { inode->i_op = &coda_symlink_inode_operations; inode->i_data.a_ops = &coda_symlink_aops; inode->i_mapping = &inode->i_data; } else init_special_inode(inode, inode->i_mode, huge_decode_dev(attr->va_rdev)); } static int coda_test_inode(struct inode *inode, void *data) { struct CodaFid *fid = (struct CodaFid *)data; struct coda_inode_info *cii = ITOC(inode); return coda_fideq(&cii->c_fid, fid); } static int coda_set_inode(struct inode *inode, void *data) { struct CodaFid *fid = (struct CodaFid *)data; struct coda_inode_info *cii = ITOC(inode); cii->c_fid = *fid; return 0; } struct inode * coda_iget(struct super_block * sb, struct CodaFid * fid, struct coda_vattr * attr) { struct inode *inode; struct coda_inode_info *cii; unsigned long hash = coda_f2i(fid); inode = iget5_locked(sb, hash, coda_test_inode, coda_set_inode, fid); if (!inode) return ERR_PTR(-ENOMEM); if (inode->i_state & I_NEW) { cii = ITOC(inode); /* we still need to set i_ino for things like stat(2) */ inode->i_ino = hash; /* inode is locked and unique, no need to grab cii->c_lock */ cii->c_mapcount = 0; unlock_new_inode(inode); } /* always replace the attributes, type might have changed */ coda_fill_inode(inode, attr); return inode; } /* this is effectively coda_iget: - get attributes (might be cached) - get the inode for the fid using vfs iget - link the two up if this is needed - fill in the attributes */ int coda_cnode_make(struct inode **inode, struct CodaFid *fid, struct super_block *sb) { struct coda_vattr attr; int error; /* We get inode numbers from Venus -- see venus source */ error = venus_getattr(sb, fid, &attr); if ( error ) { *inode = NULL; return error; } *inode = coda_iget(sb, fid, &attr); if ( IS_ERR(*inode) ) { printk("coda_cnode_make: coda_iget failed\n"); return PTR_ERR(*inode); } return 0; } /* Although we treat Coda file identifiers as immutable, there is one * special case for files created during a disconnection where they may * not be globally unique. When an identifier collision is detected we * first try to flush the cached inode from the kernel and finally * resort to renaming/rehashing in-place. Userspace remembers both old * and new values of the identifier to handle any in-flight upcalls. * The real solution is to use globally unique UUIDs as identifiers, but * retrofitting the existing userspace code for this is non-trivial. */ void coda_replace_fid(struct inode *inode, struct CodaFid *oldfid, struct CodaFid *newfid) { struct coda_inode_info *cii = ITOC(inode); unsigned long hash = coda_f2i(newfid); BUG_ON(!coda_fideq(&cii->c_fid, oldfid)); /* replace fid and rehash inode */ /* XXX we probably need to hold some lock here! */ remove_inode_hash(inode); cii->c_fid = *newfid; inode->i_ino = hash; __insert_inode_hash(inode, hash); } /* convert a fid to an inode. */ struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb) { struct inode *inode; unsigned long hash = coda_f2i(fid); if ( !sb ) { printk("coda_fid_to_inode: no sb!\n"); return NULL; } inode = ilookup5(sb, hash, coda_test_inode, fid); if ( !inode ) return NULL; /* we should never see newly created inodes because we intentionally * fail in the initialization callback */ BUG_ON(inode->i_state & I_NEW); return inode; } /* the CONTROL inode is made without asking attributes from Venus */ int coda_cnode_makectl(struct inode **inode, struct super_block *sb) { int error = -ENOMEM; *inode = new_inode(sb); if (*inode) { (*inode)->i_ino = CTL_INO; (*inode)->i_op = &coda_ioctl_inode_operations; (*inode)->i_fop = &coda_ioctl_operations; (*inode)->i_mode = 0444; error = 0; } return error; }
/* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-pre-stats" } */ int main(int *a, int argc) { int b; int c; int i; int d, e; for (i = 0; i < argc; i++) { e = *a; *a = 9; } return d + e; } /* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" } } */ /* { dg-final { cleanup-tree-dump "pre" } } */
//****************************************************************************** // // Copyright (c) 2015 Microsoft Corporation. All rights reserved. // // This code is licensed under the MIT License (MIT). // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // //****************************************************************************** #pragma once #include "UIScrollView.h" class UIFont; class UITextView : public UIScrollView { private: CGSize _shadowOffset; const char *_text; XIBObject *_textColor; UIFont *_font; int _textAlignment; bool _editable; int _dataDetectorTypes; int _autoCorrectionType; int _returnKeyType; public: UITextView(); virtual void InitFromXIB(XIBObject *obj); virtual void ConvertStaticMappings(NIBWriter *writer, XIBObject *obj); };
/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 only, * as published by the Free Software Foundation. * * 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 version 2 for more details (a copy is included * in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License * version 2 along with this program; If not, see * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. * * GPL HEADER END */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * * Copyright (c) 2012, 2013, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ * Lustre is a trademark of Sun Microsystems, Inc. * * lustre/fld/lproc_fld.c * * FLD (FIDs Location Database) * * Author: Yury Umanets <umka@clusterfs.com> * Di Wang <di.wang@whamcloud.com> */ #define DEBUG_SUBSYSTEM S_FLD #include "../../include/linux/libcfs/libcfs.h" #include <linux/module.h> #include "../include/obd.h" #include "../include/obd_class.h" #include "../include/dt_object.h" #include "../include/obd_support.h" #include "../include/lustre_req_layout.h" #include "../include/lustre_fld.h" #include "../include/lustre_fid.h" #include "fld_internal.h" static int fld_debugfs_targets_seq_show(struct seq_file *m, void *unused) { struct lu_client_fld *fld = (struct lu_client_fld *)m->private; struct lu_fld_target *target; LASSERT(fld != NULL); spin_lock(&fld->lcf_lock); list_for_each_entry(target, &fld->lcf_targets, ft_chain) seq_printf(m, "%s\n", fld_target_name(target)); spin_unlock(&fld->lcf_lock); return 0; } static int fld_debugfs_hash_seq_show(struct seq_file *m, void *unused) { struct lu_client_fld *fld = (struct lu_client_fld *)m->private; LASSERT(fld != NULL); spin_lock(&fld->lcf_lock); seq_printf(m, "%s\n", fld->lcf_hash->fh_name); spin_unlock(&fld->lcf_lock); return 0; } static ssize_t fld_debugfs_hash_seq_write(struct file *file, const char __user *buffer, size_t count, loff_t *off) { struct lu_client_fld *fld; struct lu_fld_hash *hash = NULL; char fh_name[8]; int i; if (count > sizeof(fh_name)) return -ENAMETOOLONG; if (copy_from_user(fh_name, buffer, count) != 0) return -EFAULT; fld = ((struct seq_file *)file->private_data)->private; LASSERT(fld != NULL); for (i = 0; fld_hash[i].fh_name != NULL; i++) { if (count != strlen(fld_hash[i].fh_name)) continue; if (!strncmp(fld_hash[i].fh_name, fh_name, count)) { hash = &fld_hash[i]; break; } } if (hash != NULL) { spin_lock(&fld->lcf_lock); fld->lcf_hash = hash; spin_unlock(&fld->lcf_lock); CDEBUG(D_INFO, "%s: Changed hash to \"%s\"\n", fld->lcf_name, hash->fh_name); } return count; } static ssize_t fld_debugfs_cache_flush_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos) { struct lu_client_fld *fld = file->private_data; LASSERT(fld != NULL); fld_cache_flush(fld->lcf_cache); CDEBUG(D_INFO, "%s: Lookup cache is flushed\n", fld->lcf_name); return count; } static int fld_debugfs_cache_flush_release(struct inode *inode, struct file *file) { file->private_data = NULL; return 0; } static struct file_operations fld_debugfs_cache_flush_fops = { .owner = THIS_MODULE, .open = simple_open, .write = fld_debugfs_cache_flush_write, .release = fld_debugfs_cache_flush_release, }; LPROC_SEQ_FOPS_RO(fld_debugfs_targets); LPROC_SEQ_FOPS(fld_debugfs_hash); struct lprocfs_vars fld_client_debugfs_list[] = { { "targets", &fld_debugfs_targets_fops }, { "hash", &fld_debugfs_hash_fops }, { "cache_flush", &fld_debugfs_cache_flush_fops }, { NULL } };
/* Definitions for Econet sockets. */ #ifndef __LINUX_IF_EC #define __LINUX_IF_EC /* User visible stuff. Glibc provides its own but libc5 folk will use these */ struct ec_addr { unsigned char station; /* Station number. */ unsigned char net; /* Network number. */ }; struct sockaddr_ec { unsigned short sec_family; unsigned char port; /* Port number. */ unsigned char cb; /* Control/flag byte. */ unsigned char type; /* Type of message. */ struct ec_addr addr; unsigned long cookie; }; #define ECTYPE_PACKET_RECEIVED 0 /* Packet received */ #define ECTYPE_TRANSMIT_STATUS 0x10 /* Transmit completed, low nibble holds status */ #define ECTYPE_TRANSMIT_OK 1 #define ECTYPE_TRANSMIT_NOT_LISTENING 2 #define ECTYPE_TRANSMIT_NET_ERROR 3 #define ECTYPE_TRANSMIT_NO_CLOCK 4 #define ECTYPE_TRANSMIT_LINE_JAMMED 5 #define ECTYPE_TRANSMIT_NOT_PRESENT 6 #ifdef __KERNEL__ #define EC_HLEN 6 /* This is what an Econet frame looks like on the wire. */ struct ec_framehdr { unsigned char dst_stn; unsigned char dst_net; unsigned char src_stn; unsigned char src_net; unsigned char cb; unsigned char port; }; struct econet_sock { /* struct sock has to be the first member of econet_sock */ struct sock sk; unsigned char cb; unsigned char port; unsigned char station; unsigned char net; unsigned short num; }; static inline struct econet_sock *ec_sk(const struct sock *sk) { return (struct econet_sock *)sk; } struct ec_device { unsigned char station, net; /* Econet protocol address */ }; #endif #endif
/* * UDPLITE An implementation of the UDP-Lite protocol (RFC 3828). * * Authors: Gerrit Renker <gerrit@erg.abdn.ac.uk> * * Changes: * Fixes: * 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 "udp_impl.h" struct udp_table udplite_table __read_mostly; EXPORT_SYMBOL(udplite_table); static int udplite_rcv(struct sk_buff *skb) { return __udp4_lib_rcv(skb, &udplite_table, IPPROTO_UDPLITE); } static void udplite_err(struct sk_buff *skb, u32 info) { __udp4_lib_err(skb, info, &udplite_table); } static const struct net_protocol udplite_protocol = { .handler = udplite_rcv, .err_handler = udplite_err, .no_policy = 1, .netns_ok = 1, }; struct proto udplite_prot = { .name = "UDP-Lite", .owner = THIS_MODULE, .close = udp_lib_close, .connect = ip4_datagram_connect, .disconnect = udp_disconnect, .ioctl = udp_ioctl, .init = udplite_sk_init, .destroy = udp_destroy_sock, .setsockopt = udp_setsockopt, .getsockopt = udp_getsockopt, .sendmsg = udp_sendmsg, .recvmsg = udp_recvmsg, .sendpage = udp_sendpage, .backlog_rcv = udp_queue_rcv_skb, .hash = udp_lib_hash, .unhash = udp_lib_unhash, .get_port = udp_v4_get_port, .obj_size = sizeof(struct udp_sock), .slab_flags = SLAB_DESTROY_BY_RCU, .h.udp_table = &udplite_table, #ifdef CONFIG_COMPAT .compat_setsockopt = compat_udp_setsockopt, .compat_getsockopt = compat_udp_getsockopt, #endif }; EXPORT_SYMBOL(udplite_prot); static struct inet_protosw udplite4_protosw = { .type = SOCK_DGRAM, .protocol = IPPROTO_UDPLITE, .prot = &udplite_prot, .ops = &inet_dgram_ops, .no_check = 0, /* must checksum (RFC 3828) */ .flags = INET_PROTOSW_PERMANENT, }; #ifdef CONFIG_PROC_FS static struct udp_seq_afinfo udplite4_seq_afinfo = { .name = "udplite", .family = AF_INET, .udp_table = &udplite_table, .seq_fops = { .owner = THIS_MODULE, }, .seq_ops = { .show = udp4_seq_show, }, }; static int __net_init udplite4_proc_init_net(struct net *net) { return udp_proc_register(net, &udplite4_seq_afinfo); } static void __net_exit udplite4_proc_exit_net(struct net *net) { udp_proc_unregister(net, &udplite4_seq_afinfo); } static struct pernet_operations udplite4_net_ops = { .init = udplite4_proc_init_net, .exit = udplite4_proc_exit_net, }; static __init int udplite4_proc_init(void) { return register_pernet_subsys(&udplite4_net_ops); } #else static inline int udplite4_proc_init(void) { return 0; } #endif void __init udplite4_register(void) { udp_table_init(&udplite_table, "UDP-Lite"); if (proto_register(&udplite_prot, 1)) goto out_register_err; if (inet_add_protocol(&udplite_protocol, IPPROTO_UDPLITE) < 0) goto out_unregister_proto; inet_register_protosw(&udplite4_protosw); if (udplite4_proc_init()) printk(KERN_ERR "%s: Cannot register /proc!\n", __func__); return; out_unregister_proto: proto_unregister(&udplite_prot); out_register_err: printk(KERN_CRIT "%s: Cannot add UDP-Lite protocol.\n", __func__); }
// SPDX-License-Identifier: GPL-2.0-or-later /* * Scatterlist Cryptographic API. * * Procfs information. * * Copyright (c) 2002 James Morris <jmorris@intercode.com.au> * Copyright (c) 2005 Herbert Xu <herbert@gondor.apana.org.au> */ #include <linux/atomic.h> #include <linux/init.h> #include <linux/crypto.h> #include <linux/module.h> /* for module_name() */ #include <linux/rwsem.h> #include <linux/proc_fs.h> #include <linux/seq_file.h> #include "internal.h" static void *c_start(struct seq_file *m, loff_t *pos) { down_read(&crypto_alg_sem); return seq_list_start(&crypto_alg_list, *pos); } static void *c_next(struct seq_file *m, void *p, loff_t *pos) { return seq_list_next(p, &crypto_alg_list, pos); } static void c_stop(struct seq_file *m, void *p) { up_read(&crypto_alg_sem); } static int c_show(struct seq_file *m, void *p) { struct crypto_alg *alg = list_entry(p, struct crypto_alg, cra_list); seq_printf(m, "name : %s\n", alg->cra_name); seq_printf(m, "driver : %s\n", alg->cra_driver_name); seq_printf(m, "module : %s\n", module_name(alg->cra_module)); seq_printf(m, "priority : %d\n", alg->cra_priority); seq_printf(m, "refcnt : %u\n", refcount_read(&alg->cra_refcnt)); seq_printf(m, "selftest : %s\n", (alg->cra_flags & CRYPTO_ALG_TESTED) ? "passed" : "unknown"); seq_printf(m, "internal : %s\n", (alg->cra_flags & CRYPTO_ALG_INTERNAL) ? "yes" : "no"); if (alg->cra_flags & CRYPTO_ALG_LARVAL) { seq_printf(m, "type : larval\n"); seq_printf(m, "flags : 0x%x\n", alg->cra_flags); goto out; } if (alg->cra_type && alg->cra_type->show) { alg->cra_type->show(m, alg); goto out; } switch (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) { case CRYPTO_ALG_TYPE_CIPHER: seq_printf(m, "type : cipher\n"); seq_printf(m, "blocksize : %u\n", alg->cra_blocksize); seq_printf(m, "min keysize : %u\n", alg->cra_cipher.cia_min_keysize); seq_printf(m, "max keysize : %u\n", alg->cra_cipher.cia_max_keysize); break; case CRYPTO_ALG_TYPE_COMPRESS: seq_printf(m, "type : compression\n"); break; default: seq_printf(m, "type : unknown\n"); break; } out: seq_putc(m, '\n'); return 0; } static const struct seq_operations crypto_seq_ops = { .start = c_start, .next = c_next, .stop = c_stop, .show = c_show }; void __init crypto_init_proc(void) { proc_create_seq("crypto", 0, NULL, &crypto_seq_ops); } void __exit crypto_exit_proc(void) { remove_proc_entry("crypto", NULL); }
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __MPC83XX_H__ #define __MPC83XX_H__ #include <linux/init.h> #include <linux/device.h> #include <asm/pci-bridge.h> /* System Clock Control Register */ #define MPC83XX_SCCR_OFFS 0xA08 #define MPC83XX_SCCR_USB_MASK 0x00f00000 #define MPC83XX_SCCR_USB_MPHCM_11 0x00c00000 #define MPC83XX_SCCR_USB_MPHCM_01 0x00400000 #define MPC83XX_SCCR_USB_MPHCM_10 0x00800000 #define MPC83XX_SCCR_USB_DRCM_11 0x00300000 #define MPC83XX_SCCR_USB_DRCM_01 0x00100000 #define MPC83XX_SCCR_USB_DRCM_10 0x00200000 #define MPC8315_SCCR_USB_MASK 0x00c00000 #define MPC8315_SCCR_USB_DRCM_11 0x00c00000 #define MPC8315_SCCR_USB_DRCM_01 0x00400000 #define MPC837X_SCCR_USB_DRCM_11 0x00c00000 /* system i/o configuration register low */ #define MPC83XX_SICRL_OFFS 0x114 #define MPC834X_SICRL_USB_MASK 0x60000000 #define MPC834X_SICRL_USB0 0x20000000 #define MPC834X_SICRL_USB1 0x40000000 #define MPC831X_SICRL_USB_MASK 0x00000c00 #define MPC831X_SICRL_USB_ULPI 0x00000800 #define MPC8315_SICRL_USB_MASK 0x000000fc #define MPC8315_SICRL_USB_ULPI 0x00000054 #define MPC837X_SICRL_USB_MASK 0xf0000000 #define MPC837X_SICRL_USB_ULPI 0x50000000 #define MPC837X_SICRL_USBB_MASK 0x30000000 #define MPC837X_SICRL_SD 0x20000000 /* system i/o configuration register high */ #define MPC83XX_SICRH_OFFS 0x118 #define MPC8308_SICRH_USB_MASK 0x000c0000 #define MPC8308_SICRH_USB_ULPI 0x00040000 #define MPC834X_SICRH_USB_UTMI 0x00020000 #define MPC831X_SICRH_USB_MASK 0x000000e0 #define MPC831X_SICRH_USB_ULPI 0x000000a0 #define MPC8315_SICRH_USB_MASK 0x0000ff00 #define MPC8315_SICRH_USB_ULPI 0x00000000 #define MPC837X_SICRH_SPI_MASK 0x00000003 #define MPC837X_SICRH_SD 0x00000001 /* USB Control Register */ #define FSL_USB2_CONTROL_OFFS 0x500 #define CONTROL_UTMI_PHY_EN 0x00000200 #define CONTROL_REFSEL_24MHZ 0x00000040 #define CONTROL_REFSEL_48MHZ 0x00000080 #define CONTROL_PHY_CLK_SEL_ULPI 0x00000400 #define CONTROL_OTG_PORT 0x00000020 /* USB PORTSC Registers */ #define FSL_USB2_PORTSC1_OFFS 0x184 #define FSL_USB2_PORTSC2_OFFS 0x188 #define PORTSCX_PTW_16BIT 0x10000000 #define PORTSCX_PTS_UTMI 0x00000000 #define PORTSCX_PTS_ULPI 0x80000000 /* * Declaration for the various functions exported by the * mpc83xx_* files. Mostly for use by mpc83xx_setup */ extern void __noreturn mpc83xx_restart(char *cmd); extern long mpc83xx_time_init(void); extern int mpc837x_usb_cfg(void); extern int mpc834x_usb_cfg(void); extern int mpc831x_usb_cfg(void); extern void mpc83xx_ipic_init_IRQ(void); #ifdef CONFIG_PCI extern void mpc83xx_setup_pci(void); #else #define mpc83xx_setup_pci() do {} while (0) #endif extern int mpc83xx_declare_of_platform_devices(void); extern void mpc83xx_setup_arch(void); #endif /* __MPC83XX_H__ */
#ifndef SASS_C_INTERFACE #define SASS_C_INTERFACE #include <stddef.h> #include <stdbool.h> #include "sass.h" #ifdef __cplusplus extern "C" { #endif // Please ensure there are no null values. // Thar be dragons. struct sass_options { // Output style for the generated css code // A value from above SASS_STYLE_* constants int output_style; // If you want inline source comments bool source_comments; // Path to source map file // Enables the source map generating // Used to create sourceMappingUrl const char* source_map_file; // Disable sourceMappingUrl in css output bool omit_source_map_url; // embed sourceMappingUrl as data uri bool source_map_embed; // embed include contents in maps bool source_map_contents; // Treat source_string as sass (as opposed to scss) bool is_indented_syntax_src; // Colon-separated list of paths // Semicolon-separated on Windows const char* include_paths; // For the image-url Sass function const char* image_path; // Precision for outputting fractional numbers int precision; }; struct sass_context { const char* input_path; const char* output_path; const char* source_string; char* output_string; char* source_map_string; struct sass_options options; int error_status; char* error_message; Sass_C_Function_List c_functions; char** included_files; int num_included_files; }; struct sass_file_context { const char* input_path; const char* output_path; char* output_string; char* source_map_string; struct sass_options options; int error_status; char* error_message; Sass_C_Function_List c_functions; char** included_files; int num_included_files; }; struct sass_folder_context { const char* search_path; const char* output_path; struct sass_options options; int error_status; char* error_message; Sass_C_Function_List c_functions; char** included_files; int num_included_files; }; struct sass_context* sass_new_context (void); struct sass_file_context* sass_new_file_context (void); struct sass_folder_context* sass_new_folder_context (void); void sass_free_context (struct sass_context* ctx); void sass_free_file_context (struct sass_file_context* ctx); void sass_free_folder_context(struct sass_folder_context* ctx); int sass_compile (struct sass_context* ctx); int sass_compile_file (struct sass_file_context* ctx); int sass_compile_folder (struct sass_folder_context* ctx); #ifdef __cplusplus } #endif #endif
#ifdef __sysvnecv70_target double EXFUN(fast_sin,(double)); double EXFUN(fast_cos,(double)); double EXFUN(fast_tan,(double)); double EXFUN(fast_asin,(double)); double EXFUN(fast_acos,(double)); double EXFUN(fast_atan,(double)); double EXFUN(fast_sinh,(double)); double EXFUN(fast_cosh,(double)); double EXFUN(fast_tanh,(double)); double EXFUN(fast_asinh,(double)); double EXFUN(fast_acosh,(double)); double EXFUN(fast_atanh,(double)); double EXFUN(fast_abs,(double)); double EXFUN(fast_sqrt,(double)); double EXFUN(fast_exp2,(double)); double EXFUN(fast_exp10,(double)); double EXFUN(fast_expe,(double)); double EXFUN(fast_log10,(double)); double EXFUN(fast_log2,(double)); double EXFUN(fast_loge,(double)); #define sin(x) fast_sin(x) #define cos(x) fast_cos(x) #define tan(x) fast_tan(x) #define asin(x) fast_asin(x) #define acos(x) fast_acos(x) #define atan(x) fast_atan(x) #define sinh(x) fast_sinh(x) #define cosh(x) fast_cosh(x) #define tanh(x) fast_tanh(x) #define asinh(x) fast_asinh(x) #define acosh(x) fast_acosh(x) #define atanh(x) fast_atanh(x) #define abs(x) fast_abs(x) #define sqrt(x) fast_sqrt(x) #define exp2(x) fast_exp2(x) #define exp10(x) fast_exp10(x) #define expe(x) fast_expe(x) #define log10(x) fast_log10(x) #define log2(x) fast_log2(x) #define loge(x) fast_loge(x) #ifdef _HAVE_STDC /* These functions are in assembler, they really do take floats. This can only be used with a real ANSI compiler */ float EXFUN(fast_sinf,(float)); float EXFUN(fast_cosf,(float)); float EXFUN(fast_tanf,(float)); float EXFUN(fast_asinf,(float)); float EXFUN(fast_acosf,(float)); float EXFUN(fast_atanf,(float)); float EXFUN(fast_sinhf,(float)); float EXFUN(fast_coshf,(float)); float EXFUN(fast_tanhf,(float)); float EXFUN(fast_asinhf,(float)); float EXFUN(fast_acoshf,(float)); float EXFUN(fast_atanhf,(float)); float EXFUN(fast_absf,(float)); float EXFUN(fast_sqrtf,(float)); float EXFUN(fast_exp2f,(float)); float EXFUN(fast_exp10f,(float)); float EXFUN(fast_expef,(float)); float EXFUN(fast_log10f,(float)); float EXFUN(fast_log2f,(float)); float EXFUN(fast_logef,(float)); #define sinf(x) fast_sinf(x) #define cosf(x) fast_cosf(x) #define tanf(x) fast_tanf(x) #define asinf(x) fast_asinf(x) #define acosf(x) fast_acosf(x) #define atanf(x) fast_atanf(x) #define sinhf(x) fast_sinhf(x) #define coshf(x) fast_coshf(x) #define tanhf(x) fast_tanhf(x) #define asinhf(x) fast_asinhf(x) #define acoshf(x) fast_acoshf(x) #define atanhf(x) fast_atanhf(x) #define absf(x) fast_absf(x) #define sqrtf(x) fast_sqrtf(x) #define exp2f(x) fast_exp2f(x) #define exp10f(x) fast_exp10f(x) #define expef(x) fast_expef(x) #define log10f(x) fast_log10f(x) #define log2f(x) fast_log2f(x) #define logef(x) fast_logef(x) #endif /* Override the functions defined in math.h */ #endif /* __sysvnecv70_target */
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- #ifndef __java_util_concurrent_ConcurrentHashMap$HashEntry__ #define __java_util_concurrent_ConcurrentHashMap$HashEntry__ #pragma interface #include <java/lang/Object.h> #include <gcj/array.h> class java::util::concurrent::ConcurrentHashMap$HashEntry : public ::java::lang::Object { public: // actually package-private ConcurrentHashMap$HashEntry(::java::lang::Object *, jint, ::java::util::concurrent::ConcurrentHashMap$HashEntry *, ::java::lang::Object *); static JArray< ::java::util::concurrent::ConcurrentHashMap$HashEntry * > * newArray(jint); ::java::lang::Object * __attribute__((aligned(__alignof__( ::java::lang::Object)))) key; jint hash; ::java::lang::Object * volatile value; ::java::util::concurrent::ConcurrentHashMap$HashEntry * next; public: static ::java::lang::Class class$; }; #endif // __java_util_concurrent_ConcurrentHashMap$HashEntry__
/* * Driver model for sensor * * Copyright (C) 2008 Samsung Electronics * * 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 __LINUX_SENSORS_CORE_H_INCLUDED #define __LINUX_SENSORS_CORE_H_INCLUDED extern struct device *sensors_classdev_register(char *sensors_name); extern void sensors_classdev_unregister(struct device *dev); extern int sensors_register(struct device *dev, void *drvdata, struct device_attribute *attributes[], char *name); extern void sensors_unregister(struct device *dev); struct accel_platform_data { int (*accel_get_position) (void); /* Change axis or not for user-level * If it is true, driver reports adjusted axis-raw-data * to user-space based on accel_get_position() value, * or if it is false, driver reports original axis-raw-data */ bool axis_adjust; }; struct gyro_platform_data { int (*gyro_get_position) (void); /* Change axis or not for user-level * If it is true, driver reports adjusted axis-raw-data * to user-space based on gyro_get_position() value, * or if it is false, driver reports original axis-raw-data */ bool axis_adjust; }; #endif /* __LINUX_SENSORS_CORE_H_INCLUDED */
/******************************************************************************* Intel 82599 Virtual Function driver Copyright(c) 1999 - 2012 Intel Corporation. This program is free software; you can redistribute it and/or modify it under the terms and conditions of the GNU General Public License, version 2, as published by the Free Software Foundation. This program is distributed in the hope it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. The full GNU General Public License is included in this distribution in the file called "COPYING". Contact Information: e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 *******************************************************************************/ #ifndef _IXGBE_MBX_H_ #define _IXGBE_MBX_H_ #include "vf.h" #define IXGBE_VFMAILBOX_SIZE 16 /* 16 32 bit words - 64 bytes */ #define IXGBE_ERR_MBX -100 #define IXGBE_VFMAILBOX 0x002FC #define IXGBE_VFMBMEM 0x00200 /* Define mailbox register bits */ #define IXGBE_VFMAILBOX_REQ 0x00000001 /* Request for PF Ready bit */ #define IXGBE_VFMAILBOX_ACK 0x00000002 /* Ack PF message received */ #define IXGBE_VFMAILBOX_VFU 0x00000004 /* VF owns the mailbox buffer */ #define IXGBE_VFMAILBOX_PFU 0x00000008 /* PF owns the mailbox buffer */ #define IXGBE_VFMAILBOX_PFSTS 0x00000010 /* PF wrote a message in the MB */ #define IXGBE_VFMAILBOX_PFACK 0x00000020 /* PF ack the previous VF msg */ #define IXGBE_VFMAILBOX_RSTI 0x00000040 /* PF has reset indication */ #define IXGBE_VFMAILBOX_RSTD 0x00000080 /* PF has indicated reset done */ #define IXGBE_VFMAILBOX_R2C_BITS 0x000000B0 /* All read to clear bits */ #define IXGBE_PFMAILBOX(x) (0x04B00 + (4 * (x))) #define IXGBE_PFMBMEM(vfn) (0x13000 + (64 * (vfn))) #define IXGBE_PFMAILBOX_STS 0x00000001 /* Initiate message send to VF */ #define IXGBE_PFMAILBOX_ACK 0x00000002 /* Ack message recv'd from VF */ #define IXGBE_PFMAILBOX_VFU 0x00000004 /* VF owns the mailbox buffer */ #define IXGBE_PFMAILBOX_PFU 0x00000008 /* PF owns the mailbox buffer */ #define IXGBE_PFMAILBOX_RVFU 0x00000010 /* Reset VFU - used when VF stuck */ #define IXGBE_MBVFICR_VFREQ_MASK 0x0000FFFF /* bits for VF messages */ #define IXGBE_MBVFICR_VFREQ_VF1 0x00000001 /* bit for VF 1 message */ #define IXGBE_MBVFICR_VFACK_MASK 0xFFFF0000 /* bits for VF acks */ #define IXGBE_MBVFICR_VFACK_VF1 0x00010000 /* bit for VF 1 ack */ /* If it's a IXGBE_VF_* msg then it originates in the VF and is sent to the * PF. The reverse is true if it is IXGBE_PF_*. * Message ACK's are the value or'd with 0xF0000000 */ #define IXGBE_VT_MSGTYPE_ACK 0x80000000 /* Messages below or'd with * this are the ACK */ #define IXGBE_VT_MSGTYPE_NACK 0x40000000 /* Messages below or'd with * this are the NACK */ #define IXGBE_VT_MSGTYPE_CTS 0x20000000 /* Indicates that VF is still * clear to send requests */ #define IXGBE_VT_MSGINFO_SHIFT 16 /* bits 23:16 are used for exra info for certain messages */ #define IXGBE_VT_MSGINFO_MASK (0xFF << IXGBE_VT_MSGINFO_SHIFT) /* definitions to support mailbox API version negotiation */ /* * each element denotes a version of the API; existing numbers may not * change; any additions must go at the end */ enum ixgbe_pfvf_api_rev { ixgbe_mbox_api_10, /* API version 1.0, linux/freebsd VF driver */ ixgbe_mbox_api_20, /* API version 2.0, solaris Phase1 VF driver */ ixgbe_mbox_api_11, /* API version 1.1, linux/freebsd VF driver */ /* This value should always be last */ ixgbe_mbox_api_unknown, /* indicates that API version is not known */ }; /* mailbox API, legacy requests */ #define IXGBE_VF_RESET 0x01 /* VF requests reset */ #define IXGBE_VF_SET_MAC_ADDR 0x02 /* VF requests PF to set MAC addr */ #define IXGBE_VF_SET_MULTICAST 0x03 /* VF requests PF to set MC addr */ #define IXGBE_VF_SET_VLAN 0x04 /* VF requests PF to set VLAN */ /* mailbox API, version 1.0 VF requests */ #define IXGBE_VF_SET_LPE 0x05 /* VF requests PF to set VMOLR.LPE */ #define IXGBE_VF_SET_MACVLAN 0x06 /* VF requests PF for unicast filter */ #define IXGBE_VF_API_NEGOTIATE 0x08 /* negotiate API version */ /* mailbox API, version 1.1 VF requests */ #define IXGBE_VF_GET_QUEUE 0x09 /* get queue configuration */ /* GET_QUEUES return data indices within the mailbox */ #define IXGBE_VF_TX_QUEUES 1 /* number of Tx queues supported */ #define IXGBE_VF_RX_QUEUES 2 /* number of Rx queues supported */ #define IXGBE_VF_TRANS_VLAN 3 /* Indication of port vlan */ #define IXGBE_VF_DEF_QUEUE 4 /* Default queue offset */ /* length of permanent address message returned from PF */ #define IXGBE_VF_PERMADDR_MSG_LEN 4 /* word in permanent address message with the current multicast type */ #define IXGBE_VF_MC_TYPE_WORD 3 #define IXGBE_PF_CONTROL_MSG 0x0100 /* PF control message */ #define IXGBE_VF_MBX_INIT_TIMEOUT 2000 /* number of retries on mailbox */ #define IXGBE_VF_MBX_INIT_DELAY 500 /* microseconds between retries */ /* forward declaration of the HW struct */ struct ixgbe_hw; #endif /* _IXGBE_MBX_H_ */
#undef TRACE_SYSTEM #define TRACE_SYSTEM vsyscall #if !defined(__VSYSCALL_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) #define __VSYSCALL_TRACE_H #include <linux/tracepoint.h> TRACE_EVENT(emulate_vsyscall, TP_PROTO(int nr), TP_ARGS(nr), TP_STRUCT__entry(__field(int, nr)), TP_fast_assign( __entry->nr = nr; ), TP_printk("nr = %d", __entry->nr) ); #endif #undef TRACE_INCLUDE_PATH #define TRACE_INCLUDE_PATH ../../arch/x86/entry/vsyscall/ #define TRACE_INCLUDE_FILE vsyscall_trace #include <trace/define_trace.h>
#ifndef __M68KNOMMU_LOCAL_H #define __M68KNOMMU_LOCAL_H #include <asm-generic/local.h> #endif /* __M68KNOMMU_LOCAL_H */
#ifndef _ASM_POWERPC_SECTIONS_H #define _ASM_POWERPC_SECTIONS_H #ifdef __KERNEL__ #include <linux/elf.h> #include <linux/uaccess.h> #include <asm-generic/sections.h> #ifdef __powerpc64__ extern char __start_interrupts[]; extern char __end_interrupts[]; extern char __prom_init_toc_start[]; extern char __prom_init_toc_end[]; static inline int in_kernel_text(unsigned long addr) { if (addr >= (unsigned long)_stext && addr < (unsigned long)__init_end) return 1; return 0; } static inline unsigned long kernel_toc_addr(void) { /* Defined by the linker, see vmlinux.lds.S */ extern unsigned long __toc_start; /* * The TOC register (r2) points 32kB into the TOC, so that 64kB of * the TOC can be addressed using a single machine instruction. */ return (unsigned long)(&__toc_start) + 0x8000UL; } static inline int overlaps_interrupt_vector_text(unsigned long start, unsigned long end) { unsigned long real_start, real_end; real_start = __start_interrupts - _stext; real_end = __end_interrupts - _stext; return start < (unsigned long)__va(real_end) && (unsigned long)__va(real_start) < end; } static inline int overlaps_kernel_text(unsigned long start, unsigned long end) { return start < (unsigned long)__init_end && (unsigned long)_stext < end; } static inline int overlaps_kvm_tmp(unsigned long start, unsigned long end) { #ifdef CONFIG_KVM_GUEST extern char kvm_tmp[]; return start < (unsigned long)kvm_tmp && (unsigned long)&kvm_tmp[1024 * 1024] < end; #else return 0; #endif } #ifdef PPC64_ELF_ABI_v1 #undef dereference_function_descriptor static inline void *dereference_function_descriptor(void *ptr) { struct ppc64_opd_entry *desc = ptr; void *p; if (!probe_kernel_address(&desc->funcaddr, p)) ptr = p; return ptr; } #endif /* PPC64_ELF_ABI_v1 */ #endif #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_SECTIONS_H */
// SPDX-License-Identifier: GPL-2.0-only /* * * Copyright (C) 2013 John Crispin <john@phrozen.org> */ #include <linux/debugfs.h> #include <linux/seq_file.h> #define BOOTROM_OFFSET 0x10118000 #define BOOTROM_SIZE 0x8000 static void __iomem *membase = (void __iomem *) KSEG1ADDR(BOOTROM_OFFSET); static int bootrom_show(struct seq_file *s, void *unused) { seq_write(s, membase, BOOTROM_SIZE); return 0; } static int bootrom_open(struct inode *inode, struct file *file) { return single_open(file, bootrom_show, NULL); } static const struct file_operations bootrom_file_ops = { .open = bootrom_open, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; static int __init bootrom_setup(void) { debugfs_create_file("bootrom", 0444, NULL, NULL, &bootrom_file_ops); return 0; } postcore_initcall(bootrom_setup);
/* * Copyright (c) 2003 VIA Networking, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * * File: tcrc.h * * Purpose: Implement functions to calculate CRC * * Author: Tevin Chen * * Date: Jan. 28, 1997 * */ #ifndef __TCRC_H__ #define __TCRC_H__ #include "ttype.h" /*--------------------- Export Definitions -------------------------*/ /*--------------------- Export Types ------------------------------*/ /*--------------------- Export Macros ------------------------------*/ /*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Variables --------------------------*/ /*--------------------- Export Functions --------------------------*/ unsigned long CRCdwCrc32(unsigned char *pbyData, unsigned int cbByte, unsigned long dwCrcSeed); unsigned long CRCdwGetCrc32(unsigned char *pbyData, unsigned int cbByte); unsigned long CRCdwGetCrc32Ex(unsigned char *pbyData, unsigned int cbByte, unsigned long dwPreCRC); #endif // __TCRC_H__
/* Copyright (c) 2010, Code Aurora Forum. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ #include <linux/io.h> #include <linux/module.h> #include <linux/spinlock.h> #include <mach/tlmm.h> #include <mach/msm_iomap.h> #include <mach/gpio.h> #include "tlmm-msm8660.h" enum msm_tlmm_register { SDC4_HDRV_PULL_CTL = 0x20a0, SDC3_HDRV_PULL_CTL = 0x20a4, }; struct tlmm_field_cfg { enum msm_tlmm_register reg; u8 off; }; static struct tlmm_field_cfg tlmm_hdrv_cfgs[] = { {SDC4_HDRV_PULL_CTL, 6}, /* TLMM_HDRV_SDC4_CLK */ {SDC4_HDRV_PULL_CTL, 3}, /* TLMM_HDRV_SDC4_CMD */ {SDC4_HDRV_PULL_CTL, 0}, /* TLMM_HDRV_SDC4_DATA */ {SDC3_HDRV_PULL_CTL, 6}, /* TLMM_HDRV_SDC3_CLK */ {SDC3_HDRV_PULL_CTL, 3}, /* TLMM_HDRV_SDC3_CMD */ {SDC3_HDRV_PULL_CTL, 0}, /* TLMM_HDRV_SDC3_DATA */ }; static struct tlmm_field_cfg tlmm_pull_cfgs[] = { {SDC4_HDRV_PULL_CTL, 11}, /* TLMM_PULL_SDC4_CMD */ {SDC4_HDRV_PULL_CTL, 9}, /* TLMM_PULL_SDC4_DATA */ {SDC3_HDRV_PULL_CTL, 11}, /* TLMM_PULL_SDC3_CMD */ {SDC3_HDRV_PULL_CTL, 9}, /* TLMM_PULL_SDC3_DATA */ }; static DEFINE_SPINLOCK(tlmm_lock); static void msm_tlmm_set_field(struct tlmm_field_cfg *configs, unsigned id, unsigned width, unsigned val) { unsigned long irqflags; u32 mask = (1 << width) - 1; u32 __iomem *reg = MSM_TLMM_BASE + configs[id].reg; u32 reg_val; spin_lock_irqsave(&tlmm_lock, irqflags); reg_val = readl(reg); reg_val &= ~(mask << configs[id].off); reg_val |= (val & mask) << configs[id].off; writel(reg_val, reg); spin_unlock_irqrestore(&tlmm_lock, irqflags); } void msm_tlmm_set_hdrive(enum msm_tlmm_hdrive_tgt tgt, int drv_str) { msm_tlmm_set_field(tlmm_hdrv_cfgs, tgt, 3, drv_str); } EXPORT_SYMBOL(msm_tlmm_set_hdrive); void msm_tlmm_set_pull(enum msm_tlmm_pull_tgt tgt, int pull) { msm_tlmm_set_field(tlmm_pull_cfgs, tgt, 2, pull); } EXPORT_SYMBOL(msm_tlmm_set_pull); int gpio_tlmm_config(unsigned config, unsigned disable) { uint32_t flags; unsigned gpio = GPIO_PIN(config); if (gpio > NR_MSM_GPIOS) return -EINVAL; flags = ((GPIO_DIR(config) << 9) & (0x1 << 9)) | ((GPIO_DRVSTR(config) << 6) & (0x7 << 6)) | ((GPIO_FUNC(config) << 2) & (0xf << 2)) | ((GPIO_PULL(config) & 0x3)); writel(flags, GPIO_CONFIG(gpio)); return 0; } EXPORT_SYMBOL(gpio_tlmm_config); int msm_gpio_install_direct_irq(unsigned gpio, unsigned irq) { unsigned long irq_flags; if (gpio >= NR_MSM_GPIOS || irq >= NR_TLMM_SCSS_DIR_CONN_IRQ) return -EINVAL; spin_lock_irqsave(&tlmm_lock, irq_flags); writel(readl(GPIO_CONFIG(gpio)) | BIT(GPIO_OE_BIT), GPIO_CONFIG(gpio)); writel(readl(GPIO_INTR_CFG(gpio)) & ~(INTR_RAW_STATUS_EN | INTR_ENABLE), GPIO_INTR_CFG(gpio)); writel(DC_IRQ_ENABLE | TARGET_PROC_NONE, GPIO_INTR_CFG_SU(gpio)); writel(DC_POLARITY_HI | TARGET_PROC_SCORPION | (gpio << 3), DIR_CONN_INTR_CFG_SU(irq)); spin_unlock_irqrestore(&tlmm_lock, irq_flags); return 0; } EXPORT_SYMBOL(msm_gpio_install_direct_irq);
/* * OMAP Voltage Management Routines * * Author: Thara Gopinath <thara@ti.com> * * Copyright (C) 2009 Texas Instruments, Inc. * Thara Gopinath <thara@ti.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 __ARCH_ARM_MACH_OMAP2_VOLTAGE_H #define __ARCH_ARM_MACH_OMAP2_VOLTAGE_H #include <linux/err.h> #include <linux/platform_data/voltage-omap.h> #include "vc.h" #include "vp.h" struct powerdomain; /* * OMAP3 GENERIC setup times. Revisit to see if these needs to be * passed from board or PMIC file */ #define OMAP3_CLKSETUP 0xff #define OMAP3_VOLTOFFSET 0xff #define OMAP3_VOLTSETUP2 0xff /** * struct omap_vfsm_instance - per-voltage manager FSM register/bitfield * data * @voltsetup_mask: SETUP_TIME* bitmask in the PRM_VOLTSETUP* register * @voltsetup_reg: register offset of PRM_VOLTSETUP from PRM base * @voltsetup_off_reg: register offset of PRM_VOLTSETUP_OFF from PRM base * * XXX What about VOLTOFFSET/VOLTCTRL? */ struct omap_vfsm_instance { u32 voltsetup_mask; u8 voltsetup_reg; u8 voltsetup_off_reg; }; /** * struct voltagedomain - omap voltage domain global structure. * @name: Name of the voltage domain which can be used as a unique identifier. * @scalable: Whether or not this voltage domain is scalable * @node: list_head linking all voltage domains * @vc: pointer to VC channel associated with this voltagedomain * @vp: pointer to VP associated with this voltagedomain * @read: read a VC/VP register * @write: write a VC/VP register * @read: read-modify-write a VC/VP register * @sys_clk: system clock name/frequency, used for various timing calculations * @scale: function used to scale the voltage of the voltagedomain * @nominal_volt: current nominal voltage for this voltage domain * @volt_data: voltage table having the distinct voltages supported * by the domain and other associated per voltage data. */ struct voltagedomain { char *name; bool scalable; struct list_head node; struct omap_vc_channel *vc; const struct omap_vfsm_instance *vfsm; struct omap_vp_instance *vp; struct omap_voltdm_pmic *pmic; struct omap_vp_param *vp_param; struct omap_vc_param *vc_param; /* VC/VP register access functions: SoC specific */ u32 (*read) (u8 offset); void (*write) (u32 val, u8 offset); u32 (*rmw)(u32 mask, u32 bits, u8 offset); union { const char *name; u32 rate; } sys_clk; int (*scale) (struct voltagedomain *voltdm, unsigned long target_volt); u32 nominal_volt; struct omap_volt_data *volt_data; }; /* Min and max voltages from OMAP perspective */ #define OMAP3430_VP1_VLIMITTO_VDDMIN 850000 #define OMAP3430_VP1_VLIMITTO_VDDMAX 1425000 #define OMAP3430_VP2_VLIMITTO_VDDMIN 900000 #define OMAP3430_VP2_VLIMITTO_VDDMAX 1150000 #define OMAP3630_VP1_VLIMITTO_VDDMIN 900000 #define OMAP3630_VP1_VLIMITTO_VDDMAX 1350000 #define OMAP3630_VP2_VLIMITTO_VDDMIN 900000 #define OMAP3630_VP2_VLIMITTO_VDDMAX 1200000 #define OMAP4_VP_MPU_VLIMITTO_VDDMIN 830000 #define OMAP4_VP_MPU_VLIMITTO_VDDMAX 1410000 #define OMAP4_VP_IVA_VLIMITTO_VDDMIN 830000 #define OMAP4_VP_IVA_VLIMITTO_VDDMAX 1260000 #define OMAP4_VP_CORE_VLIMITTO_VDDMIN 830000 #define OMAP4_VP_CORE_VLIMITTO_VDDMAX 1200000 /** * struct omap_voltdm_pmic - PMIC specific data required by voltage driver. * @slew_rate: PMIC slew rate (in uv/us) * @step_size: PMIC voltage step size (in uv) * @i2c_slave_addr: I2C slave address of PMIC * @volt_reg_addr: voltage configuration register address * @cmd_reg_addr: command (on, on-LP, ret, off) configuration register address * @i2c_high_speed: whether VC uses I2C high-speed mode to PMIC * @i2c_mcode: master code value for I2C high-speed preamble transmission * @vsel_to_uv: PMIC API to convert vsel value to actual voltage in uV. * @uv_to_vsel: PMIC API to convert voltage in uV to vsel value. */ struct omap_voltdm_pmic { int slew_rate; int step_size; u16 i2c_slave_addr; u16 volt_reg_addr; u16 cmd_reg_addr; u8 vp_erroroffset; u8 vp_vstepmin; u8 vp_vstepmax; u32 vddmin; u32 vddmax; u8 vp_timeout_us; bool i2c_high_speed; u32 i2c_pad_load; u8 i2c_mcode; unsigned long (*vsel_to_uv) (const u8 vsel); u8 (*uv_to_vsel) (unsigned long uV); }; struct omap_vp_param { u32 vddmax; u32 vddmin; }; struct omap_vc_param { u32 on; u32 onlp; u32 ret; u32 off; }; void omap_voltage_get_volttable(struct voltagedomain *voltdm, struct omap_volt_data **volt_data); struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm, unsigned long volt); int omap_voltage_register_pmic(struct voltagedomain *voltdm, struct omap_voltdm_pmic *pmic); int omap_voltage_late_init(void); extern void omap2xxx_voltagedomains_init(void); extern void omap3xxx_voltagedomains_init(void); extern void omap44xx_voltagedomains_init(void); extern void omap54xx_voltagedomains_init(void); struct voltagedomain *voltdm_lookup(const char *name); void voltdm_init(struct voltagedomain **voltdm_list); int voltdm_add_pwrdm(struct voltagedomain *voltdm, struct powerdomain *pwrdm); int voltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt); void voltdm_reset(struct voltagedomain *voltdm); unsigned long voltdm_get_voltage(struct voltagedomain *voltdm); #endif
#ifdef DEFINE_DWARF_REGSTR_TABLE /* This is included in perf/util/dwarf-regs.c */ /* * Reference: * http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html * http://refspecs.linux-foundation.org/elf/elfspec_ppc.pdf */ #define REG_DWARFNUM_NAME(reg, idx) [idx] = "%" #reg static const char * const powerpc_regstr_tbl[] = { "%gpr0", "%gpr1", "%gpr2", "%gpr3", "%gpr4", "%gpr5", "%gpr6", "%gpr7", "%gpr8", "%gpr9", "%gpr10", "%gpr11", "%gpr12", "%gpr13", "%gpr14", "%gpr15", "%gpr16", "%gpr17", "%gpr18", "%gpr19", "%gpr20", "%gpr21", "%gpr22", "%gpr23", "%gpr24", "%gpr25", "%gpr26", "%gpr27", "%gpr28", "%gpr29", "%gpr30", "%gpr31", REG_DWARFNUM_NAME(msr, 66), REG_DWARFNUM_NAME(ctr, 109), REG_DWARFNUM_NAME(link, 108), REG_DWARFNUM_NAME(xer, 101), REG_DWARFNUM_NAME(dar, 119), REG_DWARFNUM_NAME(dsisr, 118), }; #endif
/* * OpenRISC unwinder.c * * Reusable arch specific api for unwinding stacks. * * Copyright (C) 2017 Stafford Horne <shorne@gmail.com> * * This file is licensed under the terms of the GNU General Public License * version 2. This program is licensed "as is" without any warranty of any * kind, whether express or implied. */ #include <linux/sched/task_stack.h> #include <linux/kernel.h> #include <asm/unwinder.h> #ifdef CONFIG_FRAME_POINTER struct or1k_frameinfo { unsigned long *fp; unsigned long ra; unsigned long top; }; /* * Verify a frameinfo structure. The return address should be a valid text * address. The frame pointer may be null if its the last frame, otherwise * the frame pointer should point to a location in the stack after the the * top of the next frame up. */ static inline int or1k_frameinfo_valid(struct or1k_frameinfo *frameinfo) { return (frameinfo->fp == NULL || (!kstack_end(frameinfo->fp) && frameinfo->fp > &frameinfo->top)) && __kernel_text_address(frameinfo->ra); } /* * Create a stack trace doing scanning which is frame pointer aware. We can * get reliable stack traces by matching the previously found frame * pointer with the top of the stack address every time we find a valid * or1k_frameinfo. * * Ideally the stack parameter will be passed as FP, but it can not be * guaranteed. Therefore we scan each address looking for the first sign * of a return address. * * The OpenRISC stack frame looks something like the following. The * location SP is held in r1 and location FP is held in r2 when frame pointers * enabled. * * SP -> (top of stack) * - (callee saved registers) * - (local variables) * FP-8 -> previous FP \ * FP-4 -> return address |- or1k_frameinfo * FP -> (previous top of stack) / */ void unwind_stack(void *data, unsigned long *stack, void (*trace)(void *data, unsigned long addr, int reliable)) { unsigned long *next_fp = NULL; struct or1k_frameinfo *frameinfo = NULL; int reliable = 0; while (!kstack_end(stack)) { frameinfo = container_of(stack, struct or1k_frameinfo, top); if (__kernel_text_address(frameinfo->ra)) { if (or1k_frameinfo_valid(frameinfo) && (next_fp == NULL || next_fp == &frameinfo->top)) { reliable = 1; next_fp = frameinfo->fp; } else reliable = 0; trace(data, frameinfo->ra, reliable); } stack++; } } #else /* CONFIG_FRAME_POINTER */ /* * Create a stack trace by doing a simple scan treating all text addresses * as return addresses. */ void unwind_stack(void *data, unsigned long *stack, void (*trace)(void *data, unsigned long addr, int reliable)) { unsigned long addr; while (!kstack_end(stack)) { addr = *stack++; if (__kernel_text_address(addr)) trace(data, addr, 0); } } #endif /* CONFIG_FRAME_POINTER */
/* * Support for Medifield PNW Camera Imaging ISP subsystem. * * Copyright (c) 2010 Intel Corporation. All Rights Reserved. * * Copyright (c) 2010 Silicon Hive www.siliconhive.com. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version * 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. * */ #ifndef __ATOMISP_TPG_H__ #define __ATOMISP_TPG_H__ #include <media/media-entity.h> #include <media/v4l2-subdev.h> struct atomisp_tpg_device { struct v4l2_subdev sd; struct atomisp_device *isp; struct media_pad pads[1]; }; void atomisp_tpg_cleanup(struct atomisp_device *isp); int atomisp_tpg_init(struct atomisp_device *isp); void atomisp_tpg_unregister_entities(struct atomisp_tpg_device *tpg); int atomisp_tpg_register_entities(struct atomisp_tpg_device *tpg, struct v4l2_device *vdev); #endif /* __ATOMISP_TPG_H__ */
/* * Copyright (C) 2012 Motorola Mobility LLC. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307, USA */ #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/input.h> #include <linux/interrupt.h> #include <linux/platform_device.h> #include <linux/switch.h> #include <linux/workqueue.h> #include <linux/gpio.h> #include <linux/slab.h> #define H2W_HS_NO_DEVICE 0 #define H2W_HS_HEADSET 1 #define H2W_HS_HEADPHONE 2 #define H2W_HS_LINEOUT 0x20 struct alsa_to_h2w_data { struct switch_dev sdev; struct work_struct work; int state; }; static char *name_headsets_with_mic = "Headset with a mic"; static char *name_headsets_no_mic = "Headphone"; static char *name_headsets_pull_out = "No Device"; static char *name_headsets_line_out = "Line out"; #define NAME_SIZE 20 static struct alsa_to_h2w_data *headset_switch_data; static void alsa_to_h2w_headset_report(int state) { if (headset_switch_data) { headset_switch_data->state = state; schedule_work(&headset_switch_data->work); } } static void alsa_to_h2w_work(struct work_struct *work) { struct alsa_to_h2w_data *data = container_of(work, struct alsa_to_h2w_data, work); switch_set_state(&data->sdev, data->state); } static int switch_to_h2w(unsigned long switch_state) { if (switch_state & (1 << SW_HEADPHONE_INSERT)) { if (switch_state & (1 << SW_MICROPHONE_INSERT)) return H2W_HS_HEADSET; else return H2W_HS_HEADPHONE; } else if (switch_state & (1 << SW_LINEOUT_INSERT)) return H2W_HS_LINEOUT; return H2W_HS_NO_DEVICE; } static int alsa_to_h2w_connect(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id) { int ret; struct input_handle *handle; handle = kzalloc(sizeof(*handle), GFP_KERNEL); if (!handle) return -ENOMEM; handle->dev = dev; handle->handler = handler; handle->name = "alsa_to_h2w"; ret = input_register_handle(handle); if (ret) goto err_input_register_handle; ret = input_open_device(handle); if (ret) goto err_input_open_device; alsa_to_h2w_headset_report(switch_to_h2w(dev->sw[0])); return 0; err_input_open_device: input_unregister_handle(handle); err_input_register_handle: kfree(handle); return ret; } static void alsa_to_h2w_disconnect(struct input_handle *handle) { input_close_device(handle); input_unregister_handle(handle); kfree(handle); } static bool alsa_to_h2w_filter(struct input_handle *handle, unsigned int type, unsigned int code, int value) { if ((code == SW_HEADPHONE_INSERT) || (code == SW_MICROPHONE_INSERT) || (code == SW_LINEOUT_INSERT)) alsa_to_h2w_headset_report(switch_to_h2w(handle->dev->sw[0])); return false; } static const struct input_device_id alsa_to_h2w_ids[] = { { .flags = INPUT_DEVICE_ID_MATCH_EVBIT, .evbit = { BIT_MASK(EV_SW) }, }, { }, }; MODULE_DEVICE_TABLE(input, alsa_to_h2w_ids); static struct input_handler alsa_to_h2w_handler = { .filter = alsa_to_h2w_filter, .connect = alsa_to_h2w_connect, .disconnect = alsa_to_h2w_disconnect, .name = "alsa_to_h2w", .id_table = alsa_to_h2w_ids, }; static ssize_t headset_print_name(struct switch_dev *sdev, char *buf) { const char *name; if (!buf) return -EINVAL; switch (switch_get_state(sdev)) { case 0: name = name_headsets_pull_out; break; case 1: name = name_headsets_with_mic; break; case 2: name = name_headsets_no_mic; break; case 0x20: name = name_headsets_line_out; break; default: name = NULL; break; } if (name) return snprintf(buf, NAME_SIZE, "%s\n", name); else return -EINVAL; } static ssize_t headset_print_state(struct switch_dev *sdev, char *buf) { if (!buf) return -EINVAL; return snprintf(buf, 3, "%d\n", switch_get_state(sdev)); } static int alsa_to_h2w_probe(struct platform_device *pdev) { struct alsa_to_h2w_data *switch_data; int ret = 0; switch_data = kzalloc(sizeof(struct alsa_to_h2w_data), GFP_KERNEL); if (!switch_data) return -ENOMEM; headset_switch_data = switch_data; switch_data->sdev.name = "h2w"; switch_data->sdev.print_name = headset_print_name; switch_data->sdev.print_state = headset_print_state; ret = switch_dev_register(&switch_data->sdev); if (ret < 0) goto err_switch_dev_register; platform_set_drvdata(pdev, switch_data); INIT_WORK(&switch_data->work, alsa_to_h2w_work); if (input_register_handler(&alsa_to_h2w_handler)) pr_info("input_register_handler failed\n"); return 0; err_switch_dev_register: kfree(switch_data); return ret; } static int alsa_to_h2w_remove(struct platform_device *pdev) { struct alsa_to_h2w_data *switch_data = platform_get_drvdata(pdev); switch_dev_unregister(&switch_data->sdev); kfree(switch_data); headset_switch_data = NULL; return 0; } #ifdef CONFIG_OF static struct of_device_id alsa_to_h2w_match_table[] = { { .compatible = "mmi,alsa-to-h2w", }, {} }; #endif static struct platform_driver alsa_to_h2w_driver = { .probe = alsa_to_h2w_probe, .remove = alsa_to_h2w_remove, .driver = { .name = "alsa-to-h2w", .of_match_table = of_match_ptr(alsa_to_h2w_match_table), .owner = THIS_MODULE, }, }; static int __init alsa_to_h2w_init(void) { return platform_driver_register(&alsa_to_h2w_driver); } static void __exit alsa_to_h2w_exit(void) { platform_driver_unregister(&alsa_to_h2w_driver); } module_init(alsa_to_h2w_init); module_exit(alsa_to_h2w_exit); MODULE_DESCRIPTION("Headset ALSA to H2w driver"); MODULE_LICENSE("GPL");
// Copyright (c) 2013 Mutual Mobile (http://mutualmobile.com/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. #import <UIKit/UIKit.h> #import "MMDrawerController.h" /** A helper category on `UIViewController` that exposes the parent drawer controller, the visible side drawer frame, and a `mm_drawerWillAppear` method that is called when the drawer is about to appear. */ @interface UIViewController (MMDrawerController) ///--------------------------------------- /// @name Accessing Drawer View Controller Properties ///--------------------------------------- /** The `MMDrawerController` that the view controller is contained within. If the view controller is not contained within a `MMDrawerController`, this property is nil. Note that if the view controller is contained within a `UINavigationController`, that navigation controller is contained within a `MMDrawerController`, this property will return a refernce to the `MMDrawerController`, despite the fact that it is not the direct parent of the view controller. */ @property(nonatomic, strong, readonly) MMDrawerController *mm_drawerController; /** The visible rect of the side drawer view controller in the drawer controller coordinate space. If the view controller is not a drawer in a `MMDrawerController`, then this property returns `CGRectNull` */ @property(nonatomic, assign, readonly) CGRect mm_visibleDrawerFrame; @end
/* * Copyright 2017 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 <bskeggs@redhat.com> */ #include "ram.h" u32 gf108_ram_probe_fbp_amount(const struct nvkm_ram_func *func, u32 fbpao, struct nvkm_device *device, int fbp, int *pltcs) { u32 fbpt = nvkm_rd32(device, 0x022438); u32 fbpat = nvkm_rd32(device, 0x02243c); u32 fbpas = fbpat / fbpt; u32 fbpa = fbp * fbpas; u32 size = 0; while (fbpas--) { if (!(fbpao & BIT(fbpa))) size += func->probe_fbpa_amount(device, fbpa); fbpa++; } *pltcs = 1; return size; } static const struct nvkm_ram_func gf108_ram = { .upper = 0x0200000000ULL, .probe_fbp = gf100_ram_probe_fbp, .probe_fbp_amount = gf108_ram_probe_fbp_amount, .probe_fbpa_amount = gf100_ram_probe_fbpa_amount, .init = gf100_ram_init, .calc = gf100_ram_calc, .prog = gf100_ram_prog, .tidy = gf100_ram_tidy, }; int gf108_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) { return gf100_ram_new_(&gf108_ram, fb, pram); }
/*************************************************************************** Copyright Echo Digital Audio Corporation (c) 1998 - 2004 All rights reserved www.echoaudio.com This file is part of Echo Digital Audio's generic driver library. Echo Digital Audio's generic driver library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. 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. ************************************************************************* Translation from C++ and adaptation for use in ALSA-Driver were made by Giuliano Pochini <pochini@shiny.it> ****************************************************************************/ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) { int err; DE_INIT(("init_hw() - Darla20\n")); if (snd_BUG_ON((subdevice_id & 0xfff0) != DARLA20)) return -ENODEV; if ((err = init_dsp_comm_page(chip))) { DE_INIT(("init_hw - could not initialize DSP comm page\n")); return err; } chip->device_id = device_id; chip->subdevice_id = subdevice_id; chip->bad_board = TRUE; chip->dsp_code_to_load = FW_DARLA20_DSP; chip->spdif_status = GD_SPDIF_STATUS_UNDEF; chip->clock_state = GD_CLOCK_UNDEF; /* Since this card has no ASIC, mark it as loaded so everything works OK */ chip->asic_loaded = TRUE; chip->input_clock_types = ECHO_CLOCK_BIT_INTERNAL; if ((err = load_firmware(chip)) < 0) return err; chip->bad_board = FALSE; DE_INIT(("init_hw done\n")); return err; } static int set_mixer_defaults(struct echoaudio *chip) { return init_line_levels(chip); } /* The Darla20 has no external clock sources */ static u32 detect_input_clocks(const struct echoaudio *chip) { return ECHO_CLOCK_BIT_INTERNAL; } /* The Darla20 has no ASIC. Just do nothing */ static int load_asic(struct echoaudio *chip) { return 0; } static int set_sample_rate(struct echoaudio *chip, u32 rate) { u8 clock_state, spdif_status; if (wait_handshake(chip)) return -EIO; switch (rate) { case 44100: clock_state = GD_CLOCK_44; spdif_status = GD_SPDIF_STATUS_44; break; case 48000: clock_state = GD_CLOCK_48; spdif_status = GD_SPDIF_STATUS_48; break; default: clock_state = GD_CLOCK_NOCHANGE; spdif_status = GD_SPDIF_STATUS_NOCHANGE; break; } if (chip->clock_state == clock_state) clock_state = GD_CLOCK_NOCHANGE; if (spdif_status == chip->spdif_status) spdif_status = GD_SPDIF_STATUS_NOCHANGE; chip->comm_page->sample_rate = cpu_to_le32(rate); chip->comm_page->gd_clock_state = clock_state; chip->comm_page->gd_spdif_status = spdif_status; chip->comm_page->gd_resampler_state = 3; /* magic number - should always be 3 */ /* Save the new audio state if it changed */ if (clock_state != GD_CLOCK_NOCHANGE) chip->clock_state = clock_state; if (spdif_status != GD_SPDIF_STATUS_NOCHANGE) chip->spdif_status = spdif_status; chip->sample_rate = rate; clear_handshake(chip); return send_vector(chip, DSP_VC_SET_GD_AUDIO_STATE); }
/* SPDX-License-Identifier: GPL-2.0 */ /* drivers/atm/eni.h - Efficient Networks ENI155P device driver declarations */ /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ #ifndef DRIVER_ATM_ENI_H #define DRIVER_ATM_ENI_H #include <linux/atm.h> #include <linux/atmdev.h> #include <linux/interrupt.h> #include <linux/sonet.h> #include <linux/skbuff.h> #include <linux/time.h> #include <linux/pci.h> #include <linux/spinlock.h> #include <linux/atomic.h> #include "midway.h" #define DEV_LABEL "eni" #define UBR_BUFFER (128*1024) /* UBR buffer size */ #define RX_DMA_BUF 8 /* burst and skip a few things */ #define TX_DMA_BUF 100 /* should be enough for 64 kB */ #define DEFAULT_RX_MULT 300 /* max_sdu*3 */ #define DEFAULT_TX_MULT 300 /* max_sdu*3 */ #define ENI_ZEROES_SIZE 4 /* need that many DMA-able zero bytes */ struct eni_free { void __iomem *start; /* counting in bytes */ int order; }; struct eni_tx { void __iomem *send; /* base, 0 if unused */ int prescaler; /* shaping prescaler */ int resolution; /* shaping divider */ unsigned long tx_pos; /* current TX write position */ unsigned long words; /* size of TX queue */ int index; /* TX channel number */ int reserved; /* reserved peak cell rate */ int shaping; /* shaped peak cell rate */ struct sk_buff_head backlog; /* queue of waiting TX buffers */ }; struct eni_vcc { int (*rx)(struct atm_vcc *vcc); /* RX function, NULL if none */ void __iomem *recv; /* receive buffer */ unsigned long words; /* its size in words */ unsigned long descr; /* next descriptor (RX) */ unsigned long rx_pos; /* current RX descriptor pos */ struct eni_tx *tx; /* TXer, NULL if none */ int rxing; /* number of pending PDUs */ int servicing; /* number of waiting VCs (0 or 1) */ int txing; /* number of pending TX bytes */ ktime_t timestamp; /* for RX timing */ struct atm_vcc *next; /* next pending RX */ struct sk_buff *last; /* last PDU being DMAed (used to carry discard information) */ }; struct eni_dev { /*-------------------------------- spinlock */ spinlock_t lock; /* sync with interrupt */ struct tasklet_struct task; /* tasklet for interrupt work */ u32 events; /* pending events */ /*-------------------------------- base pointers into Midway address space */ void __iomem *ioaddr; void __iomem *phy; /* PHY interface chip registers */ void __iomem *reg; /* register base */ void __iomem *ram; /* RAM base */ void __iomem *vci; /* VCI table */ void __iomem *rx_dma; /* RX DMA queue */ void __iomem *tx_dma; /* TX DMA queue */ void __iomem *service; /* service list */ /*-------------------------------- TX part */ struct eni_tx tx[NR_CHAN]; /* TX channels */ struct eni_tx *ubr; /* UBR channel */ struct sk_buff_head tx_queue; /* PDUs currently being TX DMAed*/ wait_queue_head_t tx_wait; /* for close */ int tx_bw; /* remaining bandwidth */ u32 dma[TX_DMA_BUF*2]; /* DMA request scratch area */ struct eni_zero { /* aligned "magic" zeroes */ u32 *addr; dma_addr_t dma; } zero; int tx_mult; /* buffer size multiplier (percent) */ /*-------------------------------- RX part */ u32 serv_read; /* host service read index */ struct atm_vcc *fast,*last_fast;/* queues of VCCs with pending PDUs */ struct atm_vcc *slow,*last_slow; struct atm_vcc **rx_map; /* for fast lookups */ struct sk_buff_head rx_queue; /* PDUs currently being RX-DMAed */ wait_queue_head_t rx_wait; /* for close */ int rx_mult; /* buffer size multiplier (percent) */ /*-------------------------------- statistics */ unsigned long lost; /* number of lost cells (RX) */ /*-------------------------------- memory management */ unsigned long base_diff; /* virtual-real base address */ int free_len; /* free list length */ struct eni_free *free_list; /* free list */ int free_list_size; /* maximum size of free list */ /*-------------------------------- ENI links */ struct atm_dev *more; /* other ENI devices */ /*-------------------------------- general information */ int mem; /* RAM on board (in bytes) */ int asic; /* PCI interface type, 0 for FPGA */ unsigned int irq; /* IRQ */ struct pci_dev *pci_dev; /* PCI stuff */ }; #define ENI_DEV(d) ((struct eni_dev *) (d)->dev_data) #define ENI_VCC(d) ((struct eni_vcc *) (d)->dev_data) struct eni_skb_prv { struct atm_skb_data _; /* reserved */ unsigned long pos; /* position of next descriptor */ int size; /* PDU size in reassembly buffer */ dma_addr_t paddr; /* DMA handle */ }; #define ENI_PRV_SIZE(skb) (((struct eni_skb_prv *) (skb)->cb)->size) #define ENI_PRV_POS(skb) (((struct eni_skb_prv *) (skb)->cb)->pos) #define ENI_PRV_PADDR(skb) (((struct eni_skb_prv *) (skb)->cb)->paddr) #endif
/* SPDX-License-Identifier: GPL-2.0 */ /* * the read/write interfaces for Virtual Support Module(VSM) * * Copyright (C) 2009 Lemote, Inc. * Author: Wu Zhangjin <wuzhangjin@gmail.com> */ #ifndef _CS5536_VSM_H #define _CS5536_VSM_H #include <linux/types.h> typedef void (*cs5536_pci_vsm_write)(int reg, u32 value); typedef u32 (*cs5536_pci_vsm_read)(int reg); #define DECLARE_CS5536_MODULE(name) \ extern void pci_##name##_write_reg(int reg, u32 value); \ extern u32 pci_##name##_read_reg(int reg); /* ide module */ DECLARE_CS5536_MODULE(ide) /* acc module */ DECLARE_CS5536_MODULE(acc) /* ohci module */ DECLARE_CS5536_MODULE(ohci) /* isa module */ DECLARE_CS5536_MODULE(isa) /* ehci module */ DECLARE_CS5536_MODULE(ehci) #endif /* _CS5536_VSM_H */
// SPDX-License-Identifier: GPL-2.0 /* * linux/arch/h8300/kernel/irq.c * * Copyright 2014-2015 Yoshinori Sato <ysato@users.sourceforge.jp> */ #include <linux/init.h> #include <linux/interrupt.h> #include <linux/irq.h> #include <linux/irqdomain.h> #include <linux/of_irq.h> #include <asm/traps.h> #ifdef CONFIG_RAMKERNEL typedef void (*h8300_vector)(void); static const h8300_vector __initconst trap_table[] = { 0, 0, 0, 0, _trace_break, 0, 0, _nmi, _system_call, 0, 0, _trace_break, }; static unsigned long __init *get_vector_address(void) { unsigned long *rom_vector = CPU_VECTOR; unsigned long base, tmp; int vec_no; base = rom_vector[EXT_IRQ0] & ADDR_MASK; /* check romvector format */ for (vec_no = EXT_IRQ0 + 1; vec_no <= EXT_IRQ0+EXT_IRQS; vec_no++) { if ((base+(vec_no - EXT_IRQ0)*4) != (rom_vector[vec_no] & ADDR_MASK)) return NULL; } /* ramvector base address */ base -= EXT_IRQ0*4; /* writerble? */ tmp = ~(*(volatile unsigned long *)base); (*(volatile unsigned long *)base) = tmp; if ((*(volatile unsigned long *)base) != tmp) return NULL; return (unsigned long *)base; } static void __init setup_vector(void) { int i; unsigned long *ramvec, *ramvec_p; const h8300_vector *trap_entry; ramvec = get_vector_address(); if (ramvec == NULL) panic("interrupt vector serup failed."); else pr_debug("virtual vector at 0x%p\n", ramvec); /* create redirect table */ ramvec_p = ramvec; trap_entry = trap_table; for (i = 0; i < NR_IRQS; i++) { if (i < 12) { if (*trap_entry) *ramvec_p = VECTOR(*trap_entry); ramvec_p++; trap_entry++; } else *ramvec_p++ = REDIRECT(_interrupt_entry); } _interrupt_redirect_table = ramvec; } #else void setup_vector(void) { /* noting do */ } #endif void __init init_IRQ(void) { setup_vector(); irqchip_init(); } asmlinkage void do_IRQ(int irq) { irq_enter(); generic_handle_irq(irq); irq_exit(); }
#ifndef crypto_core_salsa2012_H #define crypto_core_salsa2012_H #include <stddef.h> #include "export.h" #ifdef __cplusplus extern "C" { #endif #define crypto_core_salsa2012_OUTPUTBYTES 64U SODIUM_EXPORT size_t crypto_core_salsa2012_outputbytes(void); #define crypto_core_salsa2012_INPUTBYTES 16U SODIUM_EXPORT size_t crypto_core_salsa2012_inputbytes(void); #define crypto_core_salsa2012_KEYBYTES 32U SODIUM_EXPORT size_t crypto_core_salsa2012_keybytes(void); #define crypto_core_salsa2012_CONSTBYTES 16U SODIUM_EXPORT size_t crypto_core_salsa2012_constbytes(void); SODIUM_EXPORT int crypto_core_salsa2012(unsigned char *out, const unsigned char *in, const unsigned char *k, const unsigned char *c); #ifdef __cplusplus } #endif #endif
/* * Meta DA JTAG debugger control. * * Copyright 2012 Imagination Technologies Ltd. */ #ifndef _METAG_DA_H_ #define _METAG_DA_H_ #ifdef CONFIG_METAG_DA #include <linux/init.h> #include <linux/types.h> extern bool _metag_da_present; /** * metag_da_enabled() - Find whether a DA is currently enabled. * * Returns: true if a DA was detected, false if not. */ static inline bool metag_da_enabled(void) { return _metag_da_present; } /** * metag_da_probe() - Try and detect a connected DA. * * This is used at start up to detect whether a DA is active. * * Returns: 0 on detection, -err otherwise. */ int __init metag_da_probe(void); #else /* !CONFIG_METAG_DA */ #define metag_da_enabled() false #define metag_da_probe() do {} while (0) #endif #endif /* _METAG_DA_H_ */
// TuxSH: removed definitions under _KERNEL ifdef blocks, modify the prototype of some functions, some other cleanup, etc. #ifndef __BSD_VISIBLE #define __BSD_VISIBLE 1 #endif /*- * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 1997 Peter Wemm <peter@freebsd.org> * 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. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef _SYS_POLL_H_ #define _SYS_POLL_H_ #include <sys/cdefs.h> /* * This file is intended to be compatible with the traditional poll.h. */ typedef unsigned int nfds_t; /* * This structure is passed as an array to poll(2). */ struct pollfd { int fd; /* which file descriptor to poll */ short events; /* events we are interested in */ short revents; /* events found on return */ }; /* * Requestable events. If poll(2) finds any of these set, they are * copied to revents on return. * XXX Note that FreeBSD doesn't make much distinction between POLLPRI * and POLLRDBAND since none of the file types have distinct priority * bands - and only some have an urgent "mode". * XXX Note POLLIN isn't really supported in true SVSV terms. Under SYSV * POLLIN includes all of normal, band and urgent data. Most poll handlers * on FreeBSD only treat it as "normal" data. */ #define POLLIN 0x0001 /* any readable data available */ #define POLLPRI 0x0002 /* OOB/Urgent readable data */ #define POLLOUT 0x0004 /* file descriptor is writeable */ #define POLLRDNORM 0x0040 /* non-OOB/URG data available */ #define POLLWRNORM POLLOUT /* no write type differentiation */ #define POLLRDBAND 0x0080 /* OOB/Urgent readable data */ #define POLLWRBAND 0x0100 /* OOB/Urgent data can be written */ #if __BSD_VISIBLE /* General FreeBSD extension (currently only supported for sockets): */ #define POLLINIGNEOF 0x2000 /* like POLLIN, except ignore EOF */ #endif /* * These events are set if they occur regardless of whether they were * requested. */ #define POLLERR 0x0008 /* some poll error occurred */ #define POLLHUP 0x0010 /* file descriptor was "hung up" */ #define POLLNVAL 0x0020 /* requested events "invalid" */ #if __BSD_VISIBLE #define POLLSTANDARD (POLLIN|POLLPRI|POLLOUT|POLLRDNORM|POLLRDBAND|\ POLLWRBAND|POLLERR|POLLHUP|POLLNVAL) /* * Request that poll() wait forever. * XXX in SYSV, this is defined in stropts.h, which is not included * by poll.h. */ #define INFTIM (-1) #endif #if __BSD_VISIBLE #include <sys/_types.h> #include <sys/_sigset.h> #include <sys/timespec.h> #ifndef _SIGSET_T_DECLARED #define _SIGSET_T_DECLARED typedef __sigset_t sigset_t; #endif #endif __BEGIN_DECLS int poll(struct pollfd *pfd, nfds_t nfds, int timeout); // changed poll argument names ; removed ppoll because it is not exposed __END_DECLS #endif /* !_SYS_POLL_H_ */
/* * Copyright (c) 2016 Johan Sköld * License: https://opensource.org/licenses/ISC */ /* * This sample implements a simple fibonacci context whose only purpose is to * repeatedly yield the next value in the fibonacci sequence. By repeatedly * switching to the fibonacci context, its parent context (the context that * created it, in this case the implicitly created main context) will receive * the next number in the sequence. * * cc -I../include -L../build/lib fibonacci.c -lsc -o fibonacci */ #include <sc.h> #include <stdio.h> /* printf */ static void fibonacci (void* param) { unsigned long a = 0; unsigned long b = 1; unsigned long fib; /* Yield the first two fibonacci numbers (0, 1) */ sc_yield(&a); sc_yield(&b); /* Infinite loop that yields the rest */ while (1) { fib = a + b; a = b; b = fib; /* By yielding to the parent context, we're switching control back to it, and the pointer we pass here will be returned from its call to `sc_switch`. */ sc_yield(&fib); } } int main(int argc, char** argv) { int i; void* fib; /* Create the fibonacci context. Since the current context will not be leaving this function before the end of the fibonacci context's lifetime, it is safe to put the new context's stack on this stack. As long as it is small enough to not cause a stack overflow. */ char stack[SC_MIN_STACK_SIZE]; sc_context_t context = sc_context_create(stack, sizeof(stack), &fibonacci); /* Print the first 10 numbers yielded by the fibonacci sequence generator. */ for (i = 0; i < 10; ++i) { /* `sc_yield` returns control to the parent (or creator) context. Since the context we want to switch to is not our parent, we must instead use `sc_switch`. */ fib = sc_switch(context, NULL); /* As with the stack of the new context, since the fibonacci stack still exists, it is safe to directly reference variables on its stack. */ printf("%lu\n", *(unsigned long*)fib); } /* Clean up. */ sc_context_destroy(context); return 0; }
/* ISC license. */ #include <skalibs/uint.h> #include <skalibs/strerr2.h> #include <skalibs/sgetopt.h> #include <skalibs/tai.h> #include <skalibs/djbunix.h> #include <s6/s6-fdholder.h> #define USAGE "s6-fdholder-retrievec [ -D ] [ -t timeout ] id prog..." #define dieusage() strerr_dieusage(100, USAGE) int main (int argc, char const *const *argv, char const *const *envp) { s6_fdholder_t a = S6_FDHOLDER_ZERO ; tain_t deadline ; int fd ; int dodelete = 0 ; PROG = "s6-fdholder-retrievec" ; { unsigned int t = 0 ; subgetopt_t l = SUBGETOPT_ZERO ; for (;;) { register int opt = subgetopt_r(argc, argv, "Dt:", &l) ; if (opt == -1) break ; switch (opt) { case 'D' : dodelete = 1 ; break ; case 't' : if (!uint0_scan(l.arg, &t)) dieusage() ; break ; default : dieusage() ; } } argc -= l.ind ; argv += l.ind ; if (t) tain_from_millisecs(&deadline, t) ; else deadline = tain_infinite_relative ; } if (!argc) dieusage() ; s6_fdholder_init(&a, 6) ; tain_now_g() ; tain_add_g(&deadline, &deadline) ; fd = s6_fdholder_retrieve_maybe_delete_g(&a, argv[0], dodelete, &deadline) ; if (fd < 0) strerr_diefu2sys(1, "retrieve fd for id ", argv[0]) ; else if (!fd) { if (uncoe(0) < 0) strerr_diefu1sys(111, "uncoe stdin") ; } else if (fd_move(0, fd) < 0) strerr_diefu1sys(111, "move fd") ; pathexec_run(argv[1], argv+1, envp) ; strerr_dieexec(111, argv[1]) ; }
// // SUColorView.h // PixelHunter // // Created by Alex Saenko on 10/17/13. // Copyright (c) 2013 Sigma Ukraine. All rights reserved. // #import <UIKit/UIKit.h> @interface SUColorView : UIView @property (nonatomic, strong) UIButton *colorViewButton; @property (nonatomic, strong) UIColor *color; - (id)initWithColor:(UIColor *)color; @end
#pragma once #include "Object2D.h" class Transform2D { public: static float TransformMatrix[3][3]; Transform2D(); static void loadIdentityMatrix(); //matricea curenta de transformari devine matricea identitate static void multiplyMatrix(float matrix[3][3]); //inmulteste matricea matrix cu matricea curenta de transformari static void translateMatrix(float tx, float ty); static void scaleMatrix(float sx,float sy); static void rotateMatrix(float u); static void rotateMatrix(float cosu,float sinu); static void applyTransform(Object2D *o); static void applyTransform_o(Object2D *o); static void applyTransform(Point2D *p,Point2D *transf_p); };
#import "GPUImageFilterGroup.h" @class GPUImagePicture; /** A photo filter based on Photoshop action by Amatorka http://amatorka.deviantart.com/art/Amatorka-Action-2-121069631 */ // Note: If you want to use this effect you have to add lookup_amatorka.png // from Resources folder to your application bundle. @interface GPUImageAmatorkaFilter : GPUImageFilterGroup { GPUImagePicture *lookupImageSource; } @end
@protocol HLFilterDelegate <NSObject> - (void)didFilterVariants; @end
#ifdef HAVE_CONFIG_H #include "../../../ext_config.h" #endif #include <php.h> #include "../../../php_ext.h" #include "../../../ext.h" #include <Zend/zend_operators.h> #include <Zend/zend_exceptions.h> #include <Zend/zend_interfaces.h> #include "kernel/main.h" /* This file is part of the php-ext-zendframework package. For the full copyright and license information, please view the LICENSE file that was distributed with this source code. */ ZEPHIR_INIT_CLASS(ZendFramework_I18n_Exception_ExtensionNotLoadedException) { ZEPHIR_REGISTER_CLASS_EX(Zend\\I18n\\Exception, ExtensionNotLoadedException, zendframework, i18n_exception_extensionnotloadedexception, spl_ce_DomainException, NULL, 0); zend_class_implements(zendframework_i18n_exception_extensionnotloadedexception_ce TSRMLS_CC, 1, zendframework_i18n_exception_exceptioninterface_ce); return SUCCESS; }
// // LUConsoleLogController.h // // Lunar Unity Mobile Console // https://github.com/SpaceMadness/lunar-unity-console // // Copyright 2017 Alex Lementuev, SpaceMadness. // // 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. // #import <UIKit/UIKit.h> #import "LUViewController.h" @class LUConsolePlugin; @class LUConsoleLogController; @protocol LUConsoleLogControllerResizeDelegate <NSObject> - (void)consoleLogControllerDidRequestResize:(LUConsoleLogController *)controller; @end @interface LUConsoleLogController : LUViewController @property (nonatomic, strong) NSString *version; @property (nonatomic, strong) NSArray<NSString *> *emails; @property (nonatomic, weak) id<LUConsoleLogControllerResizeDelegate> resizeDelegate; + (instancetype)controllerWithPlugin:(LUConsolePlugin *)plugin; - (instancetype)initWithPlugin:(LUConsolePlugin *)plugin; @end
#ifdef __OBJC__ #import <UIKit/UIKit.h> #else #ifndef FOUNDATION_EXPORT #if defined(__cplusplus) #define FOUNDATION_EXPORT extern "C" #else #define FOUNDATION_EXPORT extern #endif #endif #endif #import "Invocation.h" #import "MethodSignature.h" #import "Proxy.h" FOUNDATION_EXPORT double RoutableAssistVersionNumber; FOUNDATION_EXPORT const unsigned char RoutableAssistVersionString[];
//******************************************************************* // Copyright (C) 2000 ImageLinks Inc. // // License: MIT // // See LICENSE.txt file in the top level directory for more details. // // Author: Garrett Potts // // Description: // //************************************************************************* // $Id: ossimImageDataFactory.h 13474 2008-08-22 14:20:42Z gpotts $ #ifndef ossimImageDataFactory_HEADER #define ossimImageDataFactory_HEADER #include <ossim/imaging/ossimImageData.h> #include <ossim/base/ossimRefPtr.h> #include <mutex> class ossimSource; class ossimImageSource; /*! * This factory should be called by all image source producers to allocate * an image tile. */ class OSSIM_DLL ossimImageDataFactory { public: virtual ~ossimImageDataFactory(); static ossimImageDataFactory* instance(); virtual ossimRefPtr<ossimImageData> create(ossimSource* owner, ossimScalarType scalar, ossim_uint32 bands = 1)const; virtual ossimRefPtr<ossimImageData> create(ossimSource* owner, ossimScalarType scalar, ossim_uint32 bands, ossim_uint32 width, ossim_uint32 height)const; virtual ossimRefPtr<ossimImageData> create( ossimSource* owner, ossim_uint32 bands, ossimImageSource* inputSource)const; virtual ossimRefPtr<ossimImageData> create( ossimSource* owner, ossimImageSource* inputSource)const; protected: ossimImageDataFactory(); // hide ossimImageDataFactory(const ossimImageDataFactory&){}//hide void operator = (ossimImageDataFactory&){}// hide static ossimImageDataFactory* theInstance; static std::mutex theInstanceMutex; }; #endif
#include <string> #include <vector> #include <sstream> std::vector<std::string> split(const std::string &s, char delim, bool include_empty_tokens);
/* * $QNXLicenseC: * Copyright 2011, QNX Software Systems. * * Licensed under the Apache License, Version 2.0 (the "License"). You * may not reproduce, modify or distribute this software 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 OF ANY KIND, either express or implied. * * This file may contain contributions from others, either as * contributors under the License or as licensors under other terms. * Please review this entire file for other proprietary rights or license * notices, as well as the QNX Development Suite License Guide at * http://licensing.qnx.com/license-guide/ for other information. * $ */ #include "startup.h" /* * Configuration for Cortex-A15 MPCore: * - cache/page callouts use inner-cacheable/broadcast operations * - pte encodings use Shared/Write-back/Write-allocate encodings * * NOTE: we need to set bit 10 (ARM_MMU_CR_F) to enable swp instructions. * These were deprecated in ARMv6 and Cortex-A15 disables them by * default causing them to generate illegal instruction exceptions. * * We also need to explicitly specify ARM_MMU_CR_XP even though that * bit is always set to 1 by hardware so that arm_pte.c can detect * that we are using the ARMv6 VMSA page table format. */ const struct armv_chip armv_chip_a15 = { .cpuid = 0xc0f0, .name = "Cortex A15", .mmu_cr_set = ARM_MMU_CR_XP|ARM_MMU_CR_I|ARM_MMU_CR_Z|ARM_MMU_CR_F, .mmu_cr_clr = 0, .cycles = 2, .cache = &armv_cache_a15, .power = &power_v7_wfi, .flush = &page_flush_a15, .deferred = &page_flush_deferred_a15, .pte = &armv_pte_v7mp, .pte_wa = &armv_pte_v7mp, .pte_wb = 0, // not supported .pte_wt = 0, // not supported .setup = armv_setup_a15, .ttb_attr = ARM_TTBR_IRGN_WA|ARM_TTBR_RGN_WA|ARM_TTBR_S, .pte_attr = ARM_PTE_V6_SP_XN|ARM_PTE_V6_WA|ARM_PTE_V6_S, }; __SRCVERSION( "$URL: http://svn/product/tags/restricted/bsp/nto650/ti-omap4430-panda/latest/src/hardware/startup/lib/arm/armv_chip_a15.c $ $Rev: 655042 $" );
#import <UIKit/UIKit.h> #import "FEMAssignmentPolicy.h" #import "FEMRelationshipAssignmentContext+Internal.h" #import "FEMRelationshipAssignmentContext.h" #import "FEMManagedObjectCache.h" #import "FEMDeserializer.h" #import "FEMManagedObjectDeserializer.h" #import "FEMObjectDeserializer.h" #import "FEMAttribute.h" #import "FEMManagedObjectMapping.h" #import "FEMMapping.h" #import "FEMObjectMapping.h" #import "FEMProperty.h" #import "FEMRelationship.h" #import "FEMSerializer.h" #import "FEMManagedObjectStore.h" #import "FEMObjectStore.h" #import "FastEasyMapping.h" #import "FEMMappingUtility.h" #import "FEMRepresentationUtility.h" #import "FEMTypeIntrospection.h" #import "FEMTypes.h" FOUNDATION_EXPORT double FastEasyMappingVersionNumber; FOUNDATION_EXPORT const unsigned char FastEasyMappingVersionString[];