text
stringlengths 4
6.14k
|
|---|
/* Declarations for System V style searching functions.
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _SEARCH_H
#define _SEARCH_H 1
#include <sys/cdefs.h>
#define __need_size_t
#define __need_NULL
#include <stddef.h>
__BEGIN_DECLS
#if defined(__USE_SVID) || defined(__USE_XOPEN_EXTENDED)
/* Prototype structure for a linked-list data structure.
This is the type used by the `insque' and `remque' functions. */
struct qelem
{
struct qelem *q_forw;
struct qelem *q_back;
char q_data[1];
};
/* Insert ELEM into a doubly-linked list, after PREV. */
extern void insque __P ((void *__elem, void *__prev));
/* Unlink ELEM from the doubly-linked list that it is in. */
extern void remque __P ((void *__elem));
#endif
/* For use with hsearch(3). */
#ifndef __COMPAR_FN_T
#define __COMPAR_FN_T
typedef int (*__compar_fn_t) __P ((__const __ptr_t, __const __ptr_t));
#endif
/* Action which shall be performed in the call the hsearch. */
typedef enum
{
FIND,
ENTER
}
ACTION;
typedef struct entry
{
char *key;
char *data;
}
ENTRY;
/* Opaque type for internal use. */
struct _ENTRY;
/* Data type for reentrant functions. */
struct hsearch_data
{
struct _ENTRY *table;
unsigned int size;
unsigned int filled;
};
/* Family of hash table handling functions. The functions also have
reentrant counterparts ending with _r. */
extern ENTRY *hsearch __P ((ENTRY __item, ACTION __action));
extern int hcreate __P ((size_t __nel));
extern void hdestroy __P ((void));
extern int hsearch_r __P ((ENTRY __item, ACTION __action, ENTRY **__retval,
struct hsearch_data *__htab));
extern int hcreate_r __P ((size_t __nel, struct hsearch_data *htab));
extern void hdestroy_r __P ((struct hsearch_data *htab));
/* The tsearch routines are very interesting. They make many
assumptions about the compiler. It assumes that the first field
in node must be the "key" field, which points to the datum.
Everything depends on that. */
/* For tsearch */
typedef enum
{
preorder,
postorder,
endorder,
leaf
}
VISIT;
extern void *tsearch __P ((__const void * __key, void **__rootp,
__compar_fn_t compar));
extern void *__tsearch __P ((__const void * __key, void **__rootp,
__compar_fn_t compar));
extern void *tfind __P ((__const void * __key, __const void ** __rootp,
__compar_fn_t compar));
extern void *__tfind __P ((__const void * __key, __const void ** __rootp,
__compar_fn_t compar));
extern void *tdelete __P ((__const void * __key, void ** __rootp,
__compar_fn_t compar));
extern void *__tdelete __P ((__const void * __key, void ** __rootp,
__compar_fn_t compar));
#ifndef __ACTION_FN_T
#define __ACTION_FN_T
typedef void (*__action_fn_t) __P ((__const void *__nodep,
__const VISIT __value,
__const int __level));
#endif
extern void twalk __P ((__const void * __root, __action_fn_t action));
extern void __twalk __P ((__const void * __root, __action_fn_t action));
/* Perform linear search for KEY by comparing by COMPAR in an array
[BASE,BASE+NMEMB*SIZE). */
extern void * lfind __P ((__const void *__key, __const void *__base,
size_t *__nmemb, size_t __size,
__compar_fn_t __compar));
/* Perform linear search for KEY by comparing by COMPAR function in
array [BASE,BASE+NMEMB*SIZE) and insert entry if not found. */
extern void * lsearch __P ((__const void *__key, void *__base, size_t *__nmemb,
size_t __size, __compar_fn_t __compar));
__END_DECLS
#endif /* search.h */
|
/* 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 PSP_TIMER_H
#define PSP_TIMER_H
class PspTimer {
public:
typedef void (* CallbackFunc)(void);
PspTimer() : _callback(0), _interval(0), _threadId(-1), _init(false) {}
void stop() { _init = false; }
bool start();
~PspTimer() { stop(); }
void setCallback(CallbackFunc cb) { _callback = cb; }
void setIntervalMs(uint32 interval) { _interval = interval * 1000; }
static int thread(SceSize, void *__this); // static thread to use as bridge
void timerThread();
private:
CallbackFunc _callback; // pointer to timer callback
uint32 _interval;
int _threadId;
bool _init;
};
#endif // PSP_TIMER_H
|
#include <stdio.h>
#include <unistd.h>
/*
* Wrap the kernel time call so that it also
* returns a time_t (longlong). The kernel ABI
* doesn't deal in 64bit return values.
*/
int stime(const time_t *t)
{
__ktime_t tmp;
tmp.time = *t;
#if defined(NO_64BIT)
tmp.pad = 0;
#endif
return _stime(&tmp, 0);
}
|
/*
* perm.h - header for at(1)
* Copyright (C) 1994 Thomas Koenig
*
* 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.
*/
int check_permission();
|
/* -*- c++ -*- */
/*
* Copyright 2002 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* GNU Radio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef _QA_FILTER_H_
#define _QA_FILTER_H_
#include <cppunit/TestSuite.h>
//! collect all the tests for the gr directory
class qa_filter {
public:
//! return suite of tests for all of gr directory
static CppUnit::TestSuite *suite ();
};
#endif /* _QA_FILTER_H_ */
|
/* aacgm.h
=======
Author: R.J.Barnes
*/
/*
LICENSE AND DISCLAIMER
Copyright (c) 2012 The Johns Hopkins University/Applied Physics Laboratory
This file is part of the Radar Software Toolkit (RST).
RST is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.
RST 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 RST. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _AACGM_H
#define _AACGM_H
int AACGMLoadCoefFP(FILE *fp);
int AACGMLoadCoef(char *fname);
int AACGMInit(int year);
int AACGMConvert(double in_lat,double in_lon,double height,
double *out_lat,double *out_lon,double *r,
int flag);
#endif
|
/*
* Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2015-2017 The strace developers.
* 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 ``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 BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "tests.h"
#include <asm/unistd.h>
#ifdef __NR_sendfile64
# include <assert.h>
# include <errno.h>
# include <fcntl.h>
# include <stdio.h>
# include <stdint.h>
# include <stdlib.h>
# include <unistd.h>
# include <sys/socket.h>
int
main(void)
{
(void) close(0);
if (open("/dev/zero", O_RDONLY) != 0)
perror_msg_and_skip("open: %s", "/dev/zero");
int sv[2];
if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv))
perror_msg_and_skip("socketpair");
const unsigned int page_size = get_page_size();
assert(syscall(__NR_sendfile64, 0, 1, NULL, page_size) == -1);
if (EBADF != errno)
perror_msg_and_skip("sendfile64");
printf("sendfile64(0, 1, NULL, %u) = -1 EBADF (%m)\n", page_size);
unsigned int file_size = 0;
socklen_t optlen = sizeof(file_size);
if (getsockopt(sv[1], SOL_SOCKET, SO_SNDBUF, &file_size, &optlen))
perror_msg_and_fail("getsockopt");
if (file_size < 1024)
error_msg_and_skip("SO_SNDBUF too small: %u", file_size);
file_size /= 4;
if (file_size / 16 > page_size)
file_size = page_size * 16;
const unsigned int blen = file_size / 3;
const unsigned int alen = file_size - blen;
static const char fname[] = "sendfile64-tmpfile";
int reg_in = open(fname, O_RDWR | O_CREAT | O_TRUNC, 0600);
if (reg_in < 0)
perror_msg_and_fail("open: %s", fname);
if (unlink(fname))
perror_msg_and_fail("unlink: %s", fname);
if (ftruncate(reg_in, file_size))
perror_msg_and_fail("ftruncate: %s", fname);
TAIL_ALLOC_OBJECT_CONST_PTR(uint64_t, p_off);
void *p = p_off + 1;
*p_off = 0;
assert(syscall(__NR_sendfile64, 0, 1, p, page_size) == -1);
printf("sendfile64(0, 1, %p, %u) = -1 EFAULT (%m)\n", p, page_size);
assert(syscall(__NR_sendfile64, sv[1], reg_in, NULL, alen)
== (long) alen);
printf("sendfile64(%d, %d, NULL, %u) = %u\n",
sv[1], reg_in, alen, alen);
assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, alen)
== (long) alen);
printf("sendfile64(%d, %d, [0] => [%u], %u) = %u\n",
sv[1], reg_in, alen, alen, alen);
assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, file_size + 1)
== (long) blen);
printf("sendfile64(%d, %d, [%u] => [%u], %u) = %u\n",
sv[1], reg_in, alen, file_size, file_size + 1, blen);
*p_off = 0xcafef00dfacefeedULL;
assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, 1) == -1);
printf("sendfile64(%d, %d, [14627392582579060461], 1)"
" = -1 EINVAL (%m)\n", sv[1], reg_in);
*p_off = 0xfacefeed;
assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, 1) == 0);
printf("sendfile64(%d, %d, [4207869677], 1) = 0\n", sv[1], reg_in);
puts("+++ exited with 0 +++");
return 0;
}
#else
SKIP_MAIN_UNDEFINED("__NR_sendfile64")
#endif
|
/*
* jcmaster.h
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* mozjpeg Modifications:
* Copyright (C) 2014, Mozilla Corporation.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains the master control structures for the JPEG compressor.
*/
/* Private state */
typedef enum {
main_pass, /* input data, also do first output step */
huff_opt_pass, /* Huffman code optimization pass */
output_pass, /* data output pass */
trellis_pass /* trellis quantization pass */
} c_pass_type;
typedef struct {
struct jpeg_comp_master pub; /* public fields */
c_pass_type pass_type; /* the type of the current pass */
int pass_number; /* # of passes completed */
int total_passes; /* total # of passes needed */
int scan_number; /* current index in scan_info[] */
/* fields for scan optimisation */
int pass_number_scan_opt_base; /* pass number where scan optimization begins */
unsigned char * scan_buffer[64]; /* buffer for a given scan */
unsigned long scan_size[64]; /* size for a given scan */
int actual_Al[64]; /* actual value of Al used for a scan */
unsigned long best_cost; /* bit count for best frequency split */
int best_freq_split_idx_luma; /* index for best frequency split (luma) */
int best_freq_split_idx_chroma; /* index for best frequency split (chroma) */
int best_Al_luma; /* best value for Al found in scan search (luma) */
int best_Al_chroma; /* best value for Al found in scan search (luma) */
boolean interleave_chroma_dc; /* indicate whether to interleave chroma DC scans */
struct jpeg_destination_mgr * saved_dest; /* saved value of cinfo->dest */
} my_comp_master;
typedef my_comp_master * my_master_ptr;
|
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: Core types for the response rules -- criteria, responses, rules, and matchers.
//
// $NoKeywords: $
//=============================================================================//
#ifndef RESPONSE_HOST_INTERFACE_H
#define RESPONSE_HOST_INTERFACE_H
#ifdef _WIN32
#pragma once
#endif
#include "filesystem.h"
class IUniformRandomStream;
class ICommandLine;
namespace ResponseRules
{
// FUNCTIONS YOU MUST IMPLEMENT IN THE HOST EXECUTABLE:
// These are functions that are mentioned in the header, but need their bodies implemented
// in the .dll that links against this lib.
// This is to wrap functions that previously came from the engine interface
// back when the response rules were inside the server.dll . Now that the rules
// are included into a standalone editor, we don't necessarily have an engine around,
// so there needs to be some other implementation.
abstract_class IEngineEmulator
{
public:
/// Given an input text buffer data pointer, parses a single token into the variable token and returns the new
/// reading position
virtual const char *ParseFile( const char *data, char *token, int maxlen ) = 0;
/// Return a pointer to an IFileSystem we can use to read and process scripts.
virtual IFileSystem *GetFilesystem() = 0;
/// Return a pointer to an instance of an IUniformRandomStream
virtual IUniformRandomStream *GetRandomStream() = 0 ;
/// Return a pointer to a tier0 ICommandLine
virtual ICommandLine *GetCommandLine() = 0;
/// Emulates the server's UTIL_LoadFileForMe
virtual byte *LoadFileForMe( const char *filename, int *pLength ) = 0;
/// Emulates the server's UTIL_FreeFile
virtual void FreeFile( byte *buffer ) = 0;
/// Somewhere in the host executable you should define this symbol and
/// point it at a singleton instance.
static IEngineEmulator *s_pSingleton;
// this is just a function that returns the pointer above -- just in
// case we need to define it differently. And I get asserts this way.
static IEngineEmulator *Get();
};
};
#endif
|
/*-------------------------------------------------------------------------
*
* execUtils.h
*
* Copyright (c) 2005-2008, Greenplum inc
*
*-------------------------------------------------------------------------
*/
#ifndef _EXECUTILS_H_
#define _EXECUTILS_H_
#include "executor/execdesc.h"
struct EState;
struct QueryDesc;
extern void InitSliceTable(struct EState *estate, int nMotions, int nSubplans);
extern Slice *getCurrentSlice(struct EState *estate, int sliceIndex);
extern bool sliceRunsOnQD(Slice *slice);
extern bool sliceRunsOnQE(Slice *slice);
extern int sliceCalculateNumSendingProcesses(Slice *slice);
extern void InitRootSlices(QueryDesc *queryDesc);
extern void AssignGangs(QueryDesc *queryDesc);
extern void ReleaseGangs(QueryDesc *queryDesc);
#ifdef USE_ASSERT_CHECKING
struct PlannedStmt;
extern void AssertSliceTableIsValid(SliceTable *st, struct PlannedStmt *pstmt);
#endif
#endif
|
//******************************************************************************
//
// 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.
//
//******************************************************************************
// WindowsApplicationModelExtendedExecutionForeground.h
// Generated from winmd2objc
#pragma once
#include "interopBase.h"
@class WAEFExtendedExecutionForegroundRevokedEventArgs, WAEFExtendedExecutionForegroundSession;
@protocol WAEFIExtendedExecutionForegroundRevokedEventArgs, WAEFIExtendedExecutionForegroundSession;
// Windows.ApplicationModel.ExtendedExecution.Foreground.ExtendedExecutionForegroundResult
enum _WAEFExtendedExecutionForegroundResult {
WAEFExtendedExecutionForegroundResultAllowed = 0,
WAEFExtendedExecutionForegroundResultDenied = 1,
};
typedef unsigned WAEFExtendedExecutionForegroundResult;
// Windows.ApplicationModel.ExtendedExecution.Foreground.ExtendedExecutionForegroundRevokedReason
enum _WAEFExtendedExecutionForegroundRevokedReason {
WAEFExtendedExecutionForegroundRevokedReasonResumed = 0,
WAEFExtendedExecutionForegroundRevokedReasonSystemPolicy = 1,
};
typedef unsigned WAEFExtendedExecutionForegroundRevokedReason;
// Windows.ApplicationModel.ExtendedExecution.Foreground.ExtendedExecutionForegroundReason
enum _WAEFExtendedExecutionForegroundReason {
WAEFExtendedExecutionForegroundReasonUnspecified = 0,
WAEFExtendedExecutionForegroundReasonSavingData = 1,
WAEFExtendedExecutionForegroundReasonBackgroundAudio = 2,
WAEFExtendedExecutionForegroundReasonUnconstrained = 3,
};
typedef unsigned WAEFExtendedExecutionForegroundReason;
#include "WindowsFoundation.h"
#import <Foundation/Foundation.h>
// Windows.ApplicationModel.ExtendedExecution.Foreground.ExtendedExecutionForegroundRevokedEventArgs
#ifndef __WAEFExtendedExecutionForegroundRevokedEventArgs_DEFINED__
#define __WAEFExtendedExecutionForegroundRevokedEventArgs_DEFINED__
WINRT_EXPORT
@interface WAEFExtendedExecutionForegroundRevokedEventArgs : RTObject
@property (readonly) WAEFExtendedExecutionForegroundRevokedReason reason;
@end
#endif // __WAEFExtendedExecutionForegroundRevokedEventArgs_DEFINED__
// Windows.Foundation.IClosable
#ifndef __WFIClosable_DEFINED__
#define __WFIClosable_DEFINED__
@protocol WFIClosable
- (void)close;
@end
#endif // __WFIClosable_DEFINED__
// Windows.ApplicationModel.ExtendedExecution.Foreground.ExtendedExecutionForegroundSession
#ifndef __WAEFExtendedExecutionForegroundSession_DEFINED__
#define __WAEFExtendedExecutionForegroundSession_DEFINED__
WINRT_EXPORT
@interface WAEFExtendedExecutionForegroundSession : RTObject <WFIClosable>
+ (instancetype)create ACTIVATOR;
@property WAEFExtendedExecutionForegroundReason reason;
@property (copy) NSString * description;
- (EventRegistrationToken)addRevokedEvent:(void(^)(RTObject*, WAEFExtendedExecutionForegroundRevokedEventArgs*))del;
- (void)removeRevokedEvent:(EventRegistrationToken)tok;
- (void)requestExtensionAsyncWithSuccess:(void (^)(WAEFExtendedExecutionForegroundResult))success failure:(void (^)(NSError*))failure;
- (void)close;
@end
#endif // __WAEFExtendedExecutionForegroundSession_DEFINED__
|
/*
* Copyright 2008 Freescale Semiconductor, Inc.
*
* SPDX-License-Identifier: GPL-2.0
*/
#include <common.h>
#include <fsl_ddr_sdram.h>
#include <fsl_ddr_dimm_params.h>
void fsl_ddr_board_options(memctl_options_t *popts,
dimm_params_t *pdimm,
unsigned int ctrl_num)
{
/*
* Factors to consider for clock adjust:
* - number of chips on bus
* - position of slot
* - DDR1 vs. DDR2?
* - ???
*
* This needs to be determined on a board-by-board basis.
* 0110 3/4 cycle late
* 0111 7/8 cycle late
*/
popts->clk_adjust = 7;
/*
* Factors to consider for CPO:
* - frequency
* - ddr1 vs. ddr2
*/
popts->cpo_override = 0;
/*
* Factors to consider for write data delay:
* - number of DIMMs
*
* 1 = 1/4 clock delay
* 2 = 1/2 clock delay
* 3 = 3/4 clock delay
* 4 = 1 clock delay
* 5 = 5/4 clock delay
* 6 = 3/2 clock delay
*/
popts->write_data_delay = 3;
/*
* Factors to consider for half-strength driver enable:
* - number of DIMMs installed
*/
popts->half_strength_driver_enable = 0;
}
|
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_SHELL_SHELL_DEVTOOLS_FRONTEND_H_
#define CONTENT_SHELL_SHELL_DEVTOOLS_FRONTEND_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/devtools_client_host.h"
#include "content/public/browser/devtools_frontend_host_delegate.h"
#include "content/public/browser/web_contents_observer.h"
namespace content {
class RenderViewHost;
class Shell;
class WebContents;
class ShellDevToolsFrontend : public WebContentsObserver,
public DevToolsFrontendHostDelegate {
public:
// static ShellDevToolsFrontend* Show(WebContents* inspected_contents);
void Focus();
void Close();
Shell* frontend_shell() const { return frontend_shell_; }
ShellDevToolsFrontend(Shell* frontend_shell, DevToolsAgentHost* agent_host);
virtual ~ShellDevToolsFrontend();
private:
// WebContentsObserver overrides
virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE;
virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE;
// DevToolsFrontendHostDelegate implementation
virtual void DispatchOnEmbedder(const std::string& message) OVERRIDE {}
virtual void InspectedContentsClosing() OVERRIDE;
Shell* frontend_shell_;
scoped_refptr<DevToolsAgentHost> agent_host_;
scoped_ptr<DevToolsClientHost> frontend_host_;
DISALLOW_COPY_AND_ASSIGN(ShellDevToolsFrontend);
};
} // namespace content
#endif // CONTENT_SHELL_SHELL_DEVTOOLS_FRONTEND_H_
|
/*
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright © 2020 Keith Packard
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <math.h>
#include "math_config.h"
#if HAVE_FAST_FMA
double
fma (double x, double y, double z)
{
asm ("vfma.f64 %P0, %P1, %P2" : "=w" (z) : "w" (x), "w" (y));
return z;
}
#endif
|
/*
* Copyright (C) 2012 LG 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 __MAX17050_BATTERY_H_
#define __MAX17050_BATTERY_H_
#define MAX17050_STATUS_BATTABSENT (1 << 3)
#define MAX17050_BATTERY_FULL 100
#define MAX17050_DEFAULT_SNS_RESISTOR 10000
#define CONFIG_LGE_PM_MAX17050_POLLING
/* #define MAX17050_DEBUG */
/* Voltage Base */
/* #define CONFIG_LGE_PM_MAX17050_SOC_VF */
/* Current Base */
#define CONFIG_LGE_PM_MAX17050_SOC_REP
/* Number of words in model characterisation data */
#define MODEL_SIZE 32
/* Recharging for PPLUS max17050 */
#ifdef CONFIG_MACH_MSM8992_PPLUS
#define CONFIG_LGE_PM_MAX17050_RECHARGING
#endif
struct max17050_platform_data {
int (*battery_online)(void);
int (*charger_online)(void);
int (*charger_enable)(void);
#ifdef CONFIG_LGE_PM
bool enable_current_sense;
bool ext_batt_psy;
int empty_soc;
int full_soc;
/*
* R_sns in micro-ohms.
* default 10000 (if r_sns = 0) as it is the recommended value by
* the datasheet although it can be changed by board designers.
*/
unsigned int r_sns;
int config;
int filtercfg;
int relaxcfg;
int learncfg;
int misccfg;
int fullsocthr;
int iavg_empty;
int rcomp0;
int tempco;
int tempnom;
int ichgterm;
int tgain;
int toff;
int vempty;
int qrtable00;
int qrtable10;
int qrtable20;
int qrtable30;
int capacity;
int vf_fullcap;
int param_version;
int full_design;
int rescale_soc;
int rescale_factor;
/* model characterisation data */
u8 model_80[MODEL_SIZE];
u8 model_90[MODEL_SIZE];
u8 model_A0[MODEL_SIZE];
#endif
};
#define MAX17050_STATUS 0x00
#define MAX17050_V_ALRT_THRESHOLD 0x01
#define MAX17050_T_ALRT_THRESHOLD 0x02
#define MAX17050_SOC_ALRT_THRESHOLD 0x03
#define MAX17050_AT_RATE 0x04
#define MAX17050_REM_CAP_REP 0x05
#define MAX17050_SOC_REP 0x06
#define MAX17050_AGE 0x07
#define MAX17050_TEMPERATURE 0x08
#define MAX17050_V_CELL 0x09
#define MAX17050_CURRENT 0x0A
#define MAX17050_AVERAGE_CURRENT 0x0B
#define MAX17050_SOC_MIX 0x0D
#define MAX17050_SOC_AV 0x0E
#define MAX17050_REM_CAP_MIX 0x0F
#define MAX17050_FULL_CAP 0x10
#define MAX17050_TTE 0x11
#define MAX17050_Q_RESIDUAL_00 0x12
#define MAX17050_FULL_SOC_THR 0x13
#define MAX17050_AVERAGE_TEMP 0x16
#define MAX17050_CYCLES 0x17
#define MAX17050_DESIGN_CAP 0x18
#define MAX17050_AVERAGE_V_CELL 0x19
#define MAX17050_MAX_MIN_TEMP 0x1A
#define MAX17050_MAX_MIN_VOLTAGE 0x1B
#define MAX17050_MAX_MIN_CURRENT 0x1C
#define MAX17050_CONFIG 0x1D
#define MAX17050_I_CHG_TERM 0x1E
#define MAX17050_REM_CAP_AV 0x1F
#define MAX17050_CUSTOMVER 0x20
#define MAX17050_VERSION 0x21
#define MAX17050_Q_RESIDUAL_10 0x22
#define MAX17050_FULL_CAP_NOM 0x23
#define MAX17050_TEMP_NOM 0x24
#define MAX17050_TEMP_LIM 0x25
#define MAX17050_AIN 0x27
#define MAX17050_LEARN_CFG 0x28
#define MAX17050_FILTER_CFG 0x29
#define MAX17050_RELAX_CFG 0x2A
#define MAX17050_MISC_CFG 0x2B
#define MAX17050_T_GAIN 0x2C
#define MAX17050_T_OFF 0x2D
#define MAX17050_C_GAIN 0x2E
#define MAX17050_C_OFF 0x2F
#define MAX17050_Q_RESIDUAL_20 0x32
#define MAX17050_FULLCAP0 0x35
#define MAX17050_I_AVG_EMPTY 0x36
#define MAX17050_F_CTC 0x37
#define MAX17050_RCOMP_0 0x38
#define MAX17050_TEMP_CO 0x39
#define MAX17050_V_EMPTY 0x3A
#define MAX17050_F_STAT 0x3D
#define MAX17050_TIMER 0x3E
#define MAX17050_SHDN_TIMER 0x3F
#define MAX17050_Q_RESIDUAL_30 0x42
#define MAX17050_D_QACC 0x45
#define MAX17050_D_PACC 0x46
#define MAX17050_VFSOC0 0x48
#define MAX17050_QH0 0x4C
#define MAX17050_QH 0x4D
#define MAX17050_VFSOC0_LOCK 0x60
#define MAX17050_MODEL_LOCK1 0x62
#define MAX17050_MODEL_LOCK2 0x63
#define MAX17050_V_FOCV 0xFB
#define MAX17050_SOC_VF 0xFF
#define MAX17050_MODEL_TABLE_80 0x80
#define MAX17050_MODEL_TABLE_90 0x90
#define MAX17050_MODEL_TABLE_A0 0xA0
#ifdef CONFIG_LGE_PM
int max17050_get_battery_capacity_percent(void);
int max17050_get_battery_mvolts(void);
int max17050_suspend_get_mvolts(void);
int max17050_read_battery_age(void);
int max17050_get_battery_age(void);
int max17050_get_battery_condition(void);
int max17050_get_battery_current(void);
int max17050_get_soc_for_charging_complete_at_cmd(void);
int max17050_get_full_design(void);
int max17050_write_battery_temp(void);
int max17050_write_temp(void);
bool max17050_battery_full_info_print(void);
void max17050_initial_quickstart_check(void);
bool max17050_recharging(void);
bool max17050_i2c_write_and_verify(u8 addr, u16 value);
#endif
#endif
|
/****************************************************************************
*
* Copyright (c) 2007-2008 Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2, available
* at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html (the "GPL").
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
****************************************************************************/
/**
*
* @file lcs_ftt_api.h
*
* @brief This header provides the interface description for the fine timer transfer API.
*
****************************************************************************/
#ifndef LCS_FTT_API_H__
#define LCS_FTT_API_H__ ///< Include guard.
// ---- Include Files -------------------------------------------------------
//The following header files should be included before include lcs_ftt_api.h
// "mobcom_types.h"
// "resultcode.h"
///Fine Time Transfer parameters
typedef struct
{
UInt32 S_fn; ///< Frame number
UInt16 U_arfcn; ///< UARFCN or BCCH carrier
UInt16 psc_bsic; ///< Primary Scrambling Code in 3G or Base Station Identification Code in 2G
UInt8 ta; ///< Timing advance
UInt8 slot; ///< Time slot
UInt16 bits; ///< Bit number
} LcsFttParams_t;
///Payload for MSG_LCS_FTT_SYNC_RESULT_IND
typedef struct
{
ClientInfo_t mClientInfo; ///< The client info provided when LCS_FttSyncReq() is incoked
LcsFttParams_t mLcsFttParam; ///< The result Fine Time Transfer parameters
} LcsFttResult_t;
//*******************************************************************************
/**
* Start a FTT synchronization request
* The client will receive MSG_LCS_FTT_SYNC_RESULT_IND with LcsFttResult_t payload.
*
* @param inClientInfoPtr (in) The client info including client ID returned by SYS_RegisterForMSEvent()
* and the reference ID provided by the caller.
*
*******************************************************************************/
Result_t LCS_FttSyncReq(ClientInfo_t* inClientInfoPtr);
//*******************************************************************************
/**
* Calculate the time difference in micro second between the provided two FTT parameters.
*
* @param inT1 (in) The first FTT parameter.
* @param inT2 (in) The second FTT parameter.
*
* @return The time difference in micro second between the provided two FTT parameters.
*
*******************************************************************************/
UInt32 LCS_FttCalcDeltaTime( const LcsFttParams_t * inT1, const LcsFttParams_t* inT2);
//*******************************************************************************
/**
*
* Reports if the AFC algorithm in the L1 code is locked to
* a base station now, and over the recent history.
* The lock statistics are cleared when this is called.
* Statistics are kept of loss of lock, etc. until the next
* call to L1_bb_isLocked().
*
* @return
* TRUE if the baseband radio is locked to the base station.
* FALSE otherwise.
*
* @note
* Can be called twice in a row to get the current status:
* LCS_L1_bb_isLocked(); // Might return FALSE if we just got locked
* // since the previous time we called.
* LCS_L1_bb_isLocked(); // Will return the current lock status
*
********************************************************************************/
Boolean LCS_L1_bb_isLocked( Boolean inStartend );
#endif // LCS_FTT_API_H__
|
/** @file
Load Pe32 Image protocol enables loading and unloading EFI images into memory and executing those images.
This protocol uses File Device Path to get an EFI image.
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __LOAD_PE32_IMAGE_H__
#define __LOAD_PE32_IMAGE_H__
#define PE32_IMAGE_PROTOCOL_GUID \
{0x5cb5c776,0x60d5,0x45ee,{0x88,0x3c,0x45,0x27,0x8,0xcd,0x74,0x3f }}
#define EFI_LOAD_PE_IMAGE_ATTRIBUTE_NONE 0x00
#define EFI_LOAD_PE_IMAGE_ATTRIBUTE_RUNTIME_REGISTRATION 0x01
#define EFI_LOAD_PE_IMAGE_ATTRIBUTE_DEBUG_IMAGE_INFO_TABLE_REGISTRATION 0x02
typedef struct _EFI_PE32_IMAGE_PROTOCOL EFI_PE32_IMAGE_PROTOCOL;
/**
Loads an EFI image into memory and returns a handle to the image with extended parameters.
@param This The pointer to the LoadPe32Image protocol instance
@param ParentImageHandle The caller's image handle.
@param FilePath The specific file path from which the image is loaded.
@param SourceBuffer If not NULL, a pointer to the memory location containing a copy of
the image to be loaded.
@param SourceSize The size in bytes of SourceBuffer.
@param DstBuffer The buffer to store the image.
@param NumberOfPages For input, specifies the space size of the image by caller if not NULL.
For output, specifies the actual space size needed.
@param ImageHandle The image handle for output.
@param EntryPoint The image entry point for output.
@param Attribute The bit mask of attributes to set for the load PE image.
@retval EFI_SUCCESS The image was loaded into memory.
@retval EFI_NOT_FOUND The FilePath was not found.
@retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
@retval EFI_UNSUPPORTED The image type is not supported, or the device path cannot be
parsed to locate the proper protocol for loading the file.
@retval EFI_OUT_OF_RESOURCES The image was not loaded due to insufficient memory resources.
@retval EFI_LOAD_ERROR Image was not loaded because the image format was corrupt or not
understood.
@retval EFI_DEVICE_ERROR Image was not loaded because the device returned a read error.
@retval EFI_ACCESS_DENIED Image was not loaded because the platform policy prohibits the
image from being loaded. NULL is returned in *ImageHandle.
@retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a
valid EFI_LOADED_IMAGE_PROTOCOL. However, the current
platform policy specifies that the image should not be started.
**/
typedef
EFI_STATUS
(EFIAPI *LOAD_PE_IMAGE)(
IN EFI_PE32_IMAGE_PROTOCOL *This,
IN EFI_HANDLE ParentImageHandle,
IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
IN VOID *SourceBuffer OPTIONAL,
IN UINTN SourceSize,
IN EFI_PHYSICAL_ADDRESS DstBuffer OPTIONAL,
IN OUT UINTN *NumberOfPages OPTIONAL,
OUT EFI_HANDLE *ImageHandle,
OUT EFI_PHYSICAL_ADDRESS *EntryPoint OPTIONAL,
IN UINT32 Attribute
);
/**
Unload the specified image.
@param This The pointer to the LoadPe32Image protocol instance
@param ImageHandle The specified image handle to be unloaded.
@retval EFI_INVALID_PARAMETER Image handle is NULL.
@retval EFI_UNSUPPORTED Attempted to unload an unsupported image.
@retval EFI_SUCCESS The image successfully unloaded.
--*/
typedef
EFI_STATUS
(EFIAPI *UNLOAD_PE_IMAGE)(
IN EFI_PE32_IMAGE_PROTOCOL *This,
IN EFI_HANDLE ImageHandle
);
struct _EFI_PE32_IMAGE_PROTOCOL {
LOAD_PE_IMAGE LoadPeImage;
UNLOAD_PE_IMAGE UnLoadPeImage;
};
extern EFI_GUID gEfiLoadPeImageProtocolGuid;
#endif
|
#include <math.h>
#include "mex.h"
#include "matrix.h"
#include "geometry.h"
void
mexFunction (int nlhs, mxArray * plhs[], int nrhs, const mxArray * prhs[])
{
char str[256];
mxArray *proj, *dist;
double *l1, *l2, *r, *proj_p, *dist_p;
int flag;
if (nrhs <3 || nrhs>4)
mexErrMsgTxt ("Invalid number of input arguments");
if (mxGetM(prhs[0])!=1 || mxGetN(prhs[0])!=3)
mexErrMsgTxt ("Invalid dimension for input argument 1");
if (mxGetM(prhs[1])!=1 || mxGetN(prhs[1])!=3)
mexErrMsgTxt ("Invalid dimension for input argument 2");
if (mxGetM(prhs[2])!=1 || mxGetN(prhs[2])!=3)
mexErrMsgTxt ("Invalid dimension for input argument 3");
l1 = mxGetData (prhs[0]);
l2 = mxGetData (prhs[1]);
r = mxGetData (prhs[2]);
if (nrhs==4)
flag = (int)mxGetScalar (prhs[3]);
else
flag = 0;
proj = mxCreateDoubleMatrix (1, 3, mxREAL);
dist = mxCreateDoubleMatrix (1, 1, mxREAL);
proj_p = mxGetData (proj);
dist_p = mxGetData (dist);
(*dist_p) = plinproj(l1, l2, r, proj_p, flag);
/* assign the output parameters */
plhs[0] = proj;
if (nlhs>1)
plhs[1] = dist;
return;
}
|
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/setup.h>
#include <mach/iomap.h>
#include <mach/irqs.h>
#include <mach/nvrm_linux.h>
#include <linux/gpio.h>
#include <nvrm_module.h>
#include <nvrm_boot.h>
#include <nvodm_services.h>
#include <linux/leds-lm3530.h>
#include <linux/leds-lm3532.h>
#include "gpio-names.h"
#include "board.h"
#include "hwrev.h"
#include "board-mot.h"
#define TEGRA_BACKLIGHT_EN_GPIO 32 /* TEGRA_GPIO_PE0 */
#define TEGRA_KEY_BACKLIGHT_EN_GPIO 47 /* TEGRA_GPIO_PE0 */
static int disp_backlight_init(void)
{
int ret;
if ((ret = gpio_request(TEGRA_BACKLIGHT_EN_GPIO, "backlight_en"))) {
pr_err("%s: gpio_request(%d, backlight_en) failed: %d\n",
__func__, TEGRA_BACKLIGHT_EN_GPIO, ret);
return ret;
} else {
pr_info("%s: gpio_request(%d, backlight_en) success!\n",
__func__, TEGRA_BACKLIGHT_EN_GPIO);
}
if ((ret = gpio_direction_output(TEGRA_BACKLIGHT_EN_GPIO, 1))) {
pr_err("%s: gpio_direction_output(backlight_en) failed: %d\n",
__func__, ret);
return ret;
}
if (machine_is_olympus()) {
if ((ret = gpio_request(TEGRA_KEY_BACKLIGHT_EN_GPIO,
"key_backlight_en"))) {
pr_err("%s: gpio_request(%d, key_backlight_en) failed: %d\n",
__func__, TEGRA_KEY_BACKLIGHT_EN_GPIO, ret);
return ret;
} else {
pr_info("%s: gpio_request(%d, key_backlight_en) success!\n",
__func__, TEGRA_KEY_BACKLIGHT_EN_GPIO);
}
if ((ret = gpio_direction_output(TEGRA_KEY_BACKLIGHT_EN_GPIO, 1))) {
pr_err("%s: gpio_direction_output(key_backlight_en) failed: %d\n",
__func__, ret);
return ret;
}
}
return 0;
}
static int disp_backlight_power_on(void)
{
pr_info("%s: display backlight is powered on\n", __func__);
gpio_set_value(TEGRA_BACKLIGHT_EN_GPIO, 1);
return 0;
}
static int disp_backlight_power_off(void)
{
pr_info("%s: display backlight is powered off\n", __func__);
gpio_set_value(TEGRA_BACKLIGHT_EN_GPIO, 0);
return 0;
}
struct lm3530_platform_data lm3530_pdata = {
.init = disp_backlight_init,
.power_on = disp_backlight_power_on,
.power_off = disp_backlight_power_off,
.ramp_time = 0, /* Ramp time in milliseconds */
.gen_config =
LM3530_26mA_FS_CURRENT | LM3530_LINEAR_MAPPING | LM3530_I2C_ENABLE,
.als_config = 0, /* We don't use ALS from this chip */
};
struct lm3532_platform_data lm3532_pdata = {
.flags = LM3532_CONFIG_BUTTON_BL | LM3532_HAS_WEBTOP,
.init = disp_backlight_init,
.power_on = disp_backlight_power_on,
.power_off = disp_backlight_power_off,
.ramp_time = 0, /* Ramp time in milliseconds */
.ctrl_a_fs_current = LM3532_26p6mA_FS_CURRENT,
.ctrl_b_fs_current = LM3532_8p2mA_FS_CURRENT,
.ctrl_a_mapping_mode = LM3532_LINEAR_MAPPING,
.ctrl_b_mapping_mode = LM3532_LINEAR_MAPPING,
.ctrl_a_pwm = 0x82,
};
extern int MotorolaBootDispArgGet(unsigned int *arg);
void mot_setup_lights(struct i2c_board_info *info)
{
unsigned int disp_type = 0;
int ret;
if (machine_is_etna()) {
if ( HWREV_TYPE_IS_BRASSBOARD(system_rev) && HWREV_REV(system_rev) == HWREV_REV_1) { // S1 board
strncpy (info->type, LM3530_NAME,
sizeof (info->type));
info->addr = LM3530_I2C_ADDR;
info->platform_data = &lm3530_pdata;
pr_info("\n%s: Etna S1; changing display backlight to LM3530\n",
__func__);
} else {
pr_info("\n%s: Etna S2+; removing LM3532 button backlight\n",
__func__);
lm3532_pdata.flags = 0;
}
}
else if (machine_is_tegra_daytona()) {
pr_info("\n%s: Daytona; removing LM3532 button backlight\n",
__func__);
lm3532_pdata.flags = 0;
} else if (machine_is_sunfire()) {
pr_info("\n%s: Sunfire; removing LM3532 button backlight\n",
__func__);
lm3532_pdata.flags = LM3532_HAS_WEBTOP;
}
else {
#ifdef CONFIG_LEDS_DISP_BTN_TIED
lm3532_pdata.flags |= LM3532_DISP_BTN_TIED;
#endif
}
if ((ret = MotorolaBootDispArgGet(&disp_type))) {
pr_err("\n%s: unable to read display type: %d\n", __func__, ret);
return;
}
if (disp_type & 0x100) {
pr_info("\n%s: 0x%x ES2 display; will enable PWM in LM3532\n",
__func__, disp_type);
lm3532_pdata.ctrl_a_pwm = 0x86;
} else {
pr_info("\n%s: 0x%x ES1 display; will NOT enable PWM in LM3532\n",
__func__, disp_type);
}
}
|
/*
* Copyright (c) 2003-2012 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the License
* may not be used to create, or enable the creation or redistribution of,
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
*
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
#ifndef _STRUCT_TIMEVAL
#define _STRUCT_TIMEVAL struct timeval
_STRUCT_TIMEVAL
{
__darwin_time_t tv_sec; /* seconds */
__darwin_suseconds_t tv_usec; /* and microseconds */
};
#endif /* _STRUCT_TIMEVAL */
|
#ifndef HEADER_CURL_AMIGAOS_H
#define HEADER_CURL_AMIGAOS_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
***************************************************************************/
#include "curl_setup.h"
#if defined(__AMIGA__) && defined(HAVE_BSDSOCKET_H) && !defined(USE_AMISSL)
bool Curl_amiga_init();
void Curl_amiga_cleanup();
#else
#define Curl_amiga_init() 1
#define Curl_amiga_cleanup() Curl_nop_stmt
#endif
#ifdef USE_AMISSL
#include <openssl/x509v3.h>
void Curl_amiga_X509_free(X509 *a);
#endif /* USE_AMISSL */
#endif /* HEADER_CURL_AMIGAOS_H */
|
/*
This file is part of cpp-ethereum.
cpp-ethereum 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.
cpp-ethereum 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 cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file WordList.h
* @author Gav Wood <i@gavwood.com>
* @date 2015
*/
#pragma once
#include "Common.h"
namespace dev
{
extern std::vector<char const*> const WordList;
}
|
// Generated by esidl 0.2.1.
// This file is expected to be modified for the Web IDL interface
// implementation. Permission to use, copy, modify and distribute
// this file in any software license is hereby granted.
#ifndef ORG_W3C_DOM_BOOTSTRAP_FLOAT64ARRAYIMP_H_INCLUDED
#define ORG_W3C_DOM_BOOTSTRAP_FLOAT64ARRAYIMP_H_INCLUDED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <org/w3c/dom/typedarray/Float64Array.h>
#include "ArrayBufferViewImp.h"
#include <org/w3c/dom/typedarray/ArrayBuffer.h>
#include <org/w3c/dom/typedarray/ArrayBufferView.h>
#include <org/w3c/dom/typedarray/Float64Array.h>
namespace org
{
namespace w3c
{
namespace dom
{
namespace bootstrap
{
class Float64ArrayImp : public ObjectMixin<Float64ArrayImp, ArrayBufferViewImp>
{
public:
// Float64Array
unsigned int getLength();
double get(unsigned int index);
void set(unsigned int index, double value);
void set(typedarray::Float64Array array);
void set(typedarray::Float64Array array, unsigned int offset);
void set(ObjectArray<double> array);
void set(ObjectArray<double> array, unsigned int offset);
typedarray::Float64Array subarray(int start, int end);
// Object
virtual Any message_(uint32_t selector, const char* id, int argc, Any* argv)
{
return typedarray::Float64Array::dispatch(this, selector, id, argc, argv);
}
static const char* const getMetaData()
{
return typedarray::Float64Array::getMetaData();
}
};
}
}
}
}
#endif // ORG_W3C_DOM_BOOTSTRAP_FLOAT64ARRAYIMP_H_INCLUDED
|
// Filename: littleEndian.h
// Created by: drose (09Feb00)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////
#ifndef LITTLEENDIAN_H
#define LITTLEENDIAN_H
#include "dtoolbase.h"
#include "numeric_types.h"
#include "nativeNumericData.h"
#include "reversedNumericData.h"
////////////////////////////////////////////////////////////////////
// Class : LittleEndian
// Description : LittleEndian is a special class that automatically
// reverses the byte-order of numeric values for
// big-endian machines, and passes them through
// unchanged for little-endian machines.
////////////////////////////////////////////////////////////////////
#ifdef WORDS_BIGENDIAN
typedef ReversedNumericData LittleEndian;
#else
typedef NativeNumericData LittleEndian;
#endif
#endif
|
// Filename: queuedConnectionListener.h
// Created by: drose (09Feb00)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////
#ifndef QUEUEDCONNECTIONLISTENER_H
#define QUEUEDCONNECTIONLISTENER_H
#include "pandabase.h"
#include "connectionListener.h"
#include "connection.h"
#include "netAddress.h"
#include "queuedReturn.h"
#include "pdeque.h"
class EXPCL_PANDA_NET ConnectionListenerData {
public:
// We need these methods to make VC++ happy when we try to
// instantiate the template, below. They don't do anything useful.
INLINE bool operator == (const ConnectionListenerData &other) const;
INLINE bool operator != (const ConnectionListenerData &other) const;
INLINE bool operator < (const ConnectionListenerData &other) const;
PT(Connection) _rendezvous;
NetAddress _address;
PT(Connection) _new_connection;
};
EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_NET, EXPTP_PANDA_NET, QueuedReturn<ConnectionListenerData>);
////////////////////////////////////////////////////////////////////
// Class : QueuedConnectionListener
// Description : This flavor of ConnectionListener will queue up all
// of the TCP connections it established for later
// detection by the client code.
////////////////////////////////////////////////////////////////////
class EXPCL_PANDA_NET QueuedConnectionListener : public ConnectionListener,
public QueuedReturn<ConnectionListenerData> {
PUBLISHED:
QueuedConnectionListener(ConnectionManager *manager, int num_threads);
virtual ~QueuedConnectionListener();
BLOCKING bool new_connection_available();
bool get_new_connection(PT(Connection) &rendezvous,
NetAddress &address,
PT(Connection) &new_connection);
bool get_new_connection(PT(Connection) &new_connection);
protected:
virtual void connection_opened(const PT(Connection) &rendezvous,
const NetAddress &address,
const PT(Connection) &new_connection);
};
#include "queuedConnectionListener.I"
#endif
|
/*
* nghttp2 - HTTP/2 C Library
*
* Copyright (c) 2014 Tatsuhiro Tsujikawa
*
* 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 H2LOAD_SESSION_H
#define H2LOAD_SESSION_H
#include "nghttp2_config.h"
#include <sys/types.h>
#include <cinttypes>
#include "h2load.h"
namespace h2load {
class Session {
public:
virtual ~Session() {}
// Called when the connection was made.
virtual void on_connect() = 0;
// Called when one request must be issued.
virtual void submit_request(RequestStat *req_stat) = 0;
// Called when incoming bytes are available. The subclass has to
// return the number of bytes read.
virtual int on_read(const uint8_t *data, size_t len) = 0;
// Called when write is available. Returns 0 on success, otherwise
// return -1.
virtual int on_write() = 0;
// Called when the underlying session must be terminated.
virtual void terminate() = 0;
};
} // namespace h2load
#endif // H2LOAD_SESSION_H
|
// -*-c++-*-
/*!
\file cooperative_action.h
\brief cooperative action type Header File.
*/
/*
*Copyright:
Copyright (C) Hidehisa AKIYAMA
This code is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*EndCopyright:
*/
/////////////////////////////////////////////////////////////////////
#ifndef COOPERATIVE_ACTION_H
#define COOPERATIVE_ACTION_H
#include <rcsc/geom/vector_2d.h>
#include <rcsc/game_time.h>
#include <rcsc/types.h>
#include <boost/shared_ptr.hpp>
/*!
\class CooperativeAction
\brief abstract cooperative action class
*/
class CooperativeAction {
public:
typedef boost::shared_ptr< CooperativeAction > Ptr; //!< pointer type
typedef boost::shared_ptr< const CooperativeAction > ConstPtr; //!< const pointer type
/*!
\enum ActionCategory
\brief action category enumeration.
*/
enum ActionCategory {
Hold,
Dribble,
Pass,
Shoot,
Clear,
Move,
NoAction,
};
private:
ActionCategory M_category; //!< action category type
int M_index;
int M_player_unum; //!< acting player's uniform number
int M_target_player_unum; //!< action target player's uniform number
rcsc::Vector2D M_target_point; //!< action end point
double M_first_ball_speed; //!< first ball speed (if necessary)
double M_first_turn_moment; //!< first turn moment (if necessary)
double M_first_dash_power; //!< first dash speed (if necessary)
rcsc::AngleDeg M_first_dash_angle; //!< first dash angle (relative to body) (if necessary)
int M_duration_step; //!< action duration period
int M_kick_count; //!< kick count (if necessary)
int M_turn_count; //!< dash count (if necessary)
int M_dash_count; //!< dash count (if necessary)
bool M_final_action; //!< if this value is true, this action is the final one of action chain.
const char * M_description; //!< description message for debugging purpose
// not used
CooperativeAction();
CooperativeAction( const CooperativeAction & );
CooperativeAction & operator=( const CooperativeAction & );
protected:
/*!
\brief construct with necessary variables
\param category action category type
\param player_unum action executor player's unum
\param target_point action target point
\param duration_step this action's duration step
\param description description message (must be a literal character string)
*/
CooperativeAction( const ActionCategory & category,
const int player_unum,
const rcsc::Vector2D & target_point,
const int duration_step,
const char * description );
void setCategory( const ActionCategory & category );
void setPlayerUnum( const int unum );
void setTargetPlayerUnum( const int unum );
void setTargetPoint( const rcsc::Vector2D & point );
public:
/*!
\brief virtual destructor.
*/
virtual
~CooperativeAction()
{ }
void setIndex( const int i ) { M_index = i; }
void setFirstBallSpeed( const double & speed );
void setFirstTurnMoment( const double & moment );
void setFirstDashPower( const double & power );
void setFirstDashAngle( const rcsc::AngleDeg & angle );
void setDurationStep( const int duration_step );
void setKickCount( const int count );
void setTurnCount( const int count );
void setDashCount( const int count );
void setFinalAction( const bool on );
void setDescription( const char * description );
/*!
*/
const ActionCategory & category() const { return M_category; }
/*!
*/
int index() const { return M_index; }
/*!
*/
const char * description() const { return M_description; }
/*!
*/
int playerUnum() const { return M_player_unum; }
/*!
*/
int targetPlayerUnum() const { return M_target_player_unum; }
/*!
*/
const rcsc::Vector2D & targetPoint() const { return M_target_point; }
/*!
*/
const double & firstBallSpeed() const { return M_first_ball_speed; }
/*!
*/
const double & firstTurnMoment() const { return M_first_turn_moment; }
/*!
*/
const double & firstDashPower() const { return M_first_dash_power; }
/*!
*/
const rcsc::AngleDeg & firstDashAngle() const { return M_first_dash_angle; }
/*!
*/
int durationStep() const { return M_duration_step; }
/*!
*/
int kickCount() const { return M_kick_count; }
/*!
*/
int turnCount() const { return M_turn_count; }
/*!
*/
int dashCount() const { return M_dash_count; }
/*!
*/
bool isFinalAction() const { return M_final_action; }
//
//
//
struct DistCompare {
const rcsc::Vector2D pos_;
private:
DistCompare();
public:
DistCompare( const rcsc::Vector2D & pos )
: pos_( pos )
{ }
bool operator()( const Ptr & lhs,
const Ptr & rhs ) const
{
return lhs->targetPoint().dist2( pos_ ) < rhs->targetPoint().dist2( pos_ );
}
};
};
#endif
|
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: /Users/ex3ndr/Develop/actor-platform/actor-apps/core/src/main/java/im/actor/model/api/rpc/RequestTerminateSession.java
//
#ifndef _APRequestTerminateSession_H_
#define _APRequestTerminateSession_H_
#include "J2ObjC_header.h"
#include "im/actor/model/network/parser/Request.h"
@class BSBserValues;
@class BSBserWriter;
@class IOSByteArray;
#define APRequestTerminateSession_HEADER 82
@interface APRequestTerminateSession : APRequest
#pragma mark Public
- (instancetype)init;
- (instancetype)initWithInt:(jint)id_;
+ (APRequestTerminateSession *)fromBytesWithByteArray:(IOSByteArray *)data;
- (jint)getHeaderKey;
- (jint)getId;
- (void)parseWithBSBserValues:(BSBserValues *)values;
- (void)serializeWithBSBserWriter:(BSBserWriter *)writer;
- (NSString *)description;
@end
J2OBJC_EMPTY_STATIC_INIT(APRequestTerminateSession)
J2OBJC_STATIC_FIELD_GETTER(APRequestTerminateSession, HEADER, jint)
FOUNDATION_EXPORT APRequestTerminateSession *APRequestTerminateSession_fromBytesWithByteArray_(IOSByteArray *data);
FOUNDATION_EXPORT void APRequestTerminateSession_initWithInt_(APRequestTerminateSession *self, jint id_);
FOUNDATION_EXPORT APRequestTerminateSession *new_APRequestTerminateSession_initWithInt_(jint id_) NS_RETURNS_RETAINED;
FOUNDATION_EXPORT void APRequestTerminateSession_init(APRequestTerminateSession *self);
FOUNDATION_EXPORT APRequestTerminateSession *new_APRequestTerminateSession_init() NS_RETURNS_RETAINED;
J2OBJC_TYPE_LITERAL_HEADER(APRequestTerminateSession)
typedef APRequestTerminateSession ImActorModelApiRpcRequestTerminateSession;
#endif // _APRequestTerminateSession_H_
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkVisibilitySort.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*
* Copyright 2003 Sandia Corporation.
* Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
* license for use of this work by or on behalf of the
* U.S. Government. Redistribution and use in source and binary forms, with
* or without modification, are permitted provided that this Notice and any
* statement of authorship are reproduced on all copies.
*/
// .NAME vtkVisibilitySort - Abstract class that can sort cell data along a viewpoint.
//
// .SECTION Description
// vtkVisibilitySort encapsulates a method for depth sorting the cells of a
// vtkDataSet for a given viewpoint. It should be noted that subclasses
// are not required to give an absolutely correct sorting. Many types of
// unstructured grids may have sorting cycles, meaning that there is no
// possible correct sorting. Some subclasses also only give an approximate
// sorting in the interest of speed.
//
// .SECTION Note
// The Input field of this class tends to causes reference cycles. To help
// break these cycles, garbage collection is enabled on this object and the
// input parameter is traced. For this to work, though, an object in the
// loop holding the visibility sort should also report that to the garbage
// collector.
//
#ifndef __vtkVisibilitySort_h
#define __vtkVisibilitySort_h
#include "vtkObject.h"
class vtkIdTypeArray;
class vtkDataSet;
class vtkMatrix4x4;
class vtkCamera;
class VTK_RENDERING_EXPORT vtkVisibilitySort : public vtkObject
{
public:
vtkTypeMacro(vtkVisibilitySort, vtkObject);
virtual void PrintSelf(ostream &os, vtkIndent indent);
// Description:
// To facilitate incremental sorting algorithms, the cells are retrieved
// in an iteration process. That is, call InitTraversal to start the
// iteration and call GetNextCells to get the cell IDs in order.
// However, for efficiencies sake, GetNextCells returns an ordered list
// of several id's in once call (but not necessarily all). GetNextCells
// will return NULL once the entire sorted list is output. The
// vtkIdTypeArray returned from GetNextCells is a cached array, so do not
// delete it. At the same note, do not expect the array to be valid
// after subsequent calls to GetNextCells.
virtual void InitTraversal() = 0;
virtual vtkIdTypeArray *GetNextCells() = 0;
// Description:
// Set/Get the maximum number of cells that GetNextCells will return
// in one invocation.
vtkSetClampMacro(MaxCellsReturned, int, 1, VTK_LARGE_INTEGER);
vtkGetMacro(MaxCellsReturned, int);
// Description:
// Set/Get the matrix that transforms from object space to world space.
// Generally, you get this matrix from a call to GetMatrix of a vtkProp3D
// (vtkActor).
virtual void SetModelTransform(vtkMatrix4x4 *mat);
vtkGetObjectMacro(ModelTransform, vtkMatrix4x4);
vtkGetObjectMacro(InverseModelTransform, vtkMatrix4x4);
// Description:
// Set/Get the camera that specifies the viewing parameters.
virtual void SetCamera(vtkCamera *camera);
vtkGetObjectMacro(Camera, vtkCamera);
// Description:
// Set/Get the data set containing the cells to sort.
virtual void SetInput(vtkDataSet *data);
vtkGetObjectMacro(Input, vtkDataSet);
// Description:
// Set/Get the sorting direction. Be default, the direction is set
// to back to front.
vtkGetMacro(Direction, int);
vtkSetMacro(Direction, int);
void SetDirectionToBackToFront() { this->SetDirection(BACK_TO_FRONT); }
void SetDirectionToFrontToBack() { this->SetDirection(FRONT_TO_BACK); }
//BTX
enum { BACK_TO_FRONT, FRONT_TO_BACK };
//ETX
// Description:
// Overwritten to enable garbage collection.
virtual void Register(vtkObjectBase *o);
virtual void UnRegister(vtkObjectBase *o);
protected:
vtkVisibilitySort();
virtual ~vtkVisibilitySort();
vtkTimeStamp LastSortTime;
vtkMatrix4x4 *ModelTransform;
vtkMatrix4x4 *InverseModelTransform;
vtkCamera *Camera;
vtkDataSet *Input;
int MaxCellsReturned;
int Direction;
virtual void ReportReferences(vtkGarbageCollector *collector);
private:
vtkVisibilitySort(const vtkVisibilitySort &); // Not implemented.
void operator=(const vtkVisibilitySort &); // Not implemented.
};
#endif //__vtkVisibilitySort_h
|
/*
* Page cache for QEMU
* The cache is base on a hash of the page address
*
* Copyright 2012 Red Hat, Inc. and/or its affiliates
*
* Authors:
* Orit Wasserman <owasserm@redhat.com>
*
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*
*/
#include "qemu/osdep.h"
#include "qapi/qmp/qerror.h"
#include "qapi/error.h"
#include "qemu/host-utils.h"
#include "page_cache.h"
#ifdef DEBUG_CACHE
#define DPRINTF(fmt, ...) \
do { fprintf(stdout, "cache: " fmt, ## __VA_ARGS__); } while (0)
#else
#define DPRINTF(fmt, ...) \
do { } while (0)
#endif
/* the page in cache will not be replaced in two cycles */
#define CACHED_PAGE_LIFETIME 2
typedef struct CacheItem CacheItem;
struct CacheItem {
uint64_t it_addr;
uint64_t it_age;
uint8_t *it_data;
};
struct PageCache {
CacheItem *page_cache;
size_t page_size;
size_t max_num_items;
size_t num_items;
};
PageCache *cache_init(int64_t new_size, size_t page_size, Error **errp)
{
int64_t i;
size_t num_pages = new_size / page_size;
PageCache *cache;
if (new_size < page_size) {
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",
"is smaller than one target page size");
return NULL;
}
/* round down to the nearest power of 2 */
if (!is_power_of_2(num_pages)) {
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",
"is not a power of two number of pages");
return NULL;
}
/* We prefer not to abort if there is no memory */
cache = g_try_malloc(sizeof(*cache));
if (!cache) {
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",
"Failed to allocate cache");
return NULL;
}
cache->page_size = page_size;
cache->num_items = 0;
cache->max_num_items = num_pages;
DPRINTF("Setting cache buckets to %" PRId64 "\n", cache->max_num_items);
/* We prefer not to abort if there is no memory */
cache->page_cache = g_try_malloc((cache->max_num_items) *
sizeof(*cache->page_cache));
if (!cache->page_cache) {
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",
"Failed to allocate page cache");
g_free(cache);
return NULL;
}
for (i = 0; i < cache->max_num_items; i++) {
cache->page_cache[i].it_data = NULL;
cache->page_cache[i].it_age = 0;
cache->page_cache[i].it_addr = -1;
}
return cache;
}
void cache_fini(PageCache *cache)
{
int64_t i;
g_assert(cache);
g_assert(cache->page_cache);
for (i = 0; i < cache->max_num_items; i++) {
g_free(cache->page_cache[i].it_data);
}
g_free(cache->page_cache);
cache->page_cache = NULL;
g_free(cache);
}
static size_t cache_get_cache_pos(const PageCache *cache,
uint64_t address)
{
g_assert(cache->max_num_items);
return (address / cache->page_size) & (cache->max_num_items - 1);
}
static CacheItem *cache_get_by_addr(const PageCache *cache, uint64_t addr)
{
size_t pos;
g_assert(cache);
g_assert(cache->page_cache);
pos = cache_get_cache_pos(cache, addr);
return &cache->page_cache[pos];
}
uint8_t *get_cached_data(const PageCache *cache, uint64_t addr)
{
return cache_get_by_addr(cache, addr)->it_data;
}
bool cache_is_cached(const PageCache *cache, uint64_t addr,
uint64_t current_age)
{
CacheItem *it;
it = cache_get_by_addr(cache, addr);
if (it->it_addr == addr) {
/* update the it_age when the cache hit */
it->it_age = current_age;
return true;
}
return false;
}
int cache_insert(PageCache *cache, uint64_t addr, const uint8_t *pdata,
uint64_t current_age)
{
CacheItem *it;
/* actual update of entry */
it = cache_get_by_addr(cache, addr);
if (it->it_data && it->it_addr != addr &&
it->it_age + CACHED_PAGE_LIFETIME > current_age) {
/* the cache page is fresh, don't replace it */
return -1;
}
/* allocate page */
if (!it->it_data) {
it->it_data = g_try_malloc(cache->page_size);
if (!it->it_data) {
DPRINTF("Error allocating page\n");
return -1;
}
cache->num_items++;
}
memcpy(it->it_data, pdata, cache->page_size);
it->it_age = current_age;
it->it_addr = addr;
return 0;
}
|
// -*- c++ -*-
//
// Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
// University Research and Technology
// Corporation. All rights reserved.
// Copyright (c) 2004-2005 The University of Tennessee and The University
// of Tennessee Research Foundation. All rights
// reserved.
// Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
// University of Stuttgart. All rights reserved.
// Copyright (c) 2004-2005 The Regents of the University of California.
// All rights reserved.
// $COPYRIGHT$
//
// Additional copyrights may follow
//
// $HEADER$
//
class Exception {
public:
#if 0 /* OMPI_ENABLE_MPI_PROFILING */
inline Exception(int ec) : pmpi_exception(ec) { }
int Get_error_code() const;
int Get_error_class() const;
const char* Get_error_string() const;
#else
inline Exception(int ec) : error_code(ec), error_string(0), error_class(-1) {
(void)MPI_Error_class(error_code, &error_class);
int resultlen;
error_string = new char[MAX_ERROR_STRING];
(void)MPI_Error_string(error_code, error_string, &resultlen);
}
inline ~Exception() {
delete[] error_string;
}
// Better put in a copy constructor here since we have a string;
// copy by value (from the default copy constructor) would be
// disasterous.
inline Exception(const Exception& a)
: error_code(a.error_code), error_class(a.error_class)
{
error_string = new char[MAX_ERROR_STRING];
// Rather that force an include of <string.h>, especially this
// late in the game (recall that this file is included deep in
// other .h files), we'll just do the copy ourselves.
for (int i = 0; i < MAX_ERROR_STRING; i++)
error_string[i] = a.error_string[i];
}
inline int Get_error_code() const { return error_code; }
inline int Get_error_class() const { return error_class; }
inline const char* Get_error_string() const { return error_string; }
#endif
protected:
#if 0 /* OMPI_ENABLE_MPI_PROFILING */
PMPI::Exception pmpi_exception;
#else
int error_code;
char* error_string;
int error_class;
#endif
};
|
// $Id: SOCK_Netlink.h 80826 2008-03-04 14:51:23Z wotte $
//=============================================================================
/**
* @file SOCK_Netlink.h
*
* $Id: SOCK_Netlink.h 80826 2008-03-04 14:51:23Z wotte $
*
* @author Robert Iakobashvilli <coroberti@gmail.com>
* @author Raz Ben Yehuda <raziebe@013.net.il>
*/
//=============================================================================
#ifndef ACE_SOCK_NETLINK_H
#define ACE_SOCK_NETLINK_H
#include /**/ "ace/pre.h"
#include /**/ "ace/config-all.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#ifdef ACE_HAS_NETLINK
#include "ace/SOCK.h"
#include "ace/Netlink_Addr.h"
#include "ace/Addr.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/**
* @class ACE_SOCK_Netlink
*
* @brief Defines the member functions for the ACE_SOCK Netlink
* abstraction.
* Netlink sockets are used in Linux as a communication facilty of kernel to user
* and user to kernel.
* This code was created so one could use ACE reactor
* as a gateway to a linux kernel.
*
*/
class ACE_Export ACE_SOCK_Netlink : public ACE_SOCK {
public:
// = Initialization and termination methods.
/// Default constructor.
ACE_SOCK_Netlink(void);
~ACE_SOCK_Netlink(void);
ACE_SOCK_Netlink (ACE_Netlink_Addr &local,
int protocol_family,
int protocol);
/**
* opens a RAW socket over an ACE_SOCK and binds it
*
**/
int open (ACE_Netlink_Addr &local,
int protocol_family,
int protocol);
/**
* receives abuffer with the size n
*/
ssize_t recv (void *buf,
size_t n,
int flags) const;
/**
* send a buffer of size n bytes
*
*/
ssize_t send (void *buf,
size_t n,
int flags) const;
/**
* Recieves an iovec of size @a n to the netlink socket
*/
ssize_t recv (iovec iov[],
int n,
ACE_Addr &addr,
int flags = 0) const;
/**
* Sends an iovec of size @a n to the netlink socket
*/
ssize_t send (const iovec iov[],
int n,
const ACE_Addr &addr,
int flags = 0) const;
/// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
};
ACE_END_VERSIONED_NAMESPACE_DECL
#if defined (__ACE_INLINE__)
#include "ace/SOCK_Netlink.inl"
#endif /* __ACE_INLINE__ */
#endif /* ACE_HAS_NETLINK */
#include /**/ "ace/post.h"
#endif /* ACE_SOCK_NETLINK_H */
|
/* { dg-compile } */
typedef int __attribute__((vector_size(16))) v4si;
typedef float __attribute__((vector_size(16))) v4sf;
v4si
toint (v4sf a)
{
v4si out = (v4si){ (int)a[0], (int)a[1], (int)a[2], (int)a[3] };
return out;
}
/* { dg-final { scan-assembler-times "vcfeb\t%v24,%v24,0,5" 1 } } */
v4sf
tofloat (v4si a)
{
v4sf out = (v4sf){ (float)a[0], (float)a[1], (float)a[2], (float)a[3] };
return out;
}
/* { dg-final { scan-assembler-times "vcefb\t%v24,%v24,0,0" 1 } } */
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* 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 <https://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* FELIXprinters v2.0/3.0 (RAMPS v1.4) pin assignments
*/
#if HOTENDS > 2 || E_STEPPERS > 2
#error "Felix 2.0+ supports up to 2 hotends / E-steppers. Comment out this line to continue."
#endif
#define BOARD_INFO_NAME "Felix 2.0+"
//
// Heaters / Fans
//
// Power outputs EFBF or EFBE
#define MOSFET_D_PIN 7
#include "pins_RAMPS.h"
//
// Misc. Functions
//
#define SDPOWER_PIN 1
#define PS_ON_PIN 12
//
// LCD / Controller
//
#if IS_ULTRA_LCD && IS_NEWPANEL
#define SD_DETECT_PIN 6
#endif
//
// M3/M4/M5 - Spindle/Laser Control
//
#undef SPINDLE_LASER_PWM_PIN // Definitions in pins_RAMPS.h are not valid with this board
#undef SPINDLE_LASER_ENA_PIN
#undef SPINDLE_DIR_PIN
|
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
/*
* lpc_masking_model.h
*
* LPC functions
*
*/
#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_SOURCE_LPC_MASKING_MODEL_H_
#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_SOURCE_LPC_MASKING_MODEL_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "structs.h"
void WebRtcIsacfix_GetVars(const int16_t *input,
const int16_t *pitchGains_Q12,
uint32_t *oldEnergy,
int16_t *varscale);
void WebRtcIsacfix_GetLpcCoef(int16_t *inLoQ0,
int16_t *inHiQ0,
MaskFiltstr_enc *maskdata,
int16_t snrQ10,
const int16_t *pitchGains_Q12,
int32_t *gain_lo_hiQ17,
int16_t *lo_coeffQ15,
int16_t *hi_coeffQ15);
typedef int32_t (*CalculateResidualEnergy)(int lpc_order,
int32_t q_val_corr,
int q_val_polynomial,
int16_t* a_polynomial,
int32_t* corr_coeffs,
int* q_val_residual_energy);
extern CalculateResidualEnergy WebRtcIsacfix_CalculateResidualEnergy;
int32_t WebRtcIsacfix_CalculateResidualEnergyC(int lpc_order,
int32_t q_val_corr,
int q_val_polynomial,
int16_t* a_polynomial,
int32_t* corr_coeffs,
int* q_val_residual_energy);
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON)
int32_t WebRtcIsacfix_CalculateResidualEnergyNeon(int lpc_order,
int32_t q_val_corr,
int q_val_polynomial,
int16_t* a_polynomial,
int32_t* corr_coeffs,
int* q_val_residual_energy);
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_SOURCE_LPC_MASKING_MODEL_H_ */
|
/**
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#ifndef _SYSTEMTOPOLOGY_H_
#define _SYSTEMTOPOLOGY_H_
#include <apiset.h>
#include <apisetcconv.h>
#include <minwindef.h>
#include <minwinbase.h>
#ifdef __cplusplus
extern "C" {
#endif
#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
WINBASEAPI WINBOOL WINAPI GetNumaHighestNodeNumber (PULONG HighestNodeNumber);
#if _WIN32_WINNT >= 0x0601
WINBASEAPI WINBOOL WINAPI GetNumaNodeProcessorMaskEx (USHORT Node, PGROUP_AFFINITY ProcessorMask);
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif
|
/* Prefer faster, non-thread-safe stdio functions if available.
Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CSSTokenizer_h
#define CSSTokenizer_h
#include "core/CoreExport.h"
#include "core/css/parser/CSSParserToken.h"
#include "core/html/parser/InputStreamPreprocessor.h"
#include "wtf/text/WTFString.h"
#include <climits>
namespace blink {
class CSSTokenizerInputStream;
class CSSParserObserverWrapper;
struct CSSParserString;
class CSSParserTokenRange;
class CORE_EXPORT CSSTokenizer {
WTF_MAKE_NONCOPYABLE(CSSTokenizer);
WTF_MAKE_FAST_ALLOCATED(CSSTokenizer);
public:
class CORE_EXPORT Scope {
public:
Scope(const String&);
Scope(const String&, CSSParserObserverWrapper&); // For the inspector
CSSParserTokenRange tokenRange();
unsigned tokenCount();
private:
void storeString(const String& string) { m_stringPool.append(string); }
Vector<CSSParserToken> m_tokens;
// We only allocate strings when escapes are used.
Vector<String> m_stringPool;
String m_string;
friend class CSSTokenizer;
};
private:
CSSTokenizer(CSSTokenizerInputStream&, Scope&);
CSSParserToken nextToken();
UChar consume();
void consume(unsigned);
void reconsume(UChar);
CSSParserToken consumeNumericToken();
CSSParserToken consumeIdentLikeToken();
CSSParserToken consumeNumber();
CSSParserToken consumeStringTokenUntil(UChar);
CSSParserToken consumeUnicodeRange();
CSSParserToken consumeUrlToken();
void consumeBadUrlRemnants();
void consumeUntilNonWhitespace();
void consumeSingleWhitespaceIfNext();
void consumeUntilCommentEndFound();
bool consumeIfNext(UChar);
CSSParserString consumeName();
UChar32 consumeEscape();
bool nextTwoCharsAreValidEscape();
bool nextCharsAreNumber(UChar);
bool nextCharsAreNumber();
bool nextCharsAreIdentifier(UChar);
bool nextCharsAreIdentifier();
CSSParserToken blockStart(CSSParserTokenType);
CSSParserToken blockStart(CSSParserTokenType blockType, CSSParserTokenType, CSSParserString);
CSSParserToken blockEnd(CSSParserTokenType, CSSParserTokenType startType);
typedef CSSParserToken (CSSTokenizer::*CodePoint)(UChar);
static const CodePoint codePoints[];
Vector<CSSParserTokenType> m_blockStack;
CSSParserToken whiteSpace(UChar);
CSSParserToken leftParenthesis(UChar);
CSSParserToken rightParenthesis(UChar);
CSSParserToken leftBracket(UChar);
CSSParserToken rightBracket(UChar);
CSSParserToken leftBrace(UChar);
CSSParserToken rightBrace(UChar);
CSSParserToken plusOrFullStop(UChar);
CSSParserToken comma(UChar);
CSSParserToken hyphenMinus(UChar);
CSSParserToken asterisk(UChar);
CSSParserToken lessThan(UChar);
CSSParserToken solidus(UChar);
CSSParserToken colon(UChar);
CSSParserToken semiColon(UChar);
CSSParserToken hash(UChar);
CSSParserToken circumflexAccent(UChar);
CSSParserToken dollarSign(UChar);
CSSParserToken verticalLine(UChar);
CSSParserToken tilde(UChar);
CSSParserToken commercialAt(UChar);
CSSParserToken reverseSolidus(UChar);
CSSParserToken asciiDigit(UChar);
CSSParserToken letterU(UChar);
CSSParserToken nameStart(UChar);
CSSParserToken stringStart(UChar);
CSSParserToken endOfFile(UChar);
CSSParserString registerString(const String&);
CSSTokenizerInputStream& m_input;
Scope& m_scope;
};
} // namespace blink
#endif // CSSTokenizer_h
|
/*
* fstat() - POSIX 1003.1b 5.6.2 - Get File Status
*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.org/license/LICENSE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <rtems/libio_.h>
#include <rtems/seterr.h>
int fstat(
int fd,
struct stat *sbuf
)
{
rtems_libio_t *iop;
/*
* Check to see if we were passed a valid pointer.
*/
if ( !sbuf )
rtems_set_errno_and_return_minus_one( EFAULT );
/*
* Now process the stat() request.
*/
iop = rtems_libio_iop( fd );
rtems_libio_check_fd( fd );
rtems_libio_check_is_open(iop);
/*
* Zero out the stat structure so the various support
* versions of stat don't have to.
*/
memset( sbuf, 0, sizeof(struct stat) );
return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf );
}
/*
* _fstat_r
*
* This is the Newlib dependent reentrant version of fstat().
*/
#if defined(RTEMS_NEWLIB) && !defined(HAVE_FSTAT_R)
#include <reent.h>
int _fstat_r(
struct _reent *ptr __attribute__((unused)),
int fd,
struct stat *buf
)
{
return fstat( fd, buf );
}
#endif
|
/* The IGEN simulator generator for GDB, the GNU Debugger.
Copyright 2002, 2007 Free Software Foundation, Inc.
Contributed by Andrew Cagney.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
void print_idecode_issue_function_header
(lf *file,
const char *processor,
function_decl_type decl_type, int nr_prefetched_words);
void print_idecode_globals (lf *file);
void print_idecode_lookups
(lf *file, gen_entry *table, cache_entry *cache_rules);
void print_idecode_body (lf *file, gen_entry *table, const char *result);
/* Output code to do any final checks on the decoded instruction.
This includes things like verifying any on decoded fields have the
correct value and checking that (for floating point) floating point
hardware isn't disabled */
extern void print_idecode_validate
(lf *file, insn_entry * instruction, insn_opcodes *opcode_paths);
|
/*
* Version macros.
*
* This file is part of libswresample
*
* libswresample 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.
*
* libswresample 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 libswresample; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef SWRESAMPLE_VERSION_H
#define SWRESAMPLE_VERSION_H
/**
* @file
* Libswresample version macros
*/
#include "libavutil/avutil.h"
#define LIBSWRESAMPLE_VERSION_MAJOR 2
#define LIBSWRESAMPLE_VERSION_MINOR 4
#define LIBSWRESAMPLE_VERSION_MICRO 100
#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
LIBSWRESAMPLE_VERSION_MINOR, \
LIBSWRESAMPLE_VERSION_MICRO)
#define LIBSWRESAMPLE_VERSION AV_VERSION(LIBSWRESAMPLE_VERSION_MAJOR, \
LIBSWRESAMPLE_VERSION_MINOR, \
LIBSWRESAMPLE_VERSION_MICRO)
#define LIBSWRESAMPLE_BUILD LIBSWRESAMPLE_VERSION_INT
#define LIBSWRESAMPLE_IDENT "SwR" AV_STRINGIFY(LIBSWRESAMPLE_VERSION)
#endif /* SWRESAMPLE_VERSION_H */
|
/*
* Copyright (C) 2007-2009 Sourcefire, Inc.
*
* Authors: Tomasz Kojm
*
* 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 __MANAGER_H
#define __MANAGER_H
#include "shared/optparser.h"
int scanmanager(const struct optstruct *opts);
#endif
|
/*
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* (C) 2000 Dirk Mueller (mueller@kde.org)
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef FormAssociatedElement_h
#define FormAssociatedElement_h
#include "core/CoreExport.h"
#include "platform/heap/Handle.h"
#include "wtf/WeakPtr.h"
#include "wtf/text/WTFString.h"
namespace blink {
class ContainerNode;
class Document;
class FormAttributeTargetObserver;
class FormDataList;
class HTMLElement;
class HTMLFormElement;
class Node;
class ValidityState;
class CORE_EXPORT FormAssociatedElement : public WillBeGarbageCollectedMixin {
public:
virtual ~FormAssociatedElement();
#if !ENABLE(OILPAN)
void ref() { refFormAssociatedElement(); }
void deref() { derefFormAssociatedElement(); }
#endif
static HTMLFormElement* findAssociatedForm(const HTMLElement*);
HTMLFormElement* form() const { return m_form.get(); }
ValidityState* validity();
virtual bool isFormControlElement() const = 0;
virtual bool isFormControlElementWithState() const;
virtual bool isEnumeratable() const = 0;
virtual bool isLabelElement() const { return false; }
// Returns the 'name' attribute value. If this element has no name
// attribute, it returns an empty string instead of null string.
// Note that the 'name' IDL attribute doesn't use this function.
virtual const AtomicString& name() const;
// Override in derived classes to get the encoded name=value pair for submitting.
// Return true for a successful control (see HTML4-17.13.2).
virtual bool appendFormData(FormDataList&, bool) { return false; }
void resetFormOwner();
void formRemovedFromTree(const Node& formRoot);
// ValidityState attribute implementations
bool customError() const;
// Override functions for patterMismatch, rangeOverflow, rangerUnderflow,
// stepMismatch, tooLong, tooShort and valueMissing must call willValidate method.
virtual bool hasBadInput() const;
virtual bool patternMismatch() const;
virtual bool rangeOverflow() const;
virtual bool rangeUnderflow() const;
virtual bool stepMismatch() const;
virtual bool tooLong() const;
virtual bool tooShort() const;
virtual bool typeMismatch() const;
virtual bool valueMissing() const;
virtual String validationMessage() const;
bool valid() const;
virtual void setCustomValidity(const String&);
void formAttributeTargetChanged();
typedef WillBeHeapVector<RawPtrWillBeMember<FormAssociatedElement>> List;
DECLARE_VIRTUAL_TRACE();
protected:
FormAssociatedElement();
void insertedInto(ContainerNode*);
void removedFrom(ContainerNode*);
void didMoveToNewDocument(Document& oldDocument);
// FIXME: Remove usage of setForm. resetFormOwner should be enough, and
// setForm is confusing.
void setForm(HTMLFormElement*);
void associateByParser(HTMLFormElement*);
void formAttributeChanged();
// If you add an override of willChangeForm() or didChangeForm() to a class
// derived from this one, you will need to add a call to setForm(0) to the
// destructor of that class.
virtual void willChangeForm();
virtual void didChangeForm();
String customValidationMessage() const;
private:
#if !ENABLE(OILPAN)
virtual void refFormAssociatedElement() = 0;
virtual void derefFormAssociatedElement() = 0;
#endif
void setFormAttributeTargetObserver(PassOwnPtrWillBeRawPtr<FormAttributeTargetObserver>);
void resetFormAttributeTargetObserver();
OwnPtrWillBeMember<FormAttributeTargetObserver> m_formAttributeTargetObserver;
#if ENABLE(OILPAN)
Member<HTMLFormElement> m_form;
#else
WeakPtr<HTMLFormElement> m_form;
#endif
OwnPtrWillBeMember<ValidityState> m_validityState;
String m_customValidationMessage;
// Non-Oilpan: Even if m_formWasSetByParser is true, m_form can be null
// because parentNode is not a strong reference and |this| and m_form don't
// die together.
// Oilpan: If m_formWasSetByParser is true, m_form is always non-null.
bool m_formWasSetByParser;
};
HTMLElement* toHTMLElement(FormAssociatedElement*);
HTMLElement& toHTMLElement(FormAssociatedElement&);
const HTMLElement* toHTMLElement(const FormAssociatedElement*);
const HTMLElement& toHTMLElement(const FormAssociatedElement&);
} // namespace
#endif // FormAssociatedElement_h
|
/*
* Copyright (c) 2018, NXP Semiconductors, Inc.
* All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include "fsl_tempmon.h"
/*******************************************************************************
* Definitions
******************************************************************************/
/* Component ID definition, used by tools. */
#ifndef FSL_COMPONENT_ID
#define FSL_COMPONENT_ID "platform.drivers.tempmon"
#endif
/*! @brief TEMPMON calibration data mask. */
#define TEMPMON_HOTTEMPMASK 0xFFU
#define TEMPMON_HOTTEMPSHIFT 0x00U
#define TEMPMON_HOTCOUNTMASK 0xFFF00U
#define TEMPMON_HOTCOUNTSHIFT 0X08U
#define TEMPMON_ROOMCOUNTMASK 0xFFF00000U
#define TEMPMON_ROOMCOUNTSHIFT 0x14U
/*! @brief the room temperature. */
#define TEMPMON_ROOMTEMP 25.0
/*******************************************************************************
* Prototypes
******************************************************************************/
/*******************************************************************************
* Variables
******************************************************************************/
static uint32_t s_hotTemp; /*!< The value of TEMPMON_TEMPSENSE0[TEMP_VALUE] at room temperature .*/
static uint32_t s_hotCount; /*!< The value of TEMPMON_TEMPSENSE0[TEMP_VALUE] at the hot temperature.*/
static float s_hotT_ROOM; /*!< The value of s_hotTemp minus room temperature(25¡æ).*/
static uint32_t s_roomC_hotC; /*!< The value of s_roomCount minus s_hotCount.*/
/*******************************************************************************
* Code
******************************************************************************/
/*!
* brief Initializes the TEMPMON module.
*
* param base TEMPMON base pointer
* param config Pointer to configuration structure.
*/
void TEMPMON_Init(TEMPMON_Type *base, const tempmon_config_t *config)
{
assert(NULL != config);
uint32_t calibrationData;
uint32_t roomCount;
/* Power on the temperature sensor*/
base->TEMPSENSE0 &= ~TEMPMON_TEMPSENSE0_POWER_DOWN_MASK;
/* Set temperature monitor frequency */
base->TEMPSENSE1 = TEMPMON_TEMPSENSE1_MEASURE_FREQ(config->frequency);
/* ready to read calibration data */
calibrationData = OCOTP->ANA1;
s_hotTemp = (uint32_t)(calibrationData & TEMPMON_HOTTEMPMASK) >> TEMPMON_HOTTEMPSHIFT;
s_hotCount = (uint32_t)(calibrationData & TEMPMON_HOTCOUNTMASK) >> TEMPMON_HOTCOUNTSHIFT;
roomCount = (uint32_t)(calibrationData & TEMPMON_ROOMCOUNTMASK) >> TEMPMON_ROOMCOUNTSHIFT;
s_hotT_ROOM = s_hotTemp - TEMPMON_ROOMTEMP;
s_roomC_hotC = roomCount - s_hotCount;
/* Set alarm temperature */
TEMPMON_SetTempAlarm(base, config->highAlarmTemp, kTEMPMON_HighAlarmMode);
TEMPMON_SetTempAlarm(base, config->panicAlarmTemp, kTEMPMON_PanicAlarmMode);
TEMPMON_SetTempAlarm(base, config->lowAlarmTemp, kTEMPMON_LowAlarmMode);
}
/*!
* brief Deinitializes the TEMPMON module.
*
* param base TEMPMON base pointer
*/
void TEMPMON_Deinit(TEMPMON_Type *base)
{
base->TEMPSENSE0 |= TEMPMON_TEMPSENSE0_POWER_DOWN_MASK;
}
/*!
* brief Gets the default configuration structure.
*
* This function initializes the TEMPMON configuration structure to a default value. The default
* values are:
* tempmonConfig->frequency = 0x02U;
* tempmonConfig->highAlarmTemp = 44U;
* tempmonConfig->panicAlarmTemp = 90U;
* tempmonConfig->lowAlarmTemp = 39U;
*
* param config Pointer to a configuration structure.
*/
void TEMPMON_GetDefaultConfig(tempmon_config_t *config)
{
assert(config);
/* Initializes the configure structure to zero. */
memset(config, 0, sizeof(*config));
/* Default measure frequency */
config->frequency = 0x03U;
/* Default high alarm temperature */
config->highAlarmTemp = 40U;
/* Default panic alarm temperature */
config->panicAlarmTemp = 90U;
/* Default low alarm temperature */
config->lowAlarmTemp = 20U;
}
/*!
* brief Get current temperature with the fused temperature calibration data.
*
* param base TEMPMON base pointer
* return current temperature with degrees Celsius.
*/
float TEMPMON_GetCurrentTemperature(TEMPMON_Type *base)
{
/* Check arguments */
assert(NULL != base);
uint32_t nmeas;
float tmeas;
while (!(base->TEMPSENSE0 & TEMPMON_TEMPSENSE0_FINISHED_MASK))
{
}
/* ready to read temperature code value */
nmeas = (base->TEMPSENSE0 & TEMPMON_TEMPSENSE0_TEMP_CNT_MASK) >> TEMPMON_TEMPSENSE0_TEMP_CNT_SHIFT;
/* Calculate temperature */
tmeas = s_hotTemp - (float)((nmeas - s_hotCount) * s_hotT_ROOM / s_roomC_hotC);
return tmeas;
}
/*!
* brief Set the temperature count (raw sensor output) that will generate an alarm interrupt.
*
* param base TEMPMON base pointer
* param tempVal The alarm temperature with degrees Celsius
* param alarmMode The alarm mode.
*/
void TEMPMON_SetTempAlarm(TEMPMON_Type *base, uint32_t tempVal, tempmon_alarm_mode alarmMode)
{
/* Check arguments */
assert(NULL != base);
uint32_t tempCodeVal;
/* Calculate alarm temperature code value */
tempCodeVal = (uint32_t)(s_hotCount + (s_hotTemp - tempVal) * s_roomC_hotC / s_hotT_ROOM);
switch (alarmMode)
{
case kTEMPMON_HighAlarmMode:
/* Set high alarm temperature code value */
base->TEMPSENSE0 |= TEMPMON_TEMPSENSE0_ALARM_VALUE(tempCodeVal);
break;
case kTEMPMON_PanicAlarmMode:
/* Set panic alarm temperature code value */
base->TEMPSENSE2 |= TEMPMON_TEMPSENSE2_PANIC_ALARM_VALUE(tempCodeVal);
break;
case kTEMPMON_LowAlarmMode:
/* Set low alarm temperature code value */
base->TEMPSENSE2 |= TEMPMON_TEMPSENSE2_LOW_ALARM_VALUE(tempCodeVal);
break;
default:
assert(false);
break;
}
}
|
// Copyright 2006-2013 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This module contains the architecture-specific code. This make the rest of
// the code less dependent on differences between different processor
// architecture.
// The classes have the same definition for all architectures. The
// implementation for a particular architecture is put in cpu_<arch>.cc.
// The build system then uses the implementation for the target architecture.
//
#ifndef V8_BASE_CPU_H_
#define V8_BASE_CPU_H_
#include "src/base/macros.h"
namespace v8 {
namespace base {
// ----------------------------------------------------------------------------
// CPU
//
// Query information about the processor.
//
// This class also has static methods for the architecture specific functions.
// Add methods here to cope with differences between the supported
// architectures. For each architecture the file cpu_<arch>.cc contains the
// implementation of these static functions.
class CPU FINAL {
public:
CPU();
// x86 CPUID information
const char* vendor() const { return vendor_; }
int stepping() const { return stepping_; }
int model() const { return model_; }
int ext_model() const { return ext_model_; }
int family() const { return family_; }
int ext_family() const { return ext_family_; }
int type() const { return type_; }
// arm implementer/part information
int implementer() const { return implementer_; }
static const int ARM = 0x41;
static const int NVIDIA = 0x4e;
static const int QUALCOMM = 0x51;
int architecture() const { return architecture_; }
int variant() const { return variant_; }
static const int NVIDIA_DENVER = 0x0;
int part() const { return part_; }
// ARM-specific part codes
static const int ARM_CORTEX_A5 = 0xc05;
static const int ARM_CORTEX_A7 = 0xc07;
static const int ARM_CORTEX_A8 = 0xc08;
static const int ARM_CORTEX_A9 = 0xc09;
static const int ARM_CORTEX_A12 = 0xc0c;
static const int ARM_CORTEX_A15 = 0xc0f;
// PPC-specific part codes
enum {
PPC_POWER5,
PPC_POWER6,
PPC_POWER7,
PPC_POWER8,
PPC_G4,
PPC_G5,
PPC_PA6T
};
// General features
bool has_fpu() const { return has_fpu_; }
// x86 features
bool has_cmov() const { return has_cmov_; }
bool has_sahf() const { return has_sahf_; }
bool has_mmx() const { return has_mmx_; }
bool has_sse() const { return has_sse_; }
bool has_sse2() const { return has_sse2_; }
bool has_sse3() const { return has_sse3_; }
bool has_ssse3() const { return has_ssse3_; }
bool has_sse41() const { return has_sse41_; }
bool has_sse42() const { return has_sse42_; }
bool has_osxsave() const { return has_osxsave_; }
bool has_avx() const { return has_avx_; }
bool has_fma3() const { return has_fma3_; }
bool is_atom() const { return is_atom_; }
// arm features
bool has_idiva() const { return has_idiva_; }
bool has_neon() const { return has_neon_; }
bool has_thumb2() const { return has_thumb2_; }
bool has_vfp() const { return has_vfp_; }
bool has_vfp3() const { return has_vfp3_; }
bool has_vfp3_d32() const { return has_vfp3_d32_; }
// mips features
bool is_fp64_mode() const { return is_fp64_mode_; }
private:
char vendor_[13];
int stepping_;
int model_;
int ext_model_;
int family_;
int ext_family_;
int type_;
int implementer_;
int architecture_;
int variant_;
int part_;
bool has_fpu_;
bool has_cmov_;
bool has_sahf_;
bool has_mmx_;
bool has_sse_;
bool has_sse2_;
bool has_sse3_;
bool has_ssse3_;
bool has_sse41_;
bool has_sse42_;
bool is_atom_;
bool has_osxsave_;
bool has_avx_;
bool has_fma3_;
bool has_idiva_;
bool has_neon_;
bool has_thumb2_;
bool has_vfp_;
bool has_vfp3_;
bool has_vfp3_d32_;
bool is_fp64_mode_;
};
} } // namespace v8::base
#endif // V8_BASE_CPU_H_
|
extern const char g_GIT_SHA1[];
|
/* vi: set sw=4 ts=4: */
/*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
#include "libbb.h"
#include <math.h>
//usage:#define dc_trivial_usage
//usage: "EXPRESSION..."
//usage:
//usage:#define dc_full_usage "\n\n"
//usage: "Tiny RPN calculator. Operations:\n"
//usage: "+, add, -, sub, *, mul, /, div, %, mod, "IF_FEATURE_DC_LIBM("**, exp, ")"and, or, not, xor,\n"
//usage: "p - print top of the stack (without popping),\n"
//usage: "f - print entire stack,\n"
//usage: "o - pop the value and set output radix (must be 10, 16, 8 or 2).\n"
//usage: "Examples: 'dc 2 2 add p' -> 4, 'dc 8 8 mul 2 2 + / p' -> 16"
//usage:
//usage:#define dc_example_usage
//usage: "$ dc 2 2 + p\n"
//usage: "4\n"
//usage: "$ dc 8 8 \\* 2 2 + / p\n"
//usage: "16\n"
//usage: "$ dc 0 1 and p\n"
//usage: "0\n"
//usage: "$ dc 0 1 or p\n"
//usage: "1\n"
//usage: "$ echo 72 9 div 8 mul p | dc\n"
//usage: "64\n"
#if 0
typedef unsigned data_t;
#define DATA_FMT ""
#elif 0
typedef unsigned long data_t;
#define DATA_FMT "l"
#else
typedef unsigned long long data_t;
#define DATA_FMT "ll"
#endif
struct globals {
unsigned pointer;
unsigned base;
double stack[1];
} FIX_ALIASING;
enum { STACK_SIZE = (COMMON_BUFSIZE - offsetof(struct globals, stack)) / sizeof(double) };
#define G (*(struct globals*)&bb_common_bufsiz1)
#define pointer (G.pointer )
#define base (G.base )
#define stack (G.stack )
#define INIT_G() do { \
base = 10; \
} while (0)
static void check_under(void)
{
if (pointer == 0)
bb_error_msg_and_die("stack underflow");
}
static void push(double a)
{
if (pointer >= STACK_SIZE)
bb_error_msg_and_die("stack overflow");
stack[pointer++] = a;
}
static double pop(void)
{
check_under();
return stack[--pointer];
}
static void add(void)
{
push(pop() + pop());
}
static void sub(void)
{
double subtrahend = pop();
push(pop() - subtrahend);
}
static void mul(void)
{
push(pop() * pop());
}
#if ENABLE_FEATURE_DC_LIBM
static void power(void)
{
double topower = pop();
push(pow(pop(), topower));
}
#endif
static void divide(void)
{
double divisor = pop();
push(pop() / divisor);
}
static void mod(void)
{
data_t d = pop();
push((data_t) pop() % d);
}
static void and(void)
{
push((data_t) pop() & (data_t) pop());
}
static void or(void)
{
push((data_t) pop() | (data_t) pop());
}
static void eor(void)
{
push((data_t) pop() ^ (data_t) pop());
}
static void not(void)
{
push(~(data_t) pop());
}
static void set_output_base(void)
{
static const char bases[] ALIGN1 = { 2, 8, 10, 16, 0 };
unsigned b = (unsigned)pop();
base = *strchrnul(bases, b);
if (base == 0) {
bb_error_msg("error, base %u is not supported", b);
base = 10;
}
}
static void print_base(double print)
{
data_t x, i;
x = (data_t) print;
if (base == 10) {
if (x == print) /* exactly representable as unsigned integer */
printf("%"DATA_FMT"u\n", x);
else
printf("%g\n", print);
return;
}
switch (base) {
case 16:
printf("%"DATA_FMT"x\n", x);
break;
case 8:
printf("%"DATA_FMT"o\n", x);
break;
default: /* base 2 */
i = MAXINT(data_t) - (MAXINT(data_t) >> 1);
/* i is 100000...00000 */
do {
if (x & i)
break;
i >>= 1;
} while (i > 1);
do {
bb_putchar('1' - !(x & i));
i >>= 1;
} while (i);
bb_putchar('\n');
}
}
static void print_stack_no_pop(void)
{
unsigned i = pointer;
while (i)
print_base(stack[--i]);
}
static void print_no_pop(void)
{
check_under();
print_base(stack[pointer-1]);
}
struct op {
const char name[4];
void (*function) (void);
};
static const struct op operators[] = {
#if ENABLE_FEATURE_DC_LIBM
{"**", power},
{"exp", power},
{"pow", power},
#endif
{"%", mod},
{"mod", mod},
{"and", and},
{"or", or},
{"not", not},
{"eor", eor},
{"xor", eor},
{"+", add},
{"add", add},
{"-", sub},
{"sub", sub},
{"*", mul},
{"mul", mul},
{"/", divide},
{"div", divide},
{"p", print_no_pop},
{"f", print_stack_no_pop},
{"o", set_output_base},
};
/* Feed the stack machine */
static void stack_machine(const char *argument)
{
char *end;
double number;
const struct op *o;
next:
number = strtod(argument, &end);
if (end != argument) {
argument = end;
push(number);
goto next;
}
/* We might have matched a digit, eventually advance the argument */
argument = skip_whitespace(argument);
if (*argument == '\0')
return;
o = operators;
do {
char *after_name = is_prefixed_with(argument, o->name);
if (after_name) {
argument = after_name;
o->function();
goto next;
}
o++;
} while (o != operators + ARRAY_SIZE(operators));
bb_error_msg_and_die("syntax error at '%s'", argument);
}
int dc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int dc_main(int argc UNUSED_PARAM, char **argv)
{
INIT_G();
argv++;
if (!argv[0]) {
/* take stuff from stdin if no args are given */
char *line;
while ((line = xmalloc_fgetline(stdin)) != NULL) {
stack_machine(line);
free(line);
}
} else {
do {
stack_machine(*argv);
} while (*++argv);
}
return EXIT_SUCCESS;
}
|
/*
* Copyright (c) 2009 by David Gräff <david.graeff@web.de>
* Copyright (c) 2011 by Maximilian Güntner <maximilian.guentner@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, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* For more information on the GPL, please go to:
* http://www.gnu.org/copyleft/gpl.html
*/
#include <stdlib.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
#include "config.h"
#include "core/debug.h"
#include "core/eeprom.h"
#include "services/cron/cron.h"
#include "protocols/ecmd/ecmd-base.h"
#include "stella.h"
#ifndef TEENSY_SUPPORT
int16_t
parse_cmd_stella_eeprom_store(char *cmd, char *output, uint16_t len)
{
stella_storeToEEROM();
return ECMD_FINAL_OK;
}
int16_t
parse_cmd_stella_eeprom_load(char *cmd, char *output, uint16_t len)
{
stella_loadFromEEROM();
return ECMD_FINAL_OK;
}
#endif /* not TEENSY_SUPPORT */
int16_t
parse_cmd_stella_fadestep(char *cmd, char *output, uint16_t len)
{
if (cmd[0])
{
stella_fade_step = atoi(cmd);
return ECMD_FINAL_OK;
}
else
{
itoa(stella_fade_step, output, 10);
return ECMD_FINAL(strlen(output));
}
}
int16_t
parse_cmd_stella_channels(char *cmd, char *output, uint16_t len)
{
itoa(STELLA_CHANNELS, output, 10);
return ECMD_FINAL(strlen(output));
}
int16_t
parse_cmd_stella_channel(char *cmd, char *output, uint16_t len)
{
char f = 0;
uint8_t ch = 0;
uint8_t value = 0;
// following lines same as: sscanf_P(cmd, PSTR("%u %u %c"), &ch, &value, &f);
while (*cmd && *cmd == ' ')
cmd++; // skip whitespace
if (!*cmd)
{
/* not first argument == return all channels */
static uint8_t chan = 0;
uint8_t ret = 0;
// First return amount of channels with three bytes
if (chan == 0)
{
output[ret++] = ((uint8_t) STELLA_CHANNELS) / 10 + 48;
output[ret++] = ((uint8_t) STELLA_CHANNELS) % 10 + 48;
output[ret++] = '\n';
}
// return channel values
value = stella_getValue(chan);
output[ret + 2] = value % 10 + 48;
value /= 10;
output[ret + 1] = value % 10 + 48;
value /= 10;
output[ret + 0] = value % 10 + 48;
ret += 3;
if (chan < STELLA_CHANNELS - 1)
{
chan++;
return ECMD_AGAIN(ret);
}
else
{
chan = 0;
return ECMD_FINAL(ret);
}
}
ch = atoi(cmd); // save first argument == channel
while (*cmd && *cmd != ' ')
cmd++; // skip value
while (*cmd && *cmd == ' ')
cmd++; // skip whitespace
if (!*cmd)
{
/* no second argument -> get value */
if (ch >= STELLA_CHANNELS)
return ECMD_ERR_PARSE_ERROR;
itoa(stella_getValue(ch), output, 10);
return ECMD_FINAL(strlen(output));
}
value = atoi(cmd);
while (*cmd && *cmd != ' ')
cmd++; // skip value
while (*cmd && *cmd == ' ')
cmd++; // skip whitespace
/* third argument == fade step */
if (*cmd)
{
f = *cmd;
if (f == 's')
f = STELLA_SET_IMMEDIATELY;
else if (f == 'f')
f = STELLA_SET_FADE;
else if (f == 'y')
f = STELLA_SET_FLASHY;
}
if (ch >= STELLA_CHANNELS)
return ECMD_ERR_PARSE_ERROR;
stella_setValue(f, ch, value);
return ECMD_FINAL_OK;
}
/*
-- Ethersex META --
block([[Stella_Light]] commands)
ecmd_ifndef(TEENSY_SUPPORT)
ecmd_feature(stella_eeprom_store, "stella store",, Store values in eeprom)
ecmd_feature(stella_eeprom_load, "stella load",, Load values from eeprom)
ecmd_endif()
ecmd_feature(stella_channels, "channels",, Return stella channel size)
ecmd_feature(stella_channel, "channel", CHANNEL VALUE FUNCTION,Get/Set stella channel to value. Second and third parameters are optional. Function: You may use 's' for instant set, 'f' for fade and 'y' for flashy fade. )
ecmd_feature(stella_fadestep, "fadestep", FADESTEP, Get/Set stella fade step)
*/
|
/* gcc -g -Wall -O2 -o dialog-test dialog-test.c `pkg-config --cflags --libs gtk+-3.0` */
#include <gtk/gtk.h>
static GtkWidget *window;
static GtkWidget *width_chars_spin;
static GtkWidget *max_width_chars_spin;
static GtkWidget *default_width_spin;
static GtkWidget *default_height_spin;
static GtkWidget *resizable_check;
static gboolean
configure_event_cb (GtkWidget *window, GdkEventConfigure *event, GtkLabel *label)
{
gchar *str;
gint width, height;
gtk_window_get_size (GTK_WINDOW (window), &width, &height);
str = g_strdup_printf ("%d x %d", width, height);
gtk_label_set_label (label, str);
g_free (str);
return FALSE;
}
static void
show_dialog (void)
{
GtkWidget *dialog;
GtkWidget *label;
gint width_chars, max_width_chars, default_width, default_height;
gboolean resizable;
width_chars = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (width_chars_spin));
max_width_chars = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (max_width_chars_spin));
default_width = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (default_width_spin));
default_height = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (default_height_spin));
resizable = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (resizable_check));
dialog = gtk_dialog_new_with_buttons ("Test", GTK_WINDOW (window),
GTK_DIALOG_MODAL,
"_Close", GTK_RESPONSE_CANCEL,
NULL);
label = gtk_label_new ("Lorem ipsum dolor sit amet, consectetur adipiscing elit. "
"Nulla innn urna ac dui malesuada ornare. Nullam dictum "
"tempor mi et tincidunt. Aliquam metus nulla, auctor "
"vitae pulvinar nec, egestas at mi. Class aptent taciti "
"sociosqu ad litora torquent per conubia nostra, per "
"inceptos himenaeos. Aliquam sagittis, tellus congue "
"cursus congue, diam massa mollis enim, sit amet gravida "
"magna turpis egestas sapien. Aenean vel molestie nunc. "
"In hac habitasse platea dictumst. Suspendisse lacinia"
"mi eu ipsum vestibulum in venenatis enim commodo. "
"Vivamus non malesuada ligula.");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_width_chars (GTK_LABEL (label), width_chars);
gtk_label_set_max_width_chars (GTK_LABEL (label), max_width_chars);
gtk_window_set_default_size (GTK_WINDOW (dialog), default_width, default_height);
gtk_window_set_resizable (GTK_WINDOW (dialog), resizable);
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
label, 0, TRUE, TRUE);
gtk_widget_show (label);
label = gtk_label_new ("? x ?");
//gtk_widget_show (label);
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), label, GTK_RESPONSE_HELP);
g_signal_connect (dialog, "configure-event",
G_CALLBACK (configure_event_cb), label);
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
}
static void
create_window (void)
{
GtkWidget *grid;
GtkWidget *label;
GtkWidget *button;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Window size");
gtk_container_set_border_width (GTK_CONTAINER (window), 12);
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
grid = gtk_grid_new ();
gtk_grid_set_row_spacing (GTK_GRID (grid), 12);
gtk_grid_set_column_spacing (GTK_GRID (grid), 12);
gtk_container_add (GTK_CONTAINER (window), grid);
label = gtk_label_new ("Width chars");
gtk_widget_set_halign (label, GTK_ALIGN_START);
width_chars_spin = gtk_spin_button_new_with_range (-1, 1000, 1);
gtk_widget_set_halign (width_chars_spin, GTK_ALIGN_START);
gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
gtk_grid_attach (GTK_GRID (grid), width_chars_spin, 1, 0, 1, 1);
label = gtk_label_new ("Max width chars");
gtk_widget_set_halign (label, GTK_ALIGN_START);
max_width_chars_spin = gtk_spin_button_new_with_range (-1, 1000, 1);
gtk_widget_set_halign (width_chars_spin, GTK_ALIGN_START);
gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1);
gtk_grid_attach (GTK_GRID (grid), max_width_chars_spin, 1, 1, 1, 1);
label = gtk_label_new ("Default size");
gtk_widget_set_halign (label, GTK_ALIGN_START);
default_width_spin = gtk_spin_button_new_with_range (-1, 1000, 1);
gtk_widget_set_halign (default_width_spin, GTK_ALIGN_START);
default_height_spin = gtk_spin_button_new_with_range (-1, 1000, 1);
gtk_widget_set_halign (default_height_spin, GTK_ALIGN_START);
gtk_grid_attach (GTK_GRID (grid), label, 0, 2, 1, 1);
gtk_grid_attach (GTK_GRID (grid), default_width_spin, 1, 2, 1, 1);
gtk_grid_attach (GTK_GRID (grid), default_height_spin, 2, 2, 1, 1);
label = gtk_label_new ("Resizable");
gtk_widget_set_halign (label, GTK_ALIGN_START);
resizable_check = gtk_check_button_new ();
gtk_widget_set_halign (resizable_check, GTK_ALIGN_START);
gtk_grid_attach (GTK_GRID (grid), label, 0, 3, 1, 1);
gtk_grid_attach (GTK_GRID (grid), resizable_check, 1, 3, 1, 1);
button = gtk_button_new_with_label ("Show");
g_signal_connect (button, "clicked", G_CALLBACK (show_dialog), NULL);
gtk_grid_attach (GTK_GRID (grid), button, 2, 4, 1, 1);
gtk_widget_show_all (window);
}
int
main (int argc, char *argv[])
{
gtk_init (NULL, NULL);
create_window ();
gtk_main ();
return 0;
}
|
#ifndef __USER_DEVICEFIND_H__
#define __USER_DEVICEFIND_H__
void user_platform_timer_start(char* pbuffer, struct espconn *pespconn);
#endif
|
//#include <errno.h>
#include "codes.h" //fixme
|
/* Copyright 2020 Obosob <obosob@riseup.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifdef OLED_DRIVER_ENABLE
#define OLED_DISPLAY_128X64
#endif
#ifdef RGBLIGHT_ENABLE
// #define RGBLIGHT_ANIMATIONS
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#endif
#define PERMISSIVE_HOLD
|
/*
* (C) Copyright 2003, Psyent Corporation <www.psyent.com>
* Scott McNutt <smcnutt@psyent.com>
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <common.h>
#include <command.h>
#include <asm/byteorder.h>
#include <asm/cache.h>
#define NIOS_MAGIC 0x534f494e /* enable command line and initrd passing */
int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
{
void (*kernel)(int, int, int, char *) = (void *)images->ep;
char *commandline = getenv("bootargs");
ulong initrd_start = images->rd_start;
ulong initrd_end = images->rd_end;
if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
return 1;
/* flushes data and instruction caches before calling the kernel */
disable_interrupts();
flush_dcache((ulong)kernel, CONFIG_SYS_DCACHE_SIZE);
flush_icache((ulong)kernel, CONFIG_SYS_ICACHE_SIZE);
debug("bootargs=%s @ 0x%lx\n", commandline, (ulong)&commandline);
debug("initrd=0x%lx-0x%lx\n", (ulong)initrd_start, (ulong)initrd_end);
kernel(NIOS_MAGIC, initrd_start, initrd_end, commandline);
/* does not return */
return 1;
}
|
//
// TKDecimalInputWithNextKeyView.h
// Created by Devin Ross on 3/21/14.
//
/*
tapku || http://github.com/devinross/tapkulibrary
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 "TKDecimalInputView.h"
/** `TKDecimalInputWithNextKeyView` is subclass `TKDecimalInputView` with a next key. */
@interface TKDecimalInputWithNextKeyView : TKDecimalInputView
///----------------------------
/// @name Properties
///----------------------------
/** The next key. */
@property (nonatomic,strong) TKInputKey *nextKey;
@end
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2007 Advanced Micro Devices, Inc.
* Copyright (C) 2011 Mark Norman <mpnorman@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* Based on irq_tables.c from AMD's DB800 mainboard. */
#include <arch/pirq_routing.h>
#include <console/console.h>
#include <arch/io.h>
#include <arch/pirq_routing.h>
#include "southbridge/amd/cs5536/cs5536.h"
/* Platform IRQs */
#define PIRQA 5
#define PIRQB 11
#define PIRQC 10
#define PIRQD 9
/* Map */
#define M_PIRQA (1 << PIRQA) /* Bitmap of supported IRQs */
#define M_PIRQB (1 << PIRQB) /* Bitmap of supported IRQs */
#define M_PIRQC (1 << PIRQC) /* Bitmap of supported IRQs */
#define M_PIRQD (1 << PIRQD) /* Bitmap of supported IRQs */
/* Link */
#define L_PIRQA 1 /* Means Slot INTx# Connects To Chipset INTA# */
#define L_PIRQB 2 /* Means Slot INTx# Connects To Chipset INTB# */
#define L_PIRQC 3 /* Means Slot INTx# Connects To Chipset INTC# */
#define L_PIRQD 4 /* Means Slot INTx# Connects To Chipset INTD# */
static const struct irq_routing_table intel_irq_routing_table = {
PIRQ_SIGNATURE, /* u32 signature */
PIRQ_VERSION, /* u16 version */
32 + 16 * CONFIG_IRQ_SLOT_COUNT, /* there can be total CONFIG_IRQ_SLOT_COUNT devices on the bus */
0x00, /* Where the interrupt router lies (bus) */
(0x0F << 3) | 0x0, /* Where the interrupt router lies (dev) */
0x00, /* IRQs devoted exclusively to PCI usage */
0x100B, /* Vendor */
0x002B, /* Device */
0, /* Miniport data */
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, /* u8 rfu[11] */
0x00, /* u8 checksum , this has to set to some value that would give 0 after the sum of all bytes for this structure (including checksum) */
{
/* If you change the number of entries, change the CONFIG_IRQ_SLOT_COUNT above! */
/* bus, dev|fn, {link, bitmap}, {link, bitmap}, {link, bitmap}, {link, bitmap}, slot, rfu */
/* CPU */
{0x00, (0x01 << 3) | 0x0, {{L_PIRQA, M_PIRQA}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}}, 0x0, 0x0},
/* Ethernet */
{0x00, (0x0E << 3) | 0x0, {{L_PIRQA, M_PIRQA}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}}, 0x0, 0x0},
/* Chipset */
{0x00, (0x0F << 3) | 0x0, {{L_PIRQA, M_PIRQA}, {L_PIRQB, M_PIRQB}, {L_PIRQC, M_PIRQC}, {L_PIRQD, M_PIRQD}}, 0x0, 0x0},
}
};
unsigned long write_pirq_routing_table(unsigned long addr)
{
return copy_pirq_routing_table(addr, &intel_irq_routing_table);
}
|
#ifndef _ANTARES_DOCK_H
#define _ANTARES_DOCK_H
struct dock_platform_data {
unsigned int irq; /* interrupt number */
unsigned int gpio_num;
};
#endif
|
/*
* Copyright (C) 1997-2005, International Business Machines Corporation and others. All Rights Reserved.
*******************************************************************************
*
* File PARSEPOS.H
*
* Modification History:
*
* Date Name Description
* 07/09/97 helena Converted from java.
* 07/17/98 stephen Added errorIndex support.
* 05/11/99 stephen Cleaned up.
*******************************************************************************
*/
#ifndef PARSEPOS_H
#define PARSEPOS_H
#include "unicode/utypes.h"
#include "unicode/uobject.h"
U_NAMESPACE_BEGIN
/**
* \file
* \brief C++ API: Canonical Iterator
*/
/**
* <code>ParsePosition</code> is a simple class used by <code>Format</code>
* and its subclasses to keep track of the current position during parsing.
* The <code>parseObject</code> method in the various <code>Format</code>
* classes requires a <code>ParsePosition</code> object as an argument.
*
* <p>
* By design, as you parse through a string with different formats,
* you can use the same <code>ParsePosition</code>, since the index parameter
* records the current position.
*
* The ParsePosition class is not suitable for subclassing.
*
* @version 1.3 10/30/97
* @author Mark Davis, Helena Shih
* @see java.text.Format
*/
class U_COMMON_API ParsePosition : public UObject {
public:
/**
* Default constructor, the index starts with 0 as default.
* @stable ICU 2.0
*/
ParsePosition()
: UObject(),
index(0),
errorIndex(-1)
{}
/**
* Create a new ParsePosition with the given initial index.
* @param newIndex the new text offset.
* @stable ICU 2.0
*/
ParsePosition(int32_t newIndex)
: UObject(),
index(newIndex),
errorIndex(-1)
{}
/**
* Copy constructor
* @param copy the object to be copied from.
* @stable ICU 2.0
*/
ParsePosition(const ParsePosition& copy)
: UObject(copy),
index(copy.index),
errorIndex(copy.errorIndex)
{}
/**
* Destructor
* @stable ICU 2.0
*/
virtual ~ParsePosition();
/**
* Assignment operator
* @stable ICU 2.0
*/
ParsePosition& operator=(const ParsePosition& copy);
/**
* Equality operator.
* @return TRUE if the two parse positions are equal, FALSE otherwise.
* @stable ICU 2.0
*/
UBool operator==(const ParsePosition& that) const;
/**
* Equality operator.
* @return TRUE if the two parse positions are not equal, FALSE otherwise.
* @stable ICU 2.0
*/
UBool operator!=(const ParsePosition& that) const;
/**
* Clone this object.
* Clones can be used concurrently in multiple threads.
* If an error occurs, then NULL is returned.
* The caller must delete the clone.
*
* @return a clone of this object
*
* @see getDynamicClassID
* @stable ICU 2.8
*/
ParsePosition *clone() const;
/**
* Retrieve the current parse position. On input to a parse method, this
* is the index of the character at which parsing will begin; on output, it
* is the index of the character following the last character parsed.
* @return the current index.
* @stable ICU 2.0
*/
int32_t getIndex(void) const;
/**
* Set the current parse position.
* @param index the new index.
* @stable ICU 2.0
*/
void setIndex(int32_t index);
/**
* Set the index at which a parse error occurred. Formatters
* should set this before returning an error code from their
* parseObject method. The default value is -1 if this is not
* set.
* @stable ICU 2.0
*/
void setErrorIndex(int32_t ei);
/**
* Retrieve the index at which an error occurred, or -1 if the
* error index has not been set.
* @stable ICU 2.0
*/
int32_t getErrorIndex(void) const;
/**
* ICU "poor man's RTTI", returns a UClassID for this class.
*
* @stable ICU 2.2
*/
static UClassID U_EXPORT2 getStaticClassID();
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.
*
* @stable ICU 2.2
*/
virtual UClassID getDynamicClassID() const;
private:
/**
* Input: the place you start parsing.
* <br>Output: position where the parse stopped.
* This is designed to be used serially,
* with each call setting index up for the next one.
*/
int32_t index;
/**
* The index at which a parse error occurred.
*/
int32_t errorIndex;
};
inline ParsePosition&
ParsePosition::operator=(const ParsePosition& copy)
{
index = copy.index;
errorIndex = copy.errorIndex;
return *this;
}
inline UBool
ParsePosition::operator==(const ParsePosition& copy) const
{
if(index != copy.index || errorIndex != copy.errorIndex)
return FALSE;
else
return TRUE;
}
inline UBool
ParsePosition::operator!=(const ParsePosition& copy) const
{
return !operator==(copy);
}
inline int32_t
ParsePosition::getIndex() const
{
return index;
}
inline void
ParsePosition::setIndex(int32_t offset)
{
this->index = offset;
}
inline int32_t
ParsePosition::getErrorIndex() const
{
return errorIndex;
}
inline void
ParsePosition::setErrorIndex(int32_t ei)
{
this->errorIndex = ei;
}
U_NAMESPACE_END
#endif
|
/* Globally enable events.
Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include "thread_dbP.h"
td_err_e
td_ta_set_event(const td_thragent_t *ta,td_thr_events_t *event)
{
td_thr_events_t old_event;
int i;
LOG ("td_ta_set_event");
/* Test whether the TA parameter is ok. */
if (! ta_ok (ta))
return TD_BADTA;
/* Write the new value into the thread data structure. */
if (ps_pdread (ta->ph, ta->pthread_threads_eventsp,
&old_event, sizeof (td_thr_events_t)) != PS_OK)
return TD_ERR; /* XXX Other error value? */
/* Or the new bits in. */
for (i = 0; i < TD_EVENTSIZE; ++i)
old_event.event_bits[i] |= event->event_bits[i];
/* Write the new value into the thread data structure. */
if (ps_pdwrite (ta->ph, ta->pthread_threads_eventsp,
&old_event, sizeof (td_thr_events_t)) != PS_OK)
return TD_ERR; /* XXX Other error value? */
return TD_OK;
}
|
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ====
//
//=============================================================================
#ifndef AI_TACTICALSERVICES_H
#define AI_TACTICALSERVICES_H
#include "ai_component.h"
#if defined( _WIN32 )
#pragma once
#endif
class CAI_Network;
class CAI_Pathfinder;
enum FlankType_t
{
FLANKTYPE_NONE = 0,
FLANKTYPE_ARC, // Stay flFlankParam degrees of arc away from vecFlankRefPos
FLANKTYPE_RADIUS, // Stay flFlankParam units away from vecFlankRefPos
};
//-----------------------------------------------------------------------------
class CAI_TacticalServices : public CAI_Component
{
public:
CAI_TacticalServices( CAI_BaseNPC *pOuter )
: CAI_Component(pOuter),
m_pNetwork( NULL )
{
m_bAllowFindLateralLos = true;
}
void Init( CAI_Network *pNetwork );
bool FindLos( const Vector &threatPos, const Vector &threatEyePos, float minThreatDist, float maxThreatDist, float blockTime, Vector *pResult );
bool FindLos( const Vector &threatPos, const Vector &threatEyePos, float minThreatDist, float maxThreatDist, float blockTime, FlankType_t eFlankType, const Vector &VecFlankRefPos, float flFlankParam, Vector *pResult );
bool FindLateralLos( const Vector &threatPos, Vector *pResult );
bool FindBackAwayPos( const Vector &vecThreat, Vector *pResult );
bool FindCoverPos( const Vector &vThreatPos, const Vector &vThreatEyePos, float flMinDist, float flMaxDist, Vector *pResult );
bool FindCoverPos( const Vector &vNearPos, const Vector &vThreatPos, const Vector &vThreatEyePos, float flMinDist, float flMaxDist, Vector *pResult );
bool FindLateralCover( const Vector &vecThreat, float flMinDist, Vector *pResult );
bool FindLateralCover( const Vector &vecThreat, float flMinDist, float distToCheck, int numChecksPerDir, Vector *pResult );
bool FindLateralCover( const Vector &vNearPos, const Vector &vecThreat, float flMinDist, float distToCheck, int numChecksPerDir, Vector *pResult );
void AllowFindLateralLos( bool bAllow ) { m_bAllowFindLateralLos = bAllow; }
private:
// Checks lateral cover
bool TestLateralCover( const Vector &vecCheckStart, const Vector &vecCheckEnd, float flMinDist );
bool TestLateralLos( const Vector &vecCheckStart, const Vector &vecCheckEnd );
int FindBackAwayNode( const Vector &vecThreat );
int FindCoverNode( const Vector &vThreatPos, const Vector &vThreatEyePos, float flMinDist, float flMaxDist );
int FindCoverNode( const Vector &vNearPos, const Vector &vThreatPos, const Vector &vThreatEyePos, float flMinDist, float flMaxDist );
int FindLosNode( const Vector &vThreatPos, const Vector &vThreatEyePos, float flMinThreatDist, float flMaxThreatDist, float flBlockTime, FlankType_t eFlankType, const Vector &vThreatFacing, float flFlankParam );
Vector GetNodePos( int );
CAI_Network *GetNetwork() { return m_pNetwork; }
const CAI_Network *GetNetwork() const { return m_pNetwork; }
CAI_Pathfinder *GetPathfinder() { return m_pPathfinder; }
const CAI_Pathfinder *GetPathfinder() const { return m_pPathfinder; }
CAI_Network *m_pNetwork;
CAI_Pathfinder *m_pPathfinder;
bool m_bAllowFindLateralLos; // Allows us to turn Lateral LOS checking on/off.
DECLARE_SIMPLE_DATADESC();
};
//-----------------------------------------------------------------------------
#endif // AI_TACTICALSERVICES_H
|
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_TPU_GRAPH_REWRITE_NODEDEF_BUILDER_H_
#define TENSORFLOW_CORE_TPU_GRAPH_REWRITE_NODEDEF_BUILDER_H_
#include <string>
#include "tensorflow/core/framework/node_def_builder.h"
#include "tensorflow/core/graph/graph.h"
#include "tensorflow/core/lib/core/status.h"
namespace tensorflow {
// Convenience builder to build NodeDefs without specifying the inputs. This is
// similar to NodeDefBuilder except inputs are not specified.
// TODO(jpienaar): Clean up NodeDefBuilder and remove this class.
class IncompleteNodeDefBuilder {
public:
IncompleteNodeDefBuilder(const string& name, const string& op,
const NodeDebugInfo& debug);
IncompleteNodeDefBuilder& AddAttr(const string& attr, const DataType& type);
IncompleteNodeDefBuilder& AddAttr(const string& attr, int val);
IncompleteNodeDefBuilder& Device(const string& device);
Status Build(Graph* graph, Node** n);
static IncompleteNodeDefBuilder Identity(const string& name,
const DataType& type,
const NodeDebugInfo& debug);
static IncompleteNodeDefBuilder Merge(const string& name,
const DataType& type,
const NodeDebugInfo& debug, int n);
static IncompleteNodeDefBuilder Switch(const string& name,
const DataType& type,
const NodeDebugInfo& debug);
private:
NodeDef nodedef_;
};
} // namespace tensorflow
#endif // TENSORFLOW_CORE_TPU_GRAPH_REWRITE_NODEDEF_BUILDER_H_
|
#ifndef SHA_H
#define SHA_H
/* NIST Secure Hash Algorithm */
/* heavily modified from Peter C. Gutmann's implementation */
/* Useful defines & typedefs */
typedef unsigned char BYTE;
typedef unsigned long LONG;
#define SHA_BLOCKSIZE 64
#define SHA_DIGESTSIZE 20
typedef struct {
LONG digest[5]; /* message digest */
LONG count_lo, count_hi; /* 64-bit bit count */
LONG data[16]; /* SHA data buffer */
} SHA_INFO;
void sha_init(SHA_INFO *);
void sha_update(SHA_INFO *, BYTE *, int);
void sha_final(SHA_INFO *);
void sha_stream(SHA_INFO *, FILE *);
void sha_print(SHA_INFO *);
#endif /* SHA_H */
|
// RUN: %clang_cc1 %s -verify -fsyntax-only
void good() {
int dont_initialize_me __attribute((uninitialized));
}
void bad() {
int im_bad __attribute((uninitialized("zero"))); // expected-error {{'uninitialized' attribute takes no arguments}}
static int im_baaad __attribute((uninitialized)); // expected-warning {{'uninitialized' attribute only applies to local variables}}
}
extern int come_on __attribute((uninitialized)); // expected-warning {{'uninitialized' attribute only applies to local variables}}
int you_know __attribute((uninitialized)); // expected-warning {{'uninitialized' attribute only applies to local variables}}
static int and_the_whole_world_has_to __attribute((uninitialized)); // expected-warning {{'uninitialized' attribute only applies to local variables}}
void answer_right_now() __attribute((uninitialized)) {} // expected-warning {{'uninitialized' attribute only applies to local variables}}
void just_to_tell_you_once_again(__attribute((uninitialized)) int whos_bad) {} // expected-warning {{'uninitialized' attribute only applies to local variables}}
struct TheWordIsOut {
__attribute((uninitialized)) int youre_doin_wrong; // expected-warning {{'uninitialized' attribute only applies to local variables}}
} __attribute((uninitialized)); // expected-warning {{'uninitialized' attribute only applies to local variables}}
|
/* Test diagnostics for old-style definition not matching prior
prototype are present and give correct location for that prototype
(bug 15698). Unprototyped built-in function with user prototype at
inner scope. */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
/* { dg-do compile } */
/* { dg-options "-std=gnu99" } */
void f(void) { int isnan(void); } /* { dg-error "error: prototype declaration" } */
int isnan(a) int a; {} /* { dg-error "error: number of arguments doesn't match prototype" } */
|
/* ellpe.c
*
* Complete elliptic integral of the second kind
*
*
*
* SYNOPSIS:
*
* double m1, y, ellpe();
*
* y = ellpe( m1 );
*
*
*
* DESCRIPTION:
*
* Approximates the integral
*
*
* pi/2
* -
* | | 2
* E(m) = | sqrt( 1 - m sin t ) dt
* | |
* -
* 0
*
* Where m = 1 - m1, using the approximation
*
* P(x) - x log x Q(x).
*
* Though there are no singularities, the argument m1 is used
* rather than m for compatibility with ellpk().
*
* E(1) = 1; E(0) = pi/2.
*
*
* ACCURACY:
*
* Relative error:
* arithmetic domain # trials peak rms
* DEC 0, 1 13000 3.1e-17 9.4e-18
* IEEE 0, 1 10000 2.1e-16 7.3e-17
*
*
* ERROR MESSAGES:
*
* message condition value returned
* ellpe domain x<0, x>1 0.0
*
*/
/* ellpe.c */
/* Elliptic integral of second kind */
/*
Cephes Math Library, Release 2.8: June, 2000
Copyright 1984, 1987, 1989, 2000 by Stephen L. Moshier
*/
#include "mconf.h"
#ifdef UNK
static double P[] = {
1.53552577301013293365E-4,
2.50888492163602060990E-3,
8.68786816565889628429E-3,
1.07350949056076193403E-2,
7.77395492516787092951E-3,
7.58395289413514708519E-3,
1.15688436810574127319E-2,
2.18317996015557253103E-2,
5.68051945617860553470E-2,
4.43147180560990850618E-1,
1.00000000000000000299E0
};
static double Q[] = {
3.27954898576485872656E-5,
1.00962792679356715133E-3,
6.50609489976927491433E-3,
1.68862163993311317300E-2,
2.61769742454493659583E-2,
3.34833904888224918614E-2,
4.27180926518931511717E-2,
5.85936634471101055642E-2,
9.37499997197644278445E-2,
2.49999999999888314361E-1
};
#endif
#ifdef DEC
static unsigned short P[] = {
0035041,0001364,0141572,0117555,
0036044,0066032,0130027,0033404,
0036416,0053617,0064456,0102632,
0036457,0161100,0061177,0122612,
0036376,0136251,0012403,0124162,
0036370,0101316,0151715,0131613,
0036475,0105477,0050317,0133272,
0036662,0154232,0024645,0171552,
0037150,0126220,0047054,0030064,
0037742,0162057,0167645,0165612,
0040200,0000000,0000000,0000000
};
static unsigned short Q[] = {
0034411,0106743,0115771,0055462,
0035604,0052575,0155171,0045540,
0036325,0030424,0064332,0167756,
0036612,0052366,0063006,0115175,
0036726,0070430,0004533,0124654,
0037011,0022741,0030675,0030711,
0037056,0174452,0127062,0132122,
0037157,0177750,0142041,0072523,
0037277,0177777,0173137,0002627,
0037577,0177777,0177777,0101101
};
#endif
#ifdef IBMPC
static unsigned short P[] = {
0x53ee,0x986f,0x205e,0x3f24,
0xe6e0,0x5602,0x8d83,0x3f64,
0xd0b3,0xed25,0xcaf1,0x3f81,
0xf4b1,0x0c4f,0xfc48,0x3f85,
0x750e,0x22a0,0xd795,0x3f7f,
0xb671,0xda79,0x1059,0x3f7f,
0xf6d7,0xea19,0xb167,0x3f87,
0xbe6d,0x4534,0x5b13,0x3f96,
0x8607,0x09c5,0x1592,0x3fad,
0xbd71,0xfdf4,0x5c85,0x3fdc,
0x0000,0x0000,0x0000,0x3ff0
};
static unsigned short Q[] = {
0x2b66,0x737f,0x31bc,0x3f01,
0x296c,0xbb4f,0x8aaf,0x3f50,
0x5dfe,0x8d1b,0xa622,0x3f7a,
0xd350,0xccc0,0x4a9e,0x3f91,
0x7535,0x012b,0xce23,0x3f9a,
0xa639,0x2637,0x24bc,0x3fa1,
0x568a,0x55c6,0xdf25,0x3fa5,
0x2eaa,0x1884,0xfffd,0x3fad,
0xe0b3,0xfecb,0xffff,0x3fb7,
0xf048,0xffff,0xffff,0x3fcf
};
#endif
#ifdef MIEEE
static unsigned short P[] = {
0x3f24,0x205e,0x986f,0x53ee,
0x3f64,0x8d83,0x5602,0xe6e0,
0x3f81,0xcaf1,0xed25,0xd0b3,
0x3f85,0xfc48,0x0c4f,0xf4b1,
0x3f7f,0xd795,0x22a0,0x750e,
0x3f7f,0x1059,0xda79,0xb671,
0x3f87,0xb167,0xea19,0xf6d7,
0x3f96,0x5b13,0x4534,0xbe6d,
0x3fad,0x1592,0x09c5,0x8607,
0x3fdc,0x5c85,0xfdf4,0xbd71,
0x3ff0,0x0000,0x0000,0x0000
};
static unsigned short Q[] = {
0x3f01,0x31bc,0x737f,0x2b66,
0x3f50,0x8aaf,0xbb4f,0x296c,
0x3f7a,0xa622,0x8d1b,0x5dfe,
0x3f91,0x4a9e,0xccc0,0xd350,
0x3f9a,0xce23,0x012b,0x7535,
0x3fa1,0x24bc,0x2637,0xa639,
0x3fa5,0xdf25,0x55c6,0x568a,
0x3fad,0xfffd,0x1884,0x2eaa,
0x3fb7,0xffff,0xfecb,0xe0b3,
0x3fcf,0xffff,0xffff,0xf048
};
#endif
#ifdef ANSIPROT
extern double polevl ( double, void *, int );
extern double log ( double );
#else
double polevl(), log();
#endif
double ellpe(x)
double x;
{
if( (x <= 0.0) || (x > 1.0) )
{
if( x == 0.0 )
return( 1.0 );
mtherr( "ellpe", DOMAIN );
return( 0.0 );
}
return( polevl(x,P,10) - log(x) * (x * polevl(x,Q,9)) );
}
|
/*
* Copyright (c) 2003, 2007-11 Matteo Frigo
* Copyright (c) 2003, 2007-11 Massachusetts Institute of Technology
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include "bench.h"
typedef bench_real R;
typedef bench_complex C;
typedef struct dofft_closure_s {
void (*apply)(struct dofft_closure_s *k,
bench_complex *in, bench_complex *out);
int recopy_input;
} dofft_closure;
double dmax(double x, double y);
typedef void (*aconstrain)(C *a, int n);
void arand(C *a, int n);
void mkreal(C *A, int n);
void mkhermitian(C *A, int rank, const bench_iodim *dim, int stride);
void mkhermitian1(C *a, int n);
void aadd(C *c, C *a, C *b, int n);
void asub(C *c, C *a, C *b, int n);
void arol(C *b, C *a, int n, int nb, int na);
void aphase_shift(C *b, C *a, int n, int nb, int na, double sign);
void ascale(C *a, C alpha, int n);
double acmp(C *a, C *b, int n, const char *test, double tol);
double mydrand(void);
double impulse(dofft_closure *k,
int n, int vecn,
C *inA, C *inB, C *inC,
C *outA, C *outB, C *outC,
C *tmp, int rounds, double tol);
double linear(dofft_closure *k, int realp,
int n, C *inA, C *inB, C *inC, C *outA,
C *outB, C *outC, C *tmp, int rounds, double tol);
void preserves_input(dofft_closure *k, aconstrain constrain,
int n, C *inA, C *inB, C *outB, int rounds);
enum { TIME_SHIFT, FREQ_SHIFT };
double tf_shift(dofft_closure *k, int realp, const bench_tensor *sz,
int n, int vecn, double sign,
C *inA, C *inB, C *outA, C *outB, C *tmp,
int rounds, double tol, int which_shift);
typedef struct dotens2_closure_s {
void (*apply)(struct dotens2_closure_s *k,
int indx0, int ondx0, int indx1, int ondx1);
} dotens2_closure;
void bench_dotens2(const bench_tensor *sz0,
const bench_tensor *sz1, dotens2_closure *k);
void accuracy_test(dofft_closure *k, aconstrain constrain,
int sign, int n, C *a, C *b, int rounds, int impulse_rounds,
double t[6]);
void accuracy_dft(bench_problem *p, int rounds, int impulse_rounds,
double t[6]);
void accuracy_rdft2(bench_problem *p, int rounds, int impulse_rounds,
double t[6]);
void accuracy_r2r(bench_problem *p, int rounds, int impulse_rounds,
double t[6]);
#if defined(BENCHFFT_LDOUBLE) && HAVE_COSL
typedef long double trigreal;
# define COS cosl
# define SIN sinl
# define TAN tanl
# define KTRIG(x) (x##L)
#elif defined(BENCHFFT_QUAD) && HAVE_LIBQUADMATH
typedef __float128 trigreal;
# define COS cosq
# define SIN sinq
# define TAN tanq
# define KTRIG(x) (x##Q)
extern trigreal cosq(trigreal);
extern trigreal sinq(trigreal);
extern trigreal tanq(trigreal);
#else
typedef double trigreal;
# define COS cos
# define SIN sin
# define TAN tan
# define KTRIG(x) (x)
#endif
#define K2PI KTRIG(6.2831853071795864769252867665590057683943388)
|
/* ResidualVM - A 3D game interpreter
*
* ResidualVM 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 GRIM_LUA_VAR_COMPONENT_H
#define GRIM_LUA_VAR_COMPONENT_H
#include "engines/grim/costume/component.h"
namespace Grim {
class LuaVarComponent : public Component {
public:
LuaVarComponent(Component *parent, int parentID, const char *name, tag32 tag);
void setKey(int val) override;
};
} // end of namespace Grim
#endif
|
/*
* Copyright 2014 Samsung Electronics Co., Ltd.
* http://www.samsung.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __CORESIGHT_REGS_H
#define __CORESIGHT_REGS_H
#include <linux/kernel.h>
#include <linux/types.h>
#define OSLOCK_MAGIC (0xc5acce55)
#ifdef CONFIG_EXYNOS_CORESIGHT
/* Defines are used by core-sight */
#define CS_SJTAG_OFFSET (0x8000)
#define SJTAG_STATUS (0x4)
#define SJTAG_SOFT_LOCK (1<<2)
/* DBG Registers */
#define DBGWFAR (0x018) /* RW */
#define DBGVCR (0x01c) /* RW */
#define DBGECR (0x024) /* RW or RAZ */
#define DBGDSCCR (0x028) /* RW or RAZ */
#define DBGDSMCR (0x02c) /* RW or RAZ */
#define DBGDTRRX (0x080) /* RW */
#define DBGDSCR (0x088) /* RW */
#define DBGDTRTX (0x08c) /* RW */
#define DBGDRCR (0x090) /* WO */
#define DBGEACR (0x094) /* RW */
#define DBGECCR (0x098) /* RW */
#define DBGPCSRlo (0x0a0) /* RO */
#define DBGCIDSR (0x0a4) /* RO */
#define DBGVIDSR (0x0a8) /* RO */
#define DBGPCSRhi (0x0ac) /* RO */
#define DBGBXVR0 (0x250) /* RW */
#define DBGBXVR1 (0x254) /* RW */
#define DBGOSLAR (0x300) /* WO */
#define DBGOSLSR (0x304) /* RO */
#define DBGPRCR (0x310) /* RW */
#define DBGPRSR (0x314) /* RO, OSLSR in ARMv8 */
#define DBGITOCTRL (0xef8) /* WO */
#define DBGITISR (0xefc) /* RO */
#define DBGITCTRL (0xf00) /* RW */
#define DBGCLAIMSET (0xfa0) /* RW */
#define DBGCLAIMCLR (0xfa4) /* RW */
#define DBGLAR (0xfb0) /* WO */
#define DBGLSR (0xfb4) /* RO */
#define DBGAUTHSTATUS (0xfb8) /* RO */
#define DBGDEVID2 (0xfc0) /* RO */
#define DBGDEVID1 (0xfc4) /* RO, PC offset */
#define DBGDEVID0 (0xfc8) /* RO */
#define DBGDEVTYPE (0xfcc) /* RO */
#define MIDR (0xd00) /* RO */
#define ID_AA64DFR0_EL1 (0xd28)
/* DBG breakpoint registers (All RW) */
#define DBGBVRn(n) (0x400 + (n * 0x10)) /* 64bit */
#define DBGBCRn(n) (0x408 + (n * 0x10))
/* DBG watchpoint registers (All RW) */
#define DBGWVRn(n) (0x800 + (n * 0x10)) /* 64bit */
#define DBGWCRn(n) (0x808 + (n * 0x10))
/* DIDR or ID_AA64DFR0_EL1 bit */
#define DEBUG_ARCH_V8 (0x6)
/* MIDR bit */
#define ARMV8_PROCESSOR (0xd00)
#define ARMV8_CORTEXA53 (0xd03)
#define ARMV8_CORTEXA57 (0xd07)
#endif
#ifdef CONFIG_EXYNOS_CORESIGHT_PC_INFO
extern void exynos_cs_show_pcval(void);
#else
#define exynos_cs_show_pcval() do { } while(0)
#endif
#ifdef CONFIG_EXYNOS_CORESIGHT_ETM
/* TMC(ETB/ETF/ETR) registers */
#define TMCRSZ (0x004)
#define TMCSTS (0x00c)
#define TMCRRD (0x010)
#define TMCRRP (0x014)
#define TMCRWP (0x018)
#define TMCTGR (0x01c)
#define TMCCTL (0x020)
#define TMCRWD (0x024)
#define TMCMODE (0x028)
#define TMCLBUFLEVEL (0x02c)
#define TMCCBUFLEVEL (0x030)
#define TMCBUFWM (0x034)
#define TMCRRPHI (0x038)
#define TMCRWPHI (0x03c)
#define TMCAXICTL (0x110)
#define TMCDBALO (0x118)
#define TMCDBAHI (0x11c)
#define TMCFFSR (0x300)
#define TMCFFCR (0x304)
#define TMCPSCR (0x308)
/* Coresight manager register */
#define ITCTRL (0xf00)
#define CLAIMSET (0xfa0)
#define CLAIMCLR (0xfa4)
#define LAR (0xfb0)
#define LSR (0xfb4)
#define AUTHSTATUS (0xfb8)
/* FUNNEL configuration register */
#define FUNCTRL (0x0)
#define FUNPRIORCTRL (0x4)
/* ETM registers */
#define ETMCTLR (0x004)
#define ETMPROCSELR (0x008)
#define ETMSTATUS (0x00c)
#define ETMCONFIG (0x010)
#define ETMAUXCTLR (0x018)
#define ETMEVENTCTL0R (0x020)
#define ETMEVENTCTL1R (0x024)
#define ETMSTALLCTLR (0x02c)
#define ETMTSCTLR (0x030)
#define ETMSYNCPR (0x034)
#define ETMCCCCTLR (0x038)
#define ETMBBCTLR (0x03c)
#define ETMTRACEIDR (0x040)
#define ETMQCTRLR (0x044)
#define ETMVICTLR (0x080)
#define ETMVIIECTLR (0x084)
#define ETMVISSCTLR (0x088)
#define ETMVIPCSSCTLR (0x08c)
#define ETMVDCTLR (0x0a0)
#define ETMVDSACCTLR (0x0a4)
#define ETMVDARCCTLR (0x0a8)
#define ETMSEQEVR(n) (0x100 + (n * 4))
#define ETMSEQRSTEVR (0x118)
#define ETMSEQSTR (0x11c)
#define ETMEXTINSELR (0x120)
#define ETMCNTRLDVR(n) (0x140 + (n * 4))
#define ETMCNTCTLR(n) (0x150 + (n * 4))
#define ETMCNTVR(n) (0x160 + (n * 4))
#define ETMIDR8 (0x180)
#define ETMIDR9 (0x184)
#define ETMID10 (0x188)
#define ETMID11 (0x18c)
#define ETMID12 (0x190)
#define ETMID13 (0x194)
#define ETMID0 (0x1e0)
#define ETMID1 (0x1e4)
#define ETMID2 (0x1e8)
#define ETMID3 (0x1ec)
#define ETMID4 (0x1f0)
#define ETMID5 (0x1f4)
#define ETMID6 (0x1f8)
#define ETMID7 (0x1fc)
#define ETMRSCTLR(n) (0x200 + (n * 4))
#define ETMSSCCR(n) (0x280 + (n * 4))
#define ETMSSCSR(n) (0x2a0 + (n * 4))
#define ETMSSPCICR(n) (0x2c0 + (n * 4))
#define ETMOSLAR (0x300)
#define ETMOSLSR (0x304)
#define ETMPDCR (0x310)
#define ETMPDSR (0x314)
#define ETMACVR(n) (0x400 + (n * 4))
#define ETMACAT(n) (0x480 + (n * 4))
#define ETMDVCVR(n) (0x500 + (n * 4))
#define ETMDVCMR(n) (0x580 + (n * 4))
#define ETMCIDCVR(n) (0x600 + (n * 4))
#define ETMVMIDCVR(n) (0x640 + (n * 4))
#define ETMCCIDCCTLR0 (0x680)
#define ETMCCIDCCTLR1 (0x684)
#define ETMVMIDCCTLR0 (0x688)
#define ETMVMIDCCTLR1 (0x68c)
extern void exynos_trace_stop(void);
#else
#define exynos_trace_stop() do { } while(0)
#endif
/* defines for MNGS reset */
#define PEND_MNGS (1 << 1)
#define PEND_APOLLO (1 << 0)
#define DEFAULT_VAL_CPU_RESET_DISABLE 0xFFFFFFFC
#define RESET_DISABLE_GPR_CPUPORESET (1 << 15)
#define RESET_DISABLE_WDT_CPUPORESET (1 << 12)
#define RESET_DISABLE_CORERESET (1 << 9)
#define RESET_DISABLE_CPUPORESET (1 << 8)
#define RESET_DISABLE_WDT_PRESET_DBG (1 << 25)
#define RESET_DISABLE_PRESET_DBG (1 << 18)
#define DFD_EDPCSR_DUMP_EN (1 << 0)
#define RESET_DISABLE_L2RESET (1 << 16)
#endif
|
//
// Thread_WIN32.h
//
// $Id: //poco/1.3/Foundation/include/Poco/Thread_WIN32.h#7 $
//
// Library: Foundation
// Package: Threading
// Module: Thread
//
// Definition of the ThreadImpl class for WIN32.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// Permission is hereby granted, free of charge, to any person or organization
// obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the
// Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following:
//
// The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer,
// must be included in all copies of the Software, in whole or in part, and
// all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by
// a source language processor.
//
// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
#ifndef Foundation_Thread_WIN32_INCLUDED
#define Foundation_Thread_WIN32_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/Runnable.h"
#include "Poco/UnWindows.h"
namespace Poco {
class Foundation_API ThreadImpl
{
public:
typedef void (*Callable)(void*);
#if defined(_DLL)
typedef DWORD (WINAPI *Entry)(LPVOID);
#else
typedef unsigned (__stdcall *Entry)(void*);
#endif
struct CallbackData
{
CallbackData(): callback(0), pData(0)
{
}
Callable callback;
void* pData;
};
enum Priority
{
PRIO_LOWEST_IMPL = THREAD_PRIORITY_LOWEST,
PRIO_LOW_IMPL = THREAD_PRIORITY_BELOW_NORMAL,
PRIO_NORMAL_IMPL = THREAD_PRIORITY_NORMAL,
PRIO_HIGH_IMPL = THREAD_PRIORITY_ABOVE_NORMAL,
PRIO_HIGHEST_IMPL = THREAD_PRIORITY_HIGHEST
};
ThreadImpl();
~ThreadImpl();
void setPriorityImpl(int prio);
int getPriorityImpl() const;
void setOSPriorityImpl(int prio);
int getOSPriorityImpl() const;
static int getMinOSPriorityImpl();
static int getMaxOSPriorityImpl();
void setStackSizeImpl(int size);
int getStackSizeImpl() const;
void startImpl(Runnable& target);
void startImpl(Callable target, void* pData = 0);
void joinImpl();
bool joinImpl(long milliseconds);
bool isRunningImpl() const;
static void sleepImpl(long milliseconds);
static void yieldImpl();
static ThreadImpl* currentImpl();
protected:
#if defined(_DLL)
static DWORD WINAPI runnableEntry(LPVOID pThread);
#else
static unsigned __stdcall runnableEntry(void* pThread);
#endif
#if defined(_DLL)
static DWORD WINAPI callableEntry(LPVOID pThread);
#else
static unsigned __stdcall callableEntry(void* pThread);
#endif
void createImpl(Entry ent, void* pData);
void threadCleanup();
private:
Runnable* _pRunnableTarget;
CallbackData _callbackTarget;
HANDLE _thread;
int _prio;
int _stackSize;
static DWORD _currentKey;
};
//
// inlines
//
inline int ThreadImpl::getPriorityImpl() const
{
return _prio;
}
inline int ThreadImpl::getOSPriorityImpl() const
{
return _prio;
}
inline int ThreadImpl::getMinOSPriorityImpl()
{
return PRIO_LOWEST_IMPL;
}
inline int ThreadImpl::getMaxOSPriorityImpl()
{
return PRIO_HIGHEST_IMPL;
}
inline void ThreadImpl::sleepImpl(long milliseconds)
{
Sleep(DWORD(milliseconds));
}
inline void ThreadImpl::yieldImpl()
{
Sleep(0);
}
inline void ThreadImpl::setStackSizeImpl(int size)
{
_stackSize = size;
}
inline int ThreadImpl::getStackSizeImpl() const
{
return _stackSize;
}
} // namespace Poco
#endif // Foundation_Thread_WIN32_INCLUDED
|
//
// UYLAppDelegate.h
// Collection
//
// Created by Keith Harrison http://useyourloaf.com
// Copyright (c) 2013 Keith Harrison. 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 Keith Harrison 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 HOLDER ''AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <UIKit/UIKit.h>
@interface UYLAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
/*
* Copyright 2009 Freescale Semicondutor, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* provides masks and opcode images for use by code generation, emulation
* and for instructions that older assemblers might not know about
*/
#ifndef _ASM_POWERPC_PPC_OPCODE_H
#define _ASM_POWERPC_PPC_OPCODE_H
#include <linux/stringify.h>
#include <asm/asm-compat.h>
/* sorted alphabetically */
#define PPC_INST_DCBA 0x7c0005ec
#define PPC_INST_DCBA_MASK 0xfc0007fe
#define PPC_INST_DCBAL 0x7c2005ec
#define PPC_INST_DCBZL 0x7c2007ec
#define PPC_INST_ISEL 0x7c00001e
#define PPC_INST_ISEL_MASK 0xfc00003e
#define PPC_INST_LSWI 0x7c0004aa
#define PPC_INST_LSWX 0x7c00042a
#define PPC_INST_LWSYNC 0x7c2004ac
#define PPC_INST_LXVD2X 0x7c000698
#define PPC_INST_MCRXR 0x7c000400
#define PPC_INST_MCRXR_MASK 0xfc0007fe
#define PPC_INST_MFSPR_PVR 0x7c1f42a6
#define PPC_INST_MFSPR_PVR_MASK 0xfc1fffff
#define PPC_INST_MSGSND 0x7c00019c
#define PPC_INST_NOP 0x60000000
#define PPC_INST_POPCNTB 0x7c0000f4
#define PPC_INST_POPCNTB_MASK 0xfc0007fe
#define PPC_INST_RFCI 0x4c000066
#define PPC_INST_RFDI 0x4c00004e
#define PPC_INST_RFMCI 0x4c00004c
#define PPC_INST_STRING 0x7c00042a
#define PPC_INST_STRING_MASK 0xfc0007fe
#define PPC_INST_STRING_GEN_MASK 0xfc00067e
#define PPC_INST_STSWI 0x7c0005aa
#define PPC_INST_STSWX 0x7c00052a
#define PPC_INST_STXVD2X 0x7c000798
#define PPC_INST_TLBIE 0x7c000264
#define PPC_INST_TLBILX 0x7c000024
#define PPC_INST_WAIT 0x7c00007c
/* macros to insert fields into opcodes */
#define __PPC_RA(a) (((a) & 0x1f) << 16)
#define __PPC_RB(b) (((b) & 0x1f) << 11)
#define __PPC_RS(s) (((s) & 0x1f) << 21)
#define __PPC_XS(s) ((((s) & 0x1f) << 21) | (((s) & 0x20) >> 5))
#define __PPC_T_TLB(t) (((t) & 0x3) << 21)
#define __PPC_WC(w) (((w) & 0x3) << 21)
/* Deal with instructions that older assemblers aren't aware of */
#define PPC_DCBAL(a, b) stringify_in_c(.long PPC_INST_DCBAL | \
__PPC_RA(a) | __PPC_RB(b))
#define PPC_DCBZL(a, b) stringify_in_c(.long PPC_INST_DCBZL | \
__PPC_RA(a) | __PPC_RB(b))
#define PPC_MSGSND(b) stringify_in_c(.long PPC_INST_MSGSND | \
__PPC_RB(b))
#define PPC_RFCI stringify_in_c(.long PPC_INST_RFCI)
#define PPC_RFDI stringify_in_c(.long PPC_INST_RFDI)
#define PPC_RFMCI stringify_in_c(.long PPC_INST_RFMCI)
#define PPC_TLBILX(t, a, b) stringify_in_c(.long PPC_INST_TLBILX | \
__PPC_T_TLB(t) | __PPC_RA(a) | __PPC_RB(b))
#define PPC_TLBILX_ALL(a, b) PPC_TLBILX(0, a, b)
#define PPC_TLBILX_PID(a, b) PPC_TLBILX(1, a, b)
#define PPC_TLBILX_VA(a, b) PPC_TLBILX(3, a, b)
#define PPC_WAIT(w) stringify_in_c(.long PPC_INST_WAIT | \
__PPC_WC(w))
#define PPC_TLBIE(lp,a) stringify_in_c(.long PPC_INST_TLBIE | \
__PPC_RB(a) | __PPC_RS(lp))
/*
* Define what the VSX XX1 form instructions will look like, then add
* the 128 bit load store instructions based on that.
*/
#define VSX_XX1(s, a, b) (__PPC_XS(s) | __PPC_RA(a) | __PPC_RB(b))
#define STXVD2X(s, a, b) stringify_in_c(.long PPC_INST_STXVD2X | \
VSX_XX1((s), (a), (b)))
#define LXVD2X(s, a, b) stringify_in_c(.long PPC_INST_LXVD2X | \
VSX_XX1((s), (a), (b)))
#endif /* _ASM_POWERPC_PPC_OPCODE_H */
|
/*****************************************************************************
*
* PROJECT: Multi Theft Auto v1.0
* LICENSE: See LICENSE in the top level directory
* FILE: sdk/game/CRenderWare.h
* PURPOSE: RenderWare engine interface
*
* Multi Theft Auto is available from http://www.multitheftauto.com/
*
*****************************************************************************/
#ifndef __CRENDERWARE
#define __CRENDERWARE
#include "RenderWare.h"
#include <list>
class CD3DDUMMY;
class CClientEntityBase;
class CShaderItem;
typedef CShaderItem CSHADERDUMMY;
// A list of custom textures to add to a model's txd
struct SReplacementTextures
{
struct SPerTxd
{
std::vector < RwTexture* > usingTextures;
ushort usTxdId;
bool bTexturesAreCopies;
};
std::vector < RwTexture* > textures; // List of textures we want to inject into TXD's
std::vector < SPerTxd > perTxdList; // TXD's which have been modified
std::vector < ushort > usedInTxdIds;
std::vector < ushort > usedInModelIds;
};
// Shader layers to render
struct SShaderItemLayers
{
SShaderItemLayers ( void ) : pBase ( NULL ), bUsesVertexShader ( false ) {}
CShaderItem* pBase;
std::vector < CShaderItem* > layerList;
bool bUsesVertexShader;
};
enum EEntityTypeMask
{
TYPE_MASK_NONE = 0,
TYPE_MASK_WORLD = 1,
TYPE_MASK_PED = 2,
TYPE_MASK_VEHICLE = 4,
TYPE_MASK_OBJECT = 8,
TYPE_MASK_OTHER = 16,
TYPE_MASK_ALL = 127,
};
typedef void (*PFN_WATCH_CALLBACK) ( CSHADERDUMMY* pContext, CD3DDUMMY* pD3DDataNew, CD3DDUMMY* pD3DDataOld );
#define MAX_ATOMICS_PER_CLUMP 128
class CRenderWare {
public:
virtual bool ModelInfoTXDLoadTextures ( SReplacementTextures* pReplacementTextures, const CBuffer& fileData, bool bFilteringEnabled ) = 0;
virtual bool ModelInfoTXDAddTextures ( SReplacementTextures* pReplacementTextures, ushort usModelId ) = 0;
virtual void ModelInfoTXDRemoveTextures ( SReplacementTextures* pReplacementTextures ) = 0;
virtual void ClothesAddReplacementTxd ( char* pFileData, ushort usFileId ) = 0;
virtual void ClothesRemoveReplacementTxd ( char* pFileData ) = 0;
virtual bool HasClothesReplacementChanged( void ) = 0;
virtual RwTexDictionary * ReadTXD ( const CBuffer& fileData ) = 0;
virtual RpClump * ReadDFF ( const CBuffer& fileData, unsigned short usModelID, bool bLoadEmbeddedCollisions ) = 0;
virtual CColModel * ReadCOL ( const CBuffer& fileData ) = 0;
virtual void DestroyDFF ( RpClump * pClump ) = 0;
virtual void DestroyTXD ( RwTexDictionary * pTXD ) = 0;
virtual void DestroyTexture ( RwTexture * pTex ) = 0;
virtual void ReplaceCollisions ( CColModel * pColModel, unsigned short usModelID ) = 0;
virtual unsigned int LoadAtomics ( RpClump * pClump, RpAtomicContainer * pAtomics ) = 0;
virtual void ReplaceAllAtomicsInModel ( RpClump * pSrc, unsigned short usModelID ) = 0;
virtual void ReplaceAllAtomicsInClump ( RpClump * pDst, RpAtomicContainer * pAtomics, unsigned int uiAtomics ) = 0;
virtual void ReplaceWheels ( RpClump * pClump, RpAtomicContainer * pAtomics, unsigned int uiAtomics, const char * szWheel ) = 0;
virtual void RepositionAtomic ( RpClump * pDst, RpClump * pSrc, const char * szName ) = 0;
virtual void AddAllAtomics ( RpClump * pDst, RpClump * pSrc ) = 0;
virtual void ReplaceVehicleModel ( RpClump * pNew, unsigned short usModelID ) = 0;
virtual void ReplaceWeaponModel ( RpClump * pNew, unsigned short usModelID ) = 0;
virtual void ReplacePedModel ( RpClump * pNew, unsigned short usModelID ) = 0;
virtual bool ReplacePartModels ( RpClump * pClump, RpAtomicContainer * pAtomics, unsigned int uiAtomics, const char * szName ) = 0;
virtual void PulseWorldTextureWatch ( void ) = 0;
virtual void GetModelTextureNames ( std::vector < SString >& outNameList, ushort usModelID ) = 0;
virtual const char* GetTextureName ( CD3DDUMMY* pD3DData ) = 0;
virtual void SetRenderingClientEntity ( CClientEntityBase* pClientEntity, ushort usModelId, int iTypeMask ) = 0;
virtual SShaderItemLayers* GetAppliedShaderForD3DData ( CD3DDUMMY* pD3DData ) = 0;
virtual void AppendAdditiveMatch ( CSHADERDUMMY* pShaderData, CClientEntityBase* pClientEntity, const char* strTextureNameMatch, float fShaderPriority, bool bShaderLayered, int iTypeMask, uint uiShaderCreateTime, bool bShaderUsesVertexShader, bool bAppendLayers ) = 0;
virtual void AppendSubtractiveMatch ( CSHADERDUMMY* pShaderData, CClientEntityBase* pClientEntity, const char* strTextureNameMatch ) = 0;
virtual void RemoveClientEntityRefs ( CClientEntityBase* pClientEntity ) = 0;
virtual void RemoveShaderRefs ( CSHADERDUMMY* pShaderItem ) = 0;
virtual RwFrame * GetFrameFromName ( RpClump * pRoot, SString strName ) = 0;
};
#endif
|
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Crypto user configuration API.
*
* Copyright (C) 2011 secunet Security Networks AG
* Copyright (C) 2011 Steffen Klassert <steffen.klassert@secunet.com>
*
* 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.
*/
#ifndef _UAPI_LINUX_CRYPTOUSER_H
#define _UAPI_LINUX_CRYPTOUSER_H
#include <linux/types.h>
/* Netlink configuration messages. */
enum {
CRYPTO_MSG_BASE = 0x10,
CRYPTO_MSG_NEWALG = 0x10,
CRYPTO_MSG_DELALG,
CRYPTO_MSG_UPDATEALG,
CRYPTO_MSG_GETALG,
CRYPTO_MSG_DELRNG,
CRYPTO_MSG_GETSTAT,
__CRYPTO_MSG_MAX
};
#define CRYPTO_MSG_MAX (__CRYPTO_MSG_MAX - 1)
#define CRYPTO_NR_MSGTYPES (CRYPTO_MSG_MAX + 1 - CRYPTO_MSG_BASE)
#define CRYPTO_MAX_NAME 64
/* Netlink message attributes. */
enum crypto_attr_type_t {
CRYPTOCFGA_UNSPEC,
CRYPTOCFGA_PRIORITY_VAL, /* __u32 */
CRYPTOCFGA_REPORT_LARVAL, /* struct crypto_report_larval */
CRYPTOCFGA_REPORT_HASH, /* struct crypto_report_hash */
CRYPTOCFGA_REPORT_BLKCIPHER, /* struct crypto_report_blkcipher */
CRYPTOCFGA_REPORT_AEAD, /* struct crypto_report_aead */
CRYPTOCFGA_REPORT_COMPRESS, /* struct crypto_report_comp */
CRYPTOCFGA_REPORT_RNG, /* struct crypto_report_rng */
CRYPTOCFGA_REPORT_CIPHER, /* struct crypto_report_cipher */
CRYPTOCFGA_REPORT_AKCIPHER, /* struct crypto_report_akcipher */
CRYPTOCFGA_REPORT_KPP, /* struct crypto_report_kpp */
CRYPTOCFGA_REPORT_ACOMP, /* struct crypto_report_acomp */
CRYPTOCFGA_STAT_LARVAL, /* struct crypto_stat */
CRYPTOCFGA_STAT_HASH, /* struct crypto_stat */
CRYPTOCFGA_STAT_BLKCIPHER, /* struct crypto_stat */
CRYPTOCFGA_STAT_AEAD, /* struct crypto_stat */
CRYPTOCFGA_STAT_COMPRESS, /* struct crypto_stat */
CRYPTOCFGA_STAT_RNG, /* struct crypto_stat */
CRYPTOCFGA_STAT_CIPHER, /* struct crypto_stat */
CRYPTOCFGA_STAT_AKCIPHER, /* struct crypto_stat */
CRYPTOCFGA_STAT_KPP, /* struct crypto_stat */
CRYPTOCFGA_STAT_ACOMP, /* struct crypto_stat */
__CRYPTOCFGA_MAX
#define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
};
struct crypto_user_alg {
char cru_name[CRYPTO_MAX_NAME];
char cru_driver_name[CRYPTO_MAX_NAME];
char cru_module_name[CRYPTO_MAX_NAME];
__u32 cru_type;
__u32 cru_mask;
__u32 cru_refcnt;
__u32 cru_flags;
};
struct crypto_stat_aead {
char type[CRYPTO_MAX_NAME];
__u64 stat_encrypt_cnt;
__u64 stat_encrypt_tlen;
__u64 stat_decrypt_cnt;
__u64 stat_decrypt_tlen;
__u64 stat_err_cnt;
};
struct crypto_stat_akcipher {
char type[CRYPTO_MAX_NAME];
__u64 stat_encrypt_cnt;
__u64 stat_encrypt_tlen;
__u64 stat_decrypt_cnt;
__u64 stat_decrypt_tlen;
__u64 stat_verify_cnt;
__u64 stat_sign_cnt;
__u64 stat_err_cnt;
};
struct crypto_stat_cipher {
char type[CRYPTO_MAX_NAME];
__u64 stat_encrypt_cnt;
__u64 stat_encrypt_tlen;
__u64 stat_decrypt_cnt;
__u64 stat_decrypt_tlen;
__u64 stat_err_cnt;
};
struct crypto_stat_compress {
char type[CRYPTO_MAX_NAME];
__u64 stat_compress_cnt;
__u64 stat_compress_tlen;
__u64 stat_decompress_cnt;
__u64 stat_decompress_tlen;
__u64 stat_err_cnt;
};
struct crypto_stat_hash {
char type[CRYPTO_MAX_NAME];
__u64 stat_hash_cnt;
__u64 stat_hash_tlen;
__u64 stat_err_cnt;
};
struct crypto_stat_kpp {
char type[CRYPTO_MAX_NAME];
__u64 stat_setsecret_cnt;
__u64 stat_generate_public_key_cnt;
__u64 stat_compute_shared_secret_cnt;
__u64 stat_err_cnt;
};
struct crypto_stat_rng {
char type[CRYPTO_MAX_NAME];
__u64 stat_generate_cnt;
__u64 stat_generate_tlen;
__u64 stat_seed_cnt;
__u64 stat_err_cnt;
};
struct crypto_stat_larval {
char type[CRYPTO_MAX_NAME];
};
struct crypto_report_larval {
char type[CRYPTO_MAX_NAME];
};
struct crypto_report_hash {
char type[CRYPTO_MAX_NAME];
unsigned int blocksize;
unsigned int digestsize;
};
struct crypto_report_cipher {
char type[CRYPTO_MAX_NAME];
unsigned int blocksize;
unsigned int min_keysize;
unsigned int max_keysize;
};
struct crypto_report_blkcipher {
char type[CRYPTO_MAX_NAME];
char geniv[CRYPTO_MAX_NAME];
unsigned int blocksize;
unsigned int min_keysize;
unsigned int max_keysize;
unsigned int ivsize;
};
struct crypto_report_aead {
char type[CRYPTO_MAX_NAME];
char geniv[CRYPTO_MAX_NAME];
unsigned int blocksize;
unsigned int maxauthsize;
unsigned int ivsize;
};
struct crypto_report_comp {
char type[CRYPTO_MAX_NAME];
};
struct crypto_report_rng {
char type[CRYPTO_MAX_NAME];
unsigned int seedsize;
};
struct crypto_report_akcipher {
char type[CRYPTO_MAX_NAME];
};
struct crypto_report_kpp {
char type[CRYPTO_MAX_NAME];
};
struct crypto_report_acomp {
char type[CRYPTO_MAX_NAME];
};
#define CRYPTO_REPORT_MAXSIZE (sizeof(struct crypto_user_alg) + \
sizeof(struct crypto_report_blkcipher))
#endif /* _UAPI_LINUX_CRYPTOUSER_H */
|
/*
* ioreq.h: I/O request definitions for device models
* Copyright (c) 2004, Intel Corporation.
*
* 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 _IOREQ_H_
#define _IOREQ_H_
#define IOREQ_READ 1
#define IOREQ_WRITE 0
#define STATE_IOREQ_NONE 0
#define STATE_IOREQ_READY 1
#define STATE_IOREQ_INPROCESS 2
#define STATE_IORESP_READY 3
#define IOREQ_TYPE_PIO 0 /* pio */
#define IOREQ_TYPE_COPY 1 /* mmio ops */
#define IOREQ_TYPE_PCI_CONFIG 2
#define IOREQ_TYPE_TIMEOFFSET 7
#define IOREQ_TYPE_INVALIDATE 8 /* mapcache */
/*
* VMExit dispatcher should cooperate with instruction decoder to
* prepare this structure and notify service OS and DM by sending
* virq.
*
* For I/O type IOREQ_TYPE_PCI_CONFIG, the physical address is formatted
* as follows:
*
* 63....48|47..40|39..35|34..32|31........0
* SEGMENT |BUS |DEV |FN |OFFSET
*/
struct ioreq {
uint64_t addr; /* physical address */
uint64_t data; /* data (or paddr of data) */
uint32_t count; /* for rep prefixes */
uint32_t size; /* size in bytes */
uint32_t vp_eport; /* evtchn for notifications to/from device model */
uint16_t _pad0;
uint8_t state:4;
uint8_t data_is_ptr:1; /* if 1, data above is the guest paddr
* of the real data to use. */
uint8_t dir:1; /* 1=read, 0=write */
uint8_t df:1;
uint8_t _pad1:1;
uint8_t type; /* I/O type */
};
typedef struct ioreq ioreq_t;
struct shared_iopage {
struct ioreq vcpu_ioreq[1];
};
typedef struct shared_iopage shared_iopage_t;
struct buf_ioreq {
uint8_t type; /* I/O type */
uint8_t pad:1;
uint8_t dir:1; /* 1=read, 0=write */
uint8_t size:2; /* 0=>1, 1=>2, 2=>4, 3=>8. If 8, use two buf_ioreqs */
uint32_t addr:20;/* physical address */
uint32_t data; /* data */
};
typedef struct buf_ioreq buf_ioreq_t;
#define IOREQ_BUFFER_SLOT_NUM 511 /* 8 bytes each, plus 2 4-byte indexes */
struct buffered_iopage {
#ifdef __XEN__
union bufioreq_pointers {
struct {
#endif
uint32_t read_pointer;
uint32_t write_pointer;
#ifdef __XEN__
};
uint64_t full;
} ptrs;
#endif
buf_ioreq_t buf_ioreq[IOREQ_BUFFER_SLOT_NUM];
}; /* NB. Size of this structure must be no greater than one page. */
typedef struct buffered_iopage buffered_iopage_t;
/*
* ACPI Control/Event register locations. Location is controlled by a
* version number in HVM_PARAM_ACPI_IOPORTS_LOCATION.
*/
/* Version 0 (default): Traditional Xen locations. */
#define ACPI_PM1A_EVT_BLK_ADDRESS_V0 0x1f40
#define ACPI_PM1A_CNT_BLK_ADDRESS_V0 (ACPI_PM1A_EVT_BLK_ADDRESS_V0 + 0x04)
#define ACPI_PM_TMR_BLK_ADDRESS_V0 (ACPI_PM1A_EVT_BLK_ADDRESS_V0 + 0x08)
#define ACPI_GPE0_BLK_ADDRESS_V0 (ACPI_PM_TMR_BLK_ADDRESS_V0 + 0x20)
#define ACPI_GPE0_BLK_LEN_V0 0x08
/* Version 1: Locations preferred by modern Qemu. */
#define ACPI_PM1A_EVT_BLK_ADDRESS_V1 0xb000
#define ACPI_PM1A_CNT_BLK_ADDRESS_V1 (ACPI_PM1A_EVT_BLK_ADDRESS_V1 + 0x04)
#define ACPI_PM_TMR_BLK_ADDRESS_V1 (ACPI_PM1A_EVT_BLK_ADDRESS_V1 + 0x08)
#define ACPI_GPE0_BLK_ADDRESS_V1 0xafe0
#define ACPI_GPE0_BLK_LEN_V1 0x04
/* Compatibility definitions for the default location (version 0). */
#define ACPI_PM1A_EVT_BLK_ADDRESS ACPI_PM1A_EVT_BLK_ADDRESS_V0
#define ACPI_PM1A_CNT_BLK_ADDRESS ACPI_PM1A_CNT_BLK_ADDRESS_V0
#define ACPI_PM_TMR_BLK_ADDRESS ACPI_PM_TMR_BLK_ADDRESS_V0
#define ACPI_GPE0_BLK_ADDRESS ACPI_GPE0_BLK_ADDRESS_V0
#define ACPI_GPE0_BLK_LEN ACPI_GPE0_BLK_LEN_V0
#endif /* _IOREQ_H_ */
/*
* Local variables:
* mode: C
* c-file-style: "BSD"
* c-basic-offset: 4
* tab-width: 4
* indent-tabs-mode: nil
* End:
*/
|
#include "base/arch.h"
#if defined(_M_IX86) || defined(_M_X64)
#include <emmintrin.h>
#include "fast_matrix.h"
void fast_matrix_mul_4x4_sse(float *dest, const float *a, const float *b) {
int i;
__m128 a_col_1 = _mm_loadu_ps(a);
__m128 a_col_2 = _mm_loadu_ps(&a[4]);
__m128 a_col_3 = _mm_loadu_ps(&a[8]);
__m128 a_col_4 = _mm_loadu_ps(&a[12]);
for (i = 0; i < 16; i += 4) {
__m128 r_col = _mm_mul_ps(a_col_1, _mm_set1_ps(b[i]));
r_col = _mm_add_ps(r_col, _mm_mul_ps(a_col_2, _mm_set1_ps(b[i + 1])));
r_col = _mm_add_ps(r_col, _mm_mul_ps(a_col_3, _mm_set1_ps(b[i + 2])));
r_col = _mm_add_ps(r_col, _mm_mul_ps(a_col_4, _mm_set1_ps(b[i + 3])));
_mm_storeu_ps(&dest[i], r_col);
}
}
#endif
|
/*
* S390 version
*
* Derived from "include/asm-i386/mmu_context.h"
*/
#ifndef __S390_MMU_CONTEXT_H
#define __S390_MMU_CONTEXT_H
#include <asm/pgalloc.h>
#include <linux/uaccess.h>
#include <linux/mm_types.h>
#include <asm/tlbflush.h>
#include <asm/ctl_reg.h>
static inline int init_new_context(struct task_struct *tsk,
struct mm_struct *mm)
{
spin_lock_init(&mm->context.pgtable_lock);
INIT_LIST_HEAD(&mm->context.pgtable_list);
spin_lock_init(&mm->context.gmap_lock);
INIT_LIST_HEAD(&mm->context.gmap_list);
cpumask_clear(&mm->context.cpu_attach_mask);
atomic_set(&mm->context.flush_count, 0);
mm->context.gmap_asce = 0;
mm->context.flush_mm = 0;
#ifdef CONFIG_PGSTE
mm->context.alloc_pgste = page_table_allocate_pgste;
mm->context.has_pgste = 0;
mm->context.use_skey = 0;
#endif
switch (mm->context.asce_limit) {
case 1UL << 42:
/*
* forked 3-level task, fall through to set new asce with new
* mm->pgd
*/
case 0:
/* context created by exec, set asce limit to 4TB */
mm->context.asce_limit = STACK_TOP_MAX;
mm->context.asce = __pa(mm->pgd) | _ASCE_TABLE_LENGTH |
_ASCE_USER_BITS | _ASCE_TYPE_REGION3;
break;
case 1UL << 53:
/* forked 4-level task, set new asce with new mm->pgd */
mm->context.asce = __pa(mm->pgd) | _ASCE_TABLE_LENGTH |
_ASCE_USER_BITS | _ASCE_TYPE_REGION2;
break;
case 1UL << 31:
/* forked 2-level compat task, set new asce with new mm->pgd */
mm->context.asce = __pa(mm->pgd) | _ASCE_TABLE_LENGTH |
_ASCE_USER_BITS | _ASCE_TYPE_SEGMENT;
/* pgd_alloc() did not increase mm->nr_pmds */
mm_inc_nr_pmds(mm);
}
crst_table_init((unsigned long *) mm->pgd, pgd_entry_type(mm));
return 0;
}
#define destroy_context(mm) do { } while (0)
static inline void set_user_asce(struct mm_struct *mm)
{
S390_lowcore.user_asce = mm->context.asce;
if (current->thread.mm_segment.ar4)
__ctl_load(S390_lowcore.user_asce, 7, 7);
set_cpu_flag(CIF_ASCE_PRIMARY);
}
static inline void clear_user_asce(void)
{
S390_lowcore.user_asce = S390_lowcore.kernel_asce;
__ctl_load(S390_lowcore.user_asce, 1, 1);
__ctl_load(S390_lowcore.user_asce, 7, 7);
}
static inline void load_kernel_asce(void)
{
unsigned long asce;
__ctl_store(asce, 1, 1);
if (asce != S390_lowcore.kernel_asce)
__ctl_load(S390_lowcore.kernel_asce, 1, 1);
set_cpu_flag(CIF_ASCE_PRIMARY);
}
static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
struct task_struct *tsk)
{
int cpu = smp_processor_id();
S390_lowcore.user_asce = next->context.asce;
if (prev == next)
return;
cpumask_set_cpu(cpu, &next->context.cpu_attach_mask);
cpumask_set_cpu(cpu, mm_cpumask(next));
/* Clear old ASCE by loading the kernel ASCE. */
__ctl_load(S390_lowcore.kernel_asce, 1, 1);
__ctl_load(S390_lowcore.kernel_asce, 7, 7);
cpumask_clear_cpu(cpu, &prev->context.cpu_attach_mask);
}
#define finish_arch_post_lock_switch finish_arch_post_lock_switch
static inline void finish_arch_post_lock_switch(void)
{
struct task_struct *tsk = current;
struct mm_struct *mm = tsk->mm;
load_kernel_asce();
if (mm) {
preempt_disable();
while (atomic_read(&mm->context.flush_count))
cpu_relax();
if (mm->context.flush_mm)
__tlb_flush_mm(mm);
preempt_enable();
}
set_fs(current->thread.mm_segment);
}
#define enter_lazy_tlb(mm,tsk) do { } while (0)
#define deactivate_mm(tsk,mm) do { } while (0)
static inline void activate_mm(struct mm_struct *prev,
struct mm_struct *next)
{
switch_mm(prev, next, current);
set_user_asce(next);
}
static inline void arch_dup_mmap(struct mm_struct *oldmm,
struct mm_struct *mm)
{
}
static inline void arch_exit_mmap(struct mm_struct *mm)
{
}
static inline void arch_unmap(struct mm_struct *mm,
struct vm_area_struct *vma,
unsigned long start, unsigned long end)
{
}
static inline void arch_bprm_mm_init(struct mm_struct *mm,
struct vm_area_struct *vma)
{
}
static inline bool arch_vma_access_permitted(struct vm_area_struct *vma,
bool write, bool execute, bool foreign)
{
/* by default, allow everything */
return true;
}
static inline bool arch_pte_access_permitted(pte_t pte, bool write)
{
/* by default, allow everything */
return true;
}
#endif /* __S390_MMU_CONTEXT_H */
|
#include <xen/types.h>
#include <xen/sched.h>
#include "mcaction.h"
#include "vmce.h"
#include "mce.h"
static struct mcinfo_recovery *
mci_action_add_pageoffline(int bank, struct mc_info *mi,
uint64_t mfn, uint32_t status)
{
struct mcinfo_recovery *rec;
if (!mi)
return NULL;
rec = x86_mcinfo_reserve(mi, sizeof(*rec));
if (!rec) {
mi->flags |= MCINFO_FLAGS_UNCOMPLETE;
return NULL;
}
rec->common.type = MC_TYPE_RECOVERY;
rec->common.size = sizeof(*rec);
rec->mc_bank = bank;
rec->action_types = MC_ACTION_PAGE_OFFLINE;
rec->action_info.page_retire.mfn = mfn;
rec->action_info.page_retire.status = status;
return rec;
}
mce_check_addr_t mc_check_addr = NULL;
void mce_register_addrcheck(mce_check_addr_t cbfunc)
{
mc_check_addr = cbfunc;
}
void
mc_memerr_dhandler(struct mca_binfo *binfo,
enum mce_result *result,
struct cpu_user_regs *regs)
{
struct mcinfo_bank *bank = binfo->mib;
struct mcinfo_global *global = binfo->mig;
struct domain *d;
unsigned long mfn, gfn;
uint32_t status;
int vmce_vcpuid;
if (!mc_check_addr(bank->mc_status, bank->mc_misc, MC_ADDR_PHYSICAL)) {
dprintk(XENLOG_WARNING,
"No physical address provided for memory error\n");
return;
}
mfn = bank->mc_addr >> PAGE_SHIFT;
if (offline_page(mfn, 1, &status))
{
dprintk(XENLOG_WARNING,
"Failed to offline page %lx for MCE error\n", mfn);
return;
}
mci_action_add_pageoffline(binfo->bank, binfo->mi, mfn, status);
/* This is free page */
if (status & PG_OFFLINE_OFFLINED)
*result = MCER_RECOVERED;
else if (status & PG_OFFLINE_AGAIN)
*result = MCER_CONTINUE;
else if (status & PG_OFFLINE_PENDING) {
/* This page has owner */
if (status & PG_OFFLINE_OWNED) {
bank->mc_domid = status >> PG_OFFLINE_OWNER_SHIFT;
mce_printk(MCE_QUIET, "MCE: This error page is ownded"
" by DOM %d\n", bank->mc_domid);
/* XXX: Cannot handle shared pages yet
* (this should identify all domains and gfn mapping to
* the mfn in question) */
BUG_ON( bank->mc_domid == DOMID_COW );
if ( bank->mc_domid != DOMID_XEN ) {
d = get_domain_by_id(bank->mc_domid);
ASSERT(d);
gfn = get_gpfn_from_mfn((bank->mc_addr) >> PAGE_SHIFT);
if ( unmmap_broken_page(d, _mfn(mfn), gfn) )
{
printk("Unmap broken memory %lx for DOM%d failed\n",
mfn, d->domain_id);
goto vmce_failed;
}
bank->mc_addr = gfn << PAGE_SHIFT |
(bank->mc_addr & (PAGE_SIZE -1 ));
if ( fill_vmsr_data(bank, d,
global->mc_gstatus) == -1 )
{
mce_printk(MCE_QUIET, "Fill vMCE# data for DOM%d "
"failed\n", bank->mc_domid);
goto vmce_failed;
}
if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
vmce_vcpuid = VMCE_INJECT_BROADCAST;
else
vmce_vcpuid = global->mc_vcpuid;
/* We will inject vMCE to DOMU*/
if ( inject_vmce(d, vmce_vcpuid) < 0 )
{
mce_printk(MCE_QUIET, "inject vMCE to DOM%d"
" failed\n", d->domain_id);
goto vmce_failed;
}
/* Impacted domain go on with domain's recovery job
* if the domain has its own MCA handler.
* For xen, it has contained the error and finished
* its own recovery job.
*/
*result = MCER_RECOVERED;
put_domain(d);
return;
vmce_failed:
put_domain(d);
domain_crash(d);
}
}
}
}
|
/**********************************************************************
Audacity: A Digital Audio Editor
Internat.h
Markus Meyer
Dominic Mazzoni (Mac OS X code)
**********************************************************************/
#ifndef __AUDACITY_INTERNAT__
#define __AUDACITY_INTERNAT__
#include <wx/arrstr.h>
#include <wx/string.h>
#include <wx/longlong.h>
class Internat
{
public:
/** \brief Initialize internationalisation support. Call this once at
* program start. */
static void Init();
/** \brief Get the decimal separator for the current locale.
*
* Normally, this is a decimal point ('.'), but e.g. Germany uses a
* comma (',').*/
static wxChar GetDecimalSeparator();
/** \brief Convert a string to a number.
*
* This function will accept BOTH point and comma as a decimal separator,
* regardless of the current locale.
* Returns 'true' on success, and 'false' if an error occurs. */
static bool CompatibleToDouble(const wxString& stringToConvert, double* result);
// Function version of above.
static double CompatibleToDouble(const wxString& stringToConvert);
/** \brief Convert a number to a string, always uses the dot as decimal
* separator*/
static wxString ToString(double numberToConvert,
int digitsAfterDecimalPoint = -1);
/** \brief Convert a number to a string, uses the user's locale's decimal
* separator */
static wxString ToDisplayString(double numberToConvert,
int digitsAfterDecimalPoint = -1);
/** \brief Convert a number to a string while formatting it in bytes, KB,
* MB, GB */
static wxString FormatSize(wxLongLong size);
static wxString FormatSize(double size);
/** \brief Protect against Unicode to multi-byte conversion failures
* on Windows */
#if defined(__WXMSW__)
static char *VerifyFilename(const wxString &s, bool input = true);
#endif
/** \brief Check a proposed file name string for illegal characters and
* remove them */
static wxString SanitiseFilename(const wxString &name, const wxString &sub);
/** \brief Remove accelerator charactors from strings
*
* Utility function - takes a translatable string to be used as a menu item,
* for example _("&Splash...\tAlt+S"), and strips all of the menu
* accelerator stuff from it, to make "Splash". That way the same
* translatable string can be used both when accelerators are needed and
* when they aren't, saving translators effort. */
static wxString StripAccelerators(const wxString& str);
private:
static wxChar mDecimalSeparator;
// stuff for file name sanitisation
static wxString forbid;
static wxArrayString exclude;
static wxCharBuffer mFilename;
};
#define _NoAcc(X) Internat::StripAccelerators(_(X))
// Use this macro to wrap all filenames and pathnames that get
// passed directly to a system call, like opening a file, creating
// a directory, checking to see that a file exists, etc...
#if defined(__WXMSW__)
// Note, on Windows we don't define an OSFILENAME() to prevent accidental use.
// See VerifyFilename() for an explanation.
#define OSINPUT(X) Internat::VerifyFilename(X, true)
#define OSOUTPUT(X) Internat::VerifyFilename(X, false)
#elif defined(__WXMAC__)
#define OSFILENAME(X) ((char *) (const char *)(X).fn_str())
#define OSINPUT(X) OSFILENAME(X)
#define OSOUTPUT(X) OSFILENAME(X)
#else
#define OSFILENAME(X) ((char *) (const char *)(X).mb_str())
#define OSINPUT(X) OSFILENAME(X)
#define OSOUTPUT(X) OSFILENAME(X)
#endif
// Convert C strings to wxString
#define UTF8CTOWX(X) wxString((X), wxConvUTF8)
#define LAT1CTOWX(X) wxString((X), wxConvISO8859_1)
#endif
|
/* eggaccelerators.h
* Copyright (C) 2002 Red Hat, Inc.
* Developed by Havoc Pennington
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __EGG_ACCELERATORS_H__
#define __EGG_ACCELERATORS_H__
#include <gtk/gtkaccelgroup.h>
#include <gdk/gdk.h>
G_BEGIN_DECLS
/* Where a value is also in GdkModifierType we coincide,
* otherwise we don't overlap.
*/
typedef enum
{
EGG_VIRTUAL_SHIFT_MASK = 1 << 0,
EGG_VIRTUAL_LOCK_MASK = 1 << 1,
EGG_VIRTUAL_CONTROL_MASK = 1 << 2,
EGG_VIRTUAL_ALT_MASK = 1 << 3, /* fixed as Mod1 */
EGG_VIRTUAL_MOD2_MASK = 1 << 4,
EGG_VIRTUAL_MOD3_MASK = 1 << 5,
EGG_VIRTUAL_MOD4_MASK = 1 << 6,
EGG_VIRTUAL_MOD5_MASK = 1 << 7,
#if 0
GDK_BUTTON1_MASK = 1 << 8,
GDK_BUTTON2_MASK = 1 << 9,
GDK_BUTTON3_MASK = 1 << 10,
GDK_BUTTON4_MASK = 1 << 11,
GDK_BUTTON5_MASK = 1 << 12,
/* 13, 14 are used by Xkb for the keyboard group */
#endif
EGG_VIRTUAL_META_MASK = 1 << 24,
EGG_VIRTUAL_SUPER_MASK = 1 << 25,
EGG_VIRTUAL_HYPER_MASK = 1 << 26,
EGG_VIRTUAL_MODE_SWITCH_MASK = 1 << 27,
EGG_VIRTUAL_NUM_LOCK_MASK = 1 << 28,
EGG_VIRTUAL_SCROLL_LOCK_MASK = 1 << 29,
/* Also in GdkModifierType */
EGG_VIRTUAL_RELEASE_MASK = 1 << 30,
/* 28-31 24-27 20-23 16-19 12-15 8-11 4-7 0-3
* 7 f 0 0 0 0 f f
*/
EGG_VIRTUAL_MODIFIER_MASK = 0x7f0000ff
} EggVirtualModifierType;
gboolean egg_accelerator_parse_virtual (const gchar *accelerator,
guint *accelerator_key,
EggVirtualModifierType *accelerator_mods);
void egg_keymap_resolve_virtual_modifiers (GdkKeymap *keymap,
EggVirtualModifierType virtual_mods,
GdkModifierType *concrete_mods);
void egg_keymap_virtualize_modifiers (GdkKeymap *keymap,
GdkModifierType concrete_mods,
EggVirtualModifierType *virtual_mods);
gchar* egg_virtual_accelerator_name (guint accelerator_key,
EggVirtualModifierType accelerator_mods);
G_END_DECLS
#endif /* __EGG_ACCELERATORS_H__ */
|
/*
* cynapses libc functions
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.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 Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file c_macro.h
*
* @brief cynapses libc macro definitions
*
* @defgroup cynMacroInternals cynapses libc macro definitions
* @ingroup cynLibraryAPI
*
* @{
*/
#ifndef _C_MACRO_H
#define _C_MACRO_H
#include <stdint.h>
#include <string.h>
#define INT_TO_POINTER(i) (void *) i
#define POINTER_TO_INT(p) *((int *) (p))
/** Zero a structure */
#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
/** Zero a structure given a pointer to the structure */
#define ZERO_STRUCTP(x) do { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); } while(0)
/** Free memory and zero the pointer */
#define SAFE_FREE(x) do { if ((x) != NULL) {free((void*)x); x=NULL;} } while(0)
/** Get the smaller value */
#define MIN(a,b) ((a) < (b) ? (a) : (b))
/** Get the bigger value */
#define MAX(a,b) ((a) < (b) ? (b) : (a))
/** Get the size of an array */
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
/**
* This is a hack to fix warnings. The idea is to use this everywhere that we
* get the "discarding const" warning by the compiler. That doesn't actually
* fix the real issue, but marks the place and you can search the code for
* discard_const.
*
* Please use this macro only when there is no other way to fix the warning.
* We should use this function in only in a very few places.
*
* Also, please call this via the discard_const_p() macro interface, as that
* makes the return type safe.
*/
#define discard_const(ptr) ((void *)((uintptr_t)(ptr)))
/**
* Type-safe version of discard_const
*/
#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
#if (__GNUC__ >= 3)
# ifndef likely
# define likely(x) __builtin_expect(!!(x), 1)
# endif
# ifndef unlikely
# define unlikely(x) __builtin_expect(!!(x), 0)
# endif
#else /* __GNUC__ */
# ifndef likely
# define likely(x) (x)
# endif
# ifndef unlikely
# define unlikely(x) (x)
# endif
#endif /* __GNUC__ */
/**
* }@
*/
#ifdef _WIN32
/* missing errno codes on mingw */
#ifndef ENOTBLK
#define ENOTBLK 15
#endif
#ifndef ETXTBSY
#define ETXTBSY 26
#endif
#ifndef ENOBUFS
#define ENOBUFS WSAENOBUFS
#endif
#endif /* _WIN32 */
#endif /* _C_MACRO_H */
|
/* zsyt02.f -- translated by f2c (version 20061008).
You must link the resulting object file with libf2c:
on Microsoft Windows system, link with libf2c.lib;
on Linux or Unix systems, link with .../path/to/libf2c.a -lm
or, if you install libf2c.a in a standard place, with -lf2c -lm
-- in that order, at the end of the command line, as in
cc *.o -lf2c -lm
Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
http://www.netlib.org/f2c/libf2c.zip
*/
#include "f2c.h"
#include "blaswrap.h"
/* Table of constant values */
static doublecomplex c_b1 = {1.,0.};
static integer c__1 = 1;
/* Subroutine */ int zsyt02_(char *uplo, integer *n, integer *nrhs,
doublecomplex *a, integer *lda, doublecomplex *x, integer *ldx,
doublecomplex *b, integer *ldb, doublereal *rwork, doublereal *resid)
{
/* System generated locals */
integer a_dim1, a_offset, b_dim1, b_offset, x_dim1, x_offset, i__1;
doublereal d__1, d__2;
doublecomplex z__1;
/* Local variables */
integer j;
doublereal eps, anorm, bnorm, xnorm;
extern /* Subroutine */ int zsymm_(char *, char *, integer *, integer *,
doublecomplex *, doublecomplex *, integer *, doublecomplex *,
integer *, doublecomplex *, doublecomplex *, integer *);
extern doublereal dlamch_(char *), dzasum_(integer *,
doublecomplex *, integer *), zlansy_(char *, char *, integer *,
doublecomplex *, integer *, doublereal *);
/* -- LAPACK test routine (version 3.1) -- */
/* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
/* November 2006 */
/* .. Scalar Arguments .. */
/* .. */
/* .. Array Arguments .. */
/* .. */
/* Purpose */
/* ======= */
/* ZSYT02 computes the residual for a solution to a complex symmetric */
/* system of linear equations A*x = b: */
/* RESID = norm(B - A*X) / ( norm(A) * norm(X) * EPS ), */
/* where EPS is the machine epsilon. */
/* Arguments */
/* ========= */
/* UPLO (input) CHARACTER*1 */
/* Specifies whether the upper or lower triangular part of the */
/* symmetric matrix A is stored: */
/* = 'U': Upper triangular */
/* = 'L': Lower triangular */
/* N (input) INTEGER */
/* The number of rows and columns of the matrix A. N >= 0. */
/* NRHS (input) INTEGER */
/* The number of columns of B, the matrix of right hand sides. */
/* NRHS >= 0. */
/* A (input) COMPLEX*16 array, dimension (LDA,N) */
/* The original complex symmetric matrix A. */
/* LDA (input) INTEGER */
/* The leading dimension of the array A. LDA >= max(1,N) */
/* X (input) COMPLEX*16 array, dimension (LDX,NRHS) */
/* The computed solution vectors for the system of linear */
/* equations. */
/* LDX (input) INTEGER */
/* The leading dimension of the array X. LDX >= max(1,N). */
/* B (input/output) COMPLEX*16 array, dimension (LDB,NRHS) */
/* On entry, the right hand side vectors for the system of */
/* linear equations. */
/* On exit, B is overwritten with the difference B - A*X. */
/* LDB (input) INTEGER */
/* The leading dimension of the array B. LDB >= max(1,N). */
/* RWORK (workspace) DOUBLE PRECISION array, dimension (N) */
/* RESID (output) DOUBLE PRECISION */
/* The maximum over the number of right hand sides of */
/* norm(B - A*X) / ( norm(A) * norm(X) * EPS ). */
/* ===================================================================== */
/* .. Parameters .. */
/* .. */
/* .. Local Scalars .. */
/* .. */
/* .. External Functions .. */
/* .. */
/* .. External Subroutines .. */
/* .. */
/* .. Intrinsic Functions .. */
/* .. */
/* .. Executable Statements .. */
/* Quick exit if N = 0 or NRHS = 0 */
/* Parameter adjustments */
a_dim1 = *lda;
a_offset = 1 + a_dim1;
a -= a_offset;
x_dim1 = *ldx;
x_offset = 1 + x_dim1;
x -= x_offset;
b_dim1 = *ldb;
b_offset = 1 + b_dim1;
b -= b_offset;
--rwork;
/* Function Body */
if (*n <= 0 || *nrhs <= 0) {
*resid = 0.;
return 0;
}
/* Exit with RESID = 1/EPS if ANORM = 0. */
eps = dlamch_("Epsilon");
anorm = zlansy_("1", uplo, n, &a[a_offset], lda, &rwork[1]);
if (anorm <= 0.) {
*resid = 1. / eps;
return 0;
}
/* Compute B - A*X (or B - A'*X ) and store in B . */
z__1.r = -1., z__1.i = -0.;
zsymm_("Left", uplo, n, nrhs, &z__1, &a[a_offset], lda, &x[x_offset], ldx,
&c_b1, &b[b_offset], ldb);
/* Compute the maximum over the number of right hand sides of */
/* norm( B - A*X ) / ( norm(A) * norm(X) * EPS ) . */
*resid = 0.;
i__1 = *nrhs;
for (j = 1; j <= i__1; ++j) {
bnorm = dzasum_(n, &b[j * b_dim1 + 1], &c__1);
xnorm = dzasum_(n, &x[j * x_dim1 + 1], &c__1);
if (xnorm <= 0.) {
*resid = 1. / eps;
} else {
/* Computing MAX */
d__1 = *resid, d__2 = bnorm / anorm / xnorm / eps;
*resid = max(d__1,d__2);
}
/* L10: */
}
return 0;
/* End of ZSYT02 */
} /* zsyt02_ */
|
/* mbed Microcontroller Library
*******************************************************************************
* Copyright (c) 2015, STMicroelectronics
* 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. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************
*/
#ifndef MBED_CMSIS_NVIC_H
#define MBED_CMSIS_NVIC_H
// STM32L151CB
// CORE: 16 vectors = 64 bytes from 0x00 to 0x3F
// MCU Peripherals: 45 vectors = 180 bytes from 0x40 to 0xF3
// Total: 61 vectors = 244 bytes (0xF4) to be reserved in RAM
#define NVIC_NUM_VECTORS 61
#define NVIC_RAM_VECTOR_ADDRESS 0x20000000 // Vectors positioned at start of RAM
#endif
|
/**
******************************************************************************
* @file lcd_log_conf_template.h
* @author MCD Application Team
* @version V5.0.2
* @date 05-March-2012
* @brief lcd_log configuration template file.
* This file should be copied to the application folder and modified
* as follows:
* - Rename it to 'lcd_log_conf.h'.
* - Update the name of the LCD header file depending on the EVAL board
* you are using (see line32 below).
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (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.st.com/software_license_agreement_liberty_v2
*
* 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.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __LCD_LOG_CONF_H__
#define __LCD_LOG_CONF_H__
/* Includes ------------------------------------------------------------------*/
#include "stm32xxx_eval_lcd.h" /* replace 'stm32xxx' with your EVAL board name, ex: stm3210c_eval_lcd.h */
#include <stdio.h>
/** @addtogroup LCD_LOG
* @{
*/
/** @defgroup LCD_LOG
* @brief This file is the
* @{
*/
/** @defgroup LCD_LOG_CONF_Exported_Defines
* @{
*/
/* Comment the line below to disable the scroll back and forward features */
#define LCD_SCROLL_ENABLED
/* Define the LCD default text color */
#define LCD_LOG_DEFAULT_COLOR LCD_COLOR_WHITE
/* Define the display window settings */
#define YWINDOW_MIN 3
#define YWINDOW_SIZE 12
#define XWINDOW_MAX 50
/* Define the cache depth */
#define CACHE_SIZE 50
/** @defgroup LCD_LOG_CONF_Exported_TypesDefinitions
* @{
*/
/**
* @}
*/
/** @defgroup LCD_LOG_Exported_Macros
* @{
*/
/**
* @}
*/
/** @defgroup LCD_LOG_CONF_Exported_Variables
* @{
*/
/**
* @}
*/
/** @defgroup LCD_LOG_CONF_Exported_FunctionsPrototype
* @{
*/
/**
* @}
*/
#endif /* __LCD_LOG_H__ */
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
/*****************************************************************************
* dbus_root.h : dbus control module (mpris v1.0) - root object
*****************************************************************************
* Copyright © 2006-2008 Rafaël Carré
* Copyright © 2007-2010 Mirsal Ennaime
* Copyright © 2009-2010 The VideoLAN team
* $Id$
*
* Authors: Mirsal Ennaime <mirsal at mirsal fr>
* Rafaël Carré <funman at videolanorg>
*
* 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 _VLC_DBUS_ROOT_H
#define _VLC_DBUS_ROOT_H
#include "dbus_common.h"
/* DBUS IDENTIFIERS */
#define DBUS_MPRIS_ROOT_INTERFACE "org.mpris.MediaPlayer2"
/* Handle incoming dbus messages */
DBusHandlerResult handle_root ( DBusConnection *p_conn,
DBusMessage *p_from,
void *p_this );
int RootPropertiesChangedEmit ( intf_thread_t *,
vlc_dictionary_t * );
#endif //dbus-root.h
|
// license:GPL-2.0+
// copyright-holders:Raphael Nabet, Brett Wyer
/*****************************************************************************
*
* includes/concept.h
*
* Corvus Concept driver
*
* Raphael Nabet, 2003
*
****************************************************************************/
#ifndef MAME_INCLUDES_CONCEPT_H
#define MAME_INCLUDES_CONCEPT_H
#include "cpu/m68000/m68000.h"
#include "machine/6522via.h"
#include "machine/mos6551.h"
#include "machine/mm58174.h"
#include "sound/spkrdev.h"
#include "bus/a2bus/a2bus.h"
#define ACIA_0_TAG "acia0"
#define ACIA_1_TAG "acia1"
#define VIA_0_TAG "via6522_0"
#define KBD_ACIA_TAG "kbacia"
class concept_state : public driver_device
{
public:
concept_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_acia0(*this, ACIA_0_TAG),
m_acia1(*this, ACIA_1_TAG),
m_via0(*this, VIA_0_TAG),
m_kbdacia(*this, KBD_ACIA_TAG),
m_speaker(*this, "spkr"),
m_mm58174(*this, "mm58174"),
m_a2bus(*this, "a2bus"),
m_videoram(*this,"videoram")
{ }
void concept(machine_config &config);
private:
required_device<cpu_device> m_maincpu;
required_device<mos6551_device> m_acia0;
required_device<mos6551_device> m_acia1;
required_device<via6522_device> m_via0;
required_device<mos6551_device> m_kbdacia;
required_device<speaker_sound_device> m_speaker;
required_device<mm58174_device> m_mm58174;
required_device<a2bus_device> m_a2bus;
required_shared_ptr<uint16_t> m_videoram;
uint8_t m_pending_interrupts;
bool m_clock_enable;
uint8_t m_clock_address;
uint8_t io_r(offs_t offset);
void io_w(offs_t offset, uint8_t data);
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void video_start() override;
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint8_t via_in_a();
void via_out_a(uint8_t data);
uint8_t via_in_b();
void via_out_b(uint8_t data);
DECLARE_WRITE_LINE_MEMBER(via_out_cb2);
DECLARE_WRITE_LINE_MEMBER(via_irq_func);
DECLARE_WRITE_LINE_MEMBER(ioc_interrupt);
void concept_set_interrupt(int level, int state);
void concept_memmap(address_map &map);
};
#endif // MAME_INCLUDES_CONCEPT_H
|
#ifndef QEMU_AUDIO_PT_INT_H
#define QEMU_AUDIO_PT_INT_H
#include <pthread.h>
struct audio_pt {
const char *drv;
pthread_t thread;
pthread_cond_t cond;
pthread_mutex_t mutex;
};
int audio_pt_init (struct audio_pt *, void *(*) (void *), void *,
const char *, const char *);
int audio_pt_fini (struct audio_pt *, const char *);
int audio_pt_lock (struct audio_pt *, const char *);
int audio_pt_unlock (struct audio_pt *, const char *);
int audio_pt_wait (struct audio_pt *, const char *);
int audio_pt_unlock_and_signal (struct audio_pt *, const char *);
int audio_pt_join (struct audio_pt *, void **, const char *);
#endif /* QEMU_AUDIO_PT_INT_H */
|
/* dget10.f -- translated by f2c (version 20061008).
You must link the resulting object file with libf2c:
on Microsoft Windows system, link with libf2c.lib;
on Linux or Unix systems, link with .../path/to/libf2c.a -lm
or, if you install libf2c.a in a standard place, with -lf2c -lm
-- in that order, at the end of the command line, as in
cc *.o -lf2c -lm
Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
http://www.netlib.org/f2c/libf2c.zip
*/
#include "f2c.h"
#include "blaswrap.h"
/* Table of constant values */
static integer c__1 = 1;
static doublereal c_b7 = -1.;
/* Subroutine */ int dget10_(integer *m, integer *n, doublereal *a, integer *
lda, doublereal *b, integer *ldb, doublereal *work, doublereal *
result)
{
/* System generated locals */
integer a_dim1, a_offset, b_dim1, b_offset, i__1;
doublereal d__1, d__2;
/* Local variables */
integer j;
doublereal eps, unfl;
extern doublereal dasum_(integer *, doublereal *, integer *);
doublereal anorm;
extern /* Subroutine */ int dcopy_(integer *, doublereal *, integer *,
doublereal *, integer *), daxpy_(integer *, doublereal *,
doublereal *, integer *, doublereal *, integer *);
doublereal wnorm;
extern doublereal dlamch_(char *), dlange_(char *, integer *,
integer *, doublereal *, integer *, doublereal *);
/* -- LAPACK test routine (version 3.1) -- */
/* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
/* November 2006 */
/* .. Scalar Arguments .. */
/* .. */
/* .. Array Arguments .. */
/* .. */
/* Purpose */
/* ======= */
/* DGET10 compares two matrices A and B and computes the ratio */
/* RESULT = norm( A - B ) / ( norm(A) * M * EPS ) */
/* Arguments */
/* ========= */
/* M (input) INTEGER */
/* The number of rows of the matrices A and B. */
/* N (input) INTEGER */
/* The number of columns of the matrices A and B. */
/* A (input) DOUBLE PRECISION array, dimension (LDA,N) */
/* The m by n matrix A. */
/* LDA (input) INTEGER */
/* The leading dimension of the array A. LDA >= max(1,M). */
/* B (input) DOUBLE PRECISION array, dimension (LDB,N) */
/* The m by n matrix B. */
/* LDB (input) INTEGER */
/* The leading dimension of the array B. LDB >= max(1,M). */
/* WORK (workspace) DOUBLE PRECISION array, dimension (M) */
/* RESULT (output) DOUBLE PRECISION */
/* RESULT = norm( A - B ) / ( norm(A) * M * EPS ) */
/* ===================================================================== */
/* .. Parameters .. */
/* .. */
/* .. Local Scalars .. */
/* .. */
/* .. External Functions .. */
/* .. */
/* .. External Subroutines .. */
/* .. */
/* .. Intrinsic Functions .. */
/* .. */
/* .. Executable Statements .. */
/* Quick return if possible */
/* Parameter adjustments */
a_dim1 = *lda;
a_offset = 1 + a_dim1;
a -= a_offset;
b_dim1 = *ldb;
b_offset = 1 + b_dim1;
b -= b_offset;
--work;
/* Function Body */
if (*m <= 0 || *n <= 0) {
*result = 0.;
return 0;
}
unfl = dlamch_("Safe minimum");
eps = dlamch_("Precision");
wnorm = 0.;
i__1 = *n;
for (j = 1; j <= i__1; ++j) {
dcopy_(m, &a[j * a_dim1 + 1], &c__1, &work[1], &c__1);
daxpy_(m, &c_b7, &b[j * b_dim1 + 1], &c__1, &work[1], &c__1);
/* Computing MAX */
d__1 = wnorm, d__2 = dasum_(n, &work[1], &c__1);
wnorm = max(d__1,d__2);
/* L10: */
}
/* Computing MAX */
d__1 = dlange_("1", m, n, &a[a_offset], lda, &work[1]);
anorm = max(d__1,unfl);
if (anorm > wnorm) {
*result = wnorm / anorm / (*m * eps);
} else {
if (anorm < 1.) {
/* Computing MIN */
d__1 = wnorm, d__2 = *m * anorm;
*result = min(d__1,d__2) / anorm / (*m * eps);
} else {
/* Computing MIN */
d__1 = wnorm / anorm, d__2 = (doublereal) (*m);
*result = min(d__1,d__2) / (*m * eps);
}
}
return 0;
/* End of DGET10 */
} /* dget10_ */
|
// OCHamcrest by Jon Reid, http://qualitycoding.org/about/
// Copyright 2014 hamcrest.org. See LICENSE.txt
#import "HCReturnValueGetter.h"
@interface HCUnsignedLongReturnGetter : HCReturnValueGetter
- (instancetype)initWithSuccessor:(HCReturnValueGetter *)successor;
@end
|
/* mpz_powm_sec(res,base,exp,mod) -- Set R to (U^E) mod M.
Contributed to the GNU project by Torbjorn Granlund.
Copyright 1991, 1993, 1994, 1996, 1997, 2000-2002, 2005, 2008, 2009, 2012 Free
Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* 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.
or both in parallel, as here.
The GNU MP Library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received copies of the GNU General Public License and the
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
#include "gmp.h"
#include "gmp-impl.h"
void
mpz_powm_sec (mpz_ptr r, mpz_srcptr b, mpz_srcptr e, mpz_srcptr m)
{
mp_size_t n;
mp_ptr rp, tp;
mp_srcptr bp, ep, mp;
mp_size_t rn, bn, es, en;
TMP_DECL;
n = ABSIZ(m);
mp = PTR(m);
if (UNLIKELY ((n == 0) || (mp[0] % 2 == 0)))
DIVIDE_BY_ZERO;
es = SIZ(e);
if (UNLIKELY (es <= 0))
{
if (es == 0)
{
/* b^0 mod m, b is anything and m is non-zero.
Result is 1 mod m, i.e., 1 or 0 depending on if m = 1. */
SIZ(r) = n != 1 || mp[0] != 1;
PTR(r)[0] = 1;
return;
}
DIVIDE_BY_ZERO;
}
en = es;
bn = ABSIZ(b);
if (UNLIKELY (bn == 0))
{
SIZ(r) = 0;
return;
}
TMP_MARK;
tp = TMP_ALLOC_LIMBS (n + mpn_sec_powm_itch (bn, en * GMP_NUMB_BITS, n));
rp = tp; tp += n;
bp = PTR(b);
ep = PTR(e);
mpn_sec_powm (rp, bp, bn, ep, en * GMP_NUMB_BITS, mp, n, tp);
rn = n;
MPN_NORMALIZE (rp, rn);
if ((ep[0] & 1) && SIZ(b) < 0 && rn != 0)
{
mpn_sub (rp, PTR(m), n, rp, rn);
rn = n;
MPN_NORMALIZE (rp, rn);
}
MPZ_REALLOC (r, rn);
SIZ(r) = rn;
MPN_COPY (PTR(r), rp, rn);
TMP_FREE;
}
|
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CC_RESOURCES_RESOURCE_UPDATE_CONTROLLER_H_
#define CC_RESOURCES_RESOURCE_UPDATE_CONTROLLER_H_
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "cc/base/cc_export.h"
#include "cc/resources/resource_update_queue.h"
namespace base { class SingleThreadTaskRunner; }
namespace cc {
class ResourceProvider;
class ResourceUpdateControllerClient {
public:
virtual void ReadyToFinalizeTextureUpdates() = 0;
protected:
virtual ~ResourceUpdateControllerClient() {}
};
class CC_EXPORT ResourceUpdateController {
public:
static scoped_ptr<ResourceUpdateController> Create(
ResourceUpdateControllerClient* client,
base::SingleThreadTaskRunner* task_runner,
scoped_ptr<ResourceUpdateQueue> queue,
ResourceProvider* resource_provider) {
return make_scoped_ptr(new ResourceUpdateController(
client, task_runner, queue.Pass(), resource_provider));
}
static size_t MaxPartialTextureUpdates();
virtual ~ResourceUpdateController();
// Discard uploads to textures that were evicted on the impl thread.
void DiscardUploadsToEvictedResources();
void PerformMoreUpdates(base::TimeTicks time_limit);
void Finalize();
// Virtual for testing.
virtual size_t UpdateMoreTexturesSize() const;
virtual base::TimeTicks UpdateMoreTexturesCompletionTime();
protected:
ResourceUpdateController(ResourceUpdateControllerClient* client,
base::SingleThreadTaskRunner* task_runner,
scoped_ptr<ResourceUpdateQueue> queue,
ResourceProvider* resource_provider);
private:
static size_t MaxFullUpdatesPerTick(ResourceProvider* resource_provider);
size_t MaxBlockingUpdates() const;
void UpdateTexture(ResourceUpdate update);
// This returns true when there were textures left to update.
bool UpdateMoreTexturesIfEnoughTimeRemaining();
void UpdateMoreTexturesNow();
void OnTimerFired();
ResourceUpdateControllerClient* client_;
scoped_ptr<ResourceUpdateQueue> queue_;
bool contents_textures_purged_;
ResourceProvider* resource_provider_;
base::TimeTicks time_limit_;
size_t texture_updates_per_tick_;
bool first_update_attempt_;
base::SingleThreadTaskRunner* task_runner_;
bool task_posted_;
base::WeakPtrFactory<ResourceUpdateController> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(ResourceUpdateController);
};
} // namespace cc
#endif // CC_RESOURCES_RESOURCE_UPDATE_CONTROLLER_H_
|
/* mbed Microcontroller Library
* Copyright (c) 2006-2013 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _CUSTOM_HELPER_H_
#define _CUSTOM_HELPER_H_
#include "common/common.h"
#include "nrf_ble.h"
#include "ble/UUID.h"
#include "ble/GattCharacteristic.h"
#ifdef __cplusplus
extern "C" {
#endif
#define UUID_TABLE_MAX_ENTRIES (4) /* This is the maximum number of 128-bit UUIDs with distinct bases that
* we expect to be in use; increase this limit if needed. */
/**
* Reset the table of 128bits uuids.
* This table is used to keep track of vendors uuids added to the softdevice.
* It is important to reset it before disabling the softdevice otherwise the
* next time the softdevice will be enabled, this table will not be synchronmized
* with the softdevice table.
*/
void custom_reset_128bits_uuid_table();
uint8_t custom_add_uuid_base(uint8_t const *const p_uuid_base);
error_t custom_decode_uuid(uint8_t const *const p_uuid_base,
ble_uuid_t *p_uuid);
ble_uuid_t custom_convert_to_nordic_uuid(const UUID &uuid);
error_t custom_add_in_characteristic(uint16_t service_handle,
ble_uuid_t *p_uuid,
uint8_t properties,
SecurityManager::SecurityMode_t requiredSecurity,
uint8_t *p_data,
uint16_t length,
uint16_t max_length,
bool has_variable_len,
const uint8_t *userDescriptionDescriptorValuePtr,
uint16_t userDescriptionDescriptorValueLen,
bool readAuthorization,
bool writeAuthorization,
ble_gatts_char_handles_t *p_char_handle);
error_t custom_add_in_descriptor(uint16_t char_handle,
ble_uuid_t *p_uuid,
uint8_t *p_data,
uint16_t length,
uint16_t max_length,
bool has_variable_len,
uint16_t *p_desc_handle);
#ifdef __cplusplus
}
#endif
#endif // ifndef _CUSTOM_HELPER_H_
|
/**************************************************************************
*
* Copyright (C) 2006 Steve Karg <skarg@users.sourceforge.net>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*********************************************************************/
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include "config.h"
#include "txbuf.h"
#include "bacdef.h"
#include "bacdcode.h"
#include "bactext.h"
#include "ihave.h"
#include "handlers.h"
/** @file h_ihave.c Handles incoming I-Have messages. */
/** Simple Handler for I-Have responses (just validates response).
* @ingroup DMDOB
* @param service_request [in] The received message to be handled.
* @param service_len [in] Length of the service_request message.
* @param src [in] The BACNET_ADDRESS of the message's source.
*/
void handler_i_have(
uint8_t * service_request,
uint16_t service_len,
BACNET_ADDRESS * src)
{
int len = 0;
BACNET_I_HAVE_DATA data;
(void) service_len;
(void) src;
len = ihave_decode_service_request(service_request, service_len, &data);
if (len != -1) {
#if PRINT_ENABLED
fprintf(stderr, "I-Have: %s %lu from %s %lu!\r\n",
bactext_object_type_name(data.object_id.type),
(unsigned long) data.object_id.instance,
bactext_object_type_name(data.device_id.type),
(unsigned long) data.device_id.instance);
#endif
} else {
#if PRINT_ENABLED
fprintf(stderr, "I-Have: received, but unable to decode!\n");
#endif
}
return;
}
|
/***************************************************************************
qgsgeometryfollowboundariescheck.h
---------------------
begin : September 2017
copyright : (C) 2017 by Sandro Mani / Sourcepole AG
email : smani at sourcepole dot ch
***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#define SIP_NO_FILE
#ifndef QGSGEOMETRYFOLLOWBOUNDARIESCHECK_H
#define QGSGEOMETRYFOLLOWBOUNDARIESCHECK_H
#include "qgsgeometrycheck.h"
class QgsSpatialIndex;
/**
* \ingroup analysis
* \brief A follow boundaries check.
*/
class ANALYSIS_EXPORT QgsGeometryFollowBoundariesCheck : public QgsGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometryFollowBoundariesCheck )
public:
QgsGeometryFollowBoundariesCheck( QgsGeometryCheckContext *context, const QVariantMap &configuration, QgsVectorLayer *checkLayer );
~QgsGeometryFollowBoundariesCheck() override;
static QList<QgsWkbTypes::GeometryType> factoryCompatibleGeometryTypes() {return {QgsWkbTypes::PolygonGeometry}; }
static bool factoryIsCompatible( QgsVectorLayer *layer ) SIP_SKIP { return factoryCompatibleGeometryTypes().contains( layer->geometryType() ); }
QList<QgsWkbTypes::GeometryType> compatibleGeometryTypes() const override { return factoryCompatibleGeometryTypes(); }
void collectErrors( const QMap<QString, QgsFeaturePool *> &featurePools, QList<QgsGeometryCheckError *> &errors, QStringList &messages, QgsFeedback *feedback, const LayerFeatureIds &ids = LayerFeatureIds() ) const override;
void fixError( const QMap<QString, QgsFeaturePool *> &featurePools, QgsGeometryCheckError *error, int method, const QMap<QString, int> &mergeAttributeIndices, Changes &changes ) const override;
Q_DECL_DEPRECATED QStringList resolutionMethods() const override;
static QString factoryDescription() { return tr( "Polygon does not follow boundaries" ); }
QString description() const override { return factoryDescription(); }
static QString factoryId() { return QStringLiteral( "QgsGeometryFollowBoundariesCheck" ); }
QString id() const override { return factoryId(); }
QgsGeometryCheck::CheckType checkType() const override { return factoryCheckType(); }
static QgsGeometryCheck::CheckType factoryCheckType() SIP_SKIP;
private:
enum ResolutionMethod { NoChange };
QgsVectorLayer *mCheckLayer;
QgsSpatialIndex *mIndex = nullptr;
QgsGeometryFollowBoundariesCheck( const QgsGeometryFollowBoundariesCheck & ) = delete;
QgsGeometryFollowBoundariesCheck &operator=( const QgsGeometryFollowBoundariesCheck & ) = delete;
};
#endif // QGSGEOMETRYFOLLOWBOUNDARIESCHECK_H
|
#ifndef CERT_TRANS_UTIL_READ_PRIVATE_KEY_H_
#define CERT_TRANS_UTIL_READ_PRIVATE_KEY_H_
#include <openssl/evp.h>
#include <string>
#include "util/statusor.h"
namespace cert_trans {
util::StatusOr<EVP_PKEY*> ReadPrivateKey(const std::string& file);
util::StatusOr<EVP_PKEY*> ReadPublicKey(const std::string& file);
} // namespace cert_trans
#endif // CERT_TRANS_UTIL_READ_PRIVATE_KEY_H_
|
/*
* Copyright 2008 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*/
#include <linux/stddef.h>
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/of_platform.h>
#include <asm/system.h>
#include <asm/mpic.h>
#include <asm/i8259.h>
#ifdef CONFIG_PPC_I8259
static void mpc86xx_8259_cascade(unsigned int irq, struct irq_desc *desc)
{
unsigned int cascade_irq = i8259_irq();
if (cascade_irq != NO_IRQ)
generic_handle_irq(cascade_irq);
desc->chip->eoi(irq);
}
#endif /* CONFIG_PPC_I8259 */
void __init mpc86xx_init_irq(void)
{
struct mpic *mpic;
struct device_node *np;
struct resource res;
#ifdef CONFIG_PPC_I8259
struct device_node *cascade_node = NULL;
int cascade_irq;
#endif
/* Determine PIC address. */
np = of_find_node_by_type(NULL, "open-pic");
if (np == NULL)
return;
of_address_to_resource(np, 0, &res);
mpic = mpic_alloc(np, res.start,
MPIC_PRIMARY | MPIC_WANTS_RESET |
MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
MPIC_SINGLE_DEST_CPU,
0, 256, " MPIC ");
of_node_put(np);
BUG_ON(mpic == NULL);
mpic_init(mpic);
#ifdef CONFIG_PPC_I8259
/* Initialize i8259 controller */
for_each_node_by_type(np, "interrupt-controller")
if (of_device_is_compatible(np, "chrp,iic")) {
cascade_node = np;
break;
}
if (cascade_node == NULL) {
printk(KERN_DEBUG "Could not find i8259 PIC\n");
return;
}
cascade_irq = irq_of_parse_and_map(cascade_node, 0);
if (cascade_irq == NO_IRQ) {
printk(KERN_ERR "Failed to map cascade interrupt\n");
return;
}
i8259_init(cascade_node, 0);
of_node_put(cascade_node);
set_irq_chained_handler(cascade_irq, mpc86xx_8259_cascade);
#endif
}
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_GTK_FIRST_RUN_DIALOG_H_
#define CHROME_BROWSER_UI_GTK_FIRST_RUN_DIALOG_H_
typedef struct _GtkButton GtkButton;
typedef struct _GtkWidget GtkWidget;
#include "base/compiler_specific.h"
#include "chrome/browser/first_run/first_run.h"
#include "ui/base/gtk/gtk_signal.h"
class FirstRunDialog {
public:
// Displays the first run UI for reporting opt-in, import data etc.
// Returns true if the dialog was shown.
static bool Show(Profile* profile);
private:
explicit FirstRunDialog(Profile* profile);
virtual ~FirstRunDialog();
CHROMEGTK_CALLBACK_1(FirstRunDialog, void, OnResponseDialog, int);
CHROMEG_CALLBACK_0(FirstRunDialog, void, OnLearnMoreLinkClicked, GtkButton*);
void ShowReportingDialog();
// This method closes the first run window and quits the message loop so that
// the Chrome startup can continue. This should be called when all the
// first run tasks are done.
void FirstRunDone();
Profile* profile_;
// Dialog that holds the bug reporting and default browser checkboxes.
GtkWidget* dialog_;
// Crash reporting checkbox
GtkWidget* report_crashes_;
// Make browser default checkbox
GtkWidget* make_default_;
// Whether we should show the dialog asking the user whether to report
// crashes and usage stats.
bool show_reporting_dialog_;
// User response (accept or cancel) is returned through this.
int* response_;
DISALLOW_COPY_AND_ASSIGN(FirstRunDialog);
};
#endif // CHROME_BROWSER_UI_GTK_FIRST_RUN_DIALOG_H_
|
/*
* drivers/video/tegra/host/host1x/host1x_channel.h
*
* Tegra Graphics Host Channel
*
* Copyright (c) 2011, NVIDIA Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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 __NVHOST_HOST1X_CHANNEL_H
#define __NVHOST_HOST1X_CHANNEL_H
struct nvhost_job;
struct nvhost_channel;
struct nvhost_hwctx;
/* Submit job to a host1x client */
int host1x_channel_submit(struct nvhost_job *job);
/* Read 3d register via FIFO */
int host1x_channel_read_3d_reg(
struct nvhost_channel *channel,
struct nvhost_hwctx *hwctx,
u32 offset,
u32 *value);
/* Reads words from FIFO */
int host1x_drain_read_fifo(void __iomem *chan_regs,
u32 *ptr, unsigned int count, unsigned int *pending);
int host1x_save_context(struct nvhost_module *mod, u32 syncpt_id);
#endif
|
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2012 Red Hat
*/
#include <linux/module.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_file.h>
#include <drm/drm_gem_shmem_helper.h>
#include <drm/drm_managed.h>
#include <drm/drm_ioctl.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_print.h>
#include "udl_drv.h"
static int udl_usb_suspend(struct usb_interface *interface,
pm_message_t message)
{
struct drm_device *dev = usb_get_intfdata(interface);
return drm_mode_config_helper_suspend(dev);
}
static int udl_usb_resume(struct usb_interface *interface)
{
struct drm_device *dev = usb_get_intfdata(interface);
return drm_mode_config_helper_resume(dev);
}
DEFINE_DRM_GEM_FOPS(udl_driver_fops);
static const struct drm_driver driver = {
.driver_features = DRIVER_ATOMIC | DRIVER_GEM | DRIVER_MODESET,
/* GEM hooks */
.fops = &udl_driver_fops,
DRM_GEM_SHMEM_DRIVER_OPS,
.name = DRIVER_NAME,
.desc = DRIVER_DESC,
.date = DRIVER_DATE,
.major = DRIVER_MAJOR,
.minor = DRIVER_MINOR,
.patchlevel = DRIVER_PATCHLEVEL,
};
static struct udl_device *udl_driver_create(struct usb_interface *interface)
{
struct udl_device *udl;
int r;
udl = devm_drm_dev_alloc(&interface->dev, &driver,
struct udl_device, drm);
if (IS_ERR(udl))
return udl;
r = udl_init(udl);
if (r)
return ERR_PTR(r);
usb_set_intfdata(interface, udl);
return udl;
}
static int udl_usb_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{
int r;
struct udl_device *udl;
udl = udl_driver_create(interface);
if (IS_ERR(udl))
return PTR_ERR(udl);
r = drm_dev_register(&udl->drm, 0);
if (r)
return r;
DRM_INFO("Initialized udl on minor %d\n", udl->drm.primary->index);
drm_fbdev_generic_setup(&udl->drm, 0);
return 0;
}
static void udl_usb_disconnect(struct usb_interface *interface)
{
struct drm_device *dev = usb_get_intfdata(interface);
drm_kms_helper_poll_fini(dev);
udl_drop_usb(dev);
drm_dev_unplug(dev);
}
/*
* There are many DisplayLink-based graphics products, all with unique PIDs.
* So we match on DisplayLink's VID + Vendor-Defined Interface Class (0xff)
* We also require a match on SubClass (0x00) and Protocol (0x00),
* which is compatible with all known USB 2.0 era graphics chips and firmware,
* but allows DisplayLink to increment those for any future incompatible chips
*/
static const struct usb_device_id id_table[] = {
{.idVendor = 0x17e9, .bInterfaceClass = 0xff,
.bInterfaceSubClass = 0x00,
.bInterfaceProtocol = 0x00,
.match_flags = USB_DEVICE_ID_MATCH_VENDOR |
USB_DEVICE_ID_MATCH_INT_CLASS |
USB_DEVICE_ID_MATCH_INT_SUBCLASS |
USB_DEVICE_ID_MATCH_INT_PROTOCOL,},
{},
};
MODULE_DEVICE_TABLE(usb, id_table);
static struct usb_driver udl_driver = {
.name = "udl",
.probe = udl_usb_probe,
.disconnect = udl_usb_disconnect,
.suspend = udl_usb_suspend,
.resume = udl_usb_resume,
.id_table = id_table,
};
module_usb_driver(udl_driver);
MODULE_LICENSE("GPL");
|
// @(#)root/roostats:$Id$
// Author: Kyle Cranmer
/*************************************************************************
* Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOSTATS_BernsteinCorrection
#define ROOSTATS_BernsteinCorrection
#ifndef ROOT_Rtypes
#include "Rtypes.h"
#endif
#include "TH1F.h"
#include "RooWorkspace.h"
namespace RooStats {
class BernsteinCorrection {
public:
BernsteinCorrection(double tolerance = 0.05);
virtual ~BernsteinCorrection() {}
Int_t ImportCorrectedPdf(RooWorkspace*, const char*,const char*,const char*);
void SetMaxCorrection(Double_t maxCorr){fMaxCorrection = maxCorr;}
void SetMaxDegree(Int_t maxDegree){fMaxDegree = maxDegree;}
void CreateQSamplingDist(RooWorkspace* wks,
const char* nominalName,
const char* varName,
const char* dataName,
TH1F*, TH1F*,
Int_t degree,
Int_t nToys=500);
private:
Int_t fMaxDegree; // maximum polynomial degree correction (default is 10)
Double_t fMaxCorrection; // maximum correction factor at any point (default is 100)
Double_t fTolerance; // probability to add an unnecessary term
protected:
ClassDef(BernsteinCorrection,2) // A utility to add polynomial corrrection terms to a model to improve the description of data.
};
}
#endif
|
/*
* Copyright 2010 Tilera Corporation. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, version 2.
*
* 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, GOOD TITLE or
* NON INFRINGEMENT. See the GNU General Public License for
* more details.
*/
#include <asm/page.h>
#include <asm/cacheflush.h>
#include <arch/icache.h>
void __flush_icache_range(unsigned long start, unsigned long end)
{
invalidate_icache((const void *)start, end - start, PAGE_SIZE);
}
|
/* Common hooks for Adapteva Epiphany
Copyright (C) 1994-2013 Free Software Foundation, Inc.
Contributed by Embecosm on behalf of Adapteva, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "common/common-target.h"
#include "opts.h"
#include "flags.h"
#define TARGET_OPTION_OPTIMIZATION_TABLE epiphany_option_optimization_table
#define TARGET_DEFAULT_TARGET_FLAGS \
(MASK_CMOVE | MASK_SOFT_CMPSF | MASK_SPLIT_LOHI | MASK_ROUND_NEAREST \
| MASK_VECT_DOUBLE | MASK_POST_INC | MASK_POST_MODIFY)
#define TARGET_HAVE_NAMED_SECTIONS true
#include "common/common-target-def.h"
/* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */
static const struct default_options epiphany_option_optimization_table[] =
{
{ OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
{ OPT_LEVELS_NONE, 0, NULL, 0 }
};
struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.