max_stars_repo_path stringlengths 4 186 | max_stars_repo_name stringlengths 7 73 | max_stars_count float64 0 14.7k | id stringlengths 5 7 | text stringlengths 10 753k | lang stringclasses 1 value |
|---|---|---|---|---|---|
aws-cpp-sdk-glue/include/aws/glue/model/StatementOutput.h | Nexuscompute/aws-sdk-cpp | 1 | 451895 | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/glue/Glue_EXPORTS.h>
#include <aws/glue/model/StatementOutputData.h>
#include <aws/glue/model/StatementState.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace Glue
{
namespace Model
{
/**
* <p>The code execution output in JSON format.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StatementOutput">AWS
* API Reference</a></p>
*/
class AWS_GLUE_API StatementOutput
{
public:
StatementOutput();
StatementOutput(Aws::Utils::Json::JsonView jsonValue);
StatementOutput& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The code execution output.</p>
*/
inline const StatementOutputData& GetData() const{ return m_data; }
/**
* <p>The code execution output.</p>
*/
inline bool DataHasBeenSet() const { return m_dataHasBeenSet; }
/**
* <p>The code execution output.</p>
*/
inline void SetData(const StatementOutputData& value) { m_dataHasBeenSet = true; m_data = value; }
/**
* <p>The code execution output.</p>
*/
inline void SetData(StatementOutputData&& value) { m_dataHasBeenSet = true; m_data = std::move(value); }
/**
* <p>The code execution output.</p>
*/
inline StatementOutput& WithData(const StatementOutputData& value) { SetData(value); return *this;}
/**
* <p>The code execution output.</p>
*/
inline StatementOutput& WithData(StatementOutputData&& value) { SetData(std::move(value)); return *this;}
/**
* <p>The execution count of the output.</p>
*/
inline int GetExecutionCount() const{ return m_executionCount; }
/**
* <p>The execution count of the output.</p>
*/
inline bool ExecutionCountHasBeenSet() const { return m_executionCountHasBeenSet; }
/**
* <p>The execution count of the output.</p>
*/
inline void SetExecutionCount(int value) { m_executionCountHasBeenSet = true; m_executionCount = value; }
/**
* <p>The execution count of the output.</p>
*/
inline StatementOutput& WithExecutionCount(int value) { SetExecutionCount(value); return *this;}
/**
* <p>The status of the code execution output.</p>
*/
inline const StatementState& GetStatus() const{ return m_status; }
/**
* <p>The status of the code execution output.</p>
*/
inline bool StatusHasBeenSet() const { return m_statusHasBeenSet; }
/**
* <p>The status of the code execution output.</p>
*/
inline void SetStatus(const StatementState& value) { m_statusHasBeenSet = true; m_status = value; }
/**
* <p>The status of the code execution output.</p>
*/
inline void SetStatus(StatementState&& value) { m_statusHasBeenSet = true; m_status = std::move(value); }
/**
* <p>The status of the code execution output.</p>
*/
inline StatementOutput& WithStatus(const StatementState& value) { SetStatus(value); return *this;}
/**
* <p>The status of the code execution output.</p>
*/
inline StatementOutput& WithStatus(StatementState&& value) { SetStatus(std::move(value)); return *this;}
/**
* <p>The name of the error in the output.</p>
*/
inline const Aws::String& GetErrorName() const{ return m_errorName; }
/**
* <p>The name of the error in the output.</p>
*/
inline bool ErrorNameHasBeenSet() const { return m_errorNameHasBeenSet; }
/**
* <p>The name of the error in the output.</p>
*/
inline void SetErrorName(const Aws::String& value) { m_errorNameHasBeenSet = true; m_errorName = value; }
/**
* <p>The name of the error in the output.</p>
*/
inline void SetErrorName(Aws::String&& value) { m_errorNameHasBeenSet = true; m_errorName = std::move(value); }
/**
* <p>The name of the error in the output.</p>
*/
inline void SetErrorName(const char* value) { m_errorNameHasBeenSet = true; m_errorName.assign(value); }
/**
* <p>The name of the error in the output.</p>
*/
inline StatementOutput& WithErrorName(const Aws::String& value) { SetErrorName(value); return *this;}
/**
* <p>The name of the error in the output.</p>
*/
inline StatementOutput& WithErrorName(Aws::String&& value) { SetErrorName(std::move(value)); return *this;}
/**
* <p>The name of the error in the output.</p>
*/
inline StatementOutput& WithErrorName(const char* value) { SetErrorName(value); return *this;}
/**
* <p>The error value of the output.</p>
*/
inline const Aws::String& GetErrorValue() const{ return m_errorValue; }
/**
* <p>The error value of the output.</p>
*/
inline bool ErrorValueHasBeenSet() const { return m_errorValueHasBeenSet; }
/**
* <p>The error value of the output.</p>
*/
inline void SetErrorValue(const Aws::String& value) { m_errorValueHasBeenSet = true; m_errorValue = value; }
/**
* <p>The error value of the output.</p>
*/
inline void SetErrorValue(Aws::String&& value) { m_errorValueHasBeenSet = true; m_errorValue = std::move(value); }
/**
* <p>The error value of the output.</p>
*/
inline void SetErrorValue(const char* value) { m_errorValueHasBeenSet = true; m_errorValue.assign(value); }
/**
* <p>The error value of the output.</p>
*/
inline StatementOutput& WithErrorValue(const Aws::String& value) { SetErrorValue(value); return *this;}
/**
* <p>The error value of the output.</p>
*/
inline StatementOutput& WithErrorValue(Aws::String&& value) { SetErrorValue(std::move(value)); return *this;}
/**
* <p>The error value of the output.</p>
*/
inline StatementOutput& WithErrorValue(const char* value) { SetErrorValue(value); return *this;}
/**
* <p>The traceback of the output.</p>
*/
inline const Aws::Vector<Aws::String>& GetTraceback() const{ return m_traceback; }
/**
* <p>The traceback of the output.</p>
*/
inline bool TracebackHasBeenSet() const { return m_tracebackHasBeenSet; }
/**
* <p>The traceback of the output.</p>
*/
inline void SetTraceback(const Aws::Vector<Aws::String>& value) { m_tracebackHasBeenSet = true; m_traceback = value; }
/**
* <p>The traceback of the output.</p>
*/
inline void SetTraceback(Aws::Vector<Aws::String>&& value) { m_tracebackHasBeenSet = true; m_traceback = std::move(value); }
/**
* <p>The traceback of the output.</p>
*/
inline StatementOutput& WithTraceback(const Aws::Vector<Aws::String>& value) { SetTraceback(value); return *this;}
/**
* <p>The traceback of the output.</p>
*/
inline StatementOutput& WithTraceback(Aws::Vector<Aws::String>&& value) { SetTraceback(std::move(value)); return *this;}
/**
* <p>The traceback of the output.</p>
*/
inline StatementOutput& AddTraceback(const Aws::String& value) { m_tracebackHasBeenSet = true; m_traceback.push_back(value); return *this; }
/**
* <p>The traceback of the output.</p>
*/
inline StatementOutput& AddTraceback(Aws::String&& value) { m_tracebackHasBeenSet = true; m_traceback.push_back(std::move(value)); return *this; }
/**
* <p>The traceback of the output.</p>
*/
inline StatementOutput& AddTraceback(const char* value) { m_tracebackHasBeenSet = true; m_traceback.push_back(value); return *this; }
private:
StatementOutputData m_data;
bool m_dataHasBeenSet;
int m_executionCount;
bool m_executionCountHasBeenSet;
StatementState m_status;
bool m_statusHasBeenSet;
Aws::String m_errorName;
bool m_errorNameHasBeenSet;
Aws::String m_errorValue;
bool m_errorValueHasBeenSet;
Aws::Vector<Aws::String> m_traceback;
bool m_tracebackHasBeenSet;
};
} // namespace Model
} // namespace Glue
} // namespace Aws | c |
Thread/06thread.c | aniruddha2000/kacha-badam | 0 | 565873 | /*
Passing argument to thread
*/
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int primes[10] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
void *routine(void *arg) {
int index = *(int *)arg;
int sum = 0;
for (int i = 0; i < 5; i++) {
sum += primes[index + i];
}
printf("Local sum = %d\n", sum);
*(int *)arg = sum;
return arg;
}
int main(int argc, char const *argv[]) {
pthread_t th[2];
int i;
for (i = 0; i < 2; i++) {
int *a = malloc(sizeof(int));
*a = i * 5;
if (pthread_create(&th[i], NULL, &routine, a) != 0) {
perror("Failed to create thread");
}
}
int globalSum = 0;
for (i = 0; i < 2; i++) {
int *r;
if (pthread_join(th[i], (void **)&r) != 0) {
perror("Failed to join thread");
}
globalSum += *r;
free(r);
}
printf("Global sum = %d\n", globalSum);
return 0;
} | c |
include/BoardMulti.h | dawidd6/qtictactoe | 2 | 4952240 | #pragma once
class BoardMulti : public AbstractBoard
{
private:
SetupConnection *setup_connection;
Window *w;
Game *g;
AbstractSymbol *symbol_my;
AbstractSymbol *symbol_enemy;
QTcpSocket socket;
QStatusBar statusbar;
QString response;
QChar symbol_char_my;
QChar symbol_char_enemy;
volatile int turn;
public:
BoardMulti(Window *window, Game *game);
~BoardMulti();
void makeMove(const int &x, const int &y, const AbstractSymbol *symbol, QChar symbol_char, bool isMyTurn, QString message);
void handleRead();
void handleConnection();
void handleDisconnection();
void handleRandom();
virtual void handleRestart();
}; | c |
IN100/tri_fusion.c | emeric75/uvsq_licence | 0 | 1841491 | #include <uvsqgraphics.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define N 16
#define MAX 100
int T[N];
void init(){
for(int i=0; i<N; i++){
T[i] = alea_int(MAX-10)+10;
}
}
void disp(){
for(int i=0; i<N; i++){
write_int(T[i]);write_text(" ");
if(i%20 == 19){
writeln();
}
}
writeln();
}
void disp_tri(int min, int max){
for(int i=0; i<N; i++){
write_int(T[i]);write_text(" ");
}
write_text(" | | ");write_int(min);write_text(" ");write_int(max);
writeln();
}
void disp_ech(int min, int max){
for(int i=0; i<N; i++){
write_int(T[i]);write_text(" ");
}
write_text(" | | ");write_int(min);write_text(" ");write_int(max);write_text(" ech");
writeln();
}
void echange(int i, int j){
int tmp;
tmp = T[i];
T[i] = T[j];
T[j] = tmp;
}
int indice_du_plus_grand(int min, int max){
int maxind=min;
for(int i =min; i<max;i++){
if(T[i]>T[maxind])maxind=i;
}
return maxind;
}
void tri_selection(int min, int max){
for(int i = 0; i<max-min; i++){
echange(indice_du_plus_grand(min, max-i), max-i-1);
//disp();
}
}
void tri_fusion(int min,int max){
//condition d'arrêt
if(max-min==0){
return;
}else if(max-min==1){
if(T[max]<T[min])
echange(min,max);
return;
}
//disp(min,max);
//séparation en deux sous-tableaux et tri
int mil = (min+max)/2;
tri_fusion(min,mil);
tri_fusion(mil,max);
//FUUUUUUUUUUSION
int i,c1=0,c2=0;
int temptab[N];
for(i = min; i<max; i++){
if(T[min+c1]<T[mil+c2] && min+c1<mil){
temptab[i] = T[min+c1];
c1++;
}else{
temptab[i] = T[mil+c2];
c2++;
}
}
for(i = min; i<max; i++){
T[i] = temptab[i];
}
disp_ech(min,max);
}
int main(){
init_graphics(800,600);
clock_t t1,t2,t3,t4;
init();
disp();
write_text("fusion...");writeln();
t1=clock();
tri_fusion(0,N);
t2=clock();
printf("Temps ecoule fusion : %lf\n", (double)(t2-t1)/(double)CLOCKS_PER_SEC);
disp();
/*init();
//disp();
write_text("selection...");writeln();
t3=clock();
tri_selection(0,N);
t4=clock();
printf("Temps ecoule selection : %lf\n", (double)(t4-t3)/(double)CLOCKS_PER_SEC);
//disp();*/
wait_escape();
} | c |
test/e2e/test_master/wxWidgets/include/wx/generic/activityindicator.h | BlueCannonBall/cppparser | 0 | 4800467 | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/activityindicator.h
// Purpose: Declaration of wxActivityIndicatorGeneric.
// Author: <NAME>
// Created: 2015-03-06
// Copyright: (c) 2015 <NAME> <<EMAIL>>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_ACTIVITYINDICATOR_H_
# define _WX_GENERIC_ACTIVITYINDICATOR_H_
# ifndef wxHAS_NATIVE_ACTIVITYINDICATOR
// This is the only implementation we have, so call it accordingly.
# define wxActivityIndicatorGeneric wxActivityIndicator
# endif
// ----------------------------------------------------------------------------
// wxActivityIndicatorGeneric: built-in generic implementation.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxActivityIndicatorGeneric : public wxActivityIndicatorBase
{
public:
wxActivityIndicatorGeneric()
{
m_impl = NULL;
}
explicit wxActivityIndicatorGeneric(wxWindow* parent, wxWindowID winid = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxActivityIndicatorNameStr)
{
m_impl = NULL;
Create(parent, winid, pos, size, style, name);
}
bool Create(wxWindow* parent, wxWindowID winid = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxActivityIndicatorNameStr);
virtual ~wxActivityIndicatorGeneric();
void Start() override;
void Stop() override;
bool IsRunning() const override;
protected:
wxSize DoGetBestClientSize() const override;
private:
class wxActivityIndicatorImpl* m_impl;
# ifndef wxHAS_NATIVE_ACTIVITYINDICATOR
wxDECLARE_DYNAMIC_CLASS(wxActivityIndicator);
# endif
};
#endif | c |
LYLOptionPickerDemo/LYLOptionPickerDemo/LYLOptionPicker/LYLOptionPicker.h | LiuYulei001/LYLOptionPicker | 1 | 1832317 | //
// LYLOptionPicker.h
// LYLOptionPickerDemo
//
// Created by Rainy on 2017/12/12.
// Copyright © 2017年 Rainy. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface LYLOptionPicker : NSObject
typedef void(^DetermineChoose)(NSArray *indexes,id selectedItems);
+ (void)showOptionPickerInView:(UIView *)view
dataSource:(NSArray <NSArray <NSString *>*>*)dataSource
determineChoose:(DetermineChoose)determineChoose;
@end | c |
external/cpp/mgtest/test_ocr.h | asedl/XpaDemo | 5 | 4450997 | #pragma once
extern int testOcr(wchar_t* lpszImagefilename); | c |
SoftwareRenderer/Source/Core/Utils.h | sunzedd/software-renderer | 1 | 7767478 | #pragma once
namespace core {
template <typename T>
T clamp(T value, T min, T max)
{
return std::max(min, std::min(value, max));
}
template <typename T>
T clampNormalize(T value)
{
return clamp<T>(value, 0.0, 1.0);
}
} // namespace core | c |
firmware/Inc/app.h | windsorschmidt/reflow | 1 | 207662 | #ifndef APP_INIT
#define APP_INIT
// #define NOBEEP
#define APP_IPC_Q_SIZE 8
#define LOG_IPC_Q_SIZE 8
#define TEMP_IPC_Q_SIZE 8
#define OLED_IPC_Q_SIZE 8
#define SPEAKER_IPC_Q_SIZE 8
#define BUTTON_IPC_Q_SIZE 8
#define TIMER_IPC_Q_SIZE 8
#define BUTTON_ISR_Q_SIZE 4
#define TIMER_ISR_Q_SIZE 4
#define MSG_TIMER_1HZ_TICK 0x0001
#define MSG_TIMER_SPEAKER_TICK 0x0002
#define MSG_TEMP_TEMP 0x0101
#define MSG_TEMP_FAULT 0x0102
#define MSG_BUTTON_PREV 0x0201
#define MSG_BUTTON_SET 0x0202
#define MSG_BUTTON_NEXT 0x0203
#define MSG_BUTTON_PANIC 0x0204
#define MSG_TRIAC1_DUTY 0x0301
#define MSG_TRIAC2_DUTY 0x0302
#define MSG_TRIAC_MORE_POWER 0x0303
#define MSG_TRIAC_LESS_POWER 0x0304
#define MSG_BT_CONNECT 0x0401
#define MSG_BT_DISCONNECT 0x0402
#define MSG_REFLOW_START 0x0501
#define MSG_REFLOW_STOP 0x0502
#define MSG_REFLOW_STAGE 0x0503
#define MSG_REFLOW_RUNTIME 0x0504
#define MSG_PROFILE_TEMP 0x0601
#define MSG_SPEAKER_TEST 0x0701
#define MSG_SPEAKER_BEEP 0x0702
#define MSG_SPEAKER_ALERT 0x0703
void app_init(void);
void app_task(void *params);
#endif // APP_INIT | c |
src/utils/bluetooth/inc/bluetooth_types.h | ddoyon92/brainflow | 528 | 4743764 | #pragma once
enum class SocketBluetoothReturnCodes : int
{
STATUS_OK = 0,
WSA_STARTUP_ERROR = 1,
CREATE_SOCKET_ERROR = 2,
CONNECT_ERROR = 3,
WSA_ADDR_ERROR = 4,
IOCTL_ERROR = 5,
ANOTHER_DEVICE_IS_CREATED_ERROR = 6,
DEVICE_IS_NOT_CREATED_ERROR = 7,
UNIMPLEMENTED_ERROR = 8,
GENERAL_ERROR = 9,
WSA_LOOKUP_BEGIN_ERROR = 10
}; | c |
tests/openacc-users-group/NAS_SHOC_OpenACC_2.5/reference/ref_exact_rhs.c | passlab/accparser | 0 | 2402388 | #pragma acc update device (forcing) | c |
eva/utest/test_vqec_utest_cli.c | wmanley/cisco-vqe-client | 5 | 8075491 | /*
* Copyright (c) 2007-2010 by Cisco Systems, Inc.
* All rights reserved.
*/
#include "test_vqec_utest_main.h"
#include "test_vqec_utest_interposers.h"
#include "../add-ons/include/CUnit/CUnit.h"
#include "../add-ons/include/CUnit/Basic.h"
#include "vam_util.h"
#include "vqec_cli_register.h"
#include "vqec_tuner.h"
#include "vqec_lock_defs.h"
#include "vqec_assert_macros.h"
#include "vqec_tuner.h"
#include "vqec_debug.h"
#include "vqec_stream_output_thread_mgr.h"
#include "vqec_syscfg.h"
#include "vqec_gap_reporter.h"
#include "vqec_cli.h"
#include "vqec_pthread.h"
#include "vqec_channel_api.h"
#include "vqec_channel_private.h"
extern void vqec_str_to_lower(char *outputString, char *inputString);
extern int vqec_str_match(char *s, char *params[]);
extern int vqec_check_args_for_help_char(char *argv[], int argc);
extern void vqec_print_callback(struct vqec_cli_def *cli, char *string, int
string_len);
extern int vqec_cmd_show_tuner(struct vqec_cli_def *cli, char *command,
char *argv[], int argc);
extern int vqec_cmd_show_channel(struct vqec_cli_def *cli, char *command,
char *argv[], int argc);
extern int vqec_cmd_show_drop(struct vqec_cli_def *cli, char *command,
char *argv[], int argc);
extern int vqec_cmd_show_error_repair(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_show_counters(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_show_debug(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_show_system_config(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_drop_interval(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_drop_percentage(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_drop_enable(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_drop_disable(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_error_repair_enable(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_error_repair_disable(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_tuner_bind(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_tuner_unbind(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_tuner_create(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_tuner_destroy(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_channel_update(struct vqec_cli_def *cli,
char *command,
char *argv[], int argc);
extern int vqec_cmd_update(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_clear_counters(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_channel_tr135(struct vqec_cli_def *cli, char *command,
char *argv[], int argc);
extern int vqec_debug_func(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_proxy_igmp_join(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_stream_output(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_monitor_elog(struct vqec_cli_def *cli, char *command,
char *argv[], int argc);
extern int vqec_cmd_monitor_outputsched_show(struct vqec_cli_def *cli,
char *command,
char *argv[], int argc);
extern int vqec_cmd_monitor_outputsched_off(struct vqec_cli_def *cli,
char *command,
char *argv[], int argc);
extern int vqec_cmd_monitor_outputsched_on(struct vqec_cli_def *cli,
char *command,
char *argv[], int argc);
extern int vqec_cmd_monitor_outputsched_reset (struct vqec_cli_def *cli,
char *command,
char *argv[], int argc);
extern int vqec_cmd_error_repair_policer_enable(struct vqec_cli_def *cli,
char *command,
char *argv[], int argc);
extern int vqec_cmd_error_repair_policer_disable(struct vqec_cli_def *cli,
char *command, char *argv[],
int argc);
extern int vqec_cmd_error_repair_policer_rate(struct vqec_cli_def *cli,
char *command,
char *argv[], int argc);
extern int vqec_cmd_error_repair_policer_burst(struct vqec_cli_def *cli,
char *command,
char *argv[], int argc);
extern int vqec_cmd_show_fec(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_fec_enable(struct vqec_cli_def *cli,
char *command,char *argv[], int argc);
extern int vqec_cmd_fec_disable(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cli_help_func(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern int vqec_cmd_show_tech_support(struct vqec_cli_def *cli,
char *command, char *argv[], int argc);
extern vqec_chan_t *
vqec_chan_find (in_addr_t ip, in_port_t port);
/*
* Unit tests for vqec_cli
*/
void *cli_handle = 0;
int vqec_cli_port = 8181;
in_addr_t vqec_cli_if_addr = INADDR_ANY;
/* elog status report */
extern void status_report(void);
void *vqec_utest_cli_thread(void* arg)
{
cli_handle = vqec_cli_startup();
vqec_cli_loop_wrapper(vqec_cli_port, vqec_cli_if_addr);
return NULL;
}
int test_vqec_cli_init (void) {
pthread_t vqec_cli_thread_id;
vqec_tunerid_t deftuner;
vqec_pthread_create(&vqec_cli_thread_id,vqec_utest_cli_thread, NULL);
printf("please telnet to port %d to cover telnet session code...\n",
vqec_cli_port);
sleep(1);
vqec_ifclient_init("data/cfg_test_all_params_valid.cfg");
vqec_stream_output_thread_mgr_module_init();
vqec_ifclient_tuner_create(&deftuner, "deftuner");
return 0;
}
int test_vqec_cli_clean (void) {
vqec_stream_output_thread_mgr_module_deinit();
vqec_ifclient_deinit();
return 0;
}
static void test_vqec_cli_helper_funcs (void) {
char *varlist[] = { "first", "second", "third", "fourth", "fifth",
(char *)0 };
if(varlist);
CU_ASSERT(vqec_str_match("first", varlist) == 0);
CU_ASSERT(vqec_str_match("second", varlist) == 1);
CU_ASSERT(vqec_str_match("THird", varlist) == 2);
CU_ASSERT(vqec_str_match("four", varlist) == 3);
CU_ASSERT(vqec_str_match("fiFth", varlist) == 4);
CU_ASSERT(vqec_str_match("dfirst", varlist) == -1);
CU_ASSERT(vqec_str_match("fi", varlist) == VQEC_CLI_ERROR);
CU_ASSERT(vqec_str_match(NULL, varlist) == VQEC_CLI_ERROR);
char *argv[] = {"arg1","arg2"};
char *argv2[] = {"ar?"};
CU_ASSERT(vqec_check_args_for_help_char(argv, 2) == FALSE);
CU_ASSERT(vqec_check_args_for_help_char(argv2, 1) == TRUE);
vqec_print_callback(cli_handle, "hello world!", strlen("hello world!"));
int test_cli_fd;
test_cli_fd = vqec_get_cli_fd(cli_handle);
CU_ASSERT(test_cli_fd);
}
static void test_vqec_cli_show_cmds (void) {
int cmdstat = 0;
char *args1[] = { };
char *args2[] = { "deftuner" };
char *args3[] = { "deftuner?" };
char *args4[] = { "invalidtuner" };
char *args5[] = { "name", "deftuner" };
char *args6[] = { "cumulative" };
char *shtargs1[] = { "all" };
char *shtargs2[] = { "name", "deftuner" };
char *shtargs3[] = { "name", "deftuner?" };
char *shtargs4[] = { "name", "invalidtuner" };
char *shtargs5[] = { "join-delay" };
char *shcargs1[] = { "counters" };
char *shcargs2[] = { "counters", "all" };
char *shcargs3[] = { "counters", "url" };
char *shcargs4[] = { "config" };
char *shcargs5[] = { "config" , "all" };
char *shcargs6[] = { "config", "url" };
char *shcargs7[] = { "counters", "all", "cumulative" };
/*
* The vqec_cmd_show_system_config() function requires that the array
* arguments be writable, because they are passed to strtok_r().
* So the arrays of string literals cannot be used, and an array of
* pointers to writable memory is needed instead. Since this an issue
* for just one unit test, the variables below will be used.
*/
char deftuner[] = "deftuner";
char *args2_writable[] = { deftuner };
/* show tuner */
cmdstat = vqec_cmd_show_tuner(cli_handle, "show tuner", shtargs1, 1);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_show_tuner(cli_handle, "show tuner", shtargs2, 2);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_show_tuner(cli_handle, "show tuner", shtargs3, 2);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_show_tuner(cli_handle, "show tuner", shtargs4, 2);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_show_tuner(cli_handle, "show tuner", shtargs5, 1);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/* show channels */
cmdstat = vqec_cmd_show_channel(cli_handle, "show channel", args1, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_show_channel(cli_handle, "show channel", args2, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_show_channel(cli_handle, "show channel", shcargs1, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_show_channel(cli_handle, "show channel", shcargs2, 2);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_show_channel(cli_handle, "show channel", shcargs3, 2);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_show_channel(cli_handle, "show channel", shcargs4, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_show_channel(cli_handle, "show channel", shcargs5, 2);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_show_channel(cli_handle, "show channel", shcargs6, 2);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_show_channel(cli_handle, "show channel", shcargs7, 3);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/* show drop */
cmdstat = vqec_cmd_show_drop(cli_handle, "show drop", args1, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_show_drop(cli_handle, "show drop", args2, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
/* show error-repair */
cmdstat = vqec_cmd_show_error_repair(cli_handle, "show error_repair",
args1, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_show_error_repair(cli_handle, "show error_repair",
args2, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
/*show fec */
cmdstat = vqec_cmd_show_fec(cli_handle, "show fec", args1, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_show_fec(cli_handle, "show fec", args2, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
/* show counters */
cmdstat = vqec_cmd_show_counters(cli_handle, "show counters", args1, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_show_counters(cli_handle, "show counters", args5, 2);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_show_counters(cli_handle, "show counters", args3, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_show_counters(cli_handle, "show counters", args4, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_show_counters(cli_handle, "show counters", args6, 1);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/* show debug */
cmdstat = vqec_cmd_show_debug(cli_handle, "show debug", args1, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_show_debug(cli_handle, "show debug", args2, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
/* show system-config */
cmdstat = vqec_cmd_show_system_config(cli_handle,
"show system-config", args1, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_show_system_config(cli_handle,
"show system-config",
args2_writable, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
/* show tech-support */
cmdstat = vqec_cmd_show_tech_support(cli_handle,
"show tech-support", args1, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/* Pass some argument to see the function return an error */
cmdstat = vqec_cmd_show_tech_support(cli_handle,
"show tech-support", args2, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
}
static void test_vqec_cli_global_cmds (void) {
int cmdstat = 0;
uint32_t rate, burst;
vqec_dp_drop_sim_state_t state;
boolean policer_enabled;
char *args11[] = { };
char *args12[] = { "?" };
char *args31[] = { "1" };
char *args32[] = { "1", "2" };
/* error-repair */
CU_ASSERT(vqec_get_error_repair(NULL)); /* enabled by default */
cmdstat = vqec_cmd_error_repair_disable(cli_handle,
"error-repair disable", args11, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(!vqec_get_error_repair(NULL));
cmdstat = vqec_cmd_error_repair_enable(cli_handle,
"error-repair enable", args12, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
CU_ASSERT(!vqec_get_error_repair(NULL));
cmdstat = vqec_cmd_error_repair_enable(cli_handle,
"error-repair enable", args11, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(vqec_get_error_repair(NULL));
cmdstat = vqec_cmd_error_repair_disable(cli_handle,
"error-repair disable", args12, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
CU_ASSERT(vqec_get_error_repair(NULL));
/* fec */
boolean fec;
/* enabled by default */
CU_ASSERT(vqec_dp_get_fec(&fec, NULL) == VQEC_DP_ERR_OK);
cmdstat = vqec_cmd_fec_disable(cli_handle, "fec disable", args11, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(vqec_dp_get_fec(&fec, NULL) == VQEC_DP_ERR_OK);
cmdstat = vqec_cmd_fec_enable(cli_handle, "fec enable", args12, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
CU_ASSERT(vqec_dp_get_fec(&fec, NULL) == VQEC_DP_ERR_OK);
cmdstat = vqec_cmd_fec_enable(cli_handle, "fec enable", args11, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(vqec_dp_get_fec(&fec, NULL) == VQEC_DP_ERR_OK);
cmdstat = vqec_cmd_fec_disable(cli_handle, "fec disable", args12, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
CU_ASSERT(vqec_dp_get_fec(&fec, NULL) == VQEC_DP_ERR_OK);
/* error repair policer enable */
cmdstat = vqec_cmd_error_repair_policer_enable(
cli_handle, "error-repair policer enable", args12, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_error_repair_policer_enable(
cli_handle, "error-repair policer enable", args11, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
vqec_error_repair_policer_parameters_get(&policer_enabled, NULL,
NULL, NULL,
NULL, NULL);
CU_ASSERT(policer_enabled);
/* error repair policer disable */
cmdstat = vqec_cmd_error_repair_policer_disable(
cli_handle, "error-repair policer disable", args12, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_error_repair_policer_disable(
cli_handle, "error-repair policer disable", args11, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
vqec_error_repair_policer_parameters_get(&policer_enabled, NULL,
NULL, NULL,
NULL, NULL);
CU_ASSERT(!policer_enabled);
/* error repair policer rate */
cmdstat = vqec_cmd_error_repair_policer_rate(
cli_handle, "error-repair policer rate", args11, 0);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_error_repair_policer_rate(
cli_handle, "error-repair policer rate", args12, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_error_repair_policer_rate
(cli_handle, "error-repair policer rate", args31, 1);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
vqec_error_repair_policer_parameters_get(&policer_enabled, NULL,
&rate, NULL,
&burst, NULL);
CU_ASSERT_EQUAL(rate, 1);
/* error repair policer burst */
cmdstat = vqec_cmd_error_repair_policer_burst(
cli_handle, "error-repair policer burst", args11, 0);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_error_repair_policer_burst(
cli_handle, "error-repair policer burst", args12, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_error_repair_policer_burst(
cli_handle, "error-repair policer burst", args31, 1);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
vqec_error_repair_policer_parameters_get(&policer_enabled, NULL,
NULL, NULL,
&burst, NULL);
CU_ASSERT_EQUAL(burst, 1);
/* drop default settings */
memset(&state, 0, sizeof(state));
vqec_dp_get_drop_params(VQEC_DP_INPUT_STREAM_TYPE_PRIMARY, &state);
CU_ASSERT(!state.en); /* disabled by default */
memset(&state, 0, sizeof(state));
vqec_dp_get_drop_params(VQEC_DP_INPUT_STREAM_TYPE_REPAIR, &state);
CU_ASSERT(!state.en); /* disabled by default */
/* drop session {primary | repair} {enable | disable} */
cmdstat = vqec_cmd_drop_enable(cli_handle,
"drop session primary enable",
args11, 0);
vqec_dp_get_drop_params(VQEC_DP_INPUT_STREAM_TYPE_PRIMARY, &state);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(state.en);
cmdstat = vqec_cmd_drop_disable(cli_handle,
"drop session primary disable",
args11, 0);
vqec_dp_get_drop_params(VQEC_DP_INPUT_STREAM_TYPE_PRIMARY, &state);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(!state.en);
cmdstat = vqec_cmd_drop_enable(cli_handle,
"drop session repair enable",
args11, 0);
vqec_dp_get_drop_params(VQEC_DP_INPUT_STREAM_TYPE_REPAIR, &state);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(state.en);
cmdstat = vqec_cmd_drop_disable(cli_handle,
"drop session repair disable",
args11, 0);
vqec_dp_get_drop_params(VQEC_DP_INPUT_STREAM_TYPE_REPAIR, &state);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(!state.en);
/* drop { enable | disable */
cmdstat = vqec_cmd_drop_enable(cli_handle, "drop enable", args11, 0);
vqec_dp_get_drop_params(VQEC_DP_INPUT_STREAM_TYPE_PRIMARY, &state);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(state.en);
cmdstat = vqec_cmd_drop_enable(cli_handle, "drop enable", args11, 0);
vqec_dp_get_drop_params(VQEC_DP_INPUT_STREAM_TYPE_PRIMARY, &state);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(state.en);
cmdstat = vqec_cmd_drop_disable(cli_handle, "drop disable", args12, 1);
vqec_dp_get_drop_params(VQEC_DP_INPUT_STREAM_TYPE_PRIMARY, &state);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
CU_ASSERT(state.en);
cmdstat = vqec_cmd_drop_disable(cli_handle, "drop disable", args11, 0);
vqec_dp_get_drop_params(VQEC_DP_INPUT_STREAM_TYPE_PRIMARY, &state);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(!state.en);
cmdstat = vqec_cmd_drop_enable(cli_handle, "drop enable", args12, 1);
vqec_dp_get_drop_params(VQEC_DP_INPUT_STREAM_TYPE_PRIMARY, &state);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
CU_ASSERT(!state.en);
/* drop-interval */
vqec_dp_get_drop_params(VQEC_DP_INPUT_STREAM_TYPE_PRIMARY, &state);
CU_ASSERT(state.desc.num_cont_drops == 0); /* default */
CU_ASSERT(state.desc.interval_span == 0); /* default */
cmdstat = vqec_cmd_drop_interval(cli_handle, "drop interval", args11, 0);
vqec_dp_get_drop_params(VQEC_DP_INPUT_STREAM_TYPE_PRIMARY, &state);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
CU_ASSERT(state.desc.num_cont_drops == 0);
CU_ASSERT(state.desc.interval_span == 0);
cmdstat = vqec_cmd_drop_interval(cli_handle, "drop interval", args12, 1);
vqec_dp_get_drop_params(VQEC_DP_INPUT_STREAM_TYPE_PRIMARY, &state);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
CU_ASSERT(state.desc.num_cont_drops == 0);
CU_ASSERT(state.desc.interval_span == 0);
cmdstat = vqec_cmd_drop_interval(cli_handle, "drop interval", args31, 1);
vqec_dp_get_drop_params(VQEC_DP_INPUT_STREAM_TYPE_PRIMARY, &state);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
CU_ASSERT(state.desc.num_cont_drops == 0);
CU_ASSERT(state.desc.interval_span == 0);
cmdstat = vqec_cmd_drop_interval(cli_handle, "drop interval", args32, 2);
vqec_dp_get_drop_params(VQEC_DP_INPUT_STREAM_TYPE_PRIMARY, &state);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(state.desc.num_cont_drops == 1);
CU_ASSERT(state.desc.interval_span == 2);
/* drop-percentage */
CU_ASSERT(state.desc.drop_percent == 0); /* default */
cmdstat = vqec_cmd_drop_percentage(cli_handle, "drop percentage", args11, 0);
vqec_dp_get_drop_params(VQEC_DP_INPUT_STREAM_TYPE_PRIMARY, &state);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
CU_ASSERT(state.desc.drop_percent == 0);
cmdstat = vqec_cmd_drop_percentage(cli_handle, "drop percentage", args12, 1);
vqec_dp_get_drop_params(VQEC_DP_INPUT_STREAM_TYPE_PRIMARY, &state);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
CU_ASSERT(state.desc.drop_percent == 0);
cmdstat = vqec_cmd_drop_percentage(cli_handle, "drop percentage", args32, 2);
vqec_dp_get_drop_params(VQEC_DP_INPUT_STREAM_TYPE_PRIMARY, &state);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
CU_ASSERT(state.desc.drop_percent == 0);
cmdstat = vqec_cmd_drop_percentage(cli_handle, "drop percentage", args31, 1);
vqec_dp_get_drop_params(VQEC_DP_INPUT_STREAM_TYPE_PRIMARY, &state);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(state.desc.drop_percent == 1);
}
static void test_vqec_cli_test_cmds (void) {
int cmdstat = 0;
char *args0[] = { };
char *args11[] = { "?" };
char *args12[] = { "invalidtuner" };
char *args13[] = { "deftuner" };
char *args14[] = { "newtuner" };
char *args21[] = { "deftuner", "url?" };
char *args22[] = { "deftuner", "udp://192.168.127.12:50000" };
char *args23[] = { "deftuner", "udp://172.16.58.3:50000" };
char *args24[] = { "deftuner", "udp://192.168.127.12:50000", "tr-135",
"gmin", "2", "slmd", "3" };
char *args31[] = { "udp://192.168.127.12:50000", "gmin", "1", "slmd", "5" };
char *args32[] = { "udp://172.16.58.3:50000", "gmin", "1", "slmd", "5" };
char primary_dest_addr[INET_ADDRSTRLEN];
char *args_bind[] = {"deftuner", "chan-params", "list", /* er & rcc */
"primary-dest-addr", primary_dest_addr,
"primary-dest-port", "60000",
"primary-dest-rtcp-port", "60011",
"primary-src-addr", "127.0.0.1",
"primary-src-port", "32993",
"primary-src-rtcp-port", "55001",
"primary-payload-type", "96",
"primary-bit-rate", "4000000",
"primary-rtcp-sndr-bw", "53",
"primary-rtcp-rcvr-bw", "530000",
"primary-rtcp-per-rcvr-bw", "53",
"fbt-addr", "127.0.0.1",
"er_enable", "rcc_enable",
"rtx-src-addr", "127.0.0.1",
"rtx-src-port", "55002",
"rtx-src-rtcp-port", "55003",
"rtx-dest-addr", "0.0.0.0",
"rtx-dest-port", "0",
"rtx-dest-rtcp-port", "0",
"rtx-payload-type", "99",
"rtx-rtcp-sndr-bw", "53",
"rtx-rtcp-rcvr-bw", "53"};
char *args_bind2[] = {"deftuner", "chan-params", "list", /* w/o er & rcc */
"primary-dest-addr", primary_dest_addr,
"primary-dest-port", "60000",
"primary-dest-rtcp-port", "60011",
"primary-src-addr", "127.0.0.1",
"primary-src-port", "32993",
"primary-src-rtcp-port", "55001",
"primary-payload-type", "96",
"primary-bit-rate", "4000000",
"primary-rtcp-sndr-bw", "53",
"primary-rtcp-rcvr-bw", "530000",
"primary-rtcp-per-rcvr-bw", "53",
"fbt-addr", "127.0.0.1"};
/* args_update1 - invalid (src port supplied w/o src address) */
char *args_update1[] = {"primary-dest-addr", primary_dest_addr,
"primary-dest-port", "60000",
"primary-src-addr", "0.0.0.0",
"primary-src-port", "32993",
"fbt-addr", "127.0.0.1",
"primary-src-rtcp-port", "56001",
"rtx-src-addr", "127.0.0.1",
"rtx-src-port", "56002",
"rtx-src-rtcp-port", "56003"};
/* args_update2 - invalid (FBT addr and rtx src addr don't match) */
char *args_update2[] = {"primary-dest-addr", primary_dest_addr,
"primary-dest-port", "60000",
"primary-src-addr", "127.0.0.1",
"primary-src-port", "32993",
"fbt-addr", "127.0.0.1",
"primary-src-rtcp-port", "56001",
"rtx-src-addr", "0.0.0.0",
"rtx-src-port", "56002",
"rtx-src-rtcp-port", "56003"};
/* args_update3 - valid */
char *args_update3[] = {"primary-dest-addr", primary_dest_addr,
"primary-dest-port", "60000",
"primary-src-addr", "127.0.0.2",
"primary-src-port", "32994",
"fbt-addr", "127.0.0.3",
"primary-src-rtcp-port", "56005",
"rtx-src-addr", "127.0.0.3",
"rtx-src-port", "56004",
"rtx-src-rtcp-port", "56003"};
/* args_update4 - valid */
char *args_update4[] = {"primary-dest-addr", primary_dest_addr,
"primary-dest-port", "60000",
"primary-src-addr", "127.0.0.1",
"primary-src-port", "32993",
"fbt-addr", "127.0.0.1",
"primary-src-rtcp-port", "56001"};
char *args_update_config1[] = {"file",
"data/override_tags.txt",
"type",
"override"};
in_addr_t dst_ip, src_ip;
uint16_t dst_port, src_port;
vqec_chan_t *chan;
/* tuner bind */
cmdstat = vqec_cmd_tuner_bind(cli_handle, "tuner bind", args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_tuner_bind(cli_handle, "tuner bind", args11, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_tuner_bind(cli_handle, "tuner bind", args12, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_tuner_bind(cli_handle, "tuner bind", args13, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_tuner_bind(cli_handle, "tuner bind", args21, 2);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_tuner_bind(cli_handle, "tuner bind", args22, 2);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_tuner_bind(cli_handle, "tuner bind", args23, 2);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
/* tuner unbind */
cmdstat = vqec_cmd_tuner_unbind(cli_handle, "tuner unbind", args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_tuner_unbind(cli_handle, "tuner unbind", args11, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_tuner_unbind(cli_handle, "tuner unbind", args12, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_tuner_unbind(cli_handle, "tuner unbind", args13, 1);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/* tuner create */
cmdstat = vqec_cmd_tuner_create(cli_handle, "tuner create", args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_tuner_create(cli_handle, "tuner create", args11, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_tuner_create(cli_handle, "tuner create", args13, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_tuner_create(cli_handle, "tuner create", args14, 1);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/* tuner bind and unbind for TR-135 */
cmdstat = vqec_cmd_tuner_bind(cli_handle, "tuner bind", args24, 7);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_tuner_unbind(cli_handle, "tuner unbind", args13, 1);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/* tuner destroy */
cmdstat = vqec_cmd_tuner_destroy(cli_handle, "tuner destroy", args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_tuner_destroy(cli_handle, "tuner destroy", args11, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_tuner_destroy(cli_handle, "tuner destroy", args12, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_tuner_destroy(cli_handle, "tuner destroy", args14, 1);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/* channel tr-135 */
cmdstat = vqec_cmd_tuner_bind(cli_handle, "tuner bind", args24, 7);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_channel_tr135(cli_handle, "channel tr-135", args31, 5);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_channel_tr135(cli_handle, "channel tr-135", args32, 5);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_tuner_unbind(cli_handle, "tuner unbind", args13, 1);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/*
* channel update (w/err & rcc)
*
* Test steps:
* 1. bind a tuner to a unicast channel using chan params.
* 2. verify some invalid source changes are rejected
* 3. verify for a valid source change that the active channel's
* config reflects the new source information
*/
CU_ASSERT(get_ip_address_by_if((char *)vqec_syscfg_get_ptr()->input_ifname,
primary_dest_addr,
INET_ADDRSTRLEN));
printf("Starting channel update tests with primary stream dest %s\n",
primary_dest_addr);
cmdstat = vqec_cmd_tuner_bind(cli_handle, "tuner bind", args_bind,
sizeof(args_bind)/sizeof(char *));
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/* supply invalid channel args */
cmdstat = vqec_cmd_channel_update(cli_handle, "channel update",
args_update1,
sizeof(args_update1)/sizeof(char *));
CU_ASSERT(cmdstat != VQEC_CLI_OK);
/* supply invalid channel args */
cmdstat = vqec_cmd_channel_update(cli_handle, "channel update",
args_update2,
sizeof(args_update2)/sizeof(char *));
CU_ASSERT(cmdstat != VQEC_CLI_OK);
/* supply valid channel args */
cmdstat = vqec_cmd_channel_update(cli_handle, "channel update",
args_update3,
sizeof(args_update3)/sizeof(char *));
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/* verify the active channel's config has changed */
CU_ASSERT(inet_pton(AF_INET, primary_dest_addr, &dst_ip) > 0);
dst_port = htons(60000);
chan = vqec_chan_find(dst_ip, dst_port);
CU_ASSERT(chan != NULL);
if (chan) {
/* primary stream */
CU_ASSERT(inet_pton(AF_INET, "127.0.0.2", &src_ip));
src_port = htons(32994);
CU_ASSERT(chan->cfg.primary_source_addr.s_addr == src_ip);
CU_ASSERT(chan->cfg.primary_source_port == src_port);
/* repair stream */
CU_ASSERT(inet_pton(AF_INET, "127.0.0.3", &src_ip));
src_port = htons(56004);
CU_ASSERT(chan->cfg.rtx_source_addr.s_addr == src_ip);
CU_ASSERT(chan->cfg.rtx_source_port == src_port);
}
cmdstat = vqec_cmd_tuner_unbind(cli_handle, "tuner unbind", args13, 1);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/*
* channel update (w/o er & rcc)
*/
cmdstat = vqec_cmd_tuner_bind(cli_handle, "tuner bind", args_bind2,
sizeof(args_bind2)/sizeof(char *));
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/* supply valid channel args */
cmdstat = vqec_cmd_channel_update(cli_handle, "channel update",
args_update4,
sizeof(args_update4)/sizeof(char *));
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/* verify the active channel's config has changed back */
CU_ASSERT(inet_pton(AF_INET, primary_dest_addr, &dst_ip) > 0);
dst_port = htons(60000);
chan = vqec_chan_find(dst_ip, dst_port);
CU_ASSERT(chan != NULL);
if (chan) {
/* primary stream */
CU_ASSERT(inet_pton(AF_INET, "127.0.0.1", &src_ip));
src_port = htons(32993);
CU_ASSERT(chan->cfg.primary_source_addr.s_addr == src_ip);
CU_ASSERT(chan->cfg.primary_source_port == src_port);
}
cmdstat = vqec_cmd_tuner_unbind(cli_handle, "tuner unbind", args13, 1);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/* update [file <filename> type {network|channel|override-tags}] */
cmdstat = vqec_cmd_update(cli_handle, "update", args_update_config1, 3);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_update(cli_handle, "update", args_update_config1, 4);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
}
static void test_vqec_cli_clear_cmds (void) {
int cmdstat = 0;
char *args0[] = { };
char *args11[] = { "?" };
char *args12[] = { "deftu?" };
char *args13[] = { "invalidtuner" };
char *args14[] = { "deftuner" };
/* clear counters */
cmdstat = vqec_cmd_clear_counters(cli_handle, "clear counters", args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_clear_counters(cli_handle, "clear counters", args11, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_clear_counters(cli_handle, "clear counters", args12, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_clear_counters(cli_handle, "clear counters", args13, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_clear_counters(cli_handle, "clear counters", args14, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
}
static void test_vqec_cli_debug_cmds (void) {
int cmdstat = 0;
char command[100];
char *args0[] = { };
char *args11[] = { "?" };
char *args12[] = { "rc?" };
char *args13[] = { "rcc" };
memset(command, 0, sizeof(command));
/* invalid command/args */
strncpy(command, "debug <type>", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
strncpy(command, "debug ?", 50);
cmdstat = vqec_debug_func(cli_handle, command, args11, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
strncpy(command, "debug rcc enable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args12, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
strncpy(command, "debug rcc enable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args13, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
/* channel */
printf("trying debug channel enable...\n");
strncpy(command, "debug channel enable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_CHANNEL));
strncpy(command, "debug channel disable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_CHANNEL));
/* pcm */
strncpy(command, "debug pcm enable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_PCM));
strncpy(command, "debug pcm disable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_PCM));
/* input */
strncpy(command, "debug input enable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_INPUT));
strncpy(command, "debug input disable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_INPUT));
/* output */
strncpy(command, "debug output enable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_OUTPUT));
strncpy(command, "debug output disable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_OUTPUT));
/* event */
strncpy(command, "debug event enable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_EVENT));
strncpy(command, "debug event disable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_EVENT));
/* igmp */
strncpy(command, "debug igmp enable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_IGMP));
strncpy(command, "debug igmp disable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_IGMP));
/* tuner */
strncpy(command, "debug tuner enable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_TUNER));
strncpy(command, "debug tuner disable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_TUNER));
/* recv-socket */
strncpy(command, "debug recv-socket enable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_RECV_SOCKET));
strncpy(command, "debug recv-socket disable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_RECV_SOCKET));
/* timer */
strncpy(command, "debug timer enable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_TIMER));
strncpy(command, "debug timer disable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_TIMER));
/* rtcp */
strncpy(command, "debug rtcp enable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_RTCP));
strncpy(command, "debug rtcp disable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_RTCP));
/* error-repair */
strncpy(command, "debug error-repair enable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_ERROR_REPAIR));
strncpy(command, "debug error-repair disable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_ERROR_REPAIR));
/* rcc */
strncpy(command, "debug rcc enable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_RCC));
strncpy(command, "debug rcc disable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_RCC));
/* nat */
strncpy(command, "debug nat enable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_NAT));
strncpy(command, "debug nat disable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_NAT));
/* chan_cfg */
strncpy(command, "debug chan_cfg enable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_CHAN_CFG));
strncpy(command, "debug chan_cfg disable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_CHAN_CFG));
/* updater */
strncpy(command, "debug updater enable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_UPDATER));
strncpy(command, "debug updater disable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_UPDATER));
/* all */
strncpy(command, "debug all enable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_CHANNEL));
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_PCM));
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_INPUT));
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_OUTPUT));
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_EVENT));
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_IGMP));
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_TUNER));
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_RECV_SOCKET));
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_TIMER));
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_RTCP));
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_ERROR_REPAIR));
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_RCC));
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_NAT));
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_CHAN_CFG));
CU_ASSERT(VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_UPDATER));
strncpy(command, "debug all disable", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_CHANNEL));
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_PCM));
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_INPUT));
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_OUTPUT));
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_EVENT));
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_IGMP));
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_TUNER));
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_RECV_SOCKET));
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_TIMER));
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_RTCP));
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_ERROR_REPAIR));
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_RCC));
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_NAT));
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_CHAN_CFG));
CU_ASSERT(!VQEC_GET_DEBUG_FLAG(VQEC_DEBUG_UPDATER));
/* ? */
strncpy(command, "debug ?", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
strncpy(command, "debug rcc ?", 50);
cmdstat = vqec_debug_func(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
}
static void test_vqec_cli_hag_cmds (void) {
int cmdstat = 0;
char *args0[] = { };
char *args11[] = { "?" };
char *args12[] = { "deftu?" };
char *args21[] = { "deftuner", "eth0" };
char *args31[] = { "deftuner", "eth0", "192.168.1.128" };
char *args32[] = { "deftuner", "eth0", "udp://192.168.1.128:50000" };
char *args33[] = { "deftuner", "eth0", "udp://192.368.1.128:50000" };
char *args41[] = { "deftuner", "eth0", "192.168.1.128", "0.0.240.0" };
#ifdef HAVE_HAG_MODE
char *args42[] = { "deftuner", "eth0", "192.168.1.256", "0.0.240.0" };
char *args43[] = { "deftuner", "eth0", "192.168.1.128", "0.0.288.0" };
char *args44[] = { "deftuner", "eth0", "192.168.1.128", "0.4.240.0" };
char *args51[] = { "deftuner", "eth0", "192.168.1.128", "0.0.240.0",
"extraarg"};
#endif /* HAVE_HAG_MODE */
#ifdef HAVE_HAG_MODE
/* proxy-igmp-join */
cmdstat = vqec_cmd_proxy_igmp_join(cli_handle, "proxy-igmp-join", args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_proxy_igmp_join(cli_handle, "proxy-igmp-join",
args11, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_proxy_igmp_join(cli_handle, "proxy-igmp-join",
args12, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
/* Need to run this in root mode, so failed in socket create */
cmdstat = vqec_cmd_proxy_igmp_join(cli_handle, "proxy-igmp-join",
args31, 3);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_proxy_igmp_join(cli_handle, "proxy-igmp-join",
args41, 4);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_proxy_igmp_join(cli_handle, "proxy-igmp-join",
args42, 4);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_proxy_igmp_join(cli_handle, "proxy-igmp-join",
args43, 4);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_proxy_igmp_join(cli_handle, "proxy-igmp-join",
args44, 4);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_proxy_igmp_join(cli_handle, "proxy-igmp-join",
args51, 5);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
#endif /* HAVE_HAG_MODE */
/* stream-output */
cmdstat = vqec_cmd_stream_output(cli_handle, "stream-output", args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_stream_output(cli_handle, "stream-output", args11, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_stream_output(cli_handle, "stream-output", args12, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_stream_output(cli_handle, "stream-output", args21, 2);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_stream_output(cli_handle, "stream-output", args31, 3);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_stream_output(cli_handle, "stream-output", args32, 3);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_stream_output(cli_handle, "stream-output", args33, 3);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_stream_output(cli_handle, "stream-output", args41, 4);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
}
static void test_vqec_cli_monitor_cmds (void) {
int cmdstat = 0;
char command[100];
char *args0[] = { };
char *args11[] = { "?" };
char *args12[] = { "file?" };
char *args13[] = { "utest_elog_dump_file.tmp" };
memset(command, 0, sizeof(command));
/* invalid command/args */
strncpy(command, "monitor elog <3rdparam>", 50);
cmdstat = vqec_cmd_monitor_elog(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
strncpy(command, "monitor elog dump", 50);
cmdstat = vqec_cmd_monitor_elog(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
strncpy(command, "monitor elog on", 50);
cmdstat = vqec_cmd_monitor_elog(cli_handle, command, args11, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
/* monitor elog on */
strncpy(command, "monitor elog on", 50);
cmdstat = vqec_cmd_monitor_elog(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/* monitor elog off */
strncpy(command, "monitor elog off", 50);
cmdstat = vqec_cmd_monitor_elog(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/* monitor elog reset */
strncpy(command, "monitor elog reset", 50);
cmdstat = vqec_cmd_monitor_elog(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/* monitor elog dump */
strncpy(command, "monitor elog dump", 50);
cmdstat = vqec_cmd_monitor_elog(cli_handle, command, args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
strncpy(command, "monitor elog dump", 50);
cmdstat = vqec_cmd_monitor_elog(cli_handle, command, args11, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
strncpy(command, "monitor elog dump", 50);
cmdstat = vqec_cmd_monitor_elog(cli_handle, command, args12, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
strncpy(command, "monitor elog dump", 50);
cmdstat = vqec_cmd_monitor_elog(cli_handle, command, args13, 1);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/* print elog status report */
status_report();
/* Output Scheduling commands */
cmdstat = vqec_cmd_stream_output(cli_handle, "monitor output-sched",
args11, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cmd_monitor_outputsched_on(cli_handle,
"monitor output-sched on",
args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_monitor_outputsched_off(cli_handle,
"monitor output-sched off",
args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_monitor_outputsched_reset(cli_handle,
"monitor output-sched reset",
args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cmd_monitor_outputsched_show(cli_handle,
"monitor output-sched show",
args0, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
}
/* Test exit, quit, disable, ?, special commands */
static void test_vqec_cli_special_cmds (void)
{
int cmdstat = 0;
char *args1[] = { "?" };
char *args2[] = { "enable" };
char *args3[] = { "disable" };
char *args4[] = { "logout" };
char *args5[] = { "exit" };
char *args6[] = { "quit" };
char *args7[] = { "history" };
cmdstat = vqec_cli_help_func(cli_handle, "?", args1, 1);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/* Enter the privileged mode */
cmdstat = vqec_cli_help_func(cli_handle, "enable", args2, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cli_help_func(cli_handle, "disable", args3, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cli_help_func(cli_handle, "logout", args4, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cli_help_func(cli_handle, "exit", args5, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cli_help_func(cli_handle, "quit", args6, 1);
CU_ASSERT(cmdstat == VQEC_CLI_ERROR);
cmdstat = vqec_cli_help_func(cli_handle, "?", args1, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
/* Enter the privileged mode */
cmdstat = vqec_cli_help_func(cli_handle, "enable", args2, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cli_help_func(cli_handle, "disable", args3, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cli_help_func(cli_handle, "logout", args4, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cli_help_func(cli_handle, "exit", args5, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cli_help_func(cli_handle, "quit", args6, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
cmdstat = vqec_cli_help_func(cli_handle, "history", args7, 0);
CU_ASSERT(cmdstat == VQEC_CLI_OK);
}
void fixerrs(void){
test_vqec_cli_monitor_cmds();
}
CU_TestInfo test_array_cli[] = {
{"test vqec_cli_helper_funcs",test_vqec_cli_helper_funcs},
{"test vqec_cli_show_cmds",test_vqec_cli_show_cmds},
{"test vqec_cli_global_cmds",test_vqec_cli_global_cmds},
{"test vqec_cli_test_cmds",test_vqec_cli_test_cmds},
{"test vqec_cli_clear_cmds",test_vqec_cli_clear_cmds},
{"test vqec_cli_debug_cmds",test_vqec_cli_debug_cmds},
{"test vqec_cli_hag_cmds",test_vqec_cli_hag_cmds},
{"test vqec_cli_monitor_cmds",test_vqec_cli_monitor_cmds},
{"test vqec_cli_special_cmds",test_vqec_cli_special_cmds},
CU_TEST_INFO_NULL,
}; | c |
src/morus.c | ildyria/MiniMorus | 0 | 6456275 | #include "morus.h"
void print_state(state state) {
printf("--------------------------------------------\n");
printf(" S0 | S1 | S3 | S3 | S4 \n");
printf("%08x %08x %08x %08x %08x\n", state[0][3], state[1][3], state[2][3], state[3][3], state[4][3]);
printf("%08x %08x %08x %08x %08x\n", state[0][2], state[1][2], state[2][2], state[3][2], state[4][2]);
printf("%08x %08x %08x %08x %08x\n", state[0][1], state[1][1], state[2][1], state[3][1], state[4][1]);
printf("%08x %08x %08x %08x %08x\n", state[0][0], state[1][0], state[2][0], state[3][0], state[4][0]);
}
void print_word(state_words word) {
printf("%08x %08x %08x %08x\n", word[0], word[1], word[2], word[3]);
}
void print(state* saved_state, state_words* saved_cipher)
{
int i;
printf("-------------------------------------------- Ciphers\n");
for ( i = 0; i < 5; i++) {
print_word(saved_cipher[i]);
}
printf("-------------------------------------------- States\n");
for ( i = 0; i < 6; i++) {
print_state(saved_state[i]);
}
}
uint32_t rotate_left(uint32_t x, int bits)
{
if (bits == 0) return x;
return (x << bits) | (x >> (32 - bits));
}
void copy_state_words(state_words out, const state_words word)
{
out[0] = word[0];
out[1] = word[1];
out[2] = word[2];
out[3] = word[3];
}
void rotate_left_word(state_words word, int bits)
{
word[0] = rotate_left(word[0], bits);
word[1] = rotate_left(word[1], bits);
word[2] = rotate_left(word[2], bits);
word[3] = rotate_left(word[3], bits);
}
void and_xor_to_word(state_words o, const state_words s1 , const state_words s2)
{
o[0] ^= s1[0] & s2[0];
o[1] ^= s1[1] & s2[1];
o[2] ^= s1[2] & s2[2];
o[3] ^= s1[3] & s2[3];
}
void xor_to_word(state_words o, const state_words s)
{
o[0] ^= s[0];
o[1] ^= s[1];
o[2] ^= s[2];
o[3] ^= s[3];
}
void permute_words(state_words s, int bits)
{
// return;
uint32_t t;
if (bits == 96)
{
t = s[0];
s[0] = s[1];
s[1] = s[2];
s[2] = s[3];
s[3] = t;
}
if (bits == 64)
{
t = s[0];s[0] = s[2];s[2] = t;
t = s[1];s[1] = s[3];s[3] = t;
}
if (bits == 32)
{
t = s[3];
s[3] = s[2];
s[2] = s[1];
s[1] = s[0];
s[0] = t;
}
}
void null_word(state_words* w){
(*w)[0] = 0;
(*w)[1] = 0;
(*w)[2] = 0;
(*w)[3] = 0;
}
void rand_init(state st, struct RNG_state* seed){
st[0][0] = aesrand_int32_r(seed);
st[1][0] = aesrand_int32_r(seed);
st[2][0] = aesrand_int32_r(seed);
st[3][0] = aesrand_int32_r(seed);
st[4][0] = aesrand_int32_r(seed);
st[0][1] = aesrand_int32_r(seed);
st[1][1] = aesrand_int32_r(seed);
st[2][1] = aesrand_int32_r(seed);
st[3][1] = aesrand_int32_r(seed);
st[4][1] = aesrand_int32_r(seed);
st[0][2] = aesrand_int32_r(seed);
st[1][2] = aesrand_int32_r(seed);
st[2][2] = aesrand_int32_r(seed);
st[3][2] = aesrand_int32_r(seed);
st[4][2] = aesrand_int32_r(seed);
st[0][3] = aesrand_int32_r(seed);
st[1][3] = aesrand_int32_r(seed);
st[2][3] = aesrand_int32_r(seed);
st[3][3] = aesrand_int32_r(seed);
st[4][3] = aesrand_int32_r(seed);
}
void iterate(state st, state_words message) {
// print_state(st);
xor_to_word(st[0],st[3]);
and_xor_to_word(st[0], st[1], st[2]);
rotate_left_word(st[0],5);
permute_words(st[3],32);
xor_to_word(st[1], message);
xor_to_word(st[1],st[4]);
and_xor_to_word(st[1], st[2], st[3]);
rotate_left_word(st[1],31);
permute_words(st[4],64);
xor_to_word(st[2], message);
xor_to_word(st[2],st[0]);
and_xor_to_word(st[2], st[3], st[4]);
rotate_left_word(st[2],7);
permute_words(st[0],96);
xor_to_word(st[3], message);
xor_to_word(st[3],st[1]);
and_xor_to_word(st[3], st[4], st[0]);
rotate_left_word(st[3],22);
permute_words(st[1],64);
xor_to_word(st[4], message);
xor_to_word(st[4],st[2]);
and_xor_to_word(st[4], st[0], st[1]);
rotate_left_word(st[4],13);
permute_words(st[2],32);
// print_state(st);
}
void encrypt(state_words* out, state_words message, state st)
{
state_words mem, st1;
// printf("-------------------------------------------- Message\n");
// print_word(message);
copy_state_words(mem,message);
copy_state_words(st1,st[1]);
permute_words(st1,96);
xor_to_word(st1,message);
xor_to_word(st1,st[0]);
and_xor_to_word(st1,st[2],st[3]);
iterate(st, mem);
copy_state_words(*out,st1);
// (*out)[0] = st1[0];
// (*out)[1] = st1[1];
// (*out)[2] = st1[2];
// (*out)[3] = st1[3];
// printf("-------------------------------------------- CipherText\n");
// print_word(st1);
// print_word(*out);
}
uint32_t gen_mask(uint32_t* mask, unsigned int i)
{
*mask |= (1 << i);
return 0;
}
// Compute the Hamming Weight
uint32_t HW(uint32_t x)
{
x = x - ((x >> 1) & 0x55555555);
x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
x = (x + (x >> 4)) & 0x0F0F0F0F;
x = x + (x >> 8);
x = x + (x >> 16);
return x & 0x0000003F;
}
// return xor([mask(S[1][0], [0]),
// mask(S[1][4], [0]),
// mask(C[1], [0,8,26]),
// mask(C[2], [13,31]),
// # 2^-3 version
// mask(S[2][4], [13]),
// mask(S[3][1], [12]),
// # 2^-4 version
// #mask(S[2][1], [13]),
// ]) # 2^-3
int linear(state* saved_state, state_words* saved_cipher) {
uint32_t mask = 0;
uint32_t res = 0;
#if 0
// print(saved_state,saved_cipher);
mask = 0;
gen_mask(&mask,0);
res ^= saved_state[1][0][0] & mask;
// res ^= saved_state[1][0][1] & mask;
// res ^= saved_state[1][0][2] & mask;
// res ^= saved_state[1][0][3] & mask;
res ^= saved_state[1][4][0] & mask;
// res ^= saved_state[1][4][1] & mask;
// res ^= saved_state[1][4][2] & mask;
// res ^= saved_state[1][4][3] & mask;
mask = 0;
gen_mask(&mask,0);
gen_mask(&mask,8);
gen_mask(&mask,26);
res ^= saved_cipher[1][0] & mask;
// res ^= saved_cipher[1][1] & mask;
// res ^= saved_cipher[1][2] & mask;
// res ^= saved_cipher[1][3] & mask;
mask = 0;
gen_mask(&mask,13);
gen_mask(&mask,31);
res ^= saved_cipher[1][0] & mask;
// res ^= saved_cipher[1][1] & mask;
// res ^= saved_cipher[1][2] & mask;
// res ^= saved_cipher[1][3] & mask;
mask = 0;
gen_mask(&mask,13);
res ^= saved_state[2][4][0] & mask;
// res ^= saved_state[2][4][1] & mask;
// res ^= saved_state[2][4][2] & mask;
// res ^= saved_state[2][4][3] & mask;
mask = 0;
gen_mask(&mask,13);
res ^= saved_state[2][1][0] & mask;
// res ^= saved_state[2][1][1] & mask;
// res ^= saved_state[2][1][2] & mask;
// res ^= saved_state[2][1][3] & mask;
mask = 0;
gen_mask(&mask,12);
res ^= saved_state[3][1][0] & mask;
// res ^= saved_state[3][1][1] & mask;
// res ^= saved_state[3][1][2] & mask;
// res ^= saved_state[3][1][3] & mask;
#else
/* res ^= saved_state[0][1][0] & (1<<0); */
/* res ^= saved_state[0][1][1] & (1<<0); */
/* res ^= saved_state[1][0][3] & (1<<5); */
/* res ^= saved_cipher[0][0] & (1<<0); */
/* res ^= saved_state[0][1][1] & (1<<0); */
/* res ^= saved_state[0][0][0] & (1<<0); */
/* res ^= saved_cipher[0][0] & (1<<0); */
/* res ^= saved_state[0][1][0] & (1<<0); */
/* res ^= saved_state[1][0][3] & (1<<5); */
/* res ^= saved_state[0][0][0] & (1<<0); */
/* res ^= saved_state[0][3][0] & (1<<0); */
/* res ^= saved_state[1][1][0] & (1<<5); */
/* res ^= saved_state[1][0][3] & (1<<5); */
/* res ^= saved_cipher[1][3] & (1<<5); */
/* res ^= saved_state[0][1][0] & (1<<0); */
/* res ^= saved_state[0][1][1] & (1<<0); */
/* res ^= saved_state[1][1][0] & (1<<5); */
/* res ^= saved_cipher[0][0] & (1<<0); */
/* res ^= saved_cipher[1][3] & (1<<5); */
/* res ^= saved_state[0][1][1] & (1<<0); */
/* res ^= saved_state[0][1][2] & (1<<0); */
/* res ^= saved_state[1][1][1] & (1<<5); */
/* res ^= saved_cipher[0][1] & (1<<0); */
/* res ^= saved_cipher[1][0] & (1<<5); */
/* res ^= saved_state[1][1][0] & (1<<5); */
/* res ^= saved_state[1][1][1] & (1<<5); */
/* res ^= saved_state[2][1][0] & (1<<10); */
/* res ^= saved_cipher[1][0] & (1<<5); */
/* res ^= saved_cipher[2][3] & (1<<10); */
res ^= saved_cipher[0][0] & (1<<27);
res ^= saved_cipher[0][1] & (1<<27);
res ^= saved_cipher[0][2] & (1<<27);
res ^= saved_cipher[0][3] & (1<<27);
/* res ^= saved_state[1][0][0] & (1<<0); */
/* res ^= saved_state[1][0][1] & (1<<0); */
/* res ^= saved_state[1][0][2] & (1<<0); */
/* res ^= saved_state[1][0][3] & (1<<0); */
res ^= saved_cipher[1][0] & (1<<0);
res ^= saved_cipher[1][1] & (1<<0);
res ^= saved_cipher[1][2] & (1<<0);
res ^= saved_cipher[1][3] & (1<<0);
/* res ^= saved_state[2][0][0] & (1<<5); */
/* res ^= saved_state[2][0][1] & (1<<5); */
/* res ^= saved_state[2][0][2] & (1<<5); */
/* res ^= saved_state[2][0][3] & (1<<5); */
res ^= saved_state[1][3][0] & (1<<0);
res ^= saved_state[1][3][1] & (1<<0);
res ^= saved_state[1][3][2] & (1<<0);
res ^= saved_state[1][3][3] & (1<<0);
/* res ^= saved_state[1][0][0] & (1<<0); */
/* res ^= saved_state[1][0][1] & (1<<0); */
/* res ^= saved_state[1][0][2] & (1<<0); */
/* res ^= saved_state[1][0][3] & (1<<0); */
/* res ^= saved_state[2][0][0] & (1<<5); */
/* res ^= saved_state[2][0][1] & (1<<5); */
/* res ^= saved_state[2][0][2] & (1<<5); */
/* res ^= saved_state[2][0][3] & (1<<5); */
res ^= saved_state[1][1][0] & (1<<0);
res ^= saved_state[1][1][1] & (1<<0);
res ^= saved_state[1][1][2] & (1<<0);
res ^= saved_state[1][1][3] & (1<<0);
#endif
return 1 & HW(res);
} | c |
80186PC/include/ATA/ATADevice.h | moon-touched/80186PC | 0 | 4480063 | #ifndef ATA_ATA_DEVICE_H
#define ATA_ATA_DEVICE_H
#include <thread>
#include <mutex>
#include <atomic>
#include <array>
#include <ATA/IATADevice.h>
class ATADevice : public IATADevice {
protected:
ATADevice();
~ATADevice();
public:
void write(CS cs, uint8_t address, uint16_t value) override;
uint16_t read(CS cs, uint8_t address) override;
void attachToHost(IATADeviceHost* host) override;
bool isInterruptRequested() const override;
protected:
struct ATACommand {
uint8_t feature;
uint8_t sectorCount;
uint8_t sectorNumber;
uint8_t cylinderLow;
uint8_t cylinderHigh;
uint8_t driveHead;
uint8_t command;
};
struct ATACommandResult {
uint8_t status;
uint8_t error;
};
virtual void resetDevice() = 0;
virtual void executeCommand(const ATACommand& command, ATACommandResult& result) = 0;
virtual void pioWriteFinished() = 0;
void stopDriveThread();
void pioRead(size_t size);
void pioWrite(size_t size);
inline uint8_t* transferBuffer() {
return m_transferBuffer.data();
}
inline void set8BitPIO() {
m_eightBitPIO = true;
}
inline void clear8BitPIO() {
m_eightBitPIO = false;
}
private:
enum class TransferState {
Idle,
PIORead,
PIOWrite
};
void driveThread();
void postReset();
void postResetLocked();
void postCommand();
void postCommandLocked();
void setInterruptLocked();
void clearInterruptLocked();
bool isInterruptRequestedLocked() const;
void updateDRQLocked(TransferState state, bool first);
mutable std::mutex m_driveThreadMutex;
std::condition_variable m_driveThreadCondvar;
bool m_stopDriveThread;
bool m_resetRequest;
bool m_commandRequest;
bool m_interruptPending;
bool m_interruptEnabled;
bool m_resetAsserted;
bool m_eightBitPIO;
uint8_t m_status;
uint8_t m_feature;
uint8_t m_error;
uint8_t m_sectorCount;
uint8_t m_sectorNumber;
uint8_t m_cylinderLow;
uint8_t m_cylinderHigh;
uint8_t m_driveHead;
uint8_t m_command;
IATADeviceHost* m_host;
std::array<uint8_t, 131072> m_transferBuffer;
TransferState m_transferState;
size_t m_transferPosition;
size_t m_transferSize;
std::thread m_driveThread;
};
#endif | c |
test/aarch32/traces/assembler-cond-rd-rn-rm-uadd8-a32.h | capablevms/VIXL | 573 | 8050247 | // Copyright 2015, VIXL authors
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of ARM Limited 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 CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ---------------------------------------------------------------------
// This file is auto generated using tools/generate_simulator_traces.py.
//
// PLEASE DO NOT EDIT.
// ---------------------------------------------------------------------
#ifndef VIXL_ASSEMBLER_COND_RD_RN_RM_UADD8_A32_H_
#define VIXL_ASSEMBLER_COND_RD_RN_RM_UADD8_A32_H_
const byte kInstruction_uadd8_hi_r1_r9_r5[] = {
0x95, 0x1f, 0x59, 0x86 // uadd8 hi r1 r9 r5
};
const byte kInstruction_uadd8_pl_r8_r6_r2[] = {
0x92, 0x8f, 0x56, 0x56 // uadd8 pl r8 r6 r2
};
const byte kInstruction_uadd8_hi_r5_r8_r2[] = {
0x92, 0x5f, 0x58, 0x86 // uadd8 hi r5 r8 r2
};
const byte kInstruction_uadd8_vc_r9_r2_r7[] = {
0x97, 0x9f, 0x52, 0x76 // uadd8 vc r9 r2 r7
};
const byte kInstruction_uadd8_lt_r4_r6_r3[] = {
0x93, 0x4f, 0x56, 0xb6 // uadd8 lt r4 r6 r3
};
const byte kInstruction_uadd8_le_r11_r6_r2[] = {
0x92, 0xbf, 0x56, 0xd6 // uadd8 le r11 r6 r2
};
const byte kInstruction_uadd8_cc_r8_r14_r4[] = {
0x94, 0x8f, 0x5e, 0x36 // uadd8 cc r8 r14 r4
};
const byte kInstruction_uadd8_le_r5_r14_r6[] = {
0x96, 0x5f, 0x5e, 0xd6 // uadd8 le r5 r14 r6
};
const byte kInstruction_uadd8_lt_r6_r1_r0[] = {
0x90, 0x6f, 0x51, 0xb6 // uadd8 lt r6 r1 r0
};
const byte kInstruction_uadd8_lt_r5_r0_r9[] = {
0x99, 0x5f, 0x50, 0xb6 // uadd8 lt r5 r0 r9
};
const byte kInstruction_uadd8_le_r8_r12_r7[] = {
0x97, 0x8f, 0x5c, 0xd6 // uadd8 le r8 r12 r7
};
const byte kInstruction_uadd8_eq_r7_r14_r6[] = {
0x96, 0x7f, 0x5e, 0x06 // uadd8 eq r7 r14 r6
};
const byte kInstruction_uadd8_cs_r7_r4_r6[] = {
0x96, 0x7f, 0x54, 0x26 // uadd8 cs r7 r4 r6
};
const byte kInstruction_uadd8_gt_r9_r6_r9[] = {
0x99, 0x9f, 0x56, 0xc6 // uadd8 gt r9 r6 r9
};
const byte kInstruction_uadd8_ne_r13_r9_r1[] = {
0x91, 0xdf, 0x59, 0x16 // uadd8 ne r13 r9 r1
};
const byte kInstruction_uadd8_ge_r13_r1_r13[] = {
0x9d, 0xdf, 0x51, 0xa6 // uadd8 ge r13 r1 r13
};
const byte kInstruction_uadd8_ls_r8_r10_r2[] = {
0x92, 0x8f, 0x5a, 0x96 // uadd8 ls r8 r10 r2
};
const byte kInstruction_uadd8_hi_r0_r13_r5[] = {
0x95, 0x0f, 0x5d, 0x86 // uadd8 hi r0 r13 r5
};
const byte kInstruction_uadd8_pl_r13_r7_r8[] = {
0x98, 0xdf, 0x57, 0x56 // uadd8 pl r13 r7 r8
};
const byte kInstruction_uadd8_ge_r4_r13_r11[] = {
0x9b, 0x4f, 0x5d, 0xa6 // uadd8 ge r4 r13 r11
};
const byte kInstruction_uadd8_cs_r5_r10_r5[] = {
0x95, 0x5f, 0x5a, 0x26 // uadd8 cs r5 r10 r5
};
const byte kInstruction_uadd8_cs_r5_r4_r3[] = {
0x93, 0x5f, 0x54, 0x26 // uadd8 cs r5 r4 r3
};
const byte kInstruction_uadd8_ls_r6_r14_r8[] = {
0x98, 0x6f, 0x5e, 0x96 // uadd8 ls r6 r14 r8
};
const byte kInstruction_uadd8_vs_r3_r8_r6[] = {
0x96, 0x3f, 0x58, 0x66 // uadd8 vs r3 r8 r6
};
const byte kInstruction_uadd8_vc_r7_r12_r3[] = {
0x93, 0x7f, 0x5c, 0x76 // uadd8 vc r7 r12 r3
};
const byte kInstruction_uadd8_ge_r1_r4_r1[] = {
0x91, 0x1f, 0x54, 0xa6 // uadd8 ge r1 r4 r1
};
const byte kInstruction_uadd8_cc_r4_r7_r10[] = {
0x9a, 0x4f, 0x57, 0x36 // uadd8 cc r4 r7 r10
};
const byte kInstruction_uadd8_cc_r2_r0_r13[] = {
0x9d, 0x2f, 0x50, 0x36 // uadd8 cc r2 r0 r13
};
const byte kInstruction_uadd8_vs_r9_r6_r8[] = {
0x98, 0x9f, 0x56, 0x66 // uadd8 vs r9 r6 r8
};
const byte kInstruction_uadd8_cs_r14_r11_r13[] = {
0x9d, 0xef, 0x5b, 0x26 // uadd8 cs r14 r11 r13
};
const byte kInstruction_uadd8_pl_r5_r8_r4[] = {
0x94, 0x5f, 0x58, 0x56 // uadd8 pl r5 r8 r4
};
const byte kInstruction_uadd8_pl_r2_r3_r7[] = {
0x97, 0x2f, 0x53, 0x56 // uadd8 pl r2 r3 r7
};
const byte kInstruction_uadd8_cs_r7_r12_r14[] = {
0x9e, 0x7f, 0x5c, 0x26 // uadd8 cs r7 r12 r14
};
const byte kInstruction_uadd8_hi_r6_r6_r1[] = {
0x91, 0x6f, 0x56, 0x86 // uadd8 hi r6 r6 r1
};
const byte kInstruction_uadd8_cc_r6_r9_r6[] = {
0x96, 0x6f, 0x59, 0x36 // uadd8 cc r6 r9 r6
};
const byte kInstruction_uadd8_ne_r12_r12_r0[] = {
0x90, 0xcf, 0x5c, 0x16 // uadd8 ne r12 r12 r0
};
const byte kInstruction_uadd8_cc_r9_r3_r8[] = {
0x98, 0x9f, 0x53, 0x36 // uadd8 cc r9 r3 r8
};
const byte kInstruction_uadd8_mi_r13_r6_r1[] = {
0x91, 0xdf, 0x56, 0x46 // uadd8 mi r13 r6 r1
};
const byte kInstruction_uadd8_lt_r4_r8_r6[] = {
0x96, 0x4f, 0x58, 0xb6 // uadd8 lt r4 r8 r6
};
const byte kInstruction_uadd8_hi_r11_r5_r9[] = {
0x99, 0xbf, 0x55, 0x86 // uadd8 hi r11 r5 r9
};
const byte kInstruction_uadd8_cc_r6_r10_r6[] = {
0x96, 0x6f, 0x5a, 0x36 // uadd8 cc r6 r10 r6
};
const byte kInstruction_uadd8_eq_r10_r10_r5[] = {
0x95, 0xaf, 0x5a, 0x06 // uadd8 eq r10 r10 r5
};
const byte kInstruction_uadd8_al_r5_r4_r11[] = {
0x9b, 0x5f, 0x54, 0xe6 // uadd8 al r5 r4 r11
};
const byte kInstruction_uadd8_pl_r11_r11_r2[] = {
0x92, 0xbf, 0x5b, 0x56 // uadd8 pl r11 r11 r2
};
const byte kInstruction_uadd8_ls_r6_r14_r12[] = {
0x9c, 0x6f, 0x5e, 0x96 // uadd8 ls r6 r14 r12
};
const byte kInstruction_uadd8_vc_r7_r7_r2[] = {
0x92, 0x7f, 0x57, 0x76 // uadd8 vc r7 r7 r2
};
const byte kInstruction_uadd8_eq_r10_r8_r4[] = {
0x94, 0xaf, 0x58, 0x06 // uadd8 eq r10 r8 r4
};
const byte kInstruction_uadd8_al_r14_r7_r2[] = {
0x92, 0xef, 0x57, 0xe6 // uadd8 al r14 r7 r2
};
const byte kInstruction_uadd8_cs_r3_r11_r10[] = {
0x9a, 0x3f, 0x5b, 0x26 // uadd8 cs r3 r11 r10
};
const byte kInstruction_uadd8_ls_r11_r4_r0[] = {
0x90, 0xbf, 0x54, 0x96 // uadd8 ls r11 r4 r0
};
const byte kInstruction_uadd8_hi_r11_r8_r9[] = {
0x99, 0xbf, 0x58, 0x86 // uadd8 hi r11 r8 r9
};
const byte kInstruction_uadd8_vs_r2_r14_r13[] = {
0x9d, 0x2f, 0x5e, 0x66 // uadd8 vs r2 r14 r13
};
const byte kInstruction_uadd8_al_r1_r13_r9[] = {
0x99, 0x1f, 0x5d, 0xe6 // uadd8 al r1 r13 r9
};
const byte kInstruction_uadd8_eq_r3_r9_r13[] = {
0x9d, 0x3f, 0x59, 0x06 // uadd8 eq r3 r9 r13
};
const byte kInstruction_uadd8_ge_r10_r3_r13[] = {
0x9d, 0xaf, 0x53, 0xa6 // uadd8 ge r10 r3 r13
};
const byte kInstruction_uadd8_pl_r8_r5_r10[] = {
0x9a, 0x8f, 0x55, 0x56 // uadd8 pl r8 r5 r10
};
const byte kInstruction_uadd8_vc_r8_r11_r6[] = {
0x96, 0x8f, 0x5b, 0x76 // uadd8 vc r8 r11 r6
};
const byte kInstruction_uadd8_eq_r0_r0_r5[] = {
0x95, 0x0f, 0x50, 0x06 // uadd8 eq r0 r0 r5
};
const byte kInstruction_uadd8_ne_r6_r5_r8[] = {
0x98, 0x6f, 0x55, 0x16 // uadd8 ne r6 r5 r8
};
const byte kInstruction_uadd8_hi_r5_r13_r3[] = {
0x93, 0x5f, 0x5d, 0x86 // uadd8 hi r5 r13 r3
};
const byte kInstruction_uadd8_ne_r11_r14_r14[] = {
0x9e, 0xbf, 0x5e, 0x16 // uadd8 ne r11 r14 r14
};
const byte kInstruction_uadd8_mi_r1_r0_r6[] = {
0x96, 0x1f, 0x50, 0x46 // uadd8 mi r1 r0 r6
};
const byte kInstruction_uadd8_le_r14_r8_r2[] = {
0x92, 0xef, 0x58, 0xd6 // uadd8 le r14 r8 r2
};
const byte kInstruction_uadd8_eq_r9_r6_r5[] = {
0x95, 0x9f, 0x56, 0x06 // uadd8 eq r9 r6 r5
};
const byte kInstruction_uadd8_eq_r11_r0_r13[] = {
0x9d, 0xbf, 0x50, 0x06 // uadd8 eq r11 r0 r13
};
const byte kInstruction_uadd8_pl_r4_r5_r14[] = {
0x9e, 0x4f, 0x55, 0x56 // uadd8 pl r4 r5 r14
};
const byte kInstruction_uadd8_cs_r13_r5_r13[] = {
0x9d, 0xdf, 0x55, 0x26 // uadd8 cs r13 r5 r13
};
const byte kInstruction_uadd8_mi_r0_r13_r8[] = {
0x98, 0x0f, 0x5d, 0x46 // uadd8 mi r0 r13 r8
};
const byte kInstruction_uadd8_lt_r2_r13_r3[] = {
0x93, 0x2f, 0x5d, 0xb6 // uadd8 lt r2 r13 r3
};
const byte kInstruction_uadd8_ls_r8_r1_r11[] = {
0x9b, 0x8f, 0x51, 0x96 // uadd8 ls r8 r1 r11
};
const byte kInstruction_uadd8_vc_r14_r11_r8[] = {
0x98, 0xef, 0x5b, 0x76 // uadd8 vc r14 r11 r8
};
const byte kInstruction_uadd8_lt_r4_r13_r12[] = {
0x9c, 0x4f, 0x5d, 0xb6 // uadd8 lt r4 r13 r12
};
const byte kInstruction_uadd8_eq_r2_r1_r14[] = {
0x9e, 0x2f, 0x51, 0x06 // uadd8 eq r2 r1 r14
};
const byte kInstruction_uadd8_eq_r9_r4_r14[] = {
0x9e, 0x9f, 0x54, 0x06 // uadd8 eq r9 r4 r14
};
const byte kInstruction_uadd8_hi_r10_r6_r13[] = {
0x9d, 0xaf, 0x56, 0x86 // uadd8 hi r10 r6 r13
};
const byte kInstruction_uadd8_ge_r12_r9_r4[] = {
0x94, 0xcf, 0x59, 0xa6 // uadd8 ge r12 r9 r4
};
const byte kInstruction_uadd8_le_r9_r11_r14[] = {
0x9e, 0x9f, 0x5b, 0xd6 // uadd8 le r9 r11 r14
};
const byte kInstruction_uadd8_ls_r0_r9_r5[] = {
0x95, 0x0f, 0x59, 0x96 // uadd8 ls r0 r9 r5
};
const byte kInstruction_uadd8_mi_r2_r3_r8[] = {
0x98, 0x2f, 0x53, 0x46 // uadd8 mi r2 r3 r8
};
const byte kInstruction_uadd8_ne_r14_r10_r14[] = {
0x9e, 0xef, 0x5a, 0x16 // uadd8 ne r14 r10 r14
};
const byte kInstruction_uadd8_eq_r6_r2_r10[] = {
0x9a, 0x6f, 0x52, 0x06 // uadd8 eq r6 r2 r10
};
const byte kInstruction_uadd8_lt_r11_r0_r12[] = {
0x9c, 0xbf, 0x50, 0xb6 // uadd8 lt r11 r0 r12
};
const byte kInstruction_uadd8_ne_r1_r12_r10[] = {
0x9a, 0x1f, 0x5c, 0x16 // uadd8 ne r1 r12 r10
};
const byte kInstruction_uadd8_cc_r1_r0_r2[] = {
0x92, 0x1f, 0x50, 0x36 // uadd8 cc r1 r0 r2
};
const byte kInstruction_uadd8_al_r5_r5_r7[] = {
0x97, 0x5f, 0x55, 0xe6 // uadd8 al r5 r5 r7
};
const byte kInstruction_uadd8_hi_r7_r13_r1[] = {
0x91, 0x7f, 0x5d, 0x86 // uadd8 hi r7 r13 r1
};
const byte kInstruction_uadd8_cs_r4_r4_r9[] = {
0x99, 0x4f, 0x54, 0x26 // uadd8 cs r4 r4 r9
};
const byte kInstruction_uadd8_eq_r14_r4_r14[] = {
0x9e, 0xef, 0x54, 0x06 // uadd8 eq r14 r4 r14
};
const byte kInstruction_uadd8_vs_r10_r5_r14[] = {
0x9e, 0xaf, 0x55, 0x66 // uadd8 vs r10 r5 r14
};
const byte kInstruction_uadd8_gt_r4_r3_r11[] = {
0x9b, 0x4f, 0x53, 0xc6 // uadd8 gt r4 r3 r11
};
const byte kInstruction_uadd8_ne_r14_r10_r12[] = {
0x9c, 0xef, 0x5a, 0x16 // uadd8 ne r14 r10 r12
};
const byte kInstruction_uadd8_vs_r2_r11_r0[] = {
0x90, 0x2f, 0x5b, 0x66 // uadd8 vs r2 r11 r0
};
const byte kInstruction_uadd8_ge_r5_r12_r7[] = {
0x97, 0x5f, 0x5c, 0xa6 // uadd8 ge r5 r12 r7
};
const byte kInstruction_uadd8_mi_r7_r14_r6[] = {
0x96, 0x7f, 0x5e, 0x46 // uadd8 mi r7 r14 r6
};
const byte kInstruction_uadd8_gt_r8_r3_r8[] = {
0x98, 0x8f, 0x53, 0xc6 // uadd8 gt r8 r3 r8
};
const byte kInstruction_uadd8_hi_r9_r14_r3[] = {
0x93, 0x9f, 0x5e, 0x86 // uadd8 hi r9 r14 r3
};
const byte kInstruction_uadd8_vc_r2_r11_r2[] = {
0x92, 0x2f, 0x5b, 0x76 // uadd8 vc r2 r11 r2
};
const byte kInstruction_uadd8_hi_r11_r7_r12[] = {
0x9c, 0xbf, 0x57, 0x86 // uadd8 hi r11 r7 r12
};
const byte kInstruction_uadd8_cs_r6_r4_r11[] = {
0x9b, 0x6f, 0x54, 0x26 // uadd8 cs r6 r4 r11
};
const byte kInstruction_uadd8_cs_r12_r5_r9[] = {
0x99, 0xcf, 0x55, 0x26 // uadd8 cs r12 r5 r9
};
const byte kInstruction_uadd8_ls_r5_r10_r5[] = {
0x95, 0x5f, 0x5a, 0x96 // uadd8 ls r5 r10 r5
};
const byte kInstruction_uadd8_ls_r0_r9_r13[] = {
0x9d, 0x0f, 0x59, 0x96 // uadd8 ls r0 r9 r13
};
const byte kInstruction_uadd8_lt_r3_r3_r5[] = {
0x95, 0x3f, 0x53, 0xb6 // uadd8 lt r3 r3 r5
};
const byte kInstruction_uadd8_mi_r0_r12_r8[] = {
0x98, 0x0f, 0x5c, 0x46 // uadd8 mi r0 r12 r8
};
const byte kInstruction_uadd8_pl_r3_r12_r12[] = {
0x9c, 0x3f, 0x5c, 0x56 // uadd8 pl r3 r12 r12
};
const byte kInstruction_uadd8_eq_r8_r12_r5[] = {
0x95, 0x8f, 0x5c, 0x06 // uadd8 eq r8 r12 r5
};
const byte kInstruction_uadd8_cc_r7_r8_r1[] = {
0x91, 0x7f, 0x58, 0x36 // uadd8 cc r7 r8 r1
};
const byte kInstruction_uadd8_hi_r2_r13_r10[] = {
0x9a, 0x2f, 0x5d, 0x86 // uadd8 hi r2 r13 r10
};
const byte kInstruction_uadd8_al_r7_r10_r10[] = {
0x9a, 0x7f, 0x5a, 0xe6 // uadd8 al r7 r10 r10
};
const byte kInstruction_uadd8_vc_r1_r12_r2[] = {
0x92, 0x1f, 0x5c, 0x76 // uadd8 vc r1 r12 r2
};
const byte kInstruction_uadd8_cc_r8_r5_r8[] = {
0x98, 0x8f, 0x55, 0x36 // uadd8 cc r8 r5 r8
};
const byte kInstruction_uadd8_ls_r3_r7_r9[] = {
0x99, 0x3f, 0x57, 0x96 // uadd8 ls r3 r7 r9
};
const byte kInstruction_uadd8_al_r8_r10_r8[] = {
0x98, 0x8f, 0x5a, 0xe6 // uadd8 al r8 r10 r8
};
const byte kInstruction_uadd8_lt_r4_r12_r10[] = {
0x9a, 0x4f, 0x5c, 0xb6 // uadd8 lt r4 r12 r10
};
const byte kInstruction_uadd8_ge_r10_r5_r11[] = {
0x9b, 0xaf, 0x55, 0xa6 // uadd8 ge r10 r5 r11
};
const byte kInstruction_uadd8_ls_r3_r14_r4[] = {
0x94, 0x3f, 0x5e, 0x96 // uadd8 ls r3 r14 r4
};
const byte kInstruction_uadd8_hi_r3_r6_r12[] = {
0x9c, 0x3f, 0x56, 0x86 // uadd8 hi r3 r6 r12
};
const byte kInstruction_uadd8_hi_r6_r0_r4[] = {
0x94, 0x6f, 0x50, 0x86 // uadd8 hi r6 r0 r4
};
const byte kInstruction_uadd8_al_r11_r6_r0[] = {
0x90, 0xbf, 0x56, 0xe6 // uadd8 al r11 r6 r0
};
const byte kInstruction_uadd8_mi_r3_r1_r9[] = {
0x99, 0x3f, 0x51, 0x46 // uadd8 mi r3 r1 r9
};
const byte kInstruction_uadd8_mi_r12_r13_r0[] = {
0x90, 0xcf, 0x5d, 0x46 // uadd8 mi r12 r13 r0
};
const byte kInstruction_uadd8_le_r1_r2_r5[] = {
0x95, 0x1f, 0x52, 0xd6 // uadd8 le r1 r2 r5
};
const byte kInstruction_uadd8_hi_r4_r3_r14[] = {
0x9e, 0x4f, 0x53, 0x86 // uadd8 hi r4 r3 r14
};
const byte kInstruction_uadd8_eq_r6_r11_r11[] = {
0x9b, 0x6f, 0x5b, 0x06 // uadd8 eq r6 r11 r11
};
const byte kInstruction_uadd8_cc_r14_r11_r14[] = {
0x9e, 0xef, 0x5b, 0x36 // uadd8 cc r14 r11 r14
};
const byte kInstruction_uadd8_hi_r4_r10_r0[] = {
0x90, 0x4f, 0x5a, 0x86 // uadd8 hi r4 r10 r0
};
const byte kInstruction_uadd8_cc_r7_r11_r1[] = {
0x91, 0x7f, 0x5b, 0x36 // uadd8 cc r7 r11 r1
};
const byte kInstruction_uadd8_mi_r14_r6_r10[] = {
0x9a, 0xef, 0x56, 0x46 // uadd8 mi r14 r6 r10
};
const byte kInstruction_uadd8_eq_r2_r0_r11[] = {
0x9b, 0x2f, 0x50, 0x06 // uadd8 eq r2 r0 r11
};
const byte kInstruction_uadd8_mi_r13_r5_r12[] = {
0x9c, 0xdf, 0x55, 0x46 // uadd8 mi r13 r5 r12
};
const byte kInstruction_uadd8_eq_r2_r12_r5[] = {
0x95, 0x2f, 0x5c, 0x06 // uadd8 eq r2 r12 r5
};
const byte kInstruction_uadd8_le_r12_r0_r2[] = {
0x92, 0xcf, 0x50, 0xd6 // uadd8 le r12 r0 r2
};
const byte kInstruction_uadd8_vc_r10_r10_r9[] = {
0x99, 0xaf, 0x5a, 0x76 // uadd8 vc r10 r10 r9
};
const byte kInstruction_uadd8_ls_r11_r11_r8[] = {
0x98, 0xbf, 0x5b, 0x96 // uadd8 ls r11 r11 r8
};
const byte kInstruction_uadd8_hi_r10_r11_r9[] = {
0x99, 0xaf, 0x5b, 0x86 // uadd8 hi r10 r11 r9
};
const byte kInstruction_uadd8_vs_r7_r12_r14[] = {
0x9e, 0x7f, 0x5c, 0x66 // uadd8 vs r7 r12 r14
};
const byte kInstruction_uadd8_gt_r11_r14_r12[] = {
0x9c, 0xbf, 0x5e, 0xc6 // uadd8 gt r11 r14 r12
};
const byte kInstruction_uadd8_vs_r0_r12_r8[] = {
0x98, 0x0f, 0x5c, 0x66 // uadd8 vs r0 r12 r8
};
const byte kInstruction_uadd8_al_r0_r5_r7[] = {
0x97, 0x0f, 0x55, 0xe6 // uadd8 al r0 r5 r7
};
const byte kInstruction_uadd8_hi_r5_r13_r8[] = {
0x98, 0x5f, 0x5d, 0x86 // uadd8 hi r5 r13 r8
};
const byte kInstruction_uadd8_le_r9_r9_r7[] = {
0x97, 0x9f, 0x59, 0xd6 // uadd8 le r9 r9 r7
};
const byte kInstruction_uadd8_cc_r4_r9_r5[] = {
0x95, 0x4f, 0x59, 0x36 // uadd8 cc r4 r9 r5
};
const byte kInstruction_uadd8_vs_r8_r1_r3[] = {
0x93, 0x8f, 0x51, 0x66 // uadd8 vs r8 r1 r3
};
const byte kInstruction_uadd8_cc_r0_r10_r12[] = {
0x9c, 0x0f, 0x5a, 0x36 // uadd8 cc r0 r10 r12
};
const byte kInstruction_uadd8_eq_r7_r14_r0[] = {
0x90, 0x7f, 0x5e, 0x06 // uadd8 eq r7 r14 r0
};
const byte kInstruction_uadd8_vs_r12_r9_r11[] = {
0x9b, 0xcf, 0x59, 0x66 // uadd8 vs r12 r9 r11
};
const byte kInstruction_uadd8_gt_r5_r9_r11[] = {
0x9b, 0x5f, 0x59, 0xc6 // uadd8 gt r5 r9 r11
};
const byte kInstruction_uadd8_cs_r14_r13_r7[] = {
0x97, 0xef, 0x5d, 0x26 // uadd8 cs r14 r13 r7
};
const byte kInstruction_uadd8_mi_r11_r3_r10[] = {
0x9a, 0xbf, 0x53, 0x46 // uadd8 mi r11 r3 r10
};
const byte kInstruction_uadd8_hi_r11_r8_r12[] = {
0x9c, 0xbf, 0x58, 0x86 // uadd8 hi r11 r8 r12
};
const byte kInstruction_uadd8_cs_r3_r8_r13[] = {
0x9d, 0x3f, 0x58, 0x26 // uadd8 cs r3 r8 r13
};
const byte kInstruction_uadd8_pl_r10_r12_r6[] = {
0x96, 0xaf, 0x5c, 0x56 // uadd8 pl r10 r12 r6
};
const byte kInstruction_uadd8_vc_r7_r3_r2[] = {
0x92, 0x7f, 0x53, 0x76 // uadd8 vc r7 r3 r2
};
const byte kInstruction_uadd8_mi_r9_r0_r8[] = {
0x98, 0x9f, 0x50, 0x46 // uadd8 mi r9 r0 r8
};
const byte kInstruction_uadd8_eq_r2_r13_r7[] = {
0x97, 0x2f, 0x5d, 0x06 // uadd8 eq r2 r13 r7
};
const byte kInstruction_uadd8_ne_r2_r14_r0[] = {
0x90, 0x2f, 0x5e, 0x16 // uadd8 ne r2 r14 r0
};
const byte kInstruction_uadd8_vs_r4_r10_r0[] = {
0x90, 0x4f, 0x5a, 0x66 // uadd8 vs r4 r10 r0
};
const byte kInstruction_uadd8_ls_r0_r2_r2[] = {
0x92, 0x0f, 0x52, 0x96 // uadd8 ls r0 r2 r2
};
const byte kInstruction_uadd8_cc_r1_r6_r0[] = {
0x90, 0x1f, 0x56, 0x36 // uadd8 cc r1 r6 r0
};
const byte kInstruction_uadd8_lt_r12_r0_r8[] = {
0x98, 0xcf, 0x50, 0xb6 // uadd8 lt r12 r0 r8
};
const byte kInstruction_uadd8_cc_r9_r3_r14[] = {
0x9e, 0x9f, 0x53, 0x36 // uadd8 cc r9 r3 r14
};
const byte kInstruction_uadd8_vs_r7_r9_r1[] = {
0x91, 0x7f, 0x59, 0x66 // uadd8 vs r7 r9 r1
};
const byte kInstruction_uadd8_eq_r11_r9_r14[] = {
0x9e, 0xbf, 0x59, 0x06 // uadd8 eq r11 r9 r14
};
const byte kInstruction_uadd8_pl_r6_r10_r4[] = {
0x94, 0x6f, 0x5a, 0x56 // uadd8 pl r6 r10 r4
};
const byte kInstruction_uadd8_ne_r8_r5_r6[] = {
0x96, 0x8f, 0x55, 0x16 // uadd8 ne r8 r5 r6
};
const byte kInstruction_uadd8_cs_r0_r6_r2[] = {
0x92, 0x0f, 0x56, 0x26 // uadd8 cs r0 r6 r2
};
const byte kInstruction_uadd8_eq_r11_r12_r4[] = {
0x94, 0xbf, 0x5c, 0x06 // uadd8 eq r11 r12 r4
};
const byte kInstruction_uadd8_lt_r14_r3_r14[] = {
0x9e, 0xef, 0x53, 0xb6 // uadd8 lt r14 r3 r14
};
const byte kInstruction_uadd8_le_r7_r12_r14[] = {
0x9e, 0x7f, 0x5c, 0xd6 // uadd8 le r7 r12 r14
};
const byte kInstruction_uadd8_hi_r2_r9_r9[] = {
0x99, 0x2f, 0x59, 0x86 // uadd8 hi r2 r9 r9
};
const byte kInstruction_uadd8_ne_r8_r1_r0[] = {
0x90, 0x8f, 0x51, 0x16 // uadd8 ne r8 r1 r0
};
const byte kInstruction_uadd8_cc_r5_r11_r2[] = {
0x92, 0x5f, 0x5b, 0x36 // uadd8 cc r5 r11 r2
};
const byte kInstruction_uadd8_hi_r0_r1_r2[] = {
0x92, 0x0f, 0x51, 0x86 // uadd8 hi r0 r1 r2
};
const byte kInstruction_uadd8_al_r4_r9_r4[] = {
0x94, 0x4f, 0x59, 0xe6 // uadd8 al r4 r9 r4
};
const byte kInstruction_uadd8_cs_r12_r7_r14[] = {
0x9e, 0xcf, 0x57, 0x26 // uadd8 cs r12 r7 r14
};
const byte kInstruction_uadd8_cc_r4_r12_r10[] = {
0x9a, 0x4f, 0x5c, 0x36 // uadd8 cc r4 r12 r10
};
const byte kInstruction_uadd8_al_r3_r5_r10[] = {
0x9a, 0x3f, 0x55, 0xe6 // uadd8 al r3 r5 r10
};
const byte kInstruction_uadd8_mi_r5_r3_r7[] = {
0x97, 0x5f, 0x53, 0x46 // uadd8 mi r5 r3 r7
};
const byte kInstruction_uadd8_ls_r10_r6_r2[] = {
0x92, 0xaf, 0x56, 0x96 // uadd8 ls r10 r6 r2
};
const byte kInstruction_uadd8_mi_r0_r12_r11[] = {
0x9b, 0x0f, 0x5c, 0x46 // uadd8 mi r0 r12 r11
};
const byte kInstruction_uadd8_vc_r12_r5_r6[] = {
0x96, 0xcf, 0x55, 0x76 // uadd8 vc r12 r5 r6
};
const byte kInstruction_uadd8_cs_r3_r9_r4[] = {
0x94, 0x3f, 0x59, 0x26 // uadd8 cs r3 r9 r4
};
const byte kInstruction_uadd8_ls_r4_r9_r11[] = {
0x9b, 0x4f, 0x59, 0x96 // uadd8 ls r4 r9 r11
};
const byte kInstruction_uadd8_le_r14_r8_r13[] = {
0x9d, 0xef, 0x58, 0xd6 // uadd8 le r14 r8 r13
};
const byte kInstruction_uadd8_gt_r4_r10_r8[] = {
0x98, 0x4f, 0x5a, 0xc6 // uadd8 gt r4 r10 r8
};
const byte kInstruction_uadd8_al_r6_r9_r9[] = {
0x99, 0x6f, 0x59, 0xe6 // uadd8 al r6 r9 r9
};
const byte kInstruction_uadd8_ne_r8_r5_r12[] = {
0x9c, 0x8f, 0x55, 0x16 // uadd8 ne r8 r5 r12
};
const byte kInstruction_uadd8_ne_r0_r4_r8[] = {
0x98, 0x0f, 0x54, 0x16 // uadd8 ne r0 r4 r8
};
const byte kInstruction_uadd8_mi_r7_r13_r3[] = {
0x93, 0x7f, 0x5d, 0x46 // uadd8 mi r7 r13 r3
};
const byte kInstruction_uadd8_cc_r11_r7_r0[] = {
0x90, 0xbf, 0x57, 0x36 // uadd8 cc r11 r7 r0
};
const byte kInstruction_uadd8_hi_r1_r0_r12[] = {
0x9c, 0x1f, 0x50, 0x86 // uadd8 hi r1 r0 r12
};
const byte kInstruction_uadd8_lt_r8_r9_r3[] = {
0x93, 0x8f, 0x59, 0xb6 // uadd8 lt r8 r9 r3
};
const byte kInstruction_uadd8_al_r0_r2_r1[] = {
0x91, 0x0f, 0x52, 0xe6 // uadd8 al r0 r2 r1
};
const byte kInstruction_uadd8_vs_r4_r3_r14[] = {
0x9e, 0x4f, 0x53, 0x66 // uadd8 vs r4 r3 r14
};
const byte kInstruction_uadd8_ge_r2_r11_r1[] = {
0x91, 0x2f, 0x5b, 0xa6 // uadd8 ge r2 r11 r1
};
const byte kInstruction_uadd8_lt_r12_r9_r6[] = {
0x96, 0xcf, 0x59, 0xb6 // uadd8 lt r12 r9 r6
};
const byte kInstruction_uadd8_ls_r8_r2_r7[] = {
0x97, 0x8f, 0x52, 0x96 // uadd8 ls r8 r2 r7
};
const byte kInstruction_uadd8_le_r8_r13_r3[] = {
0x93, 0x8f, 0x5d, 0xd6 // uadd8 le r8 r13 r3
};
const byte kInstruction_uadd8_eq_r11_r13_r14[] = {
0x9e, 0xbf, 0x5d, 0x06 // uadd8 eq r11 r13 r14
};
const byte kInstruction_uadd8_lt_r1_r6_r13[] = {
0x9d, 0x1f, 0x56, 0xb6 // uadd8 lt r1 r6 r13
};
const byte kInstruction_uadd8_cs_r3_r8_r11[] = {
0x9b, 0x3f, 0x58, 0x26 // uadd8 cs r3 r8 r11
};
const byte kInstruction_uadd8_pl_r12_r5_r4[] = {
0x94, 0xcf, 0x55, 0x56 // uadd8 pl r12 r5 r4
};
const byte kInstruction_uadd8_eq_r8_r7_r2[] = {
0x92, 0x8f, 0x57, 0x06 // uadd8 eq r8 r7 r2
};
const byte kInstruction_uadd8_ls_r2_r12_r2[] = {
0x92, 0x2f, 0x5c, 0x96 // uadd8 ls r2 r12 r2
};
const byte kInstruction_uadd8_le_r14_r2_r3[] = {
0x93, 0xef, 0x52, 0xd6 // uadd8 le r14 r2 r3
};
const byte kInstruction_uadd8_ge_r10_r11_r6[] = {
0x96, 0xaf, 0x5b, 0xa6 // uadd8 ge r10 r11 r6
};
const byte kInstruction_uadd8_hi_r0_r2_r2[] = {
0x92, 0x0f, 0x52, 0x86 // uadd8 hi r0 r2 r2
};
const byte kInstruction_uadd8_ge_r2_r0_r2[] = {
0x92, 0x2f, 0x50, 0xa6 // uadd8 ge r2 r0 r2
};
const byte kInstruction_uadd8_vs_r11_r14_r0[] = {
0x90, 0xbf, 0x5e, 0x66 // uadd8 vs r11 r14 r0
};
const byte kInstruction_uadd8_lt_r2_r0_r1[] = {
0x91, 0x2f, 0x50, 0xb6 // uadd8 lt r2 r0 r1
};
const byte kInstruction_uadd8_cs_r2_r5_r11[] = {
0x9b, 0x2f, 0x55, 0x26 // uadd8 cs r2 r5 r11
};
const byte kInstruction_uadd8_ls_r7_r14_r5[] = {
0x95, 0x7f, 0x5e, 0x96 // uadd8 ls r7 r14 r5
};
const byte kInstruction_uadd8_pl_r0_r0_r3[] = {
0x93, 0x0f, 0x50, 0x56 // uadd8 pl r0 r0 r3
};
const byte kInstruction_uadd8_ge_r6_r8_r8[] = {
0x98, 0x6f, 0x58, 0xa6 // uadd8 ge r6 r8 r8
};
const byte kInstruction_uadd8_le_r11_r1_r10[] = {
0x9a, 0xbf, 0x51, 0xd6 // uadd8 le r11 r1 r10
};
const byte kInstruction_uadd8_vs_r5_r2_r7[] = {
0x97, 0x5f, 0x52, 0x66 // uadd8 vs r5 r2 r7
};
const byte kInstruction_uadd8_ne_r4_r4_r8[] = {
0x98, 0x4f, 0x54, 0x16 // uadd8 ne r4 r4 r8
};
const byte kInstruction_uadd8_cc_r9_r14_r13[] = {
0x9d, 0x9f, 0x5e, 0x36 // uadd8 cc r9 r14 r13
};
const byte kInstruction_uadd8_hi_r14_r6_r3[] = {
0x93, 0xef, 0x56, 0x86 // uadd8 hi r14 r6 r3
};
const byte kInstruction_uadd8_al_r0_r8_r0[] = {
0x90, 0x0f, 0x58, 0xe6 // uadd8 al r0 r8 r0
};
const byte kInstruction_uadd8_lt_r6_r11_r1[] = {
0x91, 0x6f, 0x5b, 0xb6 // uadd8 lt r6 r11 r1
};
const byte kInstruction_uadd8_ge_r7_r6_r12[] = {
0x9c, 0x7f, 0x56, 0xa6 // uadd8 ge r7 r6 r12
};
const byte kInstruction_uadd8_cs_r4_r6_r14[] = {
0x9e, 0x4f, 0x56, 0x26 // uadd8 cs r4 r6 r14
};
const byte kInstruction_uadd8_cs_r7_r6_r7[] = {
0x97, 0x7f, 0x56, 0x26 // uadd8 cs r7 r6 r7
};
const byte kInstruction_uadd8_cs_r3_r7_r10[] = {
0x9a, 0x3f, 0x57, 0x26 // uadd8 cs r3 r7 r10
};
const byte kInstruction_uadd8_ne_r0_r2_r1[] = {
0x91, 0x0f, 0x52, 0x16 // uadd8 ne r0 r2 r1
};
const byte kInstruction_uadd8_vs_r9_r10_r13[] = {
0x9d, 0x9f, 0x5a, 0x66 // uadd8 vs r9 r10 r13
};
const byte kInstruction_uadd8_vc_r11_r14_r12[] = {
0x9c, 0xbf, 0x5e, 0x76 // uadd8 vc r11 r14 r12
};
const byte kInstruction_uadd8_ge_r14_r8_r7[] = {
0x97, 0xef, 0x58, 0xa6 // uadd8 ge r14 r8 r7
};
const byte kInstruction_uadd8_lt_r13_r0_r11[] = {
0x9b, 0xdf, 0x50, 0xb6 // uadd8 lt r13 r0 r11
};
const byte kInstruction_uadd8_lt_r14_r13_r4[] = {
0x94, 0xef, 0x5d, 0xb6 // uadd8 lt r14 r13 r4
};
const byte kInstruction_uadd8_al_r1_r10_r9[] = {
0x99, 0x1f, 0x5a, 0xe6 // uadd8 al r1 r10 r9
};
const byte kInstruction_uadd8_ge_r11_r14_r11[] = {
0x9b, 0xbf, 0x5e, 0xa6 // uadd8 ge r11 r14 r11
};
const byte kInstruction_uadd8_cs_r11_r4_r11[] = {
0x9b, 0xbf, 0x54, 0x26 // uadd8 cs r11 r4 r11
};
const byte kInstruction_uadd8_ge_r0_r14_r7[] = {
0x97, 0x0f, 0x5e, 0xa6 // uadd8 ge r0 r14 r7
};
const byte kInstruction_uadd8_mi_r1_r2_r9[] = {
0x99, 0x1f, 0x52, 0x46 // uadd8 mi r1 r2 r9
};
const byte kInstruction_uadd8_eq_r5_r12_r3[] = {
0x93, 0x5f, 0x5c, 0x06 // uadd8 eq r5 r12 r3
};
const byte kInstruction_uadd8_ge_r1_r5_r12[] = {
0x9c, 0x1f, 0x55, 0xa6 // uadd8 ge r1 r5 r12
};
const byte kInstruction_uadd8_lt_r10_r11_r4[] = {
0x94, 0xaf, 0x5b, 0xb6 // uadd8 lt r10 r11 r4
};
const byte kInstruction_uadd8_le_r1_r1_r5[] = {
0x95, 0x1f, 0x51, 0xd6 // uadd8 le r1 r1 r5
};
const byte kInstruction_uadd8_al_r9_r1_r8[] = {
0x98, 0x9f, 0x51, 0xe6 // uadd8 al r9 r1 r8
};
const byte kInstruction_uadd8_ne_r6_r8_r4[] = {
0x94, 0x6f, 0x58, 0x16 // uadd8 ne r6 r8 r4
};
const byte kInstruction_uadd8_ge_r12_r2_r9[] = {
0x99, 0xcf, 0x52, 0xa6 // uadd8 ge r12 r2 r9
};
const byte kInstruction_uadd8_pl_r4_r3_r10[] = {
0x9a, 0x4f, 0x53, 0x56 // uadd8 pl r4 r3 r10
};
const byte kInstruction_uadd8_eq_r14_r4_r11[] = {
0x9b, 0xef, 0x54, 0x06 // uadd8 eq r14 r4 r11
};
const byte kInstruction_uadd8_cc_r9_r7_r6[] = {
0x96, 0x9f, 0x57, 0x36 // uadd8 cc r9 r7 r6
};
const byte kInstruction_uadd8_ge_r12_r4_r5[] = {
0x95, 0xcf, 0x54, 0xa6 // uadd8 ge r12 r4 r5
};
const byte kInstruction_uadd8_hi_r2_r3_r4[] = {
0x94, 0x2f, 0x53, 0x86 // uadd8 hi r2 r3 r4
};
const byte kInstruction_uadd8_cs_r0_r3_r1[] = {
0x91, 0x0f, 0x53, 0x26 // uadd8 cs r0 r3 r1
};
const byte kInstruction_uadd8_hi_r6_r2_r8[] = {
0x98, 0x6f, 0x52, 0x86 // uadd8 hi r6 r2 r8
};
const byte kInstruction_uadd8_cc_r3_r14_r13[] = {
0x9d, 0x3f, 0x5e, 0x36 // uadd8 cc r3 r14 r13
};
const byte kInstruction_uadd8_gt_r11_r4_r7[] = {
0x97, 0xbf, 0x54, 0xc6 // uadd8 gt r11 r4 r7
};
const byte kInstruction_uadd8_hi_r5_r0_r12[] = {
0x9c, 0x5f, 0x50, 0x86 // uadd8 hi r5 r0 r12
};
const byte kInstruction_uadd8_gt_r0_r14_r14[] = {
0x9e, 0x0f, 0x5e, 0xc6 // uadd8 gt r0 r14 r14
};
const byte kInstruction_uadd8_hi_r9_r0_r10[] = {
0x9a, 0x9f, 0x50, 0x86 // uadd8 hi r9 r0 r10
};
const byte kInstruction_uadd8_vc_r7_r11_r8[] = {
0x98, 0x7f, 0x5b, 0x76 // uadd8 vc r7 r11 r8
};
const byte kInstruction_uadd8_pl_r11_r9_r6[] = {
0x96, 0xbf, 0x59, 0x56 // uadd8 pl r11 r9 r6
};
const byte kInstruction_uadd8_al_r3_r3_r7[] = {
0x97, 0x3f, 0x53, 0xe6 // uadd8 al r3 r3 r7
};
const byte kInstruction_uadd8_mi_r5_r7_r9[] = {
0x99, 0x5f, 0x57, 0x46 // uadd8 mi r5 r7 r9
};
const byte kInstruction_uadd8_cc_r11_r2_r4[] = {
0x94, 0xbf, 0x52, 0x36 // uadd8 cc r11 r2 r4
};
const byte kInstruction_uadd8_cc_r9_r13_r10[] = {
0x9a, 0x9f, 0x5d, 0x36 // uadd8 cc r9 r13 r10
};
const byte kInstruction_uadd8_al_r5_r2_r6[] = {
0x96, 0x5f, 0x52, 0xe6 // uadd8 al r5 r2 r6
};
const byte kInstruction_uadd8_ge_r9_r4_r6[] = {
0x96, 0x9f, 0x54, 0xa6 // uadd8 ge r9 r4 r6
};
const byte kInstruction_uadd8_ls_r3_r3_r4[] = {
0x94, 0x3f, 0x53, 0x96 // uadd8 ls r3 r3 r4
};
const byte kInstruction_uadd8_ge_r14_r1_r8[] = {
0x98, 0xef, 0x51, 0xa6 // uadd8 ge r14 r1 r8
};
const byte kInstruction_uadd8_ls_r7_r12_r7[] = {
0x97, 0x7f, 0x5c, 0x96 // uadd8 ls r7 r12 r7
};
const byte kInstruction_uadd8_al_r11_r10_r5[] = {
0x95, 0xbf, 0x5a, 0xe6 // uadd8 al r11 r10 r5
};
const byte kInstruction_uadd8_al_r7_r4_r6[] = {
0x96, 0x7f, 0x54, 0xe6 // uadd8 al r7 r4 r6
};
const byte kInstruction_uadd8_vs_r12_r4_r10[] = {
0x9a, 0xcf, 0x54, 0x66 // uadd8 vs r12 r4 r10
};
const byte kInstruction_uadd8_eq_r4_r4_r4[] = {
0x94, 0x4f, 0x54, 0x06 // uadd8 eq r4 r4 r4
};
const byte kInstruction_uadd8_vs_r6_r6_r12[] = {
0x9c, 0x6f, 0x56, 0x66 // uadd8 vs r6 r6 r12
};
const byte kInstruction_uadd8_pl_r9_r3_r5[] = {
0x95, 0x9f, 0x53, 0x56 // uadd8 pl r9 r3 r5
};
const byte kInstruction_uadd8_eq_r6_r5_r13[] = {
0x9d, 0x6f, 0x55, 0x06 // uadd8 eq r6 r5 r13
};
const byte kInstruction_uadd8_cc_r8_r2_r12[] = {
0x9c, 0x8f, 0x52, 0x36 // uadd8 cc r8 r2 r12
};
const byte kInstruction_uadd8_le_r4_r2_r0[] = {
0x90, 0x4f, 0x52, 0xd6 // uadd8 le r4 r2 r0
};
const byte kInstruction_uadd8_lt_r7_r9_r8[] = {
0x98, 0x7f, 0x59, 0xb6 // uadd8 lt r7 r9 r8
};
const byte kInstruction_uadd8_le_r4_r7_r11[] = {
0x9b, 0x4f, 0x57, 0xd6 // uadd8 le r4 r7 r11
};
const byte kInstruction_uadd8_eq_r5_r7_r5[] = {
0x95, 0x5f, 0x57, 0x06 // uadd8 eq r5 r7 r5
};
const byte kInstruction_uadd8_vc_r10_r7_r12[] = {
0x9c, 0xaf, 0x57, 0x76 // uadd8 vc r10 r7 r12
};
const byte kInstruction_uadd8_eq_r7_r10_r6[] = {
0x96, 0x7f, 0x5a, 0x06 // uadd8 eq r7 r10 r6
};
const byte kInstruction_uadd8_pl_r1_r12_r2[] = {
0x92, 0x1f, 0x5c, 0x56 // uadd8 pl r1 r12 r2
};
const byte kInstruction_uadd8_le_r14_r6_r6[] = {
0x96, 0xef, 0x56, 0xd6 // uadd8 le r14 r6 r6
};
const byte kInstruction_uadd8_ne_r3_r8_r8[] = {
0x98, 0x3f, 0x58, 0x16 // uadd8 ne r3 r8 r8
};
const byte kInstruction_uadd8_eq_r4_r12_r8[] = {
0x98, 0x4f, 0x5c, 0x06 // uadd8 eq r4 r12 r8
};
const byte kInstruction_uadd8_ge_r11_r2_r3[] = {
0x93, 0xbf, 0x52, 0xa6 // uadd8 ge r11 r2 r3
};
const byte kInstruction_uadd8_hi_r12_r6_r11[] = {
0x9b, 0xcf, 0x56, 0x86 // uadd8 hi r12 r6 r11
};
const byte kInstruction_uadd8_cs_r4_r5_r10[] = {
0x9a, 0x4f, 0x55, 0x26 // uadd8 cs r4 r5 r10
};
const byte kInstruction_uadd8_ge_r10_r2_r10[] = {
0x9a, 0xaf, 0x52, 0xa6 // uadd8 ge r10 r2 r10
};
const byte kInstruction_uadd8_ge_r5_r14_r6[] = {
0x96, 0x5f, 0x5e, 0xa6 // uadd8 ge r5 r14 r6
};
const byte kInstruction_uadd8_gt_r13_r7_r5[] = {
0x95, 0xdf, 0x57, 0xc6 // uadd8 gt r13 r7 r5
};
const byte kInstruction_uadd8_ge_r13_r4_r12[] = {
0x9c, 0xdf, 0x54, 0xa6 // uadd8 ge r13 r4 r12
};
const byte kInstruction_uadd8_lt_r8_r10_r14[] = {
0x9e, 0x8f, 0x5a, 0xb6 // uadd8 lt r8 r10 r14
};
const byte kInstruction_uadd8_le_r4_r3_r13[] = {
0x9d, 0x4f, 0x53, 0xd6 // uadd8 le r4 r3 r13
};
const byte kInstruction_uadd8_pl_r0_r9_r0[] = {
0x90, 0x0f, 0x59, 0x56 // uadd8 pl r0 r9 r0
};
const byte kInstruction_uadd8_eq_r2_r3_r1[] = {
0x91, 0x2f, 0x53, 0x06 // uadd8 eq r2 r3 r1
};
const byte kInstruction_uadd8_vc_r0_r0_r3[] = {
0x93, 0x0f, 0x50, 0x76 // uadd8 vc r0 r0 r3
};
const byte kInstruction_uadd8_mi_r10_r8_r11[] = {
0x9b, 0xaf, 0x58, 0x46 // uadd8 mi r10 r8 r11
};
const byte kInstruction_uadd8_mi_r5_r14_r14[] = {
0x9e, 0x5f, 0x5e, 0x46 // uadd8 mi r5 r14 r14
};
const byte kInstruction_uadd8_gt_r5_r11_r2[] = {
0x92, 0x5f, 0x5b, 0xc6 // uadd8 gt r5 r11 r2
};
const byte kInstruction_uadd8_al_r4_r7_r11[] = {
0x9b, 0x4f, 0x57, 0xe6 // uadd8 al r4 r7 r11
};
const TestResult kReferenceuadd8[] = {
{
ARRAY_SIZE(kInstruction_uadd8_hi_r1_r9_r5),
kInstruction_uadd8_hi_r1_r9_r5,
},
{
ARRAY_SIZE(kInstruction_uadd8_pl_r8_r6_r2),
kInstruction_uadd8_pl_r8_r6_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r5_r8_r2),
kInstruction_uadd8_hi_r5_r8_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_vc_r9_r2_r7),
kInstruction_uadd8_vc_r9_r2_r7,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r4_r6_r3),
kInstruction_uadd8_lt_r4_r6_r3,
},
{
ARRAY_SIZE(kInstruction_uadd8_le_r11_r6_r2),
kInstruction_uadd8_le_r11_r6_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r8_r14_r4),
kInstruction_uadd8_cc_r8_r14_r4,
},
{
ARRAY_SIZE(kInstruction_uadd8_le_r5_r14_r6),
kInstruction_uadd8_le_r5_r14_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r6_r1_r0),
kInstruction_uadd8_lt_r6_r1_r0,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r5_r0_r9),
kInstruction_uadd8_lt_r5_r0_r9,
},
{
ARRAY_SIZE(kInstruction_uadd8_le_r8_r12_r7),
kInstruction_uadd8_le_r8_r12_r7,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r7_r14_r6),
kInstruction_uadd8_eq_r7_r14_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r7_r4_r6),
kInstruction_uadd8_cs_r7_r4_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_gt_r9_r6_r9),
kInstruction_uadd8_gt_r9_r6_r9,
},
{
ARRAY_SIZE(kInstruction_uadd8_ne_r13_r9_r1),
kInstruction_uadd8_ne_r13_r9_r1,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r13_r1_r13),
kInstruction_uadd8_ge_r13_r1_r13,
},
{
ARRAY_SIZE(kInstruction_uadd8_ls_r8_r10_r2),
kInstruction_uadd8_ls_r8_r10_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r0_r13_r5),
kInstruction_uadd8_hi_r0_r13_r5,
},
{
ARRAY_SIZE(kInstruction_uadd8_pl_r13_r7_r8),
kInstruction_uadd8_pl_r13_r7_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r4_r13_r11),
kInstruction_uadd8_ge_r4_r13_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r5_r10_r5),
kInstruction_uadd8_cs_r5_r10_r5,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r5_r4_r3),
kInstruction_uadd8_cs_r5_r4_r3,
},
{
ARRAY_SIZE(kInstruction_uadd8_ls_r6_r14_r8),
kInstruction_uadd8_ls_r6_r14_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_vs_r3_r8_r6),
kInstruction_uadd8_vs_r3_r8_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_vc_r7_r12_r3),
kInstruction_uadd8_vc_r7_r12_r3,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r1_r4_r1),
kInstruction_uadd8_ge_r1_r4_r1,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r4_r7_r10),
kInstruction_uadd8_cc_r4_r7_r10,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r2_r0_r13),
kInstruction_uadd8_cc_r2_r0_r13,
},
{
ARRAY_SIZE(kInstruction_uadd8_vs_r9_r6_r8),
kInstruction_uadd8_vs_r9_r6_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r14_r11_r13),
kInstruction_uadd8_cs_r14_r11_r13,
},
{
ARRAY_SIZE(kInstruction_uadd8_pl_r5_r8_r4),
kInstruction_uadd8_pl_r5_r8_r4,
},
{
ARRAY_SIZE(kInstruction_uadd8_pl_r2_r3_r7),
kInstruction_uadd8_pl_r2_r3_r7,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r7_r12_r14),
kInstruction_uadd8_cs_r7_r12_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r6_r6_r1),
kInstruction_uadd8_hi_r6_r6_r1,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r6_r9_r6),
kInstruction_uadd8_cc_r6_r9_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_ne_r12_r12_r0),
kInstruction_uadd8_ne_r12_r12_r0,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r9_r3_r8),
kInstruction_uadd8_cc_r9_r3_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_mi_r13_r6_r1),
kInstruction_uadd8_mi_r13_r6_r1,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r4_r8_r6),
kInstruction_uadd8_lt_r4_r8_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r11_r5_r9),
kInstruction_uadd8_hi_r11_r5_r9,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r6_r10_r6),
kInstruction_uadd8_cc_r6_r10_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r10_r10_r5),
kInstruction_uadd8_eq_r10_r10_r5,
},
{
ARRAY_SIZE(kInstruction_uadd8_al_r5_r4_r11),
kInstruction_uadd8_al_r5_r4_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_pl_r11_r11_r2),
kInstruction_uadd8_pl_r11_r11_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_ls_r6_r14_r12),
kInstruction_uadd8_ls_r6_r14_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_vc_r7_r7_r2),
kInstruction_uadd8_vc_r7_r7_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r10_r8_r4),
kInstruction_uadd8_eq_r10_r8_r4,
},
{
ARRAY_SIZE(kInstruction_uadd8_al_r14_r7_r2),
kInstruction_uadd8_al_r14_r7_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r3_r11_r10),
kInstruction_uadd8_cs_r3_r11_r10,
},
{
ARRAY_SIZE(kInstruction_uadd8_ls_r11_r4_r0),
kInstruction_uadd8_ls_r11_r4_r0,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r11_r8_r9),
kInstruction_uadd8_hi_r11_r8_r9,
},
{
ARRAY_SIZE(kInstruction_uadd8_vs_r2_r14_r13),
kInstruction_uadd8_vs_r2_r14_r13,
},
{
ARRAY_SIZE(kInstruction_uadd8_al_r1_r13_r9),
kInstruction_uadd8_al_r1_r13_r9,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r3_r9_r13),
kInstruction_uadd8_eq_r3_r9_r13,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r10_r3_r13),
kInstruction_uadd8_ge_r10_r3_r13,
},
{
ARRAY_SIZE(kInstruction_uadd8_pl_r8_r5_r10),
kInstruction_uadd8_pl_r8_r5_r10,
},
{
ARRAY_SIZE(kInstruction_uadd8_vc_r8_r11_r6),
kInstruction_uadd8_vc_r8_r11_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r0_r0_r5),
kInstruction_uadd8_eq_r0_r0_r5,
},
{
ARRAY_SIZE(kInstruction_uadd8_ne_r6_r5_r8),
kInstruction_uadd8_ne_r6_r5_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r5_r13_r3),
kInstruction_uadd8_hi_r5_r13_r3,
},
{
ARRAY_SIZE(kInstruction_uadd8_ne_r11_r14_r14),
kInstruction_uadd8_ne_r11_r14_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_mi_r1_r0_r6),
kInstruction_uadd8_mi_r1_r0_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_le_r14_r8_r2),
kInstruction_uadd8_le_r14_r8_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r9_r6_r5),
kInstruction_uadd8_eq_r9_r6_r5,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r11_r0_r13),
kInstruction_uadd8_eq_r11_r0_r13,
},
{
ARRAY_SIZE(kInstruction_uadd8_pl_r4_r5_r14),
kInstruction_uadd8_pl_r4_r5_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r13_r5_r13),
kInstruction_uadd8_cs_r13_r5_r13,
},
{
ARRAY_SIZE(kInstruction_uadd8_mi_r0_r13_r8),
kInstruction_uadd8_mi_r0_r13_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r2_r13_r3),
kInstruction_uadd8_lt_r2_r13_r3,
},
{
ARRAY_SIZE(kInstruction_uadd8_ls_r8_r1_r11),
kInstruction_uadd8_ls_r8_r1_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_vc_r14_r11_r8),
kInstruction_uadd8_vc_r14_r11_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r4_r13_r12),
kInstruction_uadd8_lt_r4_r13_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r2_r1_r14),
kInstruction_uadd8_eq_r2_r1_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r9_r4_r14),
kInstruction_uadd8_eq_r9_r4_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r10_r6_r13),
kInstruction_uadd8_hi_r10_r6_r13,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r12_r9_r4),
kInstruction_uadd8_ge_r12_r9_r4,
},
{
ARRAY_SIZE(kInstruction_uadd8_le_r9_r11_r14),
kInstruction_uadd8_le_r9_r11_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_ls_r0_r9_r5),
kInstruction_uadd8_ls_r0_r9_r5,
},
{
ARRAY_SIZE(kInstruction_uadd8_mi_r2_r3_r8),
kInstruction_uadd8_mi_r2_r3_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_ne_r14_r10_r14),
kInstruction_uadd8_ne_r14_r10_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r6_r2_r10),
kInstruction_uadd8_eq_r6_r2_r10,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r11_r0_r12),
kInstruction_uadd8_lt_r11_r0_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_ne_r1_r12_r10),
kInstruction_uadd8_ne_r1_r12_r10,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r1_r0_r2),
kInstruction_uadd8_cc_r1_r0_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_al_r5_r5_r7),
kInstruction_uadd8_al_r5_r5_r7,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r7_r13_r1),
kInstruction_uadd8_hi_r7_r13_r1,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r4_r4_r9),
kInstruction_uadd8_cs_r4_r4_r9,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r14_r4_r14),
kInstruction_uadd8_eq_r14_r4_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_vs_r10_r5_r14),
kInstruction_uadd8_vs_r10_r5_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_gt_r4_r3_r11),
kInstruction_uadd8_gt_r4_r3_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_ne_r14_r10_r12),
kInstruction_uadd8_ne_r14_r10_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_vs_r2_r11_r0),
kInstruction_uadd8_vs_r2_r11_r0,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r5_r12_r7),
kInstruction_uadd8_ge_r5_r12_r7,
},
{
ARRAY_SIZE(kInstruction_uadd8_mi_r7_r14_r6),
kInstruction_uadd8_mi_r7_r14_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_gt_r8_r3_r8),
kInstruction_uadd8_gt_r8_r3_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r9_r14_r3),
kInstruction_uadd8_hi_r9_r14_r3,
},
{
ARRAY_SIZE(kInstruction_uadd8_vc_r2_r11_r2),
kInstruction_uadd8_vc_r2_r11_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r11_r7_r12),
kInstruction_uadd8_hi_r11_r7_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r6_r4_r11),
kInstruction_uadd8_cs_r6_r4_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r12_r5_r9),
kInstruction_uadd8_cs_r12_r5_r9,
},
{
ARRAY_SIZE(kInstruction_uadd8_ls_r5_r10_r5),
kInstruction_uadd8_ls_r5_r10_r5,
},
{
ARRAY_SIZE(kInstruction_uadd8_ls_r0_r9_r13),
kInstruction_uadd8_ls_r0_r9_r13,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r3_r3_r5),
kInstruction_uadd8_lt_r3_r3_r5,
},
{
ARRAY_SIZE(kInstruction_uadd8_mi_r0_r12_r8),
kInstruction_uadd8_mi_r0_r12_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_pl_r3_r12_r12),
kInstruction_uadd8_pl_r3_r12_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r8_r12_r5),
kInstruction_uadd8_eq_r8_r12_r5,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r7_r8_r1),
kInstruction_uadd8_cc_r7_r8_r1,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r2_r13_r10),
kInstruction_uadd8_hi_r2_r13_r10,
},
{
ARRAY_SIZE(kInstruction_uadd8_al_r7_r10_r10),
kInstruction_uadd8_al_r7_r10_r10,
},
{
ARRAY_SIZE(kInstruction_uadd8_vc_r1_r12_r2),
kInstruction_uadd8_vc_r1_r12_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r8_r5_r8),
kInstruction_uadd8_cc_r8_r5_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_ls_r3_r7_r9),
kInstruction_uadd8_ls_r3_r7_r9,
},
{
ARRAY_SIZE(kInstruction_uadd8_al_r8_r10_r8),
kInstruction_uadd8_al_r8_r10_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r4_r12_r10),
kInstruction_uadd8_lt_r4_r12_r10,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r10_r5_r11),
kInstruction_uadd8_ge_r10_r5_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_ls_r3_r14_r4),
kInstruction_uadd8_ls_r3_r14_r4,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r3_r6_r12),
kInstruction_uadd8_hi_r3_r6_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r6_r0_r4),
kInstruction_uadd8_hi_r6_r0_r4,
},
{
ARRAY_SIZE(kInstruction_uadd8_al_r11_r6_r0),
kInstruction_uadd8_al_r11_r6_r0,
},
{
ARRAY_SIZE(kInstruction_uadd8_mi_r3_r1_r9),
kInstruction_uadd8_mi_r3_r1_r9,
},
{
ARRAY_SIZE(kInstruction_uadd8_mi_r12_r13_r0),
kInstruction_uadd8_mi_r12_r13_r0,
},
{
ARRAY_SIZE(kInstruction_uadd8_le_r1_r2_r5),
kInstruction_uadd8_le_r1_r2_r5,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r4_r3_r14),
kInstruction_uadd8_hi_r4_r3_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r6_r11_r11),
kInstruction_uadd8_eq_r6_r11_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r14_r11_r14),
kInstruction_uadd8_cc_r14_r11_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r4_r10_r0),
kInstruction_uadd8_hi_r4_r10_r0,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r7_r11_r1),
kInstruction_uadd8_cc_r7_r11_r1,
},
{
ARRAY_SIZE(kInstruction_uadd8_mi_r14_r6_r10),
kInstruction_uadd8_mi_r14_r6_r10,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r2_r0_r11),
kInstruction_uadd8_eq_r2_r0_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_mi_r13_r5_r12),
kInstruction_uadd8_mi_r13_r5_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r2_r12_r5),
kInstruction_uadd8_eq_r2_r12_r5,
},
{
ARRAY_SIZE(kInstruction_uadd8_le_r12_r0_r2),
kInstruction_uadd8_le_r12_r0_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_vc_r10_r10_r9),
kInstruction_uadd8_vc_r10_r10_r9,
},
{
ARRAY_SIZE(kInstruction_uadd8_ls_r11_r11_r8),
kInstruction_uadd8_ls_r11_r11_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r10_r11_r9),
kInstruction_uadd8_hi_r10_r11_r9,
},
{
ARRAY_SIZE(kInstruction_uadd8_vs_r7_r12_r14),
kInstruction_uadd8_vs_r7_r12_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_gt_r11_r14_r12),
kInstruction_uadd8_gt_r11_r14_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_vs_r0_r12_r8),
kInstruction_uadd8_vs_r0_r12_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_al_r0_r5_r7),
kInstruction_uadd8_al_r0_r5_r7,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r5_r13_r8),
kInstruction_uadd8_hi_r5_r13_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_le_r9_r9_r7),
kInstruction_uadd8_le_r9_r9_r7,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r4_r9_r5),
kInstruction_uadd8_cc_r4_r9_r5,
},
{
ARRAY_SIZE(kInstruction_uadd8_vs_r8_r1_r3),
kInstruction_uadd8_vs_r8_r1_r3,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r0_r10_r12),
kInstruction_uadd8_cc_r0_r10_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r7_r14_r0),
kInstruction_uadd8_eq_r7_r14_r0,
},
{
ARRAY_SIZE(kInstruction_uadd8_vs_r12_r9_r11),
kInstruction_uadd8_vs_r12_r9_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_gt_r5_r9_r11),
kInstruction_uadd8_gt_r5_r9_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r14_r13_r7),
kInstruction_uadd8_cs_r14_r13_r7,
},
{
ARRAY_SIZE(kInstruction_uadd8_mi_r11_r3_r10),
kInstruction_uadd8_mi_r11_r3_r10,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r11_r8_r12),
kInstruction_uadd8_hi_r11_r8_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r3_r8_r13),
kInstruction_uadd8_cs_r3_r8_r13,
},
{
ARRAY_SIZE(kInstruction_uadd8_pl_r10_r12_r6),
kInstruction_uadd8_pl_r10_r12_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_vc_r7_r3_r2),
kInstruction_uadd8_vc_r7_r3_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_mi_r9_r0_r8),
kInstruction_uadd8_mi_r9_r0_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r2_r13_r7),
kInstruction_uadd8_eq_r2_r13_r7,
},
{
ARRAY_SIZE(kInstruction_uadd8_ne_r2_r14_r0),
kInstruction_uadd8_ne_r2_r14_r0,
},
{
ARRAY_SIZE(kInstruction_uadd8_vs_r4_r10_r0),
kInstruction_uadd8_vs_r4_r10_r0,
},
{
ARRAY_SIZE(kInstruction_uadd8_ls_r0_r2_r2),
kInstruction_uadd8_ls_r0_r2_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r1_r6_r0),
kInstruction_uadd8_cc_r1_r6_r0,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r12_r0_r8),
kInstruction_uadd8_lt_r12_r0_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r9_r3_r14),
kInstruction_uadd8_cc_r9_r3_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_vs_r7_r9_r1),
kInstruction_uadd8_vs_r7_r9_r1,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r11_r9_r14),
kInstruction_uadd8_eq_r11_r9_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_pl_r6_r10_r4),
kInstruction_uadd8_pl_r6_r10_r4,
},
{
ARRAY_SIZE(kInstruction_uadd8_ne_r8_r5_r6),
kInstruction_uadd8_ne_r8_r5_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r0_r6_r2),
kInstruction_uadd8_cs_r0_r6_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r11_r12_r4),
kInstruction_uadd8_eq_r11_r12_r4,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r14_r3_r14),
kInstruction_uadd8_lt_r14_r3_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_le_r7_r12_r14),
kInstruction_uadd8_le_r7_r12_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r2_r9_r9),
kInstruction_uadd8_hi_r2_r9_r9,
},
{
ARRAY_SIZE(kInstruction_uadd8_ne_r8_r1_r0),
kInstruction_uadd8_ne_r8_r1_r0,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r5_r11_r2),
kInstruction_uadd8_cc_r5_r11_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r0_r1_r2),
kInstruction_uadd8_hi_r0_r1_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_al_r4_r9_r4),
kInstruction_uadd8_al_r4_r9_r4,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r12_r7_r14),
kInstruction_uadd8_cs_r12_r7_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r4_r12_r10),
kInstruction_uadd8_cc_r4_r12_r10,
},
{
ARRAY_SIZE(kInstruction_uadd8_al_r3_r5_r10),
kInstruction_uadd8_al_r3_r5_r10,
},
{
ARRAY_SIZE(kInstruction_uadd8_mi_r5_r3_r7),
kInstruction_uadd8_mi_r5_r3_r7,
},
{
ARRAY_SIZE(kInstruction_uadd8_ls_r10_r6_r2),
kInstruction_uadd8_ls_r10_r6_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_mi_r0_r12_r11),
kInstruction_uadd8_mi_r0_r12_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_vc_r12_r5_r6),
kInstruction_uadd8_vc_r12_r5_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r3_r9_r4),
kInstruction_uadd8_cs_r3_r9_r4,
},
{
ARRAY_SIZE(kInstruction_uadd8_ls_r4_r9_r11),
kInstruction_uadd8_ls_r4_r9_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_le_r14_r8_r13),
kInstruction_uadd8_le_r14_r8_r13,
},
{
ARRAY_SIZE(kInstruction_uadd8_gt_r4_r10_r8),
kInstruction_uadd8_gt_r4_r10_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_al_r6_r9_r9),
kInstruction_uadd8_al_r6_r9_r9,
},
{
ARRAY_SIZE(kInstruction_uadd8_ne_r8_r5_r12),
kInstruction_uadd8_ne_r8_r5_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_ne_r0_r4_r8),
kInstruction_uadd8_ne_r0_r4_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_mi_r7_r13_r3),
kInstruction_uadd8_mi_r7_r13_r3,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r11_r7_r0),
kInstruction_uadd8_cc_r11_r7_r0,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r1_r0_r12),
kInstruction_uadd8_hi_r1_r0_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r8_r9_r3),
kInstruction_uadd8_lt_r8_r9_r3,
},
{
ARRAY_SIZE(kInstruction_uadd8_al_r0_r2_r1),
kInstruction_uadd8_al_r0_r2_r1,
},
{
ARRAY_SIZE(kInstruction_uadd8_vs_r4_r3_r14),
kInstruction_uadd8_vs_r4_r3_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r2_r11_r1),
kInstruction_uadd8_ge_r2_r11_r1,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r12_r9_r6),
kInstruction_uadd8_lt_r12_r9_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_ls_r8_r2_r7),
kInstruction_uadd8_ls_r8_r2_r7,
},
{
ARRAY_SIZE(kInstruction_uadd8_le_r8_r13_r3),
kInstruction_uadd8_le_r8_r13_r3,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r11_r13_r14),
kInstruction_uadd8_eq_r11_r13_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r1_r6_r13),
kInstruction_uadd8_lt_r1_r6_r13,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r3_r8_r11),
kInstruction_uadd8_cs_r3_r8_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_pl_r12_r5_r4),
kInstruction_uadd8_pl_r12_r5_r4,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r8_r7_r2),
kInstruction_uadd8_eq_r8_r7_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_ls_r2_r12_r2),
kInstruction_uadd8_ls_r2_r12_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_le_r14_r2_r3),
kInstruction_uadd8_le_r14_r2_r3,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r10_r11_r6),
kInstruction_uadd8_ge_r10_r11_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r0_r2_r2),
kInstruction_uadd8_hi_r0_r2_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r2_r0_r2),
kInstruction_uadd8_ge_r2_r0_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_vs_r11_r14_r0),
kInstruction_uadd8_vs_r11_r14_r0,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r2_r0_r1),
kInstruction_uadd8_lt_r2_r0_r1,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r2_r5_r11),
kInstruction_uadd8_cs_r2_r5_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_ls_r7_r14_r5),
kInstruction_uadd8_ls_r7_r14_r5,
},
{
ARRAY_SIZE(kInstruction_uadd8_pl_r0_r0_r3),
kInstruction_uadd8_pl_r0_r0_r3,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r6_r8_r8),
kInstruction_uadd8_ge_r6_r8_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_le_r11_r1_r10),
kInstruction_uadd8_le_r11_r1_r10,
},
{
ARRAY_SIZE(kInstruction_uadd8_vs_r5_r2_r7),
kInstruction_uadd8_vs_r5_r2_r7,
},
{
ARRAY_SIZE(kInstruction_uadd8_ne_r4_r4_r8),
kInstruction_uadd8_ne_r4_r4_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r9_r14_r13),
kInstruction_uadd8_cc_r9_r14_r13,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r14_r6_r3),
kInstruction_uadd8_hi_r14_r6_r3,
},
{
ARRAY_SIZE(kInstruction_uadd8_al_r0_r8_r0),
kInstruction_uadd8_al_r0_r8_r0,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r6_r11_r1),
kInstruction_uadd8_lt_r6_r11_r1,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r7_r6_r12),
kInstruction_uadd8_ge_r7_r6_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r4_r6_r14),
kInstruction_uadd8_cs_r4_r6_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r7_r6_r7),
kInstruction_uadd8_cs_r7_r6_r7,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r3_r7_r10),
kInstruction_uadd8_cs_r3_r7_r10,
},
{
ARRAY_SIZE(kInstruction_uadd8_ne_r0_r2_r1),
kInstruction_uadd8_ne_r0_r2_r1,
},
{
ARRAY_SIZE(kInstruction_uadd8_vs_r9_r10_r13),
kInstruction_uadd8_vs_r9_r10_r13,
},
{
ARRAY_SIZE(kInstruction_uadd8_vc_r11_r14_r12),
kInstruction_uadd8_vc_r11_r14_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r14_r8_r7),
kInstruction_uadd8_ge_r14_r8_r7,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r13_r0_r11),
kInstruction_uadd8_lt_r13_r0_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r14_r13_r4),
kInstruction_uadd8_lt_r14_r13_r4,
},
{
ARRAY_SIZE(kInstruction_uadd8_al_r1_r10_r9),
kInstruction_uadd8_al_r1_r10_r9,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r11_r14_r11),
kInstruction_uadd8_ge_r11_r14_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r11_r4_r11),
kInstruction_uadd8_cs_r11_r4_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r0_r14_r7),
kInstruction_uadd8_ge_r0_r14_r7,
},
{
ARRAY_SIZE(kInstruction_uadd8_mi_r1_r2_r9),
kInstruction_uadd8_mi_r1_r2_r9,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r5_r12_r3),
kInstruction_uadd8_eq_r5_r12_r3,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r1_r5_r12),
kInstruction_uadd8_ge_r1_r5_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r10_r11_r4),
kInstruction_uadd8_lt_r10_r11_r4,
},
{
ARRAY_SIZE(kInstruction_uadd8_le_r1_r1_r5),
kInstruction_uadd8_le_r1_r1_r5,
},
{
ARRAY_SIZE(kInstruction_uadd8_al_r9_r1_r8),
kInstruction_uadd8_al_r9_r1_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_ne_r6_r8_r4),
kInstruction_uadd8_ne_r6_r8_r4,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r12_r2_r9),
kInstruction_uadd8_ge_r12_r2_r9,
},
{
ARRAY_SIZE(kInstruction_uadd8_pl_r4_r3_r10),
kInstruction_uadd8_pl_r4_r3_r10,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r14_r4_r11),
kInstruction_uadd8_eq_r14_r4_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r9_r7_r6),
kInstruction_uadd8_cc_r9_r7_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r12_r4_r5),
kInstruction_uadd8_ge_r12_r4_r5,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r2_r3_r4),
kInstruction_uadd8_hi_r2_r3_r4,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r0_r3_r1),
kInstruction_uadd8_cs_r0_r3_r1,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r6_r2_r8),
kInstruction_uadd8_hi_r6_r2_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r3_r14_r13),
kInstruction_uadd8_cc_r3_r14_r13,
},
{
ARRAY_SIZE(kInstruction_uadd8_gt_r11_r4_r7),
kInstruction_uadd8_gt_r11_r4_r7,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r5_r0_r12),
kInstruction_uadd8_hi_r5_r0_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_gt_r0_r14_r14),
kInstruction_uadd8_gt_r0_r14_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r9_r0_r10),
kInstruction_uadd8_hi_r9_r0_r10,
},
{
ARRAY_SIZE(kInstruction_uadd8_vc_r7_r11_r8),
kInstruction_uadd8_vc_r7_r11_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_pl_r11_r9_r6),
kInstruction_uadd8_pl_r11_r9_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_al_r3_r3_r7),
kInstruction_uadd8_al_r3_r3_r7,
},
{
ARRAY_SIZE(kInstruction_uadd8_mi_r5_r7_r9),
kInstruction_uadd8_mi_r5_r7_r9,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r11_r2_r4),
kInstruction_uadd8_cc_r11_r2_r4,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r9_r13_r10),
kInstruction_uadd8_cc_r9_r13_r10,
},
{
ARRAY_SIZE(kInstruction_uadd8_al_r5_r2_r6),
kInstruction_uadd8_al_r5_r2_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r9_r4_r6),
kInstruction_uadd8_ge_r9_r4_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_ls_r3_r3_r4),
kInstruction_uadd8_ls_r3_r3_r4,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r14_r1_r8),
kInstruction_uadd8_ge_r14_r1_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_ls_r7_r12_r7),
kInstruction_uadd8_ls_r7_r12_r7,
},
{
ARRAY_SIZE(kInstruction_uadd8_al_r11_r10_r5),
kInstruction_uadd8_al_r11_r10_r5,
},
{
ARRAY_SIZE(kInstruction_uadd8_al_r7_r4_r6),
kInstruction_uadd8_al_r7_r4_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_vs_r12_r4_r10),
kInstruction_uadd8_vs_r12_r4_r10,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r4_r4_r4),
kInstruction_uadd8_eq_r4_r4_r4,
},
{
ARRAY_SIZE(kInstruction_uadd8_vs_r6_r6_r12),
kInstruction_uadd8_vs_r6_r6_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_pl_r9_r3_r5),
kInstruction_uadd8_pl_r9_r3_r5,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r6_r5_r13),
kInstruction_uadd8_eq_r6_r5_r13,
},
{
ARRAY_SIZE(kInstruction_uadd8_cc_r8_r2_r12),
kInstruction_uadd8_cc_r8_r2_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_le_r4_r2_r0),
kInstruction_uadd8_le_r4_r2_r0,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r7_r9_r8),
kInstruction_uadd8_lt_r7_r9_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_le_r4_r7_r11),
kInstruction_uadd8_le_r4_r7_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r5_r7_r5),
kInstruction_uadd8_eq_r5_r7_r5,
},
{
ARRAY_SIZE(kInstruction_uadd8_vc_r10_r7_r12),
kInstruction_uadd8_vc_r10_r7_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r7_r10_r6),
kInstruction_uadd8_eq_r7_r10_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_pl_r1_r12_r2),
kInstruction_uadd8_pl_r1_r12_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_le_r14_r6_r6),
kInstruction_uadd8_le_r14_r6_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_ne_r3_r8_r8),
kInstruction_uadd8_ne_r3_r8_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r4_r12_r8),
kInstruction_uadd8_eq_r4_r12_r8,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r11_r2_r3),
kInstruction_uadd8_ge_r11_r2_r3,
},
{
ARRAY_SIZE(kInstruction_uadd8_hi_r12_r6_r11),
kInstruction_uadd8_hi_r12_r6_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_cs_r4_r5_r10),
kInstruction_uadd8_cs_r4_r5_r10,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r10_r2_r10),
kInstruction_uadd8_ge_r10_r2_r10,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r5_r14_r6),
kInstruction_uadd8_ge_r5_r14_r6,
},
{
ARRAY_SIZE(kInstruction_uadd8_gt_r13_r7_r5),
kInstruction_uadd8_gt_r13_r7_r5,
},
{
ARRAY_SIZE(kInstruction_uadd8_ge_r13_r4_r12),
kInstruction_uadd8_ge_r13_r4_r12,
},
{
ARRAY_SIZE(kInstruction_uadd8_lt_r8_r10_r14),
kInstruction_uadd8_lt_r8_r10_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_le_r4_r3_r13),
kInstruction_uadd8_le_r4_r3_r13,
},
{
ARRAY_SIZE(kInstruction_uadd8_pl_r0_r9_r0),
kInstruction_uadd8_pl_r0_r9_r0,
},
{
ARRAY_SIZE(kInstruction_uadd8_eq_r2_r3_r1),
kInstruction_uadd8_eq_r2_r3_r1,
},
{
ARRAY_SIZE(kInstruction_uadd8_vc_r0_r0_r3),
kInstruction_uadd8_vc_r0_r0_r3,
},
{
ARRAY_SIZE(kInstruction_uadd8_mi_r10_r8_r11),
kInstruction_uadd8_mi_r10_r8_r11,
},
{
ARRAY_SIZE(kInstruction_uadd8_mi_r5_r14_r14),
kInstruction_uadd8_mi_r5_r14_r14,
},
{
ARRAY_SIZE(kInstruction_uadd8_gt_r5_r11_r2),
kInstruction_uadd8_gt_r5_r11_r2,
},
{
ARRAY_SIZE(kInstruction_uadd8_al_r4_r7_r11),
kInstruction_uadd8_al_r4_r7_r11,
},
};
#endif // VIXL_ASSEMBLER_COND_RD_RN_RM_UADD8_A32_H_ | c |
okl4_kernel/okl4_2.1.1-patch.9/l4test/src/platformcontrol.c | CyberQueenMara/baseband-research | 77 | 1390033 | /*
* Copyright (c) 2007 Open Kernel Labs, Inc. (Copyright Holder).
* All rights reserved.
*
* 1. Redistribution and use of OKL4 (Software) in source and binary
* forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* (a) Redistributions of source code must retain this clause 1
* (including paragraphs (a), (b) and (c)), clause 2 and clause 3
* (Licence Terms) and the above copyright notice.
*
* (b) Redistributions in binary form must reproduce the above
* copyright notice and the Licence Terms in the documentation and/or
* other materials provided with the distribution.
*
* (c) Redistributions in any form must be accompanied by information on
* how to obtain complete source code for:
* (i) the Software; and
* (ii) all accompanying software that uses (or is intended to
* use) the Software whether directly or indirectly. Such source
* code must:
* (iii) either be included in the distribution or be available
* for no more than the cost of distribution plus a nominal fee;
* and
* (iv) be licensed by each relevant holder of copyright under
* either the Licence Terms (with an appropriate copyright notice)
* or the terms of a licence which is approved by the Open Source
* Initative. For an executable file, "complete source code"
* means the source code for all modules it contains and includes
* associated build and other files reasonably required to produce
* the executable.
*
* 2. THIS SOFTWARE IS PROVIDED ``AS IS'' AND, TO THE EXTENT PERMITTED BY
* LAW, ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED. WHERE ANY WARRANTY IS
* IMPLIED AND IS PREVENTED BY LAW FROM BEING DISCLAIMED THEN TO THE
* EXTENT PERMISSIBLE BY LAW: (A) THE WARRANTY IS READ DOWN IN FAVOUR OF
* THE COPYRIGHT HOLDER (AND, IN THE CASE OF A PARTICIPANT, THAT
* PARTICIPANT) AND (B) ANY LIMITATIONS PERMITTED BY LAW (INCLUDING AS TO
* THE EXTENT OF THE WARRANTY AND THE REMEDIES AVAILABLE IN THE EVENT OF
* BREACH) ARE DEEMED PART OF THIS LICENCE IN A FORM MOST FAVOURABLE TO
* THE COPYRIGHT HOLDER (AND, IN THE CASE OF A PARTICIPANT, THAT
* PARTICIPANT). IN THE LICENCE TERMS, "PARTICIPANT" INCLUDES EVERY
* PERSON WHO HAS CONTRIBUTED TO THE SOFTWARE OR WHO HAS BEEN INVOLVED IN
* THE DISTRIBUTION OR DISSEMINATION OF THE SOFTWARE.
*
* 3. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ANY OTHER PARTICIPANT 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 <l4test/l4test.h>
#include <l4test/utility.h>
#include <stddef.h>
#include <l4/ipc.h>
#include <l4/thread.h>
#include <l4/schedule.h>
#include <l4/misc.h>
#include <l4/security.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
/*
\begin{test}{PLAT0100}
\TestDescription{Check platform control not implemented}
\TestPostConditions{}
\TestImplementationProcess{
\begin{enumerate}
\item Call \Func{L4\_PlatformControl}
\item Check that the return value is 0
\item Check that the error code in \Func{ENOT\_IMPLEMENTED}
\end{enumerate}
}
\TestImplementationStatus{Implemented}
\TestIsFullyAutomated{Yes}
\TestRegressionStatus{In regression test suite}
\end{test}
*/
static void test_thread(void)
{
L4_ThreadId_t from = L4_nilthread;
L4_Msg_t msg;
L4_MsgTag_t tag;
L4_Word_t result;
/* Wait for msg */
tag = L4_Wait(&from);
_fail_unless (L4_IpcSucceeded (tag), __FILE__, __LINE__, "Could not get message. Error: %ld",
(int) L4_ErrorCode ());
result = L4_PlatformControl(0, 0, 0, 0);
L4_MsgClear (&msg);
L4_MsgAppendWord(&msg, (result != 0) ? -1 : L4_ErrorCode ());
L4_MsgLoad (&msg);
tag = L4_Call(from);
_fail_unless (L4_IpcSucceeded (tag), __FILE__, __LINE__, "Could not send message. Error: %ld",
(int) L4_ErrorCode ());
}
START_TEST(PLAT0100)
{
L4_Msg_t msg;
L4_MsgTag_t tag;
L4_SpaceId_t space;
L4_ThreadId_t thread;
L4_Word_t result = -10;
space = createSpace();
thread = createThreadInSpace(space, test_thread);
L4_AllowPlatformControl(space);
L4_MsgClear (&msg);
L4_Set_MsgLabel (&msg, 0x1);
L4_MsgLoad (&msg);
tag = L4_Call (thread);
_fail_unless (L4_IpcSucceeded (tag), __FILE__, __LINE__, "Could not send message to thread. Error: %ld",
(int) L4_ErrorCode ());
L4_StoreMR(1, &result);
/* check for NOT_IMPLEMENTED */
_fail_unless (result == 16, __FILE__, __LINE__, "Wrong error code: %ld",
(int) result );
deleteThread(thread);
deleteSpace(space);
}
END_TEST
/*
\begin{test}{PLAT0200}
\TestDescription{Check platform control privilege}
\TestPostConditions{}
\TestImplementationProcess{
\begin{enumerate}
\item Call \Func{L4\_PlatformControl} from a deprivileged thread
\item Check that the return value is 0
\item Check that the error code in \Func{ENO\_PRIVILEGE}
\end{enumerate}
}
\TestImplementationStatus{Implemented}
\TestIsFullyAutomated{Yes}
\TestRegressionStatus{In regression test suite}
\end{test}
*/
START_TEST(PLAT0200)
{
L4_Msg_t msg;
L4_MsgTag_t tag;
L4_SpaceId_t space;
L4_ThreadId_t thread;
L4_Word_t result = -10;
space = createSpace();
thread = createThreadInSpace(space, test_thread);
L4_MsgClear (&msg);
L4_Set_MsgLabel (&msg, 0x1);
L4_MsgLoad (&msg);
tag = L4_Call (thread);
_fail_unless (L4_IpcSucceeded (tag), __FILE__, __LINE__, "Could not send message to thread. Error: %ld",
(int) L4_ErrorCode ());
L4_StoreMR(1, &result);
/* check for NO_PRIVILEGE */
_fail_unless (result == 1, __FILE__, __LINE__, "Wrong error code: %ld",
(int) result );
deleteThread(thread);
deleteSpace(space);
}
END_TEST
static void test_setup(void)
{
initThreads(0);
}
static void test_teardown(void)
{
}
TCase *
make_platform_control_tcase(void)
{
TCase *tc;
initThreads(0);
tc = tcase_create("Platform Control Tests");
tcase_add_checked_fixture(tc, test_setup, test_teardown);
tcase_add_test(tc, PLAT0100);
tcase_add_test(tc, PLAT0200);
return tc;
} | c |
testsuite/EXP_4/test919.c | ishiura-compiler/CF3 | 34 | 2594518 | /*
CF3
Copyright (c) 2015 ishiura-lab.
Released under the MIT license.
https://github.com/ishiura-compiler/CF3/MIT-LICENSE.md
*/
#include<stdio.h>
#include<stdint.h>
#include<stdlib.h>
#include"test1.h"
static int8_t x1 = INT8_MAX;
static int64_t x5 = INT64_MIN;
int16_t x7 = -1;
int16_t x9 = INT16_MAX;
int32_t t2 = 4484857;
int32_t x16 = INT32_MAX;
int32_t x18 = INT32_MIN;
int64_t x20 = -1LL;
int32_t t4 = -61;
int16_t x22 = -6;
int64_t x28 = INT64_MIN;
int16_t x33 = INT16_MIN;
volatile int32_t x50 = INT32_MIN;
int16_t x58 = INT16_MIN;
volatile int32_t t13 = -1625662;
volatile int64_t x62 = -10175LL;
volatile int32_t t17 = 6;
int32_t t18 = -84168944;
int8_t x86 = INT8_MAX;
int8_t x90 = 27;
int8_t x92 = INT8_MIN;
static int16_t x94 = INT16_MIN;
int16_t x96 = 1336;
int32_t x98 = -1;
uint64_t x103 = UINT64_MAX;
volatile int8_t x104 = INT8_MIN;
int32_t t25 = 3638318;
int16_t x111 = INT16_MIN;
int16_t x113 = 1;
uint64_t x116 = UINT64_MAX;
int64_t x117 = INT64_MIN;
int32_t x120 = -1596;
static volatile int32_t x123 = -1;
int32_t t29 = -87;
volatile int16_t x127 = INT16_MIN;
static int64_t x134 = -1LL;
int8_t x137 = INT8_MAX;
static int32_t x142 = INT32_MIN;
int16_t x146 = INT16_MIN;
int16_t x147 = -288;
int64_t x149 = INT64_MAX;
uint16_t x153 = 7340U;
int16_t x156 = INT16_MIN;
int32_t x163 = 718;
uint16_t x167 = UINT16_MAX;
int32_t t40 = 37559374;
uint8_t x173 = UINT8_MAX;
int8_t x177 = INT8_MAX;
int8_t x179 = -1;
volatile int64_t x185 = -51415LL;
int64_t x186 = 100243862LL;
int64_t x187 = INT64_MAX;
static int32_t x193 = 9;
static int32_t x196 = -1;
volatile int32_t t47 = -2055769;
uint16_t x197 = UINT16_MAX;
int32_t x208 = -1133;
volatile int8_t x212 = -1;
int32_t t51 = 1;
int64_t x214 = -2043114LL;
int8_t x217 = INT8_MAX;
int32_t x218 = -1;
uint16_t x227 = 1270U;
uint8_t x231 = 4U;
int64_t x232 = -1LL;
int32_t t56 = 12988;
int32_t t57 = -22365;
int64_t x237 = INT64_MAX;
int16_t x240 = INT16_MAX;
int64_t x241 = INT64_MAX;
static volatile uint8_t x242 = 1U;
int32_t t59 = 2349639;
int32_t x245 = INT32_MIN;
volatile int32_t t61 = 29830;
int64_t x270 = INT64_MIN;
volatile uint64_t x271 = 1732057951912982804LLU;
uint16_t x280 = 108U;
uint32_t x285 = 105U;
int64_t x290 = -1LL;
uint8_t x293 = 1U;
int64_t x301 = INT64_MAX;
volatile int32_t t74 = -24;
volatile int32_t x309 = INT32_MAX;
uint8_t x312 = UINT8_MAX;
static uint64_t x320 = 565LLU;
static int8_t x321 = INT8_MIN;
uint8_t x323 = UINT8_MAX;
uint64_t x325 = 1150673277LLU;
volatile int32_t t81 = 1297863;
int16_t x338 = -1;
static uint8_t x339 = 28U;
uint16_t x345 = UINT16_MAX;
static int8_t x347 = INT8_MAX;
volatile int32_t t85 = 2715;
volatile int32_t x356 = INT32_MIN;
int32_t x359 = 631510324;
volatile int32_t t87 = 969567;
int32_t x361 = -56828439;
int8_t x364 = -1;
int8_t x366 = INT8_MAX;
int16_t x369 = -1;
static volatile int64_t x370 = 4343994LL;
int32_t t90 = 9427272;
static uint64_t x373 = 378LLU;
int16_t x389 = INT16_MAX;
uint64_t x393 = UINT64_MAX;
int64_t x395 = INT64_MIN;
uint64_t x396 = UINT64_MAX;
volatile int32_t t96 = -3225813;
static int32_t x401 = -1;
uint16_t x407 = 0U;
volatile int32_t t98 = 11454283;
uint32_t x412 = 723U;
int16_t x425 = INT16_MIN;
volatile int32_t x433 = -1;
static int8_t x446 = INT8_MIN;
volatile uint8_t x459 = UINT8_MAX;
volatile int64_t x462 = INT64_MIN;
uint64_t x470 = 117721465LLU;
volatile int32_t t113 = 12843;
static int32_t t116 = 136534646;
volatile int32_t t117 = -833603;
int16_t x494 = 317;
int8_t x496 = -1;
int32_t x501 = INT32_MIN;
static volatile int32_t t121 = 532401;
int32_t t122 = -3725;
int64_t x509 = INT64_MIN;
int32_t x510 = INT32_MAX;
volatile uint64_t x515 = 33449058274LLU;
int32_t t126 = 2955;
int32_t x530 = -1;
int32_t t131 = 3875;
volatile uint64_t x545 = 11915082LLU;
int32_t x552 = INT32_MIN;
volatile uint8_t x555 = UINT8_MAX;
int16_t x559 = -1;
int32_t t135 = 14596;
int32_t x567 = INT32_MIN;
uint16_t x571 = UINT16_MAX;
int32_t t139 = 1807829;
int16_t x583 = 29;
volatile int32_t t141 = -38943;
int8_t x588 = INT8_MAX;
static volatile int16_t x589 = INT16_MIN;
int8_t x600 = -1;
volatile int32_t t145 = -30520;
int16_t x602 = -1;
static int16_t x606 = -1;
static uint64_t x612 = 36189677094LLU;
volatile int32_t x620 = -1;
uint8_t x624 = 9U;
int32_t t151 = -52877649;
uint16_t x628 = 2U;
volatile int32_t t152 = 106;
static int64_t x635 = -2067532LL;
volatile int32_t x644 = -120335;
uint8_t x649 = 54U;
uint32_t x653 = 62943256U;
uint16_t x654 = UINT16_MAX;
int8_t x658 = INT8_MAX;
volatile int32_t t160 = 3195;
int64_t x666 = -192776LL;
int32_t t162 = -2472;
static int16_t x676 = INT16_MAX;
int32_t t163 = 29;
volatile int32_t t164 = 223;
int16_t x684 = 1;
int8_t x687 = INT8_MIN;
uint8_t x688 = UINT8_MAX;
static volatile int32_t t167 = 66;
int32_t x694 = 926151;
int8_t x696 = INT8_MIN;
volatile int32_t t168 = -2003;
int32_t x700 = INT32_MIN;
int32_t x705 = 775895;
int8_t x706 = INT8_MIN;
uint16_t x708 = UINT16_MAX;
int32_t t170 = 26;
static volatile int64_t x710 = INT64_MAX;
int32_t x717 = -1845;
volatile uint64_t x720 = 3959LLU;
int32_t t173 = 149;
int64_t x721 = INT64_MIN;
int32_t t175 = -2060005;
int16_t x732 = INT16_MIN;
volatile uint8_t x742 = 3U;
static int64_t x750 = INT64_MIN;
volatile int16_t x751 = INT16_MIN;
static int64_t x753 = INT64_MIN;
uint8_t x758 = 16U;
int32_t t183 = -1507924;
static volatile int32_t x769 = -718430369;
int16_t x772 = INT16_MIN;
uint16_t x782 = UINT16_MAX;
uint64_t x784 = 6465121LLU;
int32_t t189 = 274461;
static int8_t x787 = -2;
int16_t x790 = -1;
static volatile int64_t x794 = INT64_MAX;
uint16_t x798 = 2U;
volatile int32_t t193 = 1115983;
volatile int16_t x802 = INT16_MAX;
uint8_t x805 = 1U;
int64_t x811 = -1LL;
static int32_t x816 = INT32_MIN;
int32_t t197 = 5953;
uint64_t x819 = UINT64_MAX;
volatile int8_t x824 = 1;
void f0(void) {
int32_t x2 = -108;
volatile uint64_t x3 = UINT64_MAX;
int32_t x4 = -24024868;
volatile int32_t t0 = 184184;
t0 = (x1>(x2<=(x3%x4)));
if (t0 != 1) { NG(); } else { ; }
}
void f1(void) {
static int16_t x6 = INT16_MIN;
uint32_t x8 = 38U;
static volatile int32_t t1 = -5;
t1 = (x5>(x6<=(x7%x8)));
if (t1 != 0) { NG(); } else { ; }
}
void f2(void) {
static uint32_t x10 = 8027099U;
volatile int8_t x11 = INT8_MIN;
static int64_t x12 = -1LL;
t2 = (x9>(x10<=(x11%x12)));
if (t2 != 1) { NG(); } else { ; }
}
void f3(void) {
static int32_t x13 = 12;
volatile int8_t x14 = 20;
uint32_t x15 = 4124U;
int32_t t3 = 1332479;
t3 = (x13>(x14<=(x15%x16)));
if (t3 != 1) { NG(); } else { ; }
}
void f4(void) {
uint8_t x17 = 8U;
int16_t x19 = -1;
t4 = (x17>(x18<=(x19%x20)));
if (t4 != 1) { NG(); } else { ; }
}
void f5(void) {
uint16_t x21 = 32159U;
int8_t x23 = -1;
static uint32_t x24 = 910098U;
volatile int32_t t5 = 7163891;
t5 = (x21>(x22<=(x23%x24)));
if (t5 != 1) { NG(); } else { ; }
}
void f6(void) {
static uint32_t x25 = 28U;
volatile int32_t x26 = INT32_MIN;
int64_t x27 = -1LL;
int32_t t6 = 53;
t6 = (x25>(x26<=(x27%x28)));
if (t6 != 1) { NG(); } else { ; }
}
void f7(void) {
uint8_t x29 = 0U;
static int16_t x30 = -1;
int8_t x31 = -7;
int32_t x32 = 26;
int32_t t7 = 12637;
t7 = (x29>(x30<=(x31%x32)));
if (t7 != 0) { NG(); } else { ; }
}
void f8(void) {
int64_t x34 = INT64_MIN;
static int8_t x35 = -3;
uint32_t x36 = UINT32_MAX;
int32_t t8 = -1;
t8 = (x33>(x34<=(x35%x36)));
if (t8 != 0) { NG(); } else { ; }
}
void f9(void) {
volatile uint64_t x41 = UINT64_MAX;
static int16_t x42 = 654;
int32_t x43 = -3374;
int8_t x44 = -1;
int32_t t9 = -9;
t9 = (x41>(x42<=(x43%x44)));
if (t9 != 1) { NG(); } else { ; }
}
void f10(void) {
static int32_t x45 = 2645;
uint32_t x46 = UINT32_MAX;
int32_t x47 = -1;
volatile int16_t x48 = -1;
static volatile int32_t t10 = 5709;
t10 = (x45>(x46<=(x47%x48)));
if (t10 != 1) { NG(); } else { ; }
}
void f11(void) {
uint32_t x49 = 460338U;
uint8_t x51 = UINT8_MAX;
uint8_t x52 = 2U;
volatile int32_t t11 = -569;
t11 = (x49>(x50<=(x51%x52)));
if (t11 != 1) { NG(); } else { ; }
}
void f12(void) {
static uint16_t x53 = 1U;
volatile int32_t x54 = 12660;
int64_t x55 = INT64_MIN;
int8_t x56 = 27;
volatile int32_t t12 = 264744;
t12 = (x53>(x54<=(x55%x56)));
if (t12 != 1) { NG(); } else { ; }
}
void f13(void) {
int32_t x57 = -246861432;
volatile int8_t x59 = INT8_MAX;
int64_t x60 = 1191932278LL;
t13 = (x57>(x58<=(x59%x60)));
if (t13 != 0) { NG(); } else { ; }
}
void f14(void) {
uint16_t x61 = 79U;
volatile int16_t x63 = -1;
int64_t x64 = INT64_MIN;
volatile int32_t t14 = 424356;
t14 = (x61>(x62<=(x63%x64)));
if (t14 != 1) { NG(); } else { ; }
}
void f15(void) {
static uint32_t x65 = 0U;
volatile int16_t x66 = INT16_MIN;
uint16_t x67 = 0U;
static uint8_t x68 = 10U;
volatile int32_t t15 = -2178;
t15 = (x65>(x66<=(x67%x68)));
if (t15 != 0) { NG(); } else { ; }
}
void f16(void) {
volatile int8_t x69 = 42;
uint32_t x70 = 24323U;
int32_t x71 = -1;
uint32_t x72 = UINT32_MAX;
int32_t t16 = -306179;
t16 = (x69>(x70<=(x71%x72)));
if (t16 != 1) { NG(); } else { ; }
}
void f17(void) {
int32_t x73 = -47772694;
uint64_t x74 = UINT64_MAX;
volatile uint64_t x75 = UINT64_MAX;
int16_t x76 = INT16_MAX;
t17 = (x73>(x74<=(x75%x76)));
if (t17 != 0) { NG(); } else { ; }
}
void f18(void) {
volatile int32_t x77 = INT32_MAX;
uint8_t x78 = 2U;
static int8_t x79 = -1;
int64_t x80 = -1LL;
t18 = (x77>(x78<=(x79%x80)));
if (t18 != 1) { NG(); } else { ; }
}
void f19(void) {
int64_t x81 = INT64_MAX;
uint32_t x82 = 0U;
static uint64_t x83 = 15195206LLU;
uint8_t x84 = UINT8_MAX;
static volatile int32_t t19 = 3381839;
t19 = (x81>(x82<=(x83%x84)));
if (t19 != 1) { NG(); } else { ; }
}
void f20(void) {
volatile int8_t x85 = INT8_MAX;
static uint8_t x87 = 10U;
volatile uint64_t x88 = UINT64_MAX;
volatile int32_t t20 = 80628641;
t20 = (x85>(x86<=(x87%x88)));
if (t20 != 1) { NG(); } else { ; }
}
void f21(void) {
volatile int32_t x89 = INT32_MIN;
uint32_t x91 = UINT32_MAX;
int32_t t21 = 135;
t21 = (x89>(x90<=(x91%x92)));
if (t21 != 0) { NG(); } else { ; }
}
void f22(void) {
static int32_t x93 = INT32_MIN;
int16_t x95 = INT16_MIN;
volatile int32_t t22 = 6;
t22 = (x93>(x94<=(x95%x96)));
if (t22 != 0) { NG(); } else { ; }
}
void f23(void) {
int32_t x97 = 1698;
volatile uint8_t x99 = UINT8_MAX;
uint8_t x100 = UINT8_MAX;
static volatile int32_t t23 = 1628;
t23 = (x97>(x98<=(x99%x100)));
if (t23 != 1) { NG(); } else { ; }
}
void f24(void) {
static uint32_t x101 = UINT32_MAX;
static uint32_t x102 = 669654991U;
int32_t t24 = -700347825;
t24 = (x101>(x102<=(x103%x104)));
if (t24 != 1) { NG(); } else { ; }
}
void f25(void) {
int64_t x105 = -1LL;
uint8_t x106 = 18U;
int8_t x107 = -1;
int8_t x108 = INT8_MAX;
t25 = (x105>(x106<=(x107%x108)));
if (t25 != 0) { NG(); } else { ; }
}
void f26(void) {
static int16_t x109 = INT16_MIN;
uint64_t x110 = 188862LLU;
static volatile uint16_t x112 = UINT16_MAX;
int32_t t26 = -98092;
t26 = (x109>(x110<=(x111%x112)));
if (t26 != 0) { NG(); } else { ; }
}
void f27(void) {
static volatile int32_t x114 = INT32_MIN;
uint16_t x115 = 31U;
int32_t t27 = -183;
t27 = (x113>(x114<=(x115%x116)));
if (t27 != 1) { NG(); } else { ; }
}
void f28(void) {
uint64_t x118 = UINT64_MAX;
volatile int16_t x119 = INT16_MAX;
volatile int32_t t28 = 390;
t28 = (x117>(x118<=(x119%x120)));
if (t28 != 0) { NG(); } else { ; }
}
void f29(void) {
int32_t x121 = 763334;
int64_t x122 = INT64_MAX;
static uint32_t x124 = 85563U;
t29 = (x121>(x122<=(x123%x124)));
if (t29 != 1) { NG(); } else { ; }
}
void f30(void) {
int32_t x125 = INT32_MAX;
uint64_t x126 = 4130791250817998LLU;
int16_t x128 = 10;
volatile int32_t t30 = 537;
t30 = (x125>(x126<=(x127%x128)));
if (t30 != 1) { NG(); } else { ; }
}
void f31(void) {
int16_t x129 = INT16_MAX;
volatile int32_t x130 = -7576;
static uint64_t x131 = 8988531688683427LLU;
int32_t x132 = 3512197;
volatile int32_t t31 = 49027;
t31 = (x129>(x130<=(x131%x132)));
if (t31 != 1) { NG(); } else { ; }
}
void f32(void) {
uint64_t x133 = UINT64_MAX;
int64_t x135 = INT64_MIN;
static int64_t x136 = -8826107348243LL;
static volatile int32_t t32 = 7952002;
t32 = (x133>(x134<=(x135%x136)));
if (t32 != 1) { NG(); } else { ; }
}
void f33(void) {
int8_t x138 = INT8_MAX;
uint16_t x139 = UINT16_MAX;
int8_t x140 = INT8_MIN;
static int32_t t33 = 58155;
t33 = (x137>(x138<=(x139%x140)));
if (t33 != 1) { NG(); } else { ; }
}
void f34(void) {
static volatile int64_t x141 = INT64_MIN;
uint8_t x143 = UINT8_MAX;
uint64_t x144 = 706628723530883LLU;
volatile int32_t t34 = -9919488;
t34 = (x141>(x142<=(x143%x144)));
if (t34 != 0) { NG(); } else { ; }
}
void f35(void) {
uint64_t x145 = UINT64_MAX;
uint32_t x148 = 660236U;
volatile int32_t t35 = 6968373;
t35 = (x145>(x146<=(x147%x148)));
if (t35 != 1) { NG(); } else { ; }
}
void f36(void) {
int8_t x150 = -1;
volatile int32_t x151 = -139;
volatile int16_t x152 = 6;
volatile int32_t t36 = -7113068;
t36 = (x149>(x150<=(x151%x152)));
if (t36 != 1) { NG(); } else { ; }
}
void f37(void) {
volatile int64_t x154 = INT64_MIN;
uint64_t x155 = 396344650LLU;
volatile int32_t t37 = -166708637;
t37 = (x153>(x154<=(x155%x156)));
if (t37 != 1) { NG(); } else { ; }
}
void f38(void) {
uint64_t x157 = 7104370225481LLU;
static volatile uint32_t x158 = 3U;
uint64_t x159 = 36421091449275206LLU;
int8_t x160 = INT8_MIN;
int32_t t38 = 54;
t38 = (x157>(x158<=(x159%x160)));
if (t38 != 1) { NG(); } else { ; }
}
void f39(void) {
volatile int8_t x161 = -1;
int16_t x162 = -1;
int64_t x164 = INT64_MAX;
volatile int32_t t39 = 772;
t39 = (x161>(x162<=(x163%x164)));
if (t39 != 0) { NG(); } else { ; }
}
void f40(void) {
volatile uint64_t x165 = 3368349563LLU;
int8_t x166 = -3;
int32_t x168 = -1;
t40 = (x165>(x166<=(x167%x168)));
if (t40 != 1) { NG(); } else { ; }
}
void f41(void) {
int64_t x169 = -1LL;
static int16_t x170 = 13;
static volatile int8_t x171 = INT8_MIN;
uint32_t x172 = UINT32_MAX;
volatile int32_t t41 = 0;
t41 = (x169>(x170<=(x171%x172)));
if (t41 != 0) { NG(); } else { ; }
}
void f42(void) {
uint16_t x174 = 3845U;
int16_t x175 = 1;
uint32_t x176 = 158423U;
volatile int32_t t42 = -7933498;
t42 = (x173>(x174<=(x175%x176)));
if (t42 != 1) { NG(); } else { ; }
}
void f43(void) {
int32_t x178 = -27408751;
int32_t x180 = -124;
volatile int32_t t43 = -14638;
t43 = (x177>(x178<=(x179%x180)));
if (t43 != 1) { NG(); } else { ; }
}
void f44(void) {
volatile uint32_t x181 = 587U;
volatile int32_t x182 = INT32_MIN;
int32_t x183 = 926881452;
uint16_t x184 = 3U;
int32_t t44 = -78;
t44 = (x181>(x182<=(x183%x184)));
if (t44 != 1) { NG(); } else { ; }
}
void f45(void) {
static int32_t x188 = 284808116;
static int32_t t45 = 28;
t45 = (x185>(x186<=(x187%x188)));
if (t45 != 0) { NG(); } else { ; }
}
void f46(void) {
static volatile uint16_t x189 = 12454U;
int64_t x190 = 866LL;
static volatile int8_t x191 = INT8_MAX;
uint16_t x192 = 910U;
int32_t t46 = -321;
t46 = (x189>(x190<=(x191%x192)));
if (t46 != 1) { NG(); } else { ; }
}
void f47(void) {
int8_t x194 = 2;
uint32_t x195 = 994U;
t47 = (x193>(x194<=(x195%x196)));
if (t47 != 1) { NG(); } else { ; }
}
void f48(void) {
static uint16_t x198 = 1U;
int8_t x199 = -1;
volatile uint8_t x200 = 19U;
static volatile int32_t t48 = -2310;
t48 = (x197>(x198<=(x199%x200)));
if (t48 != 1) { NG(); } else { ; }
}
void f49(void) {
uint8_t x201 = 50U;
int64_t x202 = INT64_MIN;
static volatile int32_t x203 = INT32_MIN;
volatile int64_t x204 = 2250925388368800LL;
volatile int32_t t49 = 2;
t49 = (x201>(x202<=(x203%x204)));
if (t49 != 1) { NG(); } else { ; }
}
void f50(void) {
int8_t x205 = INT8_MIN;
volatile uint32_t x206 = 1644931U;
int16_t x207 = -168;
static volatile int32_t t50 = 63221;
t50 = (x205>(x206<=(x207%x208)));
if (t50 != 0) { NG(); } else { ; }
}
void f51(void) {
int8_t x209 = -1;
int32_t x210 = INT32_MIN;
int32_t x211 = 50739294;
t51 = (x209>(x210<=(x211%x212)));
if (t51 != 0) { NG(); } else { ; }
}
void f52(void) {
static int16_t x213 = INT16_MIN;
uint64_t x215 = 5651248290673365011LLU;
volatile int16_t x216 = -30;
int32_t t52 = 158045;
t52 = (x213>(x214<=(x215%x216)));
if (t52 != 0) { NG(); } else { ; }
}
void f53(void) {
int8_t x219 = INT8_MAX;
int16_t x220 = -1;
int32_t t53 = 267;
t53 = (x217>(x218<=(x219%x220)));
if (t53 != 1) { NG(); } else { ; }
}
void f54(void) {
int64_t x221 = -263366523LL;
int16_t x222 = -13;
int64_t x223 = 2073615603754311LL;
uint16_t x224 = 869U;
static volatile int32_t t54 = -50;
t54 = (x221>(x222<=(x223%x224)));
if (t54 != 0) { NG(); } else { ; }
}
void f55(void) {
int8_t x225 = 8;
int16_t x226 = INT16_MAX;
uint8_t x228 = 52U;
int32_t t55 = -785029;
t55 = (x225>(x226<=(x227%x228)));
if (t55 != 1) { NG(); } else { ; }
}
void f56(void) {
volatile int8_t x229 = INT8_MIN;
int64_t x230 = INT64_MIN;
t56 = (x229>(x230<=(x231%x232)));
if (t56 != 0) { NG(); } else { ; }
}
void f57(void) {
volatile int8_t x233 = INT8_MIN;
int8_t x234 = INT8_MIN;
int8_t x235 = INT8_MAX;
uint16_t x236 = 878U;
t57 = (x233>(x234<=(x235%x236)));
if (t57 != 0) { NG(); } else { ; }
}
void f58(void) {
int32_t x238 = INT32_MIN;
int16_t x239 = -112;
int32_t t58 = -111237714;
t58 = (x237>(x238<=(x239%x240)));
if (t58 != 1) { NG(); } else { ; }
}
void f59(void) {
int64_t x243 = INT64_MIN;
int8_t x244 = 1;
t59 = (x241>(x242<=(x243%x244)));
if (t59 != 1) { NG(); } else { ; }
}
void f60(void) {
int8_t x246 = -1;
int64_t x247 = 125040316LL;
uint64_t x248 = UINT64_MAX;
volatile int32_t t60 = 32;
t60 = (x245>(x246<=(x247%x248)));
if (t60 != 0) { NG(); } else { ; }
}
void f61(void) {
int8_t x249 = -20;
volatile int16_t x250 = 177;
volatile int64_t x251 = -1LL;
int64_t x252 = -8821LL;
t61 = (x249>(x250<=(x251%x252)));
if (t61 != 0) { NG(); } else { ; }
}
void f62(void) {
int8_t x253 = -1;
int32_t x254 = INT32_MIN;
volatile int64_t x255 = -1LL;
uint32_t x256 = UINT32_MAX;
int32_t t62 = -90;
t62 = (x253>(x254<=(x255%x256)));
if (t62 != 0) { NG(); } else { ; }
}
void f63(void) {
static int64_t x257 = -6959LL;
uint16_t x258 = 20U;
int16_t x259 = INT16_MIN;
int32_t x260 = -42;
int32_t t63 = 5;
t63 = (x257>(x258<=(x259%x260)));
if (t63 != 0) { NG(); } else { ; }
}
void f64(void) {
volatile int16_t x261 = 1665;
int32_t x262 = INT32_MIN;
int32_t x263 = 2;
int16_t x264 = INT16_MIN;
volatile int32_t t64 = -3737;
t64 = (x261>(x262<=(x263%x264)));
if (t64 != 1) { NG(); } else { ; }
}
void f65(void) {
static volatile uint64_t x265 = UINT64_MAX;
int64_t x266 = INT64_MAX;
int32_t x267 = INT32_MIN;
static uint32_t x268 = UINT32_MAX;
static volatile int32_t t65 = -17536768;
t65 = (x265>(x266<=(x267%x268)));
if (t65 != 1) { NG(); } else { ; }
}
void f66(void) {
static volatile int32_t x269 = -83;
volatile int8_t x272 = -1;
volatile int32_t t66 = 2;
t66 = (x269>(x270<=(x271%x272)));
if (t66 != 0) { NG(); } else { ; }
}
void f67(void) {
uint32_t x273 = 251463U;
int64_t x274 = INT64_MIN;
static uint16_t x275 = 30454U;
volatile int32_t x276 = -1;
volatile int32_t t67 = -1819985;
t67 = (x273>(x274<=(x275%x276)));
if (t67 != 1) { NG(); } else { ; }
}
void f68(void) {
static volatile int64_t x277 = -21787842256378758LL;
volatile int32_t x278 = INT32_MAX;
uint8_t x279 = 1U;
volatile int32_t t68 = -31138;
t68 = (x277>(x278<=(x279%x280)));
if (t68 != 0) { NG(); } else { ; }
}
void f69(void) {
uint16_t x281 = UINT16_MAX;
static int8_t x282 = INT8_MIN;
static int32_t x283 = -2928137;
int8_t x284 = -1;
int32_t t69 = 28;
t69 = (x281>(x282<=(x283%x284)));
if (t69 != 1) { NG(); } else { ; }
}
void f70(void) {
int32_t x286 = -1;
uint32_t x287 = 1010U;
volatile int8_t x288 = 43;
volatile int32_t t70 = -53;
t70 = (x285>(x286<=(x287%x288)));
if (t70 != 1) { NG(); } else { ; }
}
void f71(void) {
int32_t x289 = 44588108;
int16_t x291 = 858;
uint32_t x292 = 26U;
int32_t t71 = -316171501;
t71 = (x289>(x290<=(x291%x292)));
if (t71 != 1) { NG(); } else { ; }
}
void f72(void) {
uint8_t x294 = 1U;
int64_t x295 = INT64_MAX;
static int64_t x296 = INT64_MIN;
volatile int32_t t72 = -922899580;
t72 = (x293>(x294<=(x295%x296)));
if (t72 != 0) { NG(); } else { ; }
}
void f73(void) {
uint16_t x297 = 7233U;
static volatile int32_t x298 = -1;
int16_t x299 = 451;
uint16_t x300 = 4785U;
volatile int32_t t73 = -158;
t73 = (x297>(x298<=(x299%x300)));
if (t73 != 1) { NG(); } else { ; }
}
void f74(void) {
uint16_t x302 = 17U;
static int8_t x303 = -1;
int64_t x304 = -10666975453596LL;
t74 = (x301>(x302<=(x303%x304)));
if (t74 != 1) { NG(); } else { ; }
}
void f75(void) {
int64_t x310 = INT64_MIN;
uint8_t x311 = 34U;
int32_t t75 = 620749;
t75 = (x309>(x310<=(x311%x312)));
if (t75 != 1) { NG(); } else { ; }
}
void f76(void) {
int32_t x313 = INT32_MIN;
int8_t x314 = -2;
uint16_t x315 = 47U;
int32_t x316 = INT32_MIN;
int32_t t76 = -955395;
t76 = (x313>(x314<=(x315%x316)));
if (t76 != 0) { NG(); } else { ; }
}
void f77(void) {
volatile int8_t x317 = 11;
int16_t x318 = -1;
volatile uint64_t x319 = UINT64_MAX;
volatile int32_t t77 = -48652;
t77 = (x317>(x318<=(x319%x320)));
if (t77 != 1) { NG(); } else { ; }
}
void f78(void) {
static volatile uint16_t x322 = 3808U;
uint64_t x324 = UINT64_MAX;
int32_t t78 = 286792;
t78 = (x321>(x322<=(x323%x324)));
if (t78 != 0) { NG(); } else { ; }
}
void f79(void) {
int16_t x326 = INT16_MIN;
int16_t x327 = -1;
volatile int32_t x328 = -1;
int32_t t79 = 1263;
t79 = (x325>(x326<=(x327%x328)));
if (t79 != 1) { NG(); } else { ; }
}
void f80(void) {
uint8_t x329 = 3U;
volatile int8_t x330 = 5;
int8_t x331 = 39;
int32_t x332 = 115;
int32_t t80 = 5078265;
t80 = (x329>(x330<=(x331%x332)));
if (t80 != 1) { NG(); } else { ; }
}
void f81(void) {
int32_t x333 = -1;
uint64_t x334 = UINT64_MAX;
uint16_t x335 = 1143U;
static uint32_t x336 = 15853076U;
t81 = (x333>(x334<=(x335%x336)));
if (t81 != 0) { NG(); } else { ; }
}
void f82(void) {
static uint8_t x337 = UINT8_MAX;
int64_t x340 = -2054360171469525LL;
int32_t t82 = -217451;
t82 = (x337>(x338<=(x339%x340)));
if (t82 != 1) { NG(); } else { ; }
}
void f83(void) {
int8_t x341 = -1;
uint64_t x342 = 1254LLU;
uint8_t x343 = 0U;
static uint8_t x344 = UINT8_MAX;
int32_t t83 = 169684;
t83 = (x341>(x342<=(x343%x344)));
if (t83 != 0) { NG(); } else { ; }
}
void f84(void) {
volatile int8_t x346 = INT8_MAX;
int64_t x348 = INT64_MAX;
volatile int32_t t84 = 1009;
t84 = (x345>(x346<=(x347%x348)));
if (t84 != 1) { NG(); } else { ; }
}
void f85(void) {
int32_t x349 = 94016437;
int16_t x350 = -22;
static int64_t x351 = -1LL;
static int8_t x352 = INT8_MIN;
t85 = (x349>(x350<=(x351%x352)));
if (t85 != 1) { NG(); } else { ; }
}
void f86(void) {
uint32_t x353 = UINT32_MAX;
int8_t x354 = INT8_MIN;
uint16_t x355 = 415U;
volatile int32_t t86 = -162794349;
t86 = (x353>(x354<=(x355%x356)));
if (t86 != 1) { NG(); } else { ; }
}
void f87(void) {
uint16_t x357 = UINT16_MAX;
uint32_t x358 = UINT32_MAX;
int64_t x360 = INT64_MIN;
t87 = (x357>(x358<=(x359%x360)));
if (t87 != 1) { NG(); } else { ; }
}
void f88(void) {
int32_t x362 = -1;
volatile int32_t x363 = INT32_MIN;
volatile int32_t t88 = 79169039;
t88 = (x361>(x362<=(x363%x364)));
if (t88 != 0) { NG(); } else { ; }
}
void f89(void) {
volatile int16_t x365 = -1;
static volatile int32_t x367 = INT32_MIN;
uint16_t x368 = 848U;
int32_t t89 = 308453;
t89 = (x365>(x366<=(x367%x368)));
if (t89 != 0) { NG(); } else { ; }
}
void f90(void) {
int16_t x371 = INT16_MIN;
static int64_t x372 = INT64_MIN;
t90 = (x369>(x370<=(x371%x372)));
if (t90 != 0) { NG(); } else { ; }
}
void f91(void) {
static int16_t x374 = -1;
static volatile int64_t x375 = INT64_MAX;
uint64_t x376 = 26570201494LLU;
int32_t t91 = 13063821;
t91 = (x373>(x374<=(x375%x376)));
if (t91 != 1) { NG(); } else { ; }
}
void f92(void) {
static int16_t x381 = 2726;
uint8_t x382 = 7U;
uint8_t x383 = UINT8_MAX;
static int32_t x384 = INT32_MIN;
volatile int32_t t92 = 0;
t92 = (x381>(x382<=(x383%x384)));
if (t92 != 1) { NG(); } else { ; }
}
void f93(void) {
uint16_t x385 = UINT16_MAX;
int8_t x386 = INT8_MIN;
int16_t x387 = 66;
volatile uint16_t x388 = UINT16_MAX;
int32_t t93 = -7;
t93 = (x385>(x386<=(x387%x388)));
if (t93 != 1) { NG(); } else { ; }
}
void f94(void) {
static uint64_t x390 = UINT64_MAX;
static int64_t x391 = INT64_MIN;
volatile uint64_t x392 = 287084859844506LLU;
int32_t t94 = 0;
t94 = (x389>(x390<=(x391%x392)));
if (t94 != 1) { NG(); } else { ; }
}
void f95(void) {
volatile int64_t x394 = -125755383LL;
int32_t t95 = -2810;
t95 = (x393>(x394<=(x395%x396)));
if (t95 != 1) { NG(); } else { ; }
}
void f96(void) {
uint32_t x397 = UINT32_MAX;
int16_t x398 = -1;
static uint16_t x399 = 3U;
static int16_t x400 = INT16_MIN;
t96 = (x397>(x398<=(x399%x400)));
if (t96 != 1) { NG(); } else { ; }
}
void f97(void) {
uint8_t x402 = 24U;
static int32_t x403 = -1;
uint8_t x404 = 72U;
static int32_t t97 = -470180;
t97 = (x401>(x402<=(x403%x404)));
if (t97 != 0) { NG(); } else { ; }
}
void f98(void) {
int16_t x405 = INT16_MIN;
int32_t x406 = INT32_MAX;
int32_t x408 = -1;
t98 = (x405>(x406<=(x407%x408)));
if (t98 != 0) { NG(); } else { ; }
}
void f99(void) {
int8_t x409 = -50;
volatile int64_t x410 = INT64_MAX;
int64_t x411 = INT64_MAX;
volatile int32_t t99 = -16509;
t99 = (x409>(x410<=(x411%x412)));
if (t99 != 0) { NG(); } else { ; }
}
void f100(void) {
uint32_t x413 = 2720U;
static uint32_t x414 = 10132U;
int8_t x415 = INT8_MIN;
static int8_t x416 = -1;
int32_t t100 = 0;
t100 = (x413>(x414<=(x415%x416)));
if (t100 != 1) { NG(); } else { ; }
}
void f101(void) {
int32_t x417 = 460143145;
uint32_t x418 = UINT32_MAX;
uint16_t x419 = UINT16_MAX;
uint64_t x420 = 21677500332LLU;
volatile int32_t t101 = -231825897;
t101 = (x417>(x418<=(x419%x420)));
if (t101 != 1) { NG(); } else { ; }
}
void f102(void) {
uint32_t x421 = 35U;
static uint64_t x422 = 3178716639LLU;
volatile uint16_t x423 = UINT16_MAX;
int16_t x424 = INT16_MAX;
volatile int32_t t102 = 0;
t102 = (x421>(x422<=(x423%x424)));
if (t102 != 1) { NG(); } else { ; }
}
void f103(void) {
int16_t x426 = INT16_MAX;
static volatile uint64_t x427 = 19LLU;
int8_t x428 = INT8_MIN;
int32_t t103 = 160973;
t103 = (x425>(x426<=(x427%x428)));
if (t103 != 0) { NG(); } else { ; }
}
void f104(void) {
static int32_t x429 = 113583;
int32_t x430 = -1;
int8_t x431 = INT8_MIN;
static volatile int32_t x432 = -660501;
int32_t t104 = 0;
t104 = (x429>(x430<=(x431%x432)));
if (t104 != 1) { NG(); } else { ; }
}
void f105(void) {
volatile int64_t x434 = INT64_MIN;
int16_t x435 = INT16_MIN;
int32_t x436 = -1;
static int32_t t105 = 79728;
t105 = (x433>(x434<=(x435%x436)));
if (t105 != 0) { NG(); } else { ; }
}
void f106(void) {
int32_t x437 = -1;
volatile int16_t x438 = -1;
int32_t x439 = -1711;
int64_t x440 = -166159767LL;
volatile int32_t t106 = -97732;
t106 = (x437>(x438<=(x439%x440)));
if (t106 != 0) { NG(); } else { ; }
}
void f107(void) {
volatile int64_t x441 = 94056176LL;
int64_t x442 = -1LL;
int64_t x443 = -1536404051643541LL;
static int8_t x444 = INT8_MIN;
int32_t t107 = -592;
t107 = (x441>(x442<=(x443%x444)));
if (t107 != 1) { NG(); } else { ; }
}
void f108(void) {
static volatile int32_t x445 = 857326;
volatile uint32_t x447 = UINT32_MAX;
volatile int64_t x448 = INT64_MAX;
int32_t t108 = -5629;
t108 = (x445>(x446<=(x447%x448)));
if (t108 != 1) { NG(); } else { ; }
}
void f109(void) {
int64_t x449 = 8222094670527LL;
int32_t x450 = INT32_MAX;
static volatile uint64_t x451 = 2470570888438LLU;
volatile int8_t x452 = INT8_MIN;
int32_t t109 = 1;
t109 = (x449>(x450<=(x451%x452)));
if (t109 != 1) { NG(); } else { ; }
}
void f110(void) {
static int16_t x453 = -1;
static uint32_t x454 = UINT32_MAX;
static int32_t x455 = INT32_MIN;
int16_t x456 = -1;
volatile int32_t t110 = -15;
t110 = (x453>(x454<=(x455%x456)));
if (t110 != 0) { NG(); } else { ; }
}
void f111(void) {
int32_t x457 = 12;
int64_t x458 = -1LL;
uint8_t x460 = 55U;
volatile int32_t t111 = 55843;
t111 = (x457>(x458<=(x459%x460)));
if (t111 != 1) { NG(); } else { ; }
}
void f112(void) {
int32_t x461 = INT32_MIN;
static int64_t x463 = -1LL;
int8_t x464 = INT8_MAX;
volatile int32_t t112 = 7232208;
t112 = (x461>(x462<=(x463%x464)));
if (t112 != 0) { NG(); } else { ; }
}
void f113(void) {
int16_t x469 = INT16_MIN;
uint32_t x471 = UINT32_MAX;
volatile int32_t x472 = 108529;
t113 = (x469>(x470<=(x471%x472)));
if (t113 != 0) { NG(); } else { ; }
}
void f114(void) {
uint8_t x473 = 25U;
volatile int16_t x474 = INT16_MAX;
int16_t x475 = INT16_MIN;
int32_t x476 = -1;
volatile int32_t t114 = -49547;
t114 = (x473>(x474<=(x475%x476)));
if (t114 != 1) { NG(); } else { ; }
}
void f115(void) {
int64_t x477 = -31083LL;
static int64_t x478 = INT64_MIN;
static int16_t x479 = -7212;
int32_t x480 = INT32_MIN;
int32_t t115 = 219;
t115 = (x477>(x478<=(x479%x480)));
if (t115 != 0) { NG(); } else { ; }
}
void f116(void) {
int8_t x481 = -1;
int64_t x482 = INT64_MIN;
static uint8_t x483 = UINT8_MAX;
static int32_t x484 = INT32_MAX;
t116 = (x481>(x482<=(x483%x484)));
if (t116 != 0) { NG(); } else { ; }
}
void f117(void) {
uint64_t x485 = UINT64_MAX;
int16_t x486 = -3;
volatile int32_t x487 = -1;
int32_t x488 = INT32_MAX;
t117 = (x485>(x486<=(x487%x488)));
if (t117 != 1) { NG(); } else { ; }
}
void f118(void) {
static int32_t x489 = INT32_MIN;
int16_t x490 = INT16_MAX;
uint8_t x491 = UINT8_MAX;
volatile int32_t x492 = INT32_MAX;
volatile int32_t t118 = -17554969;
t118 = (x489>(x490<=(x491%x492)));
if (t118 != 0) { NG(); } else { ; }
}
void f119(void) {
uint32_t x493 = 3162U;
static int32_t x495 = -1;
volatile int32_t t119 = -2;
t119 = (x493>(x494<=(x495%x496)));
if (t119 != 1) { NG(); } else { ; }
}
void f120(void) {
int64_t x497 = INT64_MIN;
uint32_t x498 = UINT32_MAX;
uint64_t x499 = 1056803250174352LLU;
int64_t x500 = INT64_MAX;
volatile int32_t t120 = -13;
t120 = (x497>(x498<=(x499%x500)));
if (t120 != 0) { NG(); } else { ; }
}
void f121(void) {
static int8_t x502 = INT8_MIN;
uint32_t x503 = UINT32_MAX;
int8_t x504 = INT8_MIN;
t121 = (x501>(x502<=(x503%x504)));
if (t121 != 0) { NG(); } else { ; }
}
void f122(void) {
uint8_t x505 = UINT8_MAX;
static int32_t x506 = 0;
int8_t x507 = INT8_MAX;
int16_t x508 = INT16_MIN;
t122 = (x505>(x506<=(x507%x508)));
if (t122 != 1) { NG(); } else { ; }
}
void f123(void) {
static uint32_t x511 = 1U;
int8_t x512 = INT8_MIN;
int32_t t123 = 28;
t123 = (x509>(x510<=(x511%x512)));
if (t123 != 0) { NG(); } else { ; }
}
void f124(void) {
volatile int32_t x513 = INT32_MAX;
static uint8_t x514 = UINT8_MAX;
static volatile int32_t x516 = INT32_MIN;
volatile int32_t t124 = 3946;
t124 = (x513>(x514<=(x515%x516)));
if (t124 != 1) { NG(); } else { ; }
}
void f125(void) {
uint64_t x517 = 265134523519221LLU;
uint8_t x518 = 2U;
int16_t x519 = INT16_MAX;
volatile uint32_t x520 = 59U;
int32_t t125 = -114843638;
t125 = (x517>(x518<=(x519%x520)));
if (t125 != 1) { NG(); } else { ; }
}
void f126(void) {
volatile uint8_t x521 = 64U;
volatile uint64_t x522 = 6272961LLU;
static int16_t x523 = 1224;
int32_t x524 = INT32_MIN;
t126 = (x521>(x522<=(x523%x524)));
if (t126 != 1) { NG(); } else { ; }
}
void f127(void) {
int8_t x525 = INT8_MIN;
static volatile int8_t x526 = INT8_MAX;
int8_t x527 = INT8_MAX;
int32_t x528 = -14510761;
int32_t t127 = -251167;
t127 = (x525>(x526<=(x527%x528)));
if (t127 != 0) { NG(); } else { ; }
}
void f128(void) {
int16_t x529 = INT16_MIN;
volatile int8_t x531 = INT8_MIN;
volatile uint16_t x532 = 2U;
int32_t t128 = 2524;
t128 = (x529>(x530<=(x531%x532)));
if (t128 != 0) { NG(); } else { ; }
}
void f129(void) {
static volatile uint64_t x533 = 2730767LLU;
int64_t x534 = INT64_MIN;
volatile int32_t x535 = -1;
static int64_t x536 = INT64_MIN;
volatile int32_t t129 = 565;
t129 = (x533>(x534<=(x535%x536)));
if (t129 != 1) { NG(); } else { ; }
}
void f130(void) {
uint64_t x537 = 6LLU;
uint8_t x538 = 127U;
int64_t x539 = INT64_MAX;
uint16_t x540 = 884U;
static volatile int32_t t130 = -687;
t130 = (x537>(x538<=(x539%x540)));
if (t130 != 1) { NG(); } else { ; }
}
void f131(void) {
volatile uint32_t x541 = 449336U;
uint32_t x542 = UINT32_MAX;
volatile int32_t x543 = INT32_MAX;
volatile int16_t x544 = INT16_MAX;
t131 = (x541>(x542<=(x543%x544)));
if (t131 != 1) { NG(); } else { ; }
}
void f132(void) {
uint8_t x546 = 17U;
int8_t x547 = -1;
static uint32_t x548 = UINT32_MAX;
volatile int32_t t132 = 117;
t132 = (x545>(x546<=(x547%x548)));
if (t132 != 1) { NG(); } else { ; }
}
void f133(void) {
int8_t x549 = -1;
volatile int64_t x550 = INT64_MIN;
uint64_t x551 = UINT64_MAX;
int32_t t133 = -8;
t133 = (x549>(x550<=(x551%x552)));
if (t133 != 0) { NG(); } else { ; }
}
void f134(void) {
int64_t x553 = 3482556509589862217LL;
static uint32_t x554 = UINT32_MAX;
int16_t x556 = -1;
volatile int32_t t134 = 35158221;
t134 = (x553>(x554<=(x555%x556)));
if (t134 != 1) { NG(); } else { ; }
}
void f135(void) {
int16_t x557 = -92;
volatile uint8_t x558 = 4U;
int8_t x560 = -1;
t135 = (x557>(x558<=(x559%x560)));
if (t135 != 0) { NG(); } else { ; }
}
void f136(void) {
volatile int64_t x561 = INT64_MAX;
volatile uint8_t x562 = 4U;
volatile uint64_t x563 = 6175724944869LLU;
int8_t x564 = 1;
static volatile int32_t t136 = 5;
t136 = (x561>(x562<=(x563%x564)));
if (t136 != 1) { NG(); } else { ; }
}
void f137(void) {
int8_t x565 = -1;
int64_t x566 = INT64_MAX;
volatile int32_t x568 = INT32_MAX;
volatile int32_t t137 = -448;
t137 = (x565>(x566<=(x567%x568)));
if (t137 != 0) { NG(); } else { ; }
}
void f138(void) {
int16_t x569 = INT16_MIN;
volatile uint8_t x570 = 0U;
uint64_t x572 = UINT64_MAX;
volatile int32_t t138 = 9;
t138 = (x569>(x570<=(x571%x572)));
if (t138 != 0) { NG(); } else { ; }
}
void f139(void) {
volatile uint8_t x573 = UINT8_MAX;
int16_t x574 = INT16_MIN;
int64_t x575 = -114228546248LL;
int8_t x576 = -1;
t139 = (x573>(x574<=(x575%x576)));
if (t139 != 1) { NG(); } else { ; }
}
void f140(void) {
uint16_t x577 = 19711U;
int64_t x578 = INT64_MIN;
static int8_t x579 = INT8_MIN;
uint8_t x580 = 108U;
volatile int32_t t140 = -2;
t140 = (x577>(x578<=(x579%x580)));
if (t140 != 1) { NG(); } else { ; }
}
void f141(void) {
volatile uint32_t x581 = 82U;
uint64_t x582 = UINT64_MAX;
uint8_t x584 = UINT8_MAX;
t141 = (x581>(x582<=(x583%x584)));
if (t141 != 1) { NG(); } else { ; }
}
void f142(void) {
uint8_t x585 = UINT8_MAX;
uint64_t x586 = 805318344LLU;
uint8_t x587 = 1U;
static int32_t t142 = -7455;
t142 = (x585>(x586<=(x587%x588)));
if (t142 != 1) { NG(); } else { ; }
}
void f143(void) {
volatile int16_t x590 = -1233;
uint64_t x591 = 1LLU;
uint64_t x592 = UINT64_MAX;
volatile int32_t t143 = -110;
t143 = (x589>(x590<=(x591%x592)));
if (t143 != 0) { NG(); } else { ; }
}
void f144(void) {
int32_t x593 = -72;
int16_t x594 = INT16_MAX;
volatile int8_t x595 = INT8_MIN;
uint16_t x596 = 12U;
int32_t t144 = 16531;
t144 = (x593>(x594<=(x595%x596)));
if (t144 != 0) { NG(); } else { ; }
}
void f145(void) {
int64_t x597 = INT64_MIN;
int64_t x598 = INT64_MIN;
uint32_t x599 = UINT32_MAX;
t145 = (x597>(x598<=(x599%x600)));
if (t145 != 0) { NG(); } else { ; }
}
void f146(void) {
volatile int32_t x601 = 162932224;
static int16_t x603 = 53;
uint8_t x604 = UINT8_MAX;
volatile int32_t t146 = 131638894;
t146 = (x601>(x602<=(x603%x604)));
if (t146 != 1) { NG(); } else { ; }
}
void f147(void) {
int16_t x605 = 2;
uint8_t x607 = 21U;
int32_t x608 = INT32_MIN;
int32_t t147 = 14;
t147 = (x605>(x606<=(x607%x608)));
if (t147 != 1) { NG(); } else { ; }
}
void f148(void) {
volatile uint8_t x609 = UINT8_MAX;
int64_t x610 = 1936852556709LL;
int32_t x611 = 1;
volatile int32_t t148 = 123895;
t148 = (x609>(x610<=(x611%x612)));
if (t148 != 1) { NG(); } else { ; }
}
void f149(void) {
uint16_t x613 = 1U;
volatile int64_t x614 = -1LL;
uint16_t x615 = 228U;
int32_t x616 = INT32_MIN;
static int32_t t149 = 407;
t149 = (x613>(x614<=(x615%x616)));
if (t149 != 0) { NG(); } else { ; }
}
void f150(void) {
int8_t x617 = INT8_MAX;
static volatile uint8_t x618 = 0U;
uint32_t x619 = UINT32_MAX;
int32_t t150 = -2006;
t150 = (x617>(x618<=(x619%x620)));
if (t150 != 1) { NG(); } else { ; }
}
void f151(void) {
int64_t x621 = INT64_MIN;
static int32_t x622 = -37;
int32_t x623 = INT32_MIN;
t151 = (x621>(x622<=(x623%x624)));
if (t151 != 0) { NG(); } else { ; }
}
void f152(void) {
uint32_t x625 = 35895U;
int16_t x626 = 0;
int16_t x627 = INT16_MAX;
t152 = (x625>(x626<=(x627%x628)));
if (t152 != 1) { NG(); } else { ; }
}
void f153(void) {
volatile int8_t x629 = -1;
volatile uint8_t x630 = 12U;
int64_t x631 = INT64_MIN;
int8_t x632 = INT8_MAX;
volatile int32_t t153 = -2;
t153 = (x629>(x630<=(x631%x632)));
if (t153 != 0) { NG(); } else { ; }
}
void f154(void) {
int32_t x633 = 4;
int64_t x634 = INT64_MIN;
uint16_t x636 = 42U;
int32_t t154 = 93;
t154 = (x633>(x634<=(x635%x636)));
if (t154 != 1) { NG(); } else { ; }
}
void f155(void) {
int32_t x641 = -2595776;
int8_t x642 = 4;
int16_t x643 = 15385;
int32_t t155 = -1;
t155 = (x641>(x642<=(x643%x644)));
if (t155 != 0) { NG(); } else { ; }
}
void f156(void) {
uint64_t x645 = 95LLU;
int32_t x646 = INT32_MAX;
int64_t x647 = INT64_MAX;
int16_t x648 = INT16_MIN;
int32_t t156 = -148780114;
t156 = (x645>(x646<=(x647%x648)));
if (t156 != 1) { NG(); } else { ; }
}
void f157(void) {
volatile uint64_t x650 = UINT64_MAX;
int16_t x651 = INT16_MIN;
int16_t x652 = -13242;
volatile int32_t t157 = 101370288;
t157 = (x649>(x650<=(x651%x652)));
if (t157 != 1) { NG(); } else { ; }
}
void f158(void) {
static uint16_t x655 = 7U;
int32_t x656 = INT32_MAX;
volatile int32_t t158 = -21277289;
t158 = (x653>(x654<=(x655%x656)));
if (t158 != 1) { NG(); } else { ; }
}
void f159(void) {
int32_t x657 = INT32_MAX;
int8_t x659 = INT8_MIN;
int16_t x660 = INT16_MIN;
int32_t t159 = -132296;
t159 = (x657>(x658<=(x659%x660)));
if (t159 != 1) { NG(); } else { ; }
}
void f160(void) {
static volatile int16_t x661 = INT16_MAX;
uint64_t x662 = 552LLU;
uint16_t x663 = 93U;
static volatile uint64_t x664 = UINT64_MAX;
t160 = (x661>(x662<=(x663%x664)));
if (t160 != 1) { NG(); } else { ; }
}
void f161(void) {
int8_t x665 = 4;
uint64_t x667 = UINT64_MAX;
int16_t x668 = INT16_MIN;
int32_t t161 = -103953;
t161 = (x665>(x666<=(x667%x668)));
if (t161 != 1) { NG(); } else { ; }
}
void f162(void) {
uint8_t x669 = 70U;
volatile int32_t x670 = -50;
static int16_t x671 = -1;
int32_t x672 = INT32_MIN;
t162 = (x669>(x670<=(x671%x672)));
if (t162 != 1) { NG(); } else { ; }
}
void f163(void) {
int32_t x673 = INT32_MIN;
uint32_t x674 = 508996U;
volatile uint8_t x675 = UINT8_MAX;
t163 = (x673>(x674<=(x675%x676)));
if (t163 != 0) { NG(); } else { ; }
}
void f164(void) {
volatile int32_t x677 = 0;
static uint64_t x678 = 159400168308LLU;
static volatile int64_t x679 = 1130437060536229860LL;
static int64_t x680 = 34293435261LL;
t164 = (x677>(x678<=(x679%x680)));
if (t164 != 0) { NG(); } else { ; }
}
void f165(void) {
volatile int64_t x681 = INT64_MAX;
uint64_t x682 = 88780516LLU;
uint64_t x683 = 23406573271075712LLU;
int32_t t165 = -7429752;
t165 = (x681>(x682<=(x683%x684)));
if (t165 != 1) { NG(); } else { ; }
}
void f166(void) {
int32_t x685 = 208;
uint32_t x686 = 4912065U;
int32_t t166 = 60;
t166 = (x685>(x686<=(x687%x688)));
if (t166 != 1) { NG(); } else { ; }
}
void f167(void) {
int8_t x689 = INT8_MAX;
int64_t x690 = INT64_MIN;
uint32_t x691 = 1945589006U;
uint8_t x692 = 14U;
t167 = (x689>(x690<=(x691%x692)));
if (t167 != 1) { NG(); } else { ; }
}
void f168(void) {
int8_t x693 = INT8_MIN;
uint8_t x695 = 7U;
t168 = (x693>(x694<=(x695%x696)));
if (t168 != 0) { NG(); } else { ; }
}
void f169(void) {
volatile int64_t x697 = -256126237LL;
int16_t x698 = INT16_MIN;
uint64_t x699 = UINT64_MAX;
int32_t t169 = -800451225;
t169 = (x697>(x698<=(x699%x700)));
if (t169 != 0) { NG(); } else { ; }
}
void f170(void) {
int32_t x707 = 7;
t170 = (x705>(x706<=(x707%x708)));
if (t170 != 1) { NG(); } else { ; }
}
void f171(void) {
volatile int64_t x709 = 793LL;
volatile int32_t x711 = INT32_MAX;
static volatile int32_t x712 = INT32_MAX;
static volatile int32_t t171 = 13167;
t171 = (x709>(x710<=(x711%x712)));
if (t171 != 1) { NG(); } else { ; }
}
void f172(void) {
int64_t x713 = INT64_MIN;
volatile uint16_t x714 = 252U;
int8_t x715 = INT8_MIN;
int8_t x716 = -1;
static int32_t t172 = -71012;
t172 = (x713>(x714<=(x715%x716)));
if (t172 != 0) { NG(); } else { ; }
}
void f173(void) {
volatile int16_t x718 = 0;
int8_t x719 = INT8_MIN;
t173 = (x717>(x718<=(x719%x720)));
if (t173 != 0) { NG(); } else { ; }
}
void f174(void) {
uint8_t x722 = 21U;
volatile int32_t x723 = INT32_MIN;
int32_t x724 = -1;
int32_t t174 = -16;
t174 = (x721>(x722<=(x723%x724)));
if (t174 != 0) { NG(); } else { ; }
}
void f175(void) {
volatile int16_t x725 = -8519;
static int32_t x726 = 52;
volatile uint8_t x727 = 116U;
static int64_t x728 = INT64_MIN;
t175 = (x725>(x726<=(x727%x728)));
if (t175 != 0) { NG(); } else { ; }
}
void f176(void) {
static int32_t x729 = INT32_MAX;
static uint16_t x730 = UINT16_MAX;
uint16_t x731 = UINT16_MAX;
int32_t t176 = 2266;
t176 = (x729>(x730<=(x731%x732)));
if (t176 != 1) { NG(); } else { ; }
}
void f177(void) {
volatile uint32_t x733 = UINT32_MAX;
uint64_t x734 = UINT64_MAX;
int16_t x735 = -1;
static int64_t x736 = 758909643201LL;
int32_t t177 = -6379;
t177 = (x733>(x734<=(x735%x736)));
if (t177 != 1) { NG(); } else { ; }
}
void f178(void) {
static volatile uint16_t x737 = 59U;
uint8_t x738 = 1U;
int8_t x739 = INT8_MAX;
uint64_t x740 = 14101550850762LLU;
int32_t t178 = -4810;
t178 = (x737>(x738<=(x739%x740)));
if (t178 != 1) { NG(); } else { ; }
}
void f179(void) {
int32_t x741 = 1778533;
int32_t x743 = -2950037;
volatile uint32_t x744 = 2479U;
volatile int32_t t179 = 1404423;
t179 = (x741>(x742<=(x743%x744)));
if (t179 != 1) { NG(); } else { ; }
}
void f180(void) {
static int8_t x745 = INT8_MIN;
int64_t x746 = INT64_MIN;
int32_t x747 = INT32_MAX;
int32_t x748 = INT32_MAX;
int32_t t180 = -1;
t180 = (x745>(x746<=(x747%x748)));
if (t180 != 0) { NG(); } else { ; }
}
void f181(void) {
int32_t x749 = INT32_MIN;
uint16_t x752 = 50U;
int32_t t181 = -3323;
t181 = (x749>(x750<=(x751%x752)));
if (t181 != 0) { NG(); } else { ; }
}
void f182(void) {
uint32_t x754 = UINT32_MAX;
uint64_t x755 = UINT64_MAX;
int16_t x756 = -609;
volatile int32_t t182 = -228652833;
t182 = (x753>(x754<=(x755%x756)));
if (t182 != 0) { NG(); } else { ; }
}
void f183(void) {
int16_t x757 = INT16_MIN;
static uint16_t x759 = 21718U;
static volatile uint8_t x760 = 23U;
t183 = (x757>(x758<=(x759%x760)));
if (t183 != 0) { NG(); } else { ; }
}
void f184(void) {
static volatile uint16_t x761 = 65U;
static uint16_t x762 = 3025U;
volatile int32_t x763 = INT32_MAX;
volatile uint8_t x764 = 2U;
int32_t t184 = 36253922;
t184 = (x761>(x762<=(x763%x764)));
if (t184 != 1) { NG(); } else { ; }
}
void f185(void) {
static int32_t x765 = INT32_MAX;
volatile int8_t x766 = INT8_MIN;
int64_t x767 = -1LL;
uint16_t x768 = 98U;
int32_t t185 = 25599429;
t185 = (x765>(x766<=(x767%x768)));
if (t185 != 1) { NG(); } else { ; }
}
void f186(void) {
static volatile uint8_t x770 = UINT8_MAX;
volatile int16_t x771 = -2018;
int32_t t186 = -445001834;
t186 = (x769>(x770<=(x771%x772)));
if (t186 != 0) { NG(); } else { ; }
}
void f187(void) {
int8_t x773 = INT8_MIN;
int16_t x774 = -1247;
uint32_t x775 = UINT32_MAX;
int32_t x776 = INT32_MIN;
int32_t t187 = -3147;
t187 = (x773>(x774<=(x775%x776)));
if (t187 != 0) { NG(); } else { ; }
}
void f188(void) {
int64_t x777 = 4074181159LL;
int64_t x778 = INT64_MIN;
int8_t x779 = INT8_MAX;
int64_t x780 = INT64_MIN;
volatile int32_t t188 = 266867;
t188 = (x777>(x778<=(x779%x780)));
if (t188 != 1) { NG(); } else { ; }
}
void f189(void) {
int64_t x781 = -4127891091032155658LL;
int16_t x783 = INT16_MIN;
t189 = (x781>(x782<=(x783%x784)));
if (t189 != 0) { NG(); } else { ; }
}
void f190(void) {
static volatile int32_t x785 = 1358;
int32_t x786 = 481;
int16_t x788 = 2;
int32_t t190 = 190;
t190 = (x785>(x786<=(x787%x788)));
if (t190 != 1) { NG(); } else { ; }
}
void f191(void) {
volatile int64_t x789 = -1LL;
uint16_t x791 = UINT16_MAX;
int64_t x792 = 249532LL;
int32_t t191 = -1;
t191 = (x789>(x790<=(x791%x792)));
if (t191 != 0) { NG(); } else { ; }
}
void f192(void) {
volatile uint8_t x793 = UINT8_MAX;
uint16_t x795 = 5U;
int32_t x796 = -1;
int32_t t192 = 97041249;
t192 = (x793>(x794<=(x795%x796)));
if (t192 != 1) { NG(); } else { ; }
}
void f193(void) {
int32_t x797 = 382000;
int16_t x799 = -1;
int64_t x800 = -139572559154LL;
t193 = (x797>(x798<=(x799%x800)));
if (t193 != 1) { NG(); } else { ; }
}
void f194(void) {
static int64_t x801 = -27LL;
int8_t x803 = 0;
uint64_t x804 = UINT64_MAX;
int32_t t194 = -442424;
t194 = (x801>(x802<=(x803%x804)));
if (t194 != 0) { NG(); } else { ; }
}
void f195(void) {
int32_t x806 = INT32_MIN;
int64_t x807 = 25778005893521225LL;
uint64_t x808 = UINT64_MAX;
volatile int32_t t195 = 693230;
t195 = (x805>(x806<=(x807%x808)));
if (t195 != 1) { NG(); } else { ; }
}
void f196(void) {
int64_t x809 = -1LL;
int64_t x810 = -30078048LL;
volatile int32_t x812 = -1;
static int32_t t196 = 2186178;
t196 = (x809>(x810<=(x811%x812)));
if (t196 != 0) { NG(); } else { ; }
}
void f197(void) {
static int16_t x813 = INT16_MIN;
int32_t x814 = INT32_MIN;
int32_t x815 = INT32_MAX;
t197 = (x813>(x814<=(x815%x816)));
if (t197 != 0) { NG(); } else { ; }
}
void f198(void) {
int16_t x817 = -1;
static volatile uint16_t x818 = 1U;
uint64_t x820 = UINT64_MAX;
int32_t t198 = -2;
t198 = (x817>(x818<=(x819%x820)));
if (t198 != 0) { NG(); } else { ; }
}
void f199(void) {
uint32_t x821 = UINT32_MAX;
volatile int32_t x822 = 31394;
int64_t x823 = -3332361816LL;
static int32_t t199 = -2437;
t199 = (x821>(x822<=(x823%x824)));
if (t199 != 1) { NG(); } else { ; }
}
int main(void) {
f0();
f1();
f2();
f3();
f4();
f5();
f6();
f7();
f8();
f9();
f10();
f11();
f12();
f13();
f14();
f15();
f16();
f17();
f18();
f19();
f20();
f21();
f22();
f23();
f24();
f25();
f26();
f27();
f28();
f29();
f30();
f31();
f32();
f33();
f34();
f35();
f36();
f37();
f38();
f39();
f40();
f41();
f42();
f43();
f44();
f45();
f46();
f47();
f48();
f49();
f50();
f51();
f52();
f53();
f54();
f55();
f56();
f57();
f58();
f59();
f60();
f61();
f62();
f63();
f64();
f65();
f66();
f67();
f68();
f69();
f70();
f71();
f72();
f73();
f74();
f75();
f76();
f77();
f78();
f79();
f80();
f81();
f82();
f83();
f84();
f85();
f86();
f87();
f88();
f89();
f90();
f91();
f92();
f93();
f94();
f95();
f96();
f97();
f98();
f99();
f100();
f101();
f102();
f103();
f104();
f105();
f106();
f107();
f108();
f109();
f110();
f111();
f112();
f113();
f114();
f115();
f116();
f117();
f118();
f119();
f120();
f121();
f122();
f123();
f124();
f125();
f126();
f127();
f128();
f129();
f130();
f131();
f132();
f133();
f134();
f135();
f136();
f137();
f138();
f139();
f140();
f141();
f142();
f143();
f144();
f145();
f146();
f147();
f148();
f149();
f150();
f151();
f152();
f153();
f154();
f155();
f156();
f157();
f158();
f159();
f160();
f161();
f162();
f163();
f164();
f165();
f166();
f167();
f168();
f169();
f170();
f171();
f172();
f173();
f174();
f175();
f176();
f177();
f178();
f179();
f180();
f181();
f182();
f183();
f184();
f185();
f186();
f187();
f188();
f189();
f190();
f191();
f192();
f193();
f194();
f195();
f196();
f197();
f198();
f199();
return 0;
} | c |
include/al/iuse/IUseAreaObj.h | 3096/starlight | 385 | 5830356 | /**
* @file IUseAreaObj.h
* @brief Basic implementation of an area object.
*/
#pragma once
namespace al
{
class AreaObjDirector;
class IUseAreaObj
{
public:
virtual al::AreaObjDirector* getAreaObjDirector() const = 0;
};
}; | c |
libbrillo/brillo/streams/fake_stream.h | Toromino/chromiumos-platform2 | 4 | 7828939 | // Copyright 2015 The Chromium OS 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 LIBBRILLO_BRILLO_STREAMS_FAKE_STREAM_H_
#define LIBBRILLO_BRILLO_STREAMS_FAKE_STREAM_H_
#include <queue>
#include <string>
#include <base/callback_forward.h>
#include <base/macros.h>
#include <base/time/clock.h>
#include <base/time/time.h>
#include <brillo/secure_blob.h>
#include <brillo/streams/stream.h>
namespace brillo {
// Fake stream implementation for testing.
// This class allows to provide data for the stream in tests that can be later
// read through the Stream interface. Also, data written into the stream can be
// later inspected and verified.
//
// NOTE: This class provides a fake implementation for streams with separate
// input and output channels. That is, read and write operations do not affect
// each other. Also, the stream implementation is sequential only (no seeking).
// Good examples of a use case for fake stream are:
// - read-only sequential streams (file, memory, pipe, ...)
// - write-only sequential streams (same as above)
// - independent channel read-write streams (sockets, ...)
//
// For more complex read/write stream test scenarios using a real MemoryStream
// or temporary FileStream is probably a better choice.
class FakeStream : public Stream {
public:
// Construct a new instance of the fake stream.
// mode - expected read/write mode supported by the stream.
// clock - the clock to use to get the current time.
FakeStream(Stream::AccessMode mode, base::Clock* clock);
FakeStream(const FakeStream&) = delete;
FakeStream& operator=(const FakeStream&) = delete;
// Add data packets to the read queue of the stream.
// Optional |delay| indicates that the data packet should be delayed.
void AddReadPacketData(base::TimeDelta delay, const void* data, size_t size);
void AddReadPacketData(base::TimeDelta delay, brillo::Blob data);
void AddReadPacketString(base::TimeDelta delay, const std::string& data);
// Schedule a read error by adding a special error packet to the queue.
void QueueReadError(base::TimeDelta delay);
void QueueReadErrorWithMessage(base::TimeDelta delay,
const std::string& message);
// Resets read queue and clears any input data buffers.
void ClearReadQueue();
// Add expectations for output data packets to be written by the stream.
// Optional |delay| indicates that the initial write operation for the data in
// the packet should be delayed.
// ExpectWritePacketSize just limits the size of output packet while
// ExpectWritePacketData also validates that the data matches that of |data|.
void ExpectWritePacketSize(base::TimeDelta delay, size_t data_size);
void ExpectWritePacketData(base::TimeDelta delay,
const void* data,
size_t size);
void ExpectWritePacketData(base::TimeDelta delay, brillo::Blob data);
void ExpectWritePacketString(base::TimeDelta delay, const std::string& data);
// Schedule a write error by adding a special error packet to the queue.
void QueueWriteError(base::TimeDelta delay);
void QueueWriteErrorWithMessage(base::TimeDelta delay,
const std::string& message);
// Resets write queue and clears any output data buffers.
void ClearWriteQueue();
// Returns the output data accumulated so far by all complete write packets,
// or explicitly flushed.
const brillo::Blob& GetFlushedOutputData() const;
std::string GetFlushedOutputDataAsString() const;
// Overrides from brillo::Stream.
bool IsOpen() const override { return is_open_; }
bool CanRead() const override;
bool CanWrite() const override;
bool CanSeek() const override { return false; }
bool CanGetSize() const override { return false; }
uint64_t GetSize() const override { return 0; }
bool SetSizeBlocking(uint64_t size, ErrorPtr* error) override;
uint64_t GetRemainingSize() const override { return 0; }
uint64_t GetPosition() const override { return 0; }
bool Seek(int64_t offset,
Whence whence,
uint64_t* new_position,
ErrorPtr* error) override;
bool ReadNonBlocking(void* buffer,
size_t size_to_read,
size_t* size_read,
bool* end_of_stream,
ErrorPtr* error) override;
bool WriteNonBlocking(const void* buffer,
size_t size_to_write,
size_t* size_written,
ErrorPtr* error) override;
bool FlushBlocking(ErrorPtr* error) override;
bool CloseBlocking(ErrorPtr* error) override;
bool WaitForData(AccessMode mode,
const base::Callback<void(AccessMode)>& callback,
ErrorPtr* error) override;
bool WaitForDataBlocking(AccessMode in_mode,
base::TimeDelta timeout,
AccessMode* out_mode,
ErrorPtr* error) override;
private:
// Input data packet to be placed on the read queue.
struct InputDataPacket {
brillo::Blob data; // Data to be read.
base::TimeDelta delay_before; // Possible delay for the first read.
bool read_error{false}; // Set to true if this packet generates an error.
};
// Output data packet to be placed on the write queue.
struct OutputDataPacket {
size_t expected_size{0}; // Output packet size
brillo::Blob data; // Possible data to verify the output with.
base::TimeDelta delay_before; // Possible delay for the first write.
bool write_error{false}; // Set to true if this packet generates an error.
};
// Check if there is any pending read data in the input buffer.
bool IsReadBufferEmpty() const;
// Pops the next read packet from the queue and sets its data into the
// internal input buffer.
bool PopReadPacket();
// Check if the output buffer is full.
bool IsWriteBufferFull() const;
// Moves the current full output buffer into |all_output_data_|, clears the
// buffer, and pops the information about the next expected output packet
// from the write queue.
bool PopWritePacket();
bool is_open_{true};
Stream::AccessMode mode_;
base::Clock* clock_;
// Internal data for read operations.
std::queue<InputDataPacket> incoming_queue_;
base::Time delay_input_until_;
brillo::Blob input_buffer_;
size_t input_ptr_{0};
bool report_read_error_{false};
// Internal data for write operations.
std::queue<OutputDataPacket> outgoing_queue_;
base::Time delay_output_until_;
brillo::Blob output_buffer_;
brillo::Blob expected_output_data_;
size_t max_output_buffer_size_{0};
bool report_write_error_{false};
brillo::Blob all_output_data_;
};
} // namespace brillo
#endif // LIBBRILLO_BRILLO_STREAMS_FAKE_STREAM_H_ | c |
ZF/ZFCore/zfsrc/ZFCore/ZFCoreDef/ZFIterator.h | ZFFrameworkDist/ZFFramework | 57 | 1745538 | /**
* @file ZFIterator.h
* @brief iterator in ZFFramework
*/
#ifndef _ZFI_ZFIterator_h_
#define _ZFI_ZFIterator_h_
#include "ZFCoreTypeDef.h"
ZF_NAMESPACE_GLOBAL_BEGIN
/**
* @brief iterator for ZFFramework
*
* zfiterator is an abstract iterator holder,
* which simply stores an void * pointer for implementations
* to achieve iterator logic\n
* \n
* typically, you may use iterators like this:
* @code
* for(zfiterator it = someIterable.iterator();
* someIterable.iteratorValid(it);
* someIterable.iteratorNext(it))
* {
* // get current value located by iterator,
* // then move iterator to next
* const SomeType &value = someIterable.iteratorValue(it);
*
* // or you may simply want to access without move iterator
* // const SomeType &value = someIterable.iteratorValue(it);
* }
* @endcode
* for key-value container,
* access by iterator should return value,
* and should supply key-value version of iterator access:
* @code
* for(zfiterator it = keyValueIterable.iteratorFind(key);
* keyValueIterable.iteratorValid(it);
* keyValueIterable.iteratorNext(it))
* {
* // access key and value
* KeyType key = keyValueIterable.iteratorPair(it).key;
* ValueType value = keyValueIterable.iteratorValue(it);
* }
* @endcode
* \n
* for implementations,
* you should construct a zfiterator with a void *pointer,
* a delete callback and a copy callback,
* then you may use #data to access the stored void *pointer
* to achieve your implementation
*/
zffinal zfclassLikePOD ZF_ENV_EXPORT zfiterator
{
public:
/**
* @brief delete callback for implementation
*/
typedef void (*DeleteCallback)(ZF_IN void *data);
/**
* @brief copy callback for implementation
*/
typedef void *(*CopyCallback)(ZF_IN void *data);
public:
/**
* @brief helper method to compare two iterator, for implementation only
*/
template<typename T_Data>
static zfbool iteratorEqual(ZF_IN zfiterator const &it0, ZF_IN zfiterator const &it1)
{
T_Data d0 = it0.data<T_Data>();
T_Data d1 = it1.data<T_Data>();
return ((d0 == zfnull && d1 == zfnull) || (d0 != zfnull && d1 != zfnull && *d0 == *d1));
}
public:
/**
* @brief create a dummy iterator
*/
zfiterator(void)
{
zfmemset(&d, 0, sizeof(zfiterator::_Data));
}
/**
* @brief implementations of iterables must use this to create an iterator,
* see #zfiterator
*/
zfiterator(ZF_IN void *data,
ZF_IN zfiterator::DeleteCallback deleteCallback,
ZF_IN zfiterator::CopyCallback copyCallback)
{
d.data = data;
d.deleteCallback = deleteCallback;
d.copyCallback = copyCallback;
}
/**
* @brief implementations may use this method to access data passed from constructor,
* see #zfiterator
*/
inline void *data(void) const
{
return d.data;
}
/**
* @brief see #data
*/
template<typename T_Data>
inline T_Data data(void) const
{
return (T_Data)(d.data);
}
/**
* @brief for implementation to change the internal data
*/
inline void iteratorImplDataChange(ZF_IN void *newData)
{
if(d.data && d.deleteCallback)
{
d.deleteCallback(d.data);
}
d.data = newData;
}
public:
/** @cond ZFPrivateDoc */
zfiterator(ZF_IN const zfiterator &ref)
{
if(ref.d.data)
{
if(ref.d.copyCallback)
{
d.data = ref.d.copyCallback(ref.d.data);
}
else
{
d.data = ref.d.data;
}
d.deleteCallback = ref.d.deleteCallback;
d.copyCallback = ref.d.copyCallback;
}
else
{
zfmemset(&d, 0, sizeof(zfiterator::_Data));
}
}
~zfiterator(void)
{
if(d.data && d.deleteCallback)
{
d.deleteCallback(d.data);
}
}
zfiterator &operator = (ZF_IN const zfiterator &ref)
{
if(this != &ref)
{
if(d.data && d.deleteCallback)
{
d.deleteCallback(d.data);
}
if(ref.d.data)
{
if(ref.d.copyCallback)
{
d.data = ref.d.copyCallback(ref.d.data);
}
else
{
d.data = ref.d.data;
}
d.deleteCallback = ref.d.deleteCallback;
d.copyCallback = ref.d.copyCallback;
}
else
{
zfmemset(&d, 0, sizeof(zfiterator::_Data));
}
}
return *this;
}
zfbool operator == (ZF_IN const zfiterator &ref) const
{
return (d.data == ref.d.data
&& d.deleteCallback == ref.d.deleteCallback
&& d.copyCallback == ref.d.copyCallback
);
}
inline zfbool operator != (ZF_IN const zfiterator &ref) const {return !this->operator == (ref);}
/** @endcond */
private:
zfclassPOD _Data
{
public:
void *data;
zfiterator::DeleteCallback deleteCallback;
zfiterator::CopyCallback copyCallback;
};
_Data d;
};
extern ZF_ENV_EXPORT const zfiterator _ZFP_zfiteratorInvalid;
/**
* @brief invalid iterator
* @note compare another iterator with this value is not safe,
* always use the check method that container supplys is recommended,
* such as aArray.iteratorValid(it)
*/
#define zfiteratorInvalid() _ZFP_zfiteratorInvalid
ZF_NAMESPACE_GLOBAL_END
#endif // #ifndef _ZFI_ZFIterator_h_ | c |
src/Practice/CozyThunder.Core/HttpClient.h | zpublic/cozy | 48 | 519430 | #ifndef __COZY_HTTP_CLIENT__
#define __COZY_HTTP_CLIENT__
#include "HttpDef.h"
namespace Cozy
{
class HttpClient
{
public:
HttpClient();
~HttpClient();
public:
HttpStatusCode Get(const std::string& strUrl, const IBuffer* input, IBuffer* output);
HttpStatusCode Post(const std::string& strUrl, const IBuffer* input, IBuffer* output);
HttpStatusCode DownloadFile(const std::string& strUrl, IBuffer* output);
std::size_t GetFileSize(const std::string& strUrl);
public:
void SetEnableSSL(bool bIsEnableSSL);
bool GetEnableSSL() const;
void SetEnableCookie(bool bIsEnableCookie);
bool GetEnableCookie() const;
HttpCookie GetCookie() const;
void SetEnableAutoRedirect(bool bIsEnableAutoRedirect);
bool GetEnableAutoRedirect() const;
void SetTimeLimit(HttpLimitType nTimeLimit);
HttpLimitType GetTimeLimit() const;
void SetSpeedLimit(HttpLimitType nSpeedLimit);
HttpLimitType GetSpeedLimit() const;
void AppendHttpHeader(const HttpHeader& header);
private:
std::string __CreateHeader(const HttpHeader& header);
HttpStatusCode __SendRequest(const std::string& strUrl, const IBuffer* input, IBuffer* output, bool isGetMethod);
static std::size_t __WriteCallback(void* pvData, std::size_t nSize, std::size_t nCount, void* pvParam);
private:
HttpHeaderList m_HeaderList;
HttpCookie m_cookie;
HttpLimitType m_nSpeedLimit;
HttpLimitType m_nTimeLimit;
bool m_bEnableSSL;
bool m_bEnableCookie;
bool m_bEnableAutoRedirect;
};
}
#endif // __COZY_HTTP_CLIENT__ | c |
SOFTWARE/A64-TERES/u-boot_new/board/genesi/mx51_efikamx/efikamx-usb.c | xloem/DIY-LAPTOP | 35 | 6816899 | /*
* Copyright (C) 2010 <NAME> <<EMAIL>>
*
* (C) Copyright 2009 Freescale Semiconductor, Inc.
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <usb.h>
#include <asm/io.h>
#include <asm/arch/imx-regs.h>
#include <asm/arch/iomux-mx51.h>
#include <asm/gpio.h>
#include <usb/ehci-fsl.h>
#include <usb/ulpi.h>
#include <errno.h>
#include "../../../drivers/usb/host/ehci.h"
/*
* Configure the USB H1 and USB H2 IOMUX
*/
void setup_iomux_usb(void)
{
static const iomux_v3_cfg_t usb_h1_pads[] = {
MX51_PAD_USBH1_CLK__USBH1_CLK,
MX51_PAD_USBH1_DIR__USBH1_DIR,
MX51_PAD_USBH1_STP__USBH1_STP,
MX51_PAD_USBH1_NXT__USBH1_NXT,
MX51_PAD_USBH1_DATA0__USBH1_DATA0,
MX51_PAD_USBH1_DATA1__USBH1_DATA1,
MX51_PAD_USBH1_DATA2__USBH1_DATA2,
MX51_PAD_USBH1_DATA3__USBH1_DATA3,
MX51_PAD_USBH1_DATA4__USBH1_DATA4,
MX51_PAD_USBH1_DATA5__USBH1_DATA5,
MX51_PAD_USBH1_DATA6__USBH1_DATA6,
MX51_PAD_USBH1_DATA7__USBH1_DATA7,
};
static const iomux_v3_cfg_t usb_pads[] = {
MX51_PAD_EIM_D27__GPIO2_9, /* USB PHY reset */
MX51_PAD_GPIO1_5__GPIO1_5, /* USB HUB reset */
NEW_PAD_CTRL(MX51_PAD_EIM_A22__GPIO2_16, 0), /* WIFI /EN */
NEW_PAD_CTRL(MX51_PAD_EIM_A16__GPIO2_10, 0), /* WIFI RESET */
NEW_PAD_CTRL(MX51_PAD_EIM_A17__GPIO2_11, 0), /* BT /EN */
};
imx_iomux_v3_setup_multiple_pads(usb_h1_pads, ARRAY_SIZE(usb_h1_pads));
if (machine_is_efikasb()) {
static const iomux_v3_cfg_t usb_h2_pads[] = {
MX51_PAD_EIM_A24__USBH2_CLK,
MX51_PAD_EIM_A25__USBH2_DIR,
MX51_PAD_EIM_A26__USBH2_STP,
MX51_PAD_EIM_A27__USBH2_NXT,
MX51_PAD_EIM_D16__USBH2_DATA0,
MX51_PAD_EIM_D17__USBH2_DATA1,
MX51_PAD_EIM_D18__USBH2_DATA2,
MX51_PAD_EIM_D19__USBH2_DATA3,
MX51_PAD_EIM_D20__USBH2_DATA4,
MX51_PAD_EIM_D21__USBH2_DATA5,
MX51_PAD_EIM_D22__USBH2_DATA6,
MX51_PAD_EIM_D23__USBH2_DATA7,
};
imx_iomux_v3_setup_multiple_pads(usb_h2_pads,
ARRAY_SIZE(usb_h2_pads));
}
imx_iomux_v3_setup_multiple_pads(usb_pads, ARRAY_SIZE(usb_pads));
}
/*
* Enable devices connected to USB BUSes
*/
static void efika_usb_enable_devices(void)
{
/* Enable Bluetooth */
gpio_direction_output(IMX_GPIO_NR(2, 11), 0);
udelay(10000);
gpio_set_value(IMX_GPIO_NR(2, 11), 1);
/* Enable WiFi */
gpio_direction_output(IMX_GPIO_NR(2, 16), 1);
udelay(10000);
/* Reset the WiFi chip */
gpio_direction_output(IMX_GPIO_NR(2, 10), 0);
udelay(10000);
gpio_set_value(IMX_GPIO_NR(2, 10), 1);
}
/*
* Reset USB HUB (or HUBs on EfikaSB)
*/
static void efika_usb_hub_reset(void)
{
/* HUB reset */
gpio_direction_output(IMX_GPIO_NR(1, 5), 1);
udelay(1000);
gpio_set_value(IMX_GPIO_NR(1, 5), 0);
udelay(1000);
gpio_set_value(IMX_GPIO_NR(1, 5), 1);
}
/*
* Reset USB PHY (or PHYs on EfikaSB)
*/
static void efika_usb_phy_reset(void)
{
/* SMSC 3317 PHY reset */
gpio_direction_output(IMX_GPIO_NR(2, 9), 0);
udelay(1000);
gpio_set_value(IMX_GPIO_NR(2, 9), 1);
}
static void efika_ehci_init(struct usb_ehci *ehci, uint32_t stp_gpio,
iomux_v3_cfg_t stp_pad_gpio,
iomux_v3_cfg_t stp_pad_usb)
{
int ret;
struct ulpi_regs *ulpi = (struct ulpi_regs *)0;
struct ulpi_viewport ulpi_vp;
imx_iomux_v3_setup_pad(stp_pad_gpio);
gpio_direction_output(stp_gpio, 0);
udelay(1000);
gpio_set_value(stp_gpio, 1);
udelay(1000);
imx_iomux_v3_setup_pad(stp_pad_usb);
udelay(10000);
ulpi_vp.viewport_addr = (u32)&ehci->ulpi_viewpoint;
ulpi_vp.port_num = 0;
ret = ulpi_init(&ulpi_vp);
if (ret) {
printf("Efika USB ULPI initialization failed\n");
return;
}
/* ULPI set flags */
ulpi_write(&ulpi_vp, &ulpi->otg_ctrl,
ULPI_OTG_DP_PULLDOWN | ULPI_OTG_DM_PULLDOWN |
ULPI_OTG_EXTVBUSIND);
ulpi_write(&ulpi_vp, &ulpi->function_ctrl,
ULPI_FC_FULL_SPEED | ULPI_FC_OPMODE_NORMAL |
ULPI_FC_SUSPENDM);
ulpi_write(&ulpi_vp, &ulpi->iface_ctrl, 0);
/* Set VBus */
ulpi_write(&ulpi_vp, &ulpi->otg_ctrl_set,
ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT);
/*
* Set VBusChrg
*
* NOTE: This violates USB specification, but otherwise, USB on Efika
* doesn't work.
*/
ulpi_write(&ulpi_vp, &ulpi->otg_ctrl_set, ULPI_OTG_CHRGVBUS);
}
int board_ehci_hcd_init(int port)
{
/* Init iMX51 EHCI */
efika_usb_phy_reset();
efika_usb_hub_reset();
efika_usb_enable_devices();
return 0;
}
void ehci_powerup_fixup(uint32_t *status_reg, uint32_t *reg)
{
uint32_t port = OTG_BASE_ADDR + (0x200 * CONFIG_MXC_USB_PORT);
struct usb_ehci *ehci = (struct usb_ehci *)port;
struct ulpi_regs *ulpi = (struct ulpi_regs *)0;
struct ulpi_viewport ulpi_vp;
ulpi_vp.viewport_addr = (u32)&ehci->ulpi_viewpoint;
ulpi_vp.port_num = 0;
ulpi_write(&ulpi_vp, &ulpi->otg_ctrl_set, ULPI_OTG_CHRGVBUS);
mdelay(50);
/* terminate the reset */
*reg = ehci_readl(status_reg);
*reg |= EHCI_PS_PE;
}
void board_ehci_hcd_postinit(struct usb_ehci *ehci, int port)
{
uint32_t tmp;
if (port == 0) {
/* Adjust UTMI PHY frequency to 24MHz */
tmp = readl(OTG_BASE_ADDR + 0x80c);
tmp = (tmp & ~0x3) | 0x01;
writel(tmp, OTG_BASE_ADDR + 0x80c);
} else if (port == 1) {
efika_ehci_init(ehci, IMX_GPIO_NR(1, 27),
MX51_PAD_USBH1_STP__GPIO1_27,
MX51_PAD_USBH1_STP__USBH1_STP);
} else if ((port == 2) && machine_is_efikasb()) {
efika_ehci_init(ehci, IMX_GPIO_NR(2, 20),
MX51_PAD_EIM_A26__GPIO2_20,
MX51_PAD_EIM_A26__USBH2_STP);
}
if (port)
mdelay(10);
}
/*
* Ethernet on the Smarttop is on the USB bus. Rather than give an error about
* "CPU Net Initialization Failed", just pass this test since no other settings
* are required. Smartbook doesn't have built-in Ethernet but we will let it
* pass anyway considering someone may have plugged in a USB stick and all
* they need to do is run "usb start".
*/
int board_eth_init(bd_t *bis)
{
return 0;
} | c |
sdk-6.5.16/src/soc/i2c/cy22150.c | copslock/broadcom_cpri | 0 | 6920134 | /*
*
* This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
*
* Copyright 2007-2019 Broadcom Inc. All rights reserved.
* _____ _____________________
* / __\ \ / / _ \ _ \ __/ __/ __|
* | (__ \ ^ /| _/ / _|\__ \__ \
* \___| |_| |_| |_|_\___|___/___/ TIMING TECHNOLOGY
* ==================================================
* Generated by CyClocksRT R1.05.00
*
* Modification Date: 8/12/02
* Comments:
* Customer:
* FAE:
* License #:
* Part Number: CY22150
* ______________
* _| \__/ |_
* XIN |_| 1 16 |_| XOUT
* _| |_
* VDD |_| 2 15 |_| CLK6
* _| |_
* AVDD |_| 3 14 |_| CLK5
* _| |_
* SDA |_| 4 13 |_| VSS
* _| CY22150 |_
* AVSS |_| 5 12 |_| LCLK4
* _| |_
* VSSL |_| 6 11 |_| VDDL
* _| |_
* LCLK1 |_| 7 10 |_| SCL
* _| |_
* LCLK2 |_| 8 9 |_| LCLK3
* |______________|
*
*
* Reference Input: 25.000000 MHz External
* Target VCO: 314.000000 MHz
* Actual VCO: 314.000000 MHz PPM: 0.0
*
* P value: 314 MSB 0100111010 LSB
* Q vaule: 25 MSB 0011001 LSB
* Charge Pump Setting: 4
* Divider 1-X: 4 VCO
* Divider 2-X: 9 VCO
*
* Clock Output
* ====================================================================
* |Output| Source | Desired | Actual | PPM | Voltage |
* ====================================================================
* | CLK1 | Pll/2 | 157.000000 | 157.000000 | 0.0 | 2.5V |
* | CLK2 | Pll/2 | 157.000000 | 157.000000 | 0.0 | 2.5V |
* | CLK3 | Off | Off | Off | - - | 2.5V |
* | CLK4 | Off | Off | Off | - - | 2.5V |
* | CLK5 | Pll/ 9 | 34.888889 | 34.888889 | 0.0 | 3.3V |
* | CLK6 | Pll/ 9 | 34.888889 | 34.888889 | 0.0 | 3.3V |
* ====================================================================
*
*
*
* Programming Algorithm
*
* For Core (Outputs AB, PLL3): NOTE: Q defaults to 25 so no adjustmnt
* is necessary.
*
* 1. Adjust Q to desired value (25). Default so no action necessary!!!
* 2. Adjust P to desired value 3. Adjust output divider to desired value
* (2) - default is 3 for core and SDRAM 4. Adjust LF
*
* For SDRAM (Outputs CD, PLL2):
*
* 1. Adjust Q to desired value (25)
* 2. Adjust P to desired value
* 3. Adjust output divider to desired value (2) - default is 3 for core and
* SDRAM
* 4. Adjust LF
*
* For PCI/CPU clock (OUTPUT E, PLL1)
*
* 1. Adjust Q to desired value (25). Default so no action necessary!!!
* 2. Adjust P to desired value
* 3. Adjust output divider to desired value (4) - Default so no action
* necessary!!!
* 4. Adjust LF.
* 5. Compensate as necessary for baud rate or other parameters affected by
* changing the PCI or CPU frequency!!!!!!
*
*
* See the Cypress W22393 Clock chip data sheet(s) for more details.
* See also: http://www.cypress.com/clock/datasheets.html
*/
#include <sal/types.h>
#include <soc/drv.h>
#include <soc/error.h>
#include <soc/i2c.h>
#include <shared/bsl.h>
#define MHZ(x) ((x)*1000000)
/* FRef = 25MHz */
#define CY22150_REF_CLK MHZ(25)
#define CY22150_DIV_CORE 2
#define CY22150_DIV_SDRAM 2
#define CY22150_DIV_PCI 4
#define CY_DEBUG(x) do { \
LOG_CLI((BSL_META(x); \
sal_usleep(1000); \
} while (0)
/*
* Charge Pump : Computed based on Ptotal
* See datasheet for more info.
*/
STATIC uint8
cy22150_charge_pump(int val)
{
uint8 tmp;
/* Convert from MHz if required */
if (val > MHZ(1)) {
val /= MHZ(1);
}
if (val >= 16 && val <= 44) {
tmp = 0;
} else if (val >= 45 && val <= 479) {
tmp = 1;
} else if (val >= 480 && val <= 639) {
tmp = 2;
} else if (val >= 640 && val <= 799) {
tmp = 3;
} else if (val >= 800 && val <= 1023) {
tmp = 4;
} else {
tmp = 0;
}
return tmp;
}
STATIC int
cy22150_ioctl(int unit, int devno,
int opcode, void *data, int len)
{
#ifdef COMPILER_HAS_DOUBLE
double clk, qt;
#else
int qt;
#endif
int iclk, P0, ip, iq;
uint8 tmp, lf, saddr = soc_i2c_addr(unit, devno);
if ( I2C_XPLL_SET_PCI == opcode ) {
/* Not implemented, but report success */
} else if ( I2C_XPLL_GET_PCI == opcode ) {
/* Not implemented, but report success */
} else if ( I2C_XPLL_SET_CORE == opcode ) {
#ifdef COMPILER_HAS_DOUBLE
clk = *((double *)data);
/* Convert from MHz if required */
if( clk < MHZ(1))
clk *= MHZ(1);
/* Setup new core clock */
iclk = (int) clk;
#else
iclk = *((int *)data);
#endif
/* Compute actual frequency in MHz */
iclk = (CY22150_DIV_CORE * iclk) / MHZ(1);
/* This is set only on an odd clock freq */
P0 = iclk % 2;
/* Compute Qt and convert to byte value (in MHz)*/
qt = CY22150_REF_CLK - MHZ(2);
qt = qt / MHZ(1);
/* Compute P/Q (integer format) */
ip = ((iclk - P0) / 2) - 4;
iq = (int) qt;
/* Bit 8 of Q (0x42) is PNot */
iq |= (P0 << 8);
/* Compute Charge Pump setting */
lf = cy22150_charge_pump(iclk);
/* Bits 7-5 fixed at 110b */
tmp = 0xC0;
/* Add upper P bits */
tmp |= (ip >> 8);
/* Add Charge Pump bits */
tmp |= (lf << 2);
/* Configure new clock setting */
soc_i2c_write_byte_data(unit, saddr, 0x40, tmp);
soc_i2c_write_byte_data(unit, saddr, 0x41, (uint8)ip);
soc_i2c_write_byte_data(unit, saddr, 0x42, (uint8)iq);
} else if ( I2C_XPLL_GET_CORE == opcode) {
uint8 p_l, p_h, q, pNot;
uint16 p;
soc_i2c_read_byte_data(unit, saddr, 0x41, &p_l);
soc_i2c_read_byte_data(unit, saddr, 0x40, &p_h);
soc_i2c_read_byte_data(unit, saddr, 0x42, &q);
pNot = ((p_h & 0x04) >> 2); /* Bit 2 of 0x57 */
p_h &= 0x03; /* Clear all bits except bits 0-1 */
p = (p_h << 8) | p_l; /* 10 bits of p value */
#ifdef COMPILER_HAS_DOUBLE
clk = 2 * ( p + 4 ) + pNot ;
clk *= CY22150_REF_CLK;
clk /= (q+2);
clk /= 2;
clk /= MHZ(1);
*((double *)data) = clk;
#else
iclk = 2 * (p + 4) + pNot;
iclk *= CY22150_REF_CLK / (q + 2);
iclk /= 2;
*((int *)data) = iclk;
#endif
} else if ( I2C_XPLL_SET_SDRAM == opcode) {
/* Not implemented, but report success */
} else if ( I2C_XPLL_GET_SDRAM == opcode) {
/* Not implemented, but report success */
} else {
return SOC_E_PARAM;
}
return SOC_E_NONE;
}
/*
* Function: cy22150_init
*
* Purpose:
* Initialize the CY22150 clock chip
* Parameters:
* unit - StrataSwitch device number or I2C bus number
* devno - chip device id
* data - not used
* len - not used
* Returns:
* SOC_E_NONE - no failure
*/
STATIC int
cy22150_init(int unit, int devno,
void *data, int len)
{
#if 0
int i;
uint8 x;
uint8 saddr = soc_i2c_addr(unit, devno);
/* Dump register values */
for (i = 0x08; i <= 0x17; i++) {
soc_i2c_read_byte_data(unit, saddr, (uint8)i, &x);
LOG_CLI((BSL_META_U(unit,
"pll[%x] = 0x%x\n"), i, x));
}
for (i = 0x40; i <= 0x57; i++) {
soc_i2c_read_byte_data(unit, saddr, (uint8)i, &x);
LOG_CLI((BSL_META_U(unit,
"pll[%x] = 0x%x\n"), i, x));
}
#endif
soc_i2c_devdesc_set(unit, devno, "Cypress W22150 clock Chip");
return SOC_E_NONE;
}
STATIC int
cy22150_read(int unit, int devno,
uint16 addr, uint8 *data, uint32 *len)
{
*len = 1; /* Byte-write mode */
return soc_i2c_read_byte_data(unit,
soc_i2c_addr(unit, devno),
(uint8)addr, data);
}
STATIC int
cy22150_write(int unit, int devno,
uint16 addr, uint8 *data, uint32 len)
{
return soc_i2c_write_byte_data(unit,
soc_i2c_addr(unit, devno),
(uint8)addr, *data);
}
/* CY22150/W311 Clock Chip Driver callout */
i2c_driver_t _soc_i2c_cy22150_driver = {
0x0, 0x0, /* System assigned bytes */
CY22150_DEVICE_TYPE,
cy22150_read,
cy22150_write,
cy22150_ioctl,
cy22150_init,
NULL,
}; | c |
macOS/macOS/AppDelegate.h | christophpurrer/native-menus | 0 | 309912 | //
// AppDelegate.h
// macOS
//
// Created by <NAME> on 3/10/21.
//
#import <Cocoa/Cocoa.h>
@interface AppDelegate : NSObject <NSApplicationDelegate>
@end | c |
VPImageCropperDemo/VPImageCropperDemo/VPViewController.h | briansoule/VPImageCropper | 535 | 3999636 | //
// VPViewController.h
// VPImageCropperDemo
//
// Created by Vinson.D.Warm on 1/13/14.
// Copyright (c) 2014 Vinson.D.Warm. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface VPViewController : UIViewController
@end | c |
Application/Users/Main/inc/fsmc.h | Tyroo/stm32f407zgt6-template | 1 | 2377595 | #ifndef __FSMC_H__
#define __FSMC_H__
/**
* @include
**/
#include "stm32f4xx_fsmc.h"
#include "stm32f4xx_rcc.h"
/**
* @define
**/
#define SRAM_START_ADDR 0x68000000
/**
* @function
**/
void FsmcSram_Init(void);
void Fsmc_AF_Config(GPIO_TypeDef* Gpio, u8* Arr, u8 Len);
void FsmcSram_Write(u16* Data, u32 StartAddr, u16 Length);
vu16 FsmcSram_Read(u32 Addr);
#endif | c |
linux-3.0.1/drivers/net/wireless/rtl8189es/include/sdio_ops.h | tonghua209/samsun6410_linux_3_0_0_1_for_aws | 0 | 2316480 | /******************************************************************************
*
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
*
******************************************************************************/
#ifndef __SDIO_OPS_H__
#define __SDIO_OPS_H__
#include <drv_conf.h>
#include <osdep_service.h>
#include <drv_types.h>
#include <osdep_intf.h>
#ifdef PLATFORM_LINUX
#include <sdio_ops_linux.h>
#endif
#ifdef PLATFORM_WINDOWS
#ifdef PLATFORM_OS_XP
#include <sdio_ops_xp.h>
struct async_context
{
PMDL pmdl;
PSDBUS_REQUEST_PACKET sdrp;
unsigned char* r_buf;
unsigned char* padapter;
};
#endif
#ifdef PLATFORM_OS_CE
#include <sdio_ops_ce.h>
#endif
#endif
extern void sdio_set_intf_ops(struct _io_ops *pops);
//extern void sdio_func1cmd52_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem);
//extern void sdio_func1cmd52_write(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem);
extern u8 SdioLocalCmd52Read1Byte(PADAPTER padapter, u32 addr);
extern void SdioLocalCmd52Write1Byte(PADAPTER padapter, u32 addr, u8 v);
extern s32 _sdio_local_read(PADAPTER padapter, u32 addr, u32 cnt, u8 *pbuf);
extern s32 sdio_local_read(PADAPTER padapter, u32 addr, u32 cnt, u8 *pbuf);
extern s32 _sdio_local_write(PADAPTER padapter, u32 addr, u32 cnt, u8 *pbuf);
extern s32 sdio_local_write(PADAPTER padapter, u32 addr, u32 cnt, u8 *pbuf);
u32 _sdio_read32(PADAPTER padapter, u32 addr);
s32 _sdio_write32(PADAPTER padapter, u32 addr, u32 val);
extern void InitInterrupt8723ASdio(PADAPTER padapter);
extern void InitSysInterrupt8723ASdio(PADAPTER padapter);
extern void EnableInterrupt8723ASdio(PADAPTER padapter);
extern void DisableInterrupt8723ASdio(PADAPTER padapter);
extern void sd_int_hdl(PADAPTER padapter);
#ifdef CONFIG_RTL8723A
extern u8 HalQueryTxBufferStatus8723ASdio(PADAPTER padapter);
#endif //CONFIG_RTL8723A
#ifdef CONFIG_RTL8188E
extern u8 HalQueryTxBufferStatus8189ESdio(PADAPTER padapter);
#endif //CONFIG_RTL8188E
extern void InitInterrupt8188ESdio(PADAPTER padapter);
extern void EnableInterrupt8188ESdio(PADAPTER padapter);
extern void DisableInterrupt8188ESdio(PADAPTER padapter);
extern void UpdateInterruptMask8188ESdio(PADAPTER padapter, u32 AddMSR, u32 RemoveMSR);
#ifdef CONFIG_WOWLAN
extern u8 RecvOnePkt(PADAPTER padapter, u32 size);
extern void ClearInterrupt8189ESdio(PADAPTER padapter);
#endif //CONFIG_WOWLAN
#endif | c |
ports/raspberrypi/common-hal/microcontroller/Pin.c | Neradoc/circuitpython | 3,010 | 7999930 | /*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2021 <NAME> for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "py/runtime.h"
#include "common-hal/microcontroller/__init__.h"
#include "shared-bindings/microcontroller/Pin.h"
#include "src/rp2_common/hardware_gpio/include/hardware/gpio.h"
STATIC uint32_t never_reset_pins;
void reset_all_pins(void) {
for (size_t i = 0; i < TOTAL_GPIO_COUNT; i++) {
if ((never_reset_pins & (1 << i)) != 0) {
continue;
}
reset_pin_number(i);
}
}
void never_reset_pin_number(uint8_t pin_number) {
if (pin_number >= TOTAL_GPIO_COUNT) {
return;
}
never_reset_pins |= 1 << pin_number;
}
void reset_pin_number(uint8_t pin_number) {
if (pin_number >= TOTAL_GPIO_COUNT) {
return;
}
never_reset_pins &= ~(1 << pin_number);
// We are very aggressive in shutting down the pad fully. Both pulls are
// disabled and both buffers are as well.
gpio_init(pin_number);
hw_clear_bits(&padsbank0_hw->io[pin_number], PADS_BANK0_GPIO0_IE_BITS |
PADS_BANK0_GPIO0_PUE_BITS |
PADS_BANK0_GPIO0_PDE_BITS);
hw_set_bits(&padsbank0_hw->io[pin_number], PADS_BANK0_GPIO0_OD_BITS);
}
void common_hal_never_reset_pin(const mcu_pin_obj_t *pin) {
never_reset_pin_number(pin->number);
}
void common_hal_reset_pin(const mcu_pin_obj_t *pin) {
reset_pin_number(pin->number);
}
void claim_pin(const mcu_pin_obj_t *pin) {
// Nothing to do because all changes will set the GPIO settings.
}
bool pin_number_is_free(uint8_t pin_number) {
if (pin_number >= TOTAL_GPIO_COUNT) {
return false;
}
uint32_t pad_state = padsbank0_hw->io[pin_number];
return (pad_state & PADS_BANK0_GPIO0_IE_BITS) == 0 &&
(pad_state & PADS_BANK0_GPIO0_OD_BITS) != 0;
}
bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t *pin) {
return pin_number_is_free(pin->number);
}
uint8_t common_hal_mcu_pin_number(const mcu_pin_obj_t *pin) {
return pin->number;
}
void common_hal_mcu_pin_claim(const mcu_pin_obj_t *pin) {
return claim_pin(pin);
}
void common_hal_mcu_pin_reset_number(uint8_t pin_no) {
reset_pin_number(pin_no);
} | c |
code/utils/xrCompress/lzo/lzo1b_4.c | InNoHurryToCode/xray-162 | 58 | 302183 | #define COMPRESS_ID 4
#define DDBITS 1
#define CLEVEL 2
#include "compr1b.h" | c |
VTU/OverViewCells.h | DevJock/VTU | 0 | 2686596 | //
// OverViewCells.h
// VTU
//
// Created by <NAME> on 11/26/14.
// Copyright (c) 2014 <NAME>. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface OverViewCells : UITableViewCell
@property (strong, nonatomic) IBOutlet UILabel *sName;
@property (strong, nonatomic) IBOutlet UILabel *iMarks;
@property (strong, nonatomic) IBOutlet UILabel *eMarks;
@property (strong, nonatomic) IBOutlet UILabel *tMarks;
@end | c |
Year-1/FOP-fundamentals-of-algorithmization-and-programming/laboratory-work-11-v-16/employee.h | Ellanity/university | 0 | 3848069 | #pragma once
#ifndef employee_H
#define employee_H
// Standard libraries
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
using std::ifstream;
using std::ofstream;
using std::string;
using std::vector;
using std::to_string;
using std::cout;
using std::cin;
class Employee
{
private:
string name;
string faculty;
string department;
string position;
int workload;
public:
Employee();
Employee(string name_, string faculty_, string department_, string position_, int workload_);
void print();
void print(string separator);
string getName();
string getFaculty();
string getDepartment();
string getPosition();
int getWorkload();
void setName(string name_);
void setFaculty(string faculty_);
void setDepartment(string department_);
void setPosition(string position_);
void setWorkload(int workload_);
};
void createFile();
void writeToFile(vector <Employee> *employees_);
vector <Employee> readFile();
string encryptionEmployee(Employee employee);
Employee decryptionEmployee(string employee_str);
#endif // !1 | c |
src/parser.c | autopp/lisplay | 0 | 7837072 | /**
* Copyright 2017 autopp
*
* 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.
*/
#include <stdio.h>
#include <stdlib.h>
#include "parser.h"
#include "scanner.h"
#include "context.h"
#include "value.h"
static lisplay_val_t parse_sexprs(lisplay_cxt_t cxt, lisplay_root_chunk_t root, lisplay_scanner_t scanner);
static lisplay_val_t parse_sexpr(lisplay_cxt_t cxt, lisplay_root_chunk_t root, lisplay_scanner_t scanner);
static lisplay_val_t parse_cons(lisplay_cxt_t cxt, lisplay_root_chunk_t root, lisplay_scanner_t scanner);
static lisplay_val_t parse_cons_tail(lisplay_cxt_t cxt, lisplay_root_chunk_t root, lisplay_scanner_t scanner);
lisplay_val_t lisplay_parse_sexpr(lisplay_cxt_t cxt, lisplay_root_chunk_t root, lisplay_cstr_t filename, FILE *fp);
lisplay_val_t lisplay_parse_sexprs(lisplay_cxt_t cxt, lisplay_root_chunk_t root, lisplay_cstr_t filename, FILE *fp) {
struct lisplay_scanner_t scanner;
lisplay_init_scanner(cxt, &scanner, filename, fp);
lisplay_val_t ret = parse_sexprs(cxt, root, &scanner);
lisplay_destroy_scanner(cxt, &scanner);
return ret;
}
static lisplay_val_t parse_sexprs(lisplay_cxt_t cxt, lisplay_root_chunk_t root, lisplay_scanner_t scanner) {
if (lisplay_scanner_head(cxt, scanner) == LISPLAY_TOKEN_EOS) {
return lisplay_make_root_nil(cxt, root);
} else {
lisplay_val_t car = parse_sexpr(cxt, root, scanner);
if (lisplay_has_error(cxt)) {
return lisplay_make_root_undef(cxt, root);
}
lisplay_val_t cdr = parse_sexprs(cxt, root, scanner);
if (lisplay_has_error(cxt)) {
return lisplay_make_root_undef(cxt, root);
}
return lisplay_make_root_cons(cxt, root, car, cdr);
}
}
static lisplay_val_t parse_sexpr(lisplay_cxt_t cxt, lisplay_root_chunk_t root, lisplay_scanner_t scanner) {
lisplay_token_t token = lisplay_scanner_head(cxt, scanner);
lisplay_val_t ret;
switch (token) {
case LISPLAY_TOKEN_ERR:
lisplay_set_error(cxt, "parse error: %s", scanner->text);
ret = lisplay_make_root_undef(cxt, root);
break;
case LISPLAY_TOKEN_EOS:
lisplay_set_error(cxt, "parse error: expect '(' or atom, but <EOS> given");
ret = lisplay_make_root_undef(cxt, root);
break;
case LISPLAY_TOKEN_QUOTE:
lisplay_scanner_forward(cxt, scanner);
{
lisplay_val_t val = parse_sexpr(cxt, root, scanner);
if (lisplay_has_error(cxt)) {
ret = val;
} else {
ret = lisplay_make_root_cons(cxt, root, lisplay_make_root_sym(cxt, root, "quote"), lisplay_make_root_cons(cxt, root, val, lisplay_make_root_nil(cxt, root)));
}
}
break;
case LISPLAY_TOKEN_LPAREN:
lisplay_scanner_forward(cxt, scanner);
ret = parse_cons(cxt, root, scanner);
break;
case LISPLAY_TOKEN_TRUE:
ret = lisplay_make_root_true(cxt, root);
lisplay_scanner_forward(cxt, scanner);
break;
case LISPLAY_TOKEN_FALSE:
ret = lisplay_make_root_false(cxt, root);
lisplay_scanner_forward(cxt, scanner);
break;
case LISPLAY_TOKEN_INT:
ret = lisplay_make_root_int(cxt, root, atoi(scanner->text));
lisplay_scanner_forward(cxt, scanner);
break;
case LISPLAY_TOKEN_FLOAT:
ret = lisplay_make_root_float(cxt, root, strtod(scanner->text, NULL));
lisplay_scanner_forward(cxt, scanner);
break;
case LISPLAY_TOKEN_SYM:
ret = lisplay_make_root_sym(cxt, root, scanner->text);
lisplay_scanner_forward(cxt, scanner);
break;
default:
lisplay_set_error(cxt, "parse error: expect '(' or atom, but '%s' given", scanner->text);
ret = lisplay_make_root_undef(cxt, root);
break;
}
return ret;
}
lisplay_val_t parse_cons(lisplay_cxt_t cxt, lisplay_root_chunk_t root, lisplay_scanner_t scanner) {
lisplay_token_t token = lisplay_scanner_head(cxt, scanner);
if (token == LISPLAY_TOKEN_ERR) {
lisplay_set_error(cxt, "parse error: %s", scanner->text);
return lisplay_make_root_undef(cxt, root);
} else if (token == LISPLAY_TOKEN_RPAREN) {
lisplay_scanner_forward(cxt, scanner);
return lisplay_make_root_nil(cxt, root);
} else {
lisplay_val_t car = parse_sexpr(cxt, root, scanner);
if (lisplay_is_undef(cxt, car)) {
return car;
}
lisplay_val_t cdr = parse_cons_tail(cxt, root, scanner);
if (lisplay_is_undef(cxt, cdr)) {
return cdr;
}
return lisplay_make_root_cons(cxt, root, car, cdr);
}
}
lisplay_val_t parse_cons_tail(lisplay_cxt_t cxt, lisplay_root_chunk_t root, lisplay_scanner_t scanner) {
lisplay_token_t token = lisplay_scanner_head(cxt, scanner);
if (token == LISPLAY_TOKEN_ERR) {
lisplay_set_error(cxt, "parse error: %s", scanner->text);
return lisplay_make_root_undef(cxt, root);
} else if (token == LISPLAY_TOKEN_EOS) {
lisplay_set_error(cxt, "parse error: expect sexpr, dot, or ')', but <EOS> given");
return lisplay_make_root_undef(cxt, root);
} else if (token == LISPLAY_TOKEN_RPAREN) {
lisplay_scanner_forward(cxt, scanner);
return lisplay_make_root_nil(cxt, root);
} else if (token == LISPLAY_TOKEN_DOT) {
lisplay_scanner_forward(cxt, scanner);
lisplay_val_t cdr = parse_sexpr(cxt, root, scanner);
if (lisplay_is_undef(cxt, cdr)) {
return cdr;
}
lisplay_token_t after_cdr = lisplay_scanner_head(cxt, scanner);
if (after_cdr != LISPLAY_TOKEN_RPAREN) {
if (after_cdr == LISPLAY_TOKEN_EOS) {
lisplay_set_error(cxt, "parse error: expect ')', but <EOS> given");
} else {
lisplay_set_error(cxt, "parse error: expect ')', but %s given", scanner->text);
}
return lisplay_make_root_undef(cxt, root);
}
lisplay_scanner_forward(cxt, scanner);
return cdr;
} else {
lisplay_val_t sexpr = parse_sexpr(cxt, root, scanner);
if (lisplay_is_undef(cxt, sexpr)) {
return sexpr;
}
lisplay_val_t cdr = parse_cons_tail(cxt, root, scanner);
if (lisplay_is_undef(cxt, cdr)) {
return cdr;
}
return lisplay_make_root_cons(cxt, root, sexpr, cdr);
}
} | c |
jslide/video_reader.h | janm31415/jslide | 0 | 8226828 | #pragma once
/*
From: https://github.com/bartjoyce/video-app
*/
#include <stdint.h>
#ifdef _FFMPEG_SUPPORTED
extern "C" {
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libswscale/swscale.h"
}
struct VideoReaderState {
int width=0, height=0;
AVRational time_base;
AVFormatContext* av_format_ctx = nullptr;
AVCodecContext* av_codec_ctx = nullptr;
int video_stream_index;
AVFrame* av_frame = nullptr;
AVPacket* av_packet = nullptr;
SwsContext* sws_scaler_ctx = nullptr;
};
#else
struct VideoReaderState
{
int width = 0, height = 0;
};
#endif
bool video_reader_open(VideoReaderState* state, const char* filename);
bool video_reader_read_frame(VideoReaderState* state, uint8_t* frame_buffer, int64_t* pts);
bool video_reader_seek_frame(VideoReaderState* state, int64_t ts);
void video_reader_close(VideoReaderState* state); | c |
cmake_targets/lte_build_oai/build/CMakeFiles/Rel14/RRCConnectionResumeRequest-r13.h | davidraditya/OAI-Powder | 1 | 4304051 | /*
* Generated by asn1c-0.9.24 (http://lionet.info/asn1c)
* From ASN.1 module "EUTRA-RRC-Definitions"
* found in "fixed_grammar.asn"
* `asn1c -gen-PER`
*/
#ifndef _RRCConnectionResumeRequest_r13_H_
#define _RRCConnectionResumeRequest_r13_H_
#include <asn_application.h>
/* Including external dependencies */
#include "RRCConnectionResumeRequest-r13-IEs.h"
#include <constr_SEQUENCE.h>
#include <constr_CHOICE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Dependencies */
typedef enum RRCConnectionResumeRequest_r13__criticalExtensions_PR {
RRCConnectionResumeRequest_r13__criticalExtensions_PR_NOTHING, /* No components present */
RRCConnectionResumeRequest_r13__criticalExtensions_PR_rrcConnectionResumeRequest_r13,
RRCConnectionResumeRequest_r13__criticalExtensions_PR_criticalExtensionsFuture
} RRCConnectionResumeRequest_r13__criticalExtensions_PR;
/* RRCConnectionResumeRequest-r13 */
typedef struct RRCConnectionResumeRequest_r13 {
struct RRCConnectionResumeRequest_r13__criticalExtensions {
RRCConnectionResumeRequest_r13__criticalExtensions_PR present;
union RRCConnectionResumeRequest_r13__criticalExtensions_u {
RRCConnectionResumeRequest_r13_IEs_t rrcConnectionResumeRequest_r13;
struct RRCConnectionResumeRequest_r13__criticalExtensions__criticalExtensionsFuture {
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} criticalExtensionsFuture;
} choice;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} criticalExtensions;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} RRCConnectionResumeRequest_r13_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_RRCConnectionResumeRequest_r13;
#ifdef __cplusplus
}
#endif
#endif /* _RRCConnectionResumeRequest_r13_H_ */
#include <asn_internal.h> | c |
src/klist.c | tmbx/libktools | 0 | 4971313 | /**
* src/klist.c
* Copyright (C) 2005-2012 Opersys inc., All rights reserved.
*
* List utilities.
*/
#include <string.h>
#include "klist.h"
#include "kmem.h"
#include "kutils.h"
#include "kerror.h"
static struct klist_node *klist_node_new(void *data) {
struct klist_node *self = kcalloc(sizeof(struct klist_node));
self->data = data;
return self;
}
static void klist_node_destroy(struct klist_node *self) {
kfree(self);
}
static inline int klist_is_empty(klist *self) {
return self->head->next == self->tail;
}
klist *klist_new() {
klist *self = kmalloc(sizeof(klist));
klist_init(self);
return self;
}
void klist_init(klist *self) {
self->head = klist_node_new(NULL);
self->head->next = self->tail;
self->head->prev = self->head;
self->tail = klist_node_new(NULL);
self->tail->prev = self->head;
self->tail->next = self->tail;
self->length = 0;
}
void klist_init_klist(klist *self, klist *init_list) {
struct klist_iter list_iter;
kiter *iter = (kiter *)&list_iter;
void *data;
klist_init(self);
klist_iter_init(&list_iter, init_list);
while (kiter_next(iter, &data))
klist_append(self, data);
}
void klist_destroy(klist *self) {
if (self) {
klist_clean(self);
}
kfree(self);
}
void klist_clean(klist *self) {
klist_reset(self);
klist_node_destroy(self->head);
klist_node_destroy(self->tail);
}
void klist_reset(klist *self) {
while (self->length > 0)
klist_rm_head(self, NULL);
}
void klist_prepend(klist *self, void *data) {
struct klist_node *node = klist_node_new(data);
node->next = self->head->next;
node->prev = self->head;
self->head->next->prev = node;
self->head->next = node;
self->length++;
}
void klist_append(klist *self, void *data) {
struct klist_node *node = klist_node_new(data);
node->prev = self->tail->prev;
node->next = self->tail;
self->tail->prev->next = node;
self->tail->prev = node;
self->length++;
}
int klist_rm_head(klist *self, void **el) {
struct klist_node *node;
if (klist_is_empty(self)) {
KTOOLS_ERROR_SET("the list is empty");
return -1;
}
node = self->head->next;
self->head->next = node->next;
self->head->next->prev = self->head;
self->length --;
if (el)
*el = node->data;
klist_node_destroy(node);
return 0;
}
int klist_rm_tail(klist *self, void **el) {
struct klist_node *node;
if (klist_is_empty(self)) {
KTOOLS_ERROR_SET("the list is empty");
return -1;
}
node = self->tail->prev;
self->tail->prev = node->prev;
self->tail->prev->next = self->tail;
self->length --;
if (el)
*el = node->data;
klist_node_destroy(node);
return 0;
}
int klist_head(klist *self, void **el) {
if (klist_is_empty(self)) {
KTOOLS_ERROR_SET("the list is empty");
return -1;
}
*el = self->head->next->data;
return 0;
}
int klist_tail(klist *self, void **el) {
if (klist_is_empty(self)) {
KTOOLS_ERROR_SET("the list is empty");
return -1;
}
*el = self->tail->prev->data;
return 0;
}
int klist_get(klist *self, int pos, void **el) {
struct klist_iter list_iter;
kiter *iter = (kiter *)&list_iter;
klist_iter_init(&list_iter, self);
for (; pos >= 0; pos --) {
if (kiter_next(iter, el)) {
KTOOLS_ERROR_SET("the list is too short");
return -1;
}
}
return 0;
}
/*****************
* Klist iterator
*****************/
static void klist_iter_begin(kiter *iter);
static int klist_iter_prev(kiter *iter);
static int klist_iter_next(kiter *iter);
static void klist_iter_end(kiter *iter);
static int klist_iter_get(kiter *iter, void **el);
static int klist_iter_remove(kiter *iter);
static int klist_iter_insert(kiter *iter, void *el);
static int klist_iter_insert_after(kiter *iter, void *el);
static int klist_iter_change(kiter *iter, void *el);
//static struct kiter *klist_iter_copy(kiter *iter);
static struct kiter_ops klist_iter_ops = {
klist_iter_begin,
klist_iter_prev,
klist_iter_next,
klist_iter_end,
klist_iter_get,
klist_iter_remove,
klist_iter_insert,
klist_iter_insert_after,
klist_iter_change,
};
/*static inline int klist_iter_is_root(kiter *iter) {
struct klist_iter *self = (struct klist_iter *)iter;
if (self->node == self->list->root) {
return 1;
}
return 0;
}*/
static void klist_iter_begin(kiter *iter) {
struct klist_iter *self = (struct klist_iter *)iter;
self->node = self->list->head;
}
static int klist_iter_prev(kiter *iter) {
struct klist_iter *self = (struct klist_iter *)iter;
self->node = self->node->prev;
if (self->node == self->list->head)
return -1;
return 0;
}
static int klist_iter_next(kiter *iter) {
struct klist_iter *self = (struct klist_iter *)iter;
self->node = self->node->next;
if (self->node == self->list->tail)
return 1;
return 0;
}
static void klist_iter_end(kiter *iter) {
struct klist_iter *self = (struct klist_iter *)iter;
self->node = self->list->tail;
}
static int klist_iter_get(kiter *iter, void **el) {
struct klist_iter *self = (struct klist_iter *)iter;
int ret;
if (self->node == self->list->head)
ret = -1;
else if (self->node == self->list->tail)
ret = 1;
else
ret = 0;
*el = self->node->data;
return ret;
}
static int klist_iter_remove(kiter *iter) {
struct klist_iter *self = (struct klist_iter *)iter;
struct klist_node *prev;
struct klist_node *next;
if (self->node == self->list->head)
return -1;
if (self->node == self->list->tail)
return 1;
prev = self->node->prev;
next = self->node->next;
prev->next = next;
next->prev = prev;
klist_node_destroy(self->node);
self->list->length--;
self->node = next;
return 0;
}
static int klist_iter_insert(kiter *iter, void *el) {
struct klist_iter *self = (struct klist_iter *)iter;
struct klist_node *node;
if (self->node == self->list->head) {
return -1;
}
node = klist_node_new(el);
node->prev = self->node->prev;
node->next = self->node;
node->prev->next = node;
node->next->prev = node;
return 0;
}
static int klist_iter_insert_after(kiter *iter, void *el) {
struct klist_iter *self = (struct klist_iter *)iter;
struct klist_node *node;
if (self->node == self->list->tail) {
return -1;
}
node = klist_node_new(el);
node->prev = self->node;
node->next = self->node->next;
node->prev->next = node;
node->next->prev = node;
return 0;
}
static int klist_iter_change(kiter *iter, void *el) {
struct klist_iter *self = (struct klist_iter *)iter;
int ret;
if (self->node == self->list->head)
ret = -1;
else if (self->node == self->list->tail)
ret = 1;
else {
self->node->data = el;
ret = 0;
}
return ret;
}
#if 0
/* TODO: insert the iterator in a iterator hash table in the list. */
static struct kiter *klist_iter_copy(kiter *iter) {
struct kiter *copy = kmalloc(sizeof(struct klist_iter));
memcpy(copy, iter, sizeof(struct klist_iter));
return copy;
}
/* TODO: remove the iterator from the iterator hash table in the array. Do not use for now. */
void klist_iter_destroy(struct kiter *self) {
kfree(self);
}
#endif
/* TODO: insert the iterator in an iterator hash table in the list. This would be useful if we remove the item this iterator is pointing to from the list interface of another kiter on the same list. This way we could advance de iterator before removing it. */
void klist_iter_init(struct klist_iter *self, klist *list) {
self->list = list;
self->node = self->list->head;
kiter_init((kiter *)self, &klist_iter_ops);
} | c |
src/day15.h | AdamOttvar/AoC_2020 | 0 | 3625761 | //
// Created by AdamOttvar on 2020-12-15
//
#ifndef _DAY15_H_
#define _DAY15_H_
#include "common.h"
int day15(bool part_two = false);
#endif //_DAY15_H_ | c |
src/lms7002_wxgui/lms7002_pnlSX_view.h | enterstudio/LimeSuite | 0 | 4640459 | #ifndef __lms7002_pnlSX_view__
#define __lms7002_pnlSX_view__
/**
@file
Subclass of pnlSX_view, which is generated by wxFormBuilder.
*/
#include "lms7002_wxgui.h"
//// end generated include
#include <map>
#include "lime/LimeSuite.h"
namespace lime{
}
/** Implementing pnlSX_view */
class lms7002_pnlSX_view : public pnlSX_view
{
protected:
// Handlers for pnlSX_view events.
void ParameterChangeHandler( wxCommandEvent& event );
void ParameterChangeHandler( wxSpinEvent& event);
void OnbtnReadComparators(wxCommandEvent& event);
void OnbtnChangeRefClkClick( wxCommandEvent& event );
void OnbtnCalculateClick( wxCommandEvent& event );
void OnbtnTuneClick( wxCommandEvent& event );
void OnShowVCOclicked(wxCommandEvent& event);
public:
/** Constructor */
lms7002_pnlSX_view( wxWindow* parent );
//// end generated class members
lms7002_pnlSX_view(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL);
void Initialize(lms_device_t* pControl);
void UpdateGUI();
protected:
lms_device_t* lmsControl;
std::map<wxWindow*, LMS7Parameter> wndId2Enum;
};
#endif // __lms7002_pnlSX_view__ | c |
sketches/Bluetooth/Bluetooth/src/commands/i2c/SetPinCommand.h | jeff-winn/nemesis-mod | 2 | 3088048 | #ifndef SET_PIN_COMMAND_H
#define SET_PIN_COMMAND_H
#include "../Command.h"
class SetPinCommand : public Command {
public:
SetPinCommand() = default;
protected:
void executeImpl(const uint8_t* data, const uint8_t len) override;
};
#endif /* SET_PIN_COMMAND_H */ | c |
usr/src/uts/i86pc/io/pci/pci_kstats.c | AsahiOS/gate | 0 | 8297705 | /*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Kstat support for X86 PCI driver
*/
#include <sys/conf.h>
#include <sys/mach_intr.h>
#include <sys/psm.h>
#include <sys/clock.h>
#include <sys/apic.h>
#include <io/pci/pci_var.h>
typedef struct pci_kstat_private {
ddi_intr_handle_impl_t *hdlp;
dev_info_t *rootnex_dip;
} pci_kstat_private_t;
static struct {
kstat_named_t ihks_name;
kstat_named_t ihks_type;
kstat_named_t ihks_cpu;
kstat_named_t ihks_pil;
kstat_named_t ihks_time;
kstat_named_t ihks_ino;
kstat_named_t ihks_cookie;
kstat_named_t ihks_devpath;
kstat_named_t ihks_buspath;
} pci_ks_template = {
{ "name", KSTAT_DATA_CHAR },
{ "type", KSTAT_DATA_CHAR },
{ "cpu", KSTAT_DATA_UINT64 },
{ "pil", KSTAT_DATA_UINT64 },
{ "time", KSTAT_DATA_UINT64 },
{ "ino", KSTAT_DATA_UINT64 },
{ "cookie", KSTAT_DATA_UINT64 },
{ "devpath", KSTAT_DATA_STRING },
{ "buspath", KSTAT_DATA_STRING },
};
static char ih_devpath[MAXPATHLEN];
static char ih_buspath[MAXPATHLEN];
static uint32_t pci_ks_inst;
static kmutex_t pci_ks_template_lock;
extern int (*psm_intr_ops)(dev_info_t *, ddi_intr_handle_impl_t *,
psm_intr_op_t, int *);
/*ARGSUSED*/
static int
pci_ih_ks_update(kstat_t *ksp, int rw)
{
pci_kstat_private_t *private_data =
(pci_kstat_private_t *)ksp->ks_private;
dev_info_t *rootnex_dip = private_data->rootnex_dip;
ddi_intr_handle_impl_t tmp_hdl, *ih_p = private_data->hdlp;
dev_info_t *dip = ih_p->ih_dip;
int maxlen = sizeof (pci_ks_template.ihks_name.value.c);
apic_get_intr_t intrinfo;
(void) snprintf(pci_ks_template.ihks_name.value.c, maxlen, "%s%d",
ddi_driver_name(dip), ddi_get_instance(dip));
(void) ddi_pathname(dip, ih_devpath);
(void) ddi_pathname(rootnex_dip, ih_buspath);
kstat_named_setstr(&pci_ks_template.ihks_devpath, ih_devpath);
kstat_named_setstr(&pci_ks_template.ihks_buspath, ih_buspath);
/*
* Note that although possibly multiple vectors can map to an IRQ, the
* vector returned below will always be the same for a given IRQ
* specified, and so all kstats for a given IRQ will report the same
* value for the ino field.
*
* ---
*
* Check for the enabled state, since kstats are set up when the ISR is
* added, not enabled. There may be a period where interrupts are not
* enabled even though they may have been added.
*
* It is also possible that the vector is for a dummy interrupt.
* pci_get_intr_from_vecirq will return failure in this case.
*/
bcopy(ih_p, &tmp_hdl, sizeof (ddi_intr_handle_impl_t));
tmp_hdl.ih_private = (void *)&intrinfo;
intrinfo.avgi_cpu_id = 0; /* In case psm_intr_ops fails */
intrinfo.avgi_req_flags = PSMGI_REQ_CPUID | PSMGI_REQ_VECTOR;
intrinfo.avgi_req_flags |= PSMGI_INTRBY_DEFAULT;
if ((ih_p->ih_state != DDI_IHDL_STATE_ENABLE) ||
((*psm_intr_ops)(NULL, &tmp_hdl, PSM_INTR_OP_GET_INTR, NULL) !=
DDI_SUCCESS) ||
(intrinfo.avgi_cpu_id & PSMGI_CPU_FLAGS)) {
(void) strcpy(pci_ks_template.ihks_type.value.c, "disabled");
pci_ks_template.ihks_pil.value.ui64 = 0;
pci_ks_template.ihks_time.value.ui64 = 0;
pci_ks_template.ihks_cookie.value.ui64 = 0;
pci_ks_template.ihks_cpu.value.ui64 = 0;
pci_ks_template.ihks_ino.value.ui64 = 0;
/* Interrupt is user-bound. Remove kstat. */
if (intrinfo.avgi_cpu_id & PSMGI_CPU_FLAGS)
(void) taskq_dispatch(system_taskq,
(void (*)(void *))pci_kstat_delete, ksp, TQ_SLEEP);
return (0);
}
/*
* Interrupt is valid (not a dummy), not user-bound to a specific cpu,
* and enabled. Update kstat fields.
*/
switch (ih_p->ih_type) {
case DDI_INTR_TYPE_MSI:
(void) strcpy(pci_ks_template.ihks_type.value.c, "msi");
break;
case DDI_INTR_TYPE_MSIX:
(void) strcpy(pci_ks_template.ihks_type.value.c, "msix");
break;
default:
(void) strcpy(pci_ks_template.ihks_type.value.c, "fixed");
break;
}
pci_ks_template.ihks_pil.value.ui64 = ih_p->ih_pri;
pci_ks_template.ihks_time.value.ui64 =
((ihdl_plat_t *)ih_p->ih_private)->ip_ticks;
scalehrtime((hrtime_t *)&pci_ks_template.ihks_time.value.ui64);
pci_ks_template.ihks_cookie.value.ui64 = ih_p->ih_vector;
/* CPU won't be user bound at this point. */
pci_ks_template.ihks_cpu.value.ui64 = intrinfo.avgi_cpu_id;
pci_ks_template.ihks_ino.value.ui64 = intrinfo.avgi_vector;
return (0);
}
void pci_kstat_create(kstat_t **kspp, dev_info_t *rootnex_dip,
ddi_intr_handle_impl_t *hdlp)
{
pci_kstat_private_t *private_data;
*kspp = kstat_create("pci_intrs", atomic_inc_32_nv(&pci_ks_inst),
_MODULE_NAME, "interrupts", KSTAT_TYPE_NAMED,
sizeof (pci_ks_template) / sizeof (kstat_named_t),
KSTAT_FLAG_VIRTUAL);
if (*kspp != NULL) {
private_data =
kmem_zalloc(sizeof (pci_kstat_private_t), KM_SLEEP);
private_data->hdlp = hdlp;
private_data->rootnex_dip = rootnex_dip;
(*kspp)->ks_private = private_data;
(*kspp)->ks_data_size += MAXPATHLEN * 2;
(*kspp)->ks_lock = &pci_ks_template_lock;
(*kspp)->ks_data = &pci_ks_template;
(*kspp)->ks_update = pci_ih_ks_update;
kstat_install(*kspp);
}
}
/*
* This function is invoked in two ways:
* - Thru taskq thread via pci_ih_ks_update to remove kstats for user-bound
* interrupts.
* - From the REMISR introp when an interrupt is being removed.
*/
void
pci_kstat_delete(kstat_t *ksp)
{
pci_kstat_private_t *kstat_private;
ddi_intr_handle_impl_t *hdlp;
if (ksp) {
kstat_private = ksp->ks_private;
hdlp = kstat_private->hdlp;
((ihdl_plat_t *)hdlp->ih_private)->ip_ksp = NULL;
/*
* Delete the kstat before removing the private pointer, to
* prevent a kstat update from coming after private is freed.
*/
kstat_delete(ksp);
kmem_free(kstat_private, sizeof (pci_kstat_private_t));
}
} | c |
src/ios/InneractiveAdSDK-iOS-v7.0.6/Inneractive SDK/IASDKClientPub/IASDKClient/UI/IAColors.h | mingz2013/cordova-plugin-ironsource-ads | 0 | 2220789 | //
// IAColors.h
// IASDKClient
//
// Created by Inneractive on 06/04/2017.
// Copyright (c) 2017 Inneractive. All rights reserved.
//
#import <Foundation/Foundation.h>
#define kIAColorsNavigationBar [UIColor whiteColor]
#define kIAColorsButtonsText [UIColor colorWithRed:255/255.0 green:151/255.0 blue:4/255.0 alpha:1.0]
#define kIAColorsAquamarine [UIColor colorWithRed:36/255.0 green:183/255.0 blue:197/255.0 alpha:1.0] | c |
src/ios/HTTPRequestOperationData.h | xatshepsut/cordova-plugin-http-requester | 0 | 4126826 | //
// HTTPRequestOperationData.h
//
// Created by <NAME> on 3/27/17.
// Copyright © 2017 Macadamian. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface HTTPRequestOperationData : NSObject
@property (nonatomic, strong, nonnull) NSString *identifier;
@property (nonatomic, strong, nonnull) NSString *timestamp;
@property (nonatomic, strong, nonnull) NSURLRequest *request;
@property (nonatomic, assign) NSInteger retryCounter;
+ (instancetype _Nonnull)dataWithRequest:(NSURLRequest * _Nonnull)request;
+ (instancetype _Nonnull)dataWithIdentifier:(NSString * _Nonnull)identifier timestamp:(NSString * _Nonnull)timestamp request:(NSURLRequest * _Nonnull)request retryCounter:(NSInteger)counter;
+ (NSString *)timestamp:(NSString *)format;
+ (NSString *)uuid;
@end | c |
HTSTrainingScripts/dependencies/ActiveTcl/include/tclxml/docObj.h | falabrasil/resources_for_BP_HMM-based_Speech_Synthesis | 4 | 5518609 | /* docObj.h --
*
* This module manages libxml2 xmlDocPtr Tcl objects.
*
* Copyright (c) 2003 Zveno Pty Ltd
* http://www.zveno.com/
*
* Zveno Pty Ltd makes this software and associated documentation
* available free of charge for any purpose. You may make copies
* of the software but you must include all of this notice on any copy.
*
* Zveno Pty Ltd does not warrant that this software is error free
* or fit for any purpose. Zveno Pty Ltd disclaims any liability for
* all claims, expenses, losses, damages and costs any user may incur
* as a result of using, copying or modifying the software.
*
* $Id: docObj.h,v 1.2 2003/12/03 20:06:34 balls Exp $
*/
#ifndef TCLXML_LIBXML2_DOCOBJ_H
#define TCLXML_LIBXML2_DOCOBJ_H
#ifdef TCLXML_BUILD_AS_FRAMEWORK
#include <Tcl/tcl.h>
#else
#include <tcl.h>
#endif /* TCLXML_BUILD_AS_FRAMEWORK */
#include <libxml/tree.h>
typedef void (TclXML_libxml2Doc_FreeHookProc) _ANSI_ARGS_((ClientData clientData));
/*
* Values that define how documents are handled:
* KEEP means that documents must be explicitly destroyed,
* IMPLICIT means that documents will be destroyed when there are no longer
* any references to it.
*/
typedef enum TclXML_libxml2_DocumentHandling {
TCLXML_LIBXML2_DOCUMENT_KEEP,
TCLXML_LIBXML2_DOCUMENT_IMPLICIT
} TclXML_libxml2_DocumentHandling;
typedef struct TclXML_libxml2_Document {
xmlDocPtr docPtr;
char *token; /* string rep of this document */
TclXML_libxml2_DocumentHandling keep;
/* how to handle document destruction */
void *objs; /* List of Tcl_Obj's that reference this document */
ClientData dom; /* Hook for TclDOM data */
TclXML_libxml2Doc_FreeHookProc *domfree;
ClientData apphook; /* Application hook - not used by TclXML or TclDOM */
TclXML_libxml2Doc_FreeHookProc *appfree;
} TclXML_libxml2_Document;
#endif /* TCLXML_LIBXML2_DOCOBJ_H */ | c |
Source/Engine/Source/ING/Event/Storage/Storage.h | vinoxphucs/ING | 1 | 2651729 | #pragma once
/**
* Include Entry Point
*/
#include <ING\EntryPoint\EntryPoint.h>
/**
* Include Utils
*/
#include <ING/Utils/Utils.h>
using namespace ING::Utils;
/**
* Include Map
*/
#include <map>
namespace ING {
class Event;
class ING_API EventStorage
{
/**
* Constructors And Destructor
*/
public:
EventStorage();
~EventStorage();
/**
* Event Management
*/
protected:
List<Event*> eventList;
std::map<std::string, Event*> eventMap;
public:
const List<Event*>& GetEventList() { return eventList; }
Event* GetEvent(std::string name);
virtual List<Event*>::Node* AddEvent(Event* event);
void RemoveEvent(List<Event*>::Node* eventNode);
};
/**
* Define Macros
*/
#define RELEASE_EVENT_STORAGE()\
eventList.Foreach([](Event*& e) {\
\
e->Release();\
\
});\
\
eventMap.clear();\
} | c |
HLHorizontalPageLayoutDemo/HLHorizontalPageLayout/HLHorizontalPageLayout.h | dhl613/HLHorizontalPageLayoutDemo | 22 | 1435562 | //
// HLHorizontalPageLayout.h
// HLHorizontalPageLayoutDemo
//
// Created by dhl613 on 2018/8/24.
// Copyright © 2018年 dhl613. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface HLHorizontalPageLayout : UICollectionViewLayout
@property (nonatomic) CGFloat minimumLineSpacing;
@property (nonatomic) CGFloat minimumInteritemSpacing;
@property (nonatomic) CGSize itemSize;
@property (nonatomic) UIEdgeInsets sectionInset;
@end | c |
src/util/file.c | conquerw/cw_reactor | 2 | 6081408 | /************************************************
* @addtogroup CITS
* @{
* @file : file.c
* @brief :
* @author: wangshaobo
* @email : <EMAIL>
* @date : 2019-05-10 10:43:51
************************************************/
//-----------------------------------------------
// Copyright (c) CITS
//-----------------------------------------------
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <file.h>
void file_init(file_t *file)
{
// pthread_mutex_init(&file->mutex, NULL);
}
int file_read(char *buffer, int size, file_t *file)
{
// pthread_mutex_lock(&file->mutex);
int fd = open(file->filepath, O_RDONLY);
if(fd < 0)
{
printf("the open the file is failure\n");
// pthread_mutex_unlock(&file->mutex);
return -1;
}
int ret = read(fd, buffer, size);
if((ret > size) || (ret < -1))
{
printf("the open the file is failure\n");
close(fd);
// pthread_mutex_unlock(&file->mutex);
return -1;
}
close(fd);
// pthread_mutex_unlock(&file->mutex);
return ret;
}
int file_write(file_t *file, char *buffer, int size)
{
pthread_mutex_lock(&file->mutex);
int fd = open(file->filepath, file->flag, file->mode);
if(fd < 0)
{
printf("the open the file is failure\n");
pthread_mutex_unlock(&file->mutex);
return -1;
}
int ret = write(fd, buffer, size);
if(ret < -1)
{
printf("the open the file is failure\n");
close(fd);
pthread_mutex_unlock(&file->mutex);
return -1;
}
fsync(fd);
close(fd);
pthread_mutex_unlock(&file->mutex);
return ret;
} | c |
contrib/cube/cubedata.h | wotchin/openGauss-server | 1 | 5668945 | /* contrib/cube/cubedata.h */
#define CUBE_MAX_DIM (100)
typedef struct NDBOX {
int32 vl_len_; /* varlena header (do not touch directly!) */
unsigned int dim;
double x[1];
} NDBOX;
#define DatumGetNDBOX(x) ((NDBOX*)DatumGetPointer(x))
#define PG_GETARG_NDBOX(x) DatumGetNDBOX(PG_DETOAST_DATUM(PG_GETARG_DATUM(x)))
#define PG_RETURN_NDBOX(x) PG_RETURN_POINTER(x) | c |
src/heapy/stdtypes.h | odidev/guppy3 | 251 | 4690667 | #ifndef NY_STDDEFS_INCLUDED
#define NY_STDDEFS_INCLUDED
/*
Definitions of type structure(s) that were not exported
but were needed anyway.
XXX dangerous, if Python changes this may break.
Should be made officially exported.
Or pull some from offset in tp_members, but that seems
a too complicated workaround for now.
*/
typedef struct {
PyObject_HEAD
PyObject *mapping;
} mappingproxyobject;
#endif /* NY_STDDEFS_INCLUDED */ | c |
util.c | laserbat/dzen-gitorious | 0 | 852693 | /*
* (C)opyright MMVI-MMVII <NAME> <<EMAIL>beam at gmail dot com>
* (C)opyright MMVII <NAME> <rob dot manea at gmail dot com>
* See LICENSE file for license details.
*
*/
#include "dzen.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>
#define ONEMASK ((size_t)(-1) / 0xFF)
void *
emalloc(unsigned int size) {
void *res = malloc(size);
if(!res)
eprint("fatal: could not malloc() %u bytes\n", size);
return res;
}
void
eprint(const char *errstr, ...) {
va_list ap;
va_start(ap, errstr);
vfprintf(stderr, errstr, ap);
va_end(ap);
exit(EXIT_FAILURE);
}
char *
estrdup(const char *str) {
void *res = strdup(str);
if(!res)
eprint("fatal: could not malloc() %u bytes\n", strlen(str));
return res;
}
void
spawn(const char *arg) {
static const char *shell = NULL;
if(!shell && !(shell = getenv("SHELL")))
shell = "/bin/sh";
if(!arg)
return;
/* The double-fork construct avoids zombie processes and keeps the code
* clean from stupid signal handlers. */
if(fork() == 0) {
if(fork() == 0) {
setsid();
execl(shell, shell, "-c", arg, (char *)NULL);
fprintf(stderr, "dzen: execl '%s -c %s'", shell, arg);
perror(" failed");
}
exit(0);
}
wait(0);
}
// convert XColor to XftColor
#ifdef DZEN_XFT
void
XColorToXRenderColor(XColor xcol, XRenderColor *rendcol) {
rendcol->red = xcol.red;
rendcol->green = xcol.green;
rendcol->blue = xcol.blue;
rendcol->alpha = 0xFFFF;
}
#endif
#ifdef DZEN_XRESOURCES
Boolean
CvtStringToXColor(Display *dpy, XrmValue *args, Cardinal *num_args, XrmValue *fromVal, XrmValue *toVal, XtPointer *converter_data ) {
XrmValue *pixelVal = XtNew(XrmValue);
// needed by the donestr macro of libXt
pixelVal->size = sizeof(Pixel);
Status st = False;
if (XtCallConverter(dpy, XtCvtStringToPixel, args, *num_args, fromVal, pixelVal, NULL) == True)
st = XtCallConverter(dpy, XtCvtPixelToColor, args, *num_args, pixelVal, toVal, NULL);
XtFree((char *)pixelVal);
return st;
}
#endif | c |
src/loader/spectral/SpectralMapperManager.h | PearCoding/PearRay | 19 | 6469041 | #pragma once
#include "AbstractDatabase.h"
#include "ISpectralMapperPlugin.h"
#include "plugin/AbstractManager.h"
namespace PR {
class ISpectralMapperFactory;
class Environment;
class PR_LIB_LOADER SpectralMapperManager : public AbstractManager<ISpectralMapperPlugin> {
public:
SpectralMapperManager();
virtual ~SpectralMapperManager();
bool createDefaultsIfNecessary(Environment* env);
};
} // namespace PR | c |
Chapter1/Exercises/15.c | Peter-Fam/K-and-R-C-programming-language-exercises | 0 | 891307 | #include <stdio.h>
/*
* Exercise 15
* Page: 27
* Rewrite the temperatute conversion program of section 1.2
* to use a function for conversion.
* */
#define LOWER 0
#define UPPER 300
#define STEP 20
static double toCelsius(double fahr);
int main(void) {
double fahr;
printf("%12s:%12s\n", "Fahrenhiet", "Celsius");
for (fahr = LOWER; fahr <= UPPER; fahr += STEP) {
printf("%12.0f %12.1f\n", fahr, toCelsius(fahr));
}
return 0;
}
static double toCelsius(double fahr) { return (5.0 / 9.0) * (fahr - 32); } | c |
thirdparty/simpleuv/simpleuv/triangulate.h | MelvinG24/dust3d | 2,392 | 6894646 | #ifndef SIMPLEUV_TRIANGULATE_H
#define SIMPLEUV_TRIANGULATE_H
#include <simpleuv/meshdatatype.h>
namespace simpleuv
{
void triangulate(const std::vector<Vertex> &vertices, std::vector<Face> &faces, const std::vector<size_t> &ring);
}
#endif | c |
cmake_targets/lte_build_oai/build/CMakeFiles/Rel14/RCLWI-Config-r13.c | davidraditya/OAI-Powder | 0 | 4575516 | /*
* Generated by asn1c-0.9.24 (http://lionet.info/asn1c)
* From ASN.1 module "EUTRA-RRC-Definitions"
* found in "fixed_grammar.asn"
* `asn1c -gen-PER`
*/
#include "RCLWI-Config-r13.h"
static asn_per_constraints_t asn_PER_type_command_constr_2 GCC_NOTUSED = {
{ APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static asn_TYPE_member_t asn_MBR_steerToWLAN_r13_3[] = {
{ ATF_NOFLAGS, 0, offsetof(struct RCLWI_Config_r13__command__steerToWLAN_r13, mobilityConfig_r13),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_WLAN_Id_List_r12,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"mobilityConfig-r13"
},
};
static ber_tlv_tag_t asn_DEF_steerToWLAN_r13_tags_3[] = {
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_steerToWLAN_r13_tag2el_3[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* mobilityConfig-r13 at 6074 */
};
static asn_SEQUENCE_specifics_t asn_SPC_steerToWLAN_r13_specs_3 = {
sizeof(struct RCLWI_Config_r13__command__steerToWLAN_r13),
offsetof(struct RCLWI_Config_r13__command__steerToWLAN_r13, _asn_ctx),
asn_MAP_steerToWLAN_r13_tag2el_3,
1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* Start extensions */
-1 /* Stop extensions */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_steerToWLAN_r13_3 = {
"steerToWLAN-r13",
"steerToWLAN-r13",
SEQUENCE_free,
SEQUENCE_print,
SEQUENCE_constraint,
SEQUENCE_decode_ber,
SEQUENCE_encode_der,
SEQUENCE_decode_xer,
SEQUENCE_encode_xer,
SEQUENCE_decode_uper,
SEQUENCE_encode_uper,
SEQUENCE_decode_aper,
SEQUENCE_encode_aper,
SEQUENCE_compare,
0, /* Use generic outmost tag fetcher */
asn_DEF_steerToWLAN_r13_tags_3,
sizeof(asn_DEF_steerToWLAN_r13_tags_3)
/sizeof(asn_DEF_steerToWLAN_r13_tags_3[0]) - 1, /* 1 */
asn_DEF_steerToWLAN_r13_tags_3, /* Same as above */
sizeof(asn_DEF_steerToWLAN_r13_tags_3)
/sizeof(asn_DEF_steerToWLAN_r13_tags_3[0]), /* 2 */
0, /* No PER visible constraints */
asn_MBR_steerToWLAN_r13_3,
1, /* Elements count */
&asn_SPC_steerToWLAN_r13_specs_3 /* Additional specs */
};
static asn_TYPE_member_t asn_MBR_command_2[] = {
{ ATF_NOFLAGS, 0, offsetof(struct RCLWI_Config_r13__command, choice.steerToWLAN_r13),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
0,
&asn_DEF_steerToWLAN_r13_3,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"steerToWLAN-r13"
},
{ ATF_NOFLAGS, 0, offsetof(struct RCLWI_Config_r13__command, choice.steerToLTE_r13),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_NULL,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"steerToLTE-r13"
},
};
static asn_TYPE_tag2member_t asn_MAP_command_tag2el_2[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* steerToWLAN-r13 at 6074 */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* steerToLTE-r13 at 6075 */
};
static asn_CHOICE_specifics_t asn_SPC_command_specs_2 = {
sizeof(struct RCLWI_Config_r13__command),
offsetof(struct RCLWI_Config_r13__command, _asn_ctx),
offsetof(struct RCLWI_Config_r13__command, present),
sizeof(((struct RCLWI_Config_r13__command *)0)->present),
asn_MAP_command_tag2el_2,
2, /* Count of tags in the map */
0,
-1 /* Extensions start */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_command_2 = {
"command",
"command",
CHOICE_free,
CHOICE_print,
CHOICE_constraint,
CHOICE_decode_ber,
CHOICE_encode_der,
CHOICE_decode_xer,
CHOICE_encode_xer,
CHOICE_decode_uper,
CHOICE_encode_uper,
CHOICE_decode_aper,
CHOICE_encode_aper,
CHOICE_compare,
CHOICE_outmost_tag,
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */
0, /* No tags (count) */
&asn_PER_type_command_constr_2,
asn_MBR_command_2,
2, /* Elements count */
&asn_SPC_command_specs_2 /* Additional specs */
};
static asn_TYPE_member_t asn_MBR_RCLWI_Config_r13_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct RCLWI_Config_r13, command),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+1, /* EXPLICIT tag at current level */
&asn_DEF_command_2,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"command"
},
};
static ber_tlv_tag_t asn_DEF_RCLWI_Config_r13_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_RCLWI_Config_r13_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* command at 6074 */
};
static asn_SEQUENCE_specifics_t asn_SPC_RCLWI_Config_r13_specs_1 = {
sizeof(struct RCLWI_Config_r13),
offsetof(struct RCLWI_Config_r13, _asn_ctx),
asn_MAP_RCLWI_Config_r13_tag2el_1,
1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
0, /* Start extensions */
2 /* Stop extensions */
};
asn_TYPE_descriptor_t asn_DEF_RCLWI_Config_r13 = {
"RCLWI-Config-r13",
"RCLWI-Config-r13",
SEQUENCE_free,
SEQUENCE_print,
SEQUENCE_constraint,
SEQUENCE_decode_ber,
SEQUENCE_encode_der,
SEQUENCE_decode_xer,
SEQUENCE_encode_xer,
SEQUENCE_decode_uper,
SEQUENCE_encode_uper,
SEQUENCE_decode_aper,
SEQUENCE_encode_aper,
SEQUENCE_compare,
0, /* Use generic outmost tag fetcher */
asn_DEF_RCLWI_Config_r13_tags_1,
sizeof(asn_DEF_RCLWI_Config_r13_tags_1)
/sizeof(asn_DEF_RCLWI_Config_r13_tags_1[0]), /* 1 */
asn_DEF_RCLWI_Config_r13_tags_1, /* Same as above */
sizeof(asn_DEF_RCLWI_Config_r13_tags_1)
/sizeof(asn_DEF_RCLWI_Config_r13_tags_1[0]), /* 1 */
0, /* No PER visible constraints */
asn_MBR_RCLWI_Config_r13_1,
1, /* Elements count */
&asn_SPC_RCLWI_Config_r13_specs_1 /* Additional specs */
}; | c |
crc32.c | data-respons-solutions/libnvram | 0 | 4060932 | #include "crc32.h"
/*
* Lookup table and calc_crc32 function taken from here:
* http://web.mit.edu/wwwdev/src/harvest-1.3.pl3/components/gatherer/standard/unbinhex/crc/ccitt32.c
* http://web.mit.edu/wwwdev/src/harvest-1.3.pl3/components/gatherer/standard/unbinhex/crc/makecrc.c
*
* Value used by: CCITT32 ZIP
* The poly: 0x04c11db7 0xedb88320
* original: 0x04c11db7 0x04c11db7
* init value: -1 -1
* swapped no yes
* bits in CRC: 32 32
*/
static uint32_t CRC_TABLE[256] = {
0x00000000L, 0x04c11db7L, 0x09823b6eL, 0x0d4326d9L,
0x130476dcL, 0x17c56b6bL, 0x1a864db2L, 0x1e475005L,
0x2608edb8L, 0x22c9f00fL, 0x2f8ad6d6L, 0x2b4bcb61L,
0x350c9b64L, 0x31cd86d3L, 0x3c8ea00aL, 0x384fbdbdL,
0x4c11db70L, 0x48d0c6c7L, 0x4593e01eL, 0x4152fda9L,
0x5f15adacL, 0x5bd4b01bL, 0x569796c2L, 0x52568b75L,
0x6a1936c8L, 0x6ed82b7fL, 0x639b0da6L, 0x675a1011L,
0x791d4014L, 0x7ddc5da3L, 0x709f7b7aL, 0x745e66cdL,
0x9823b6e0L, 0x9ce2ab57L, 0x91a18d8eL, 0x95609039L,
0x8b27c03cL, 0x8fe6dd8bL, 0x82a5fb52L, 0x8664e6e5L,
0xbe2b5b58L, 0xbaea46efL, 0xb7a96036L, 0xb3687d81L,
0xad2f2d84L, 0xa9ee3033L, 0xa4ad16eaL, 0xa06c0b5dL,
0xd4326d90L, 0xd0f37027L, 0xddb056feL, 0xd9714b49L,
0xc7361b4cL, 0xc3f706fbL, 0xceb42022L, 0xca753d95L,
0xf23a8028L, 0xf6fb9d9fL, 0xfbb8bb46L, 0xff79a6f1L,
0xe13ef6f4L, 0xe5ffeb43L, 0xe8bccd9aL, 0xec7dd02dL,
0x34867077L, 0x30476dc0L, 0x3d044b19L, 0x39c556aeL,
0x278206abL, 0x23431b1cL, 0x2e003dc5L, 0x2ac12072L,
0x128e9dcfL, 0x164f8078L, 0x1b0ca6a1L, 0x1fcdbb16L,
0x018aeb13L, 0x054bf6a4L, 0x0808d07dL, 0x0cc9cdcaL,
0x7897ab07L, 0x7c56b6b0L, 0x71159069L, 0x75d48ddeL,
0x6b93dddbL, 0x6f52c06cL, 0x6211e6b5L, 0x66d0fb02L,
0x5e9f46bfL, 0x5a5e5b08L, 0x571d7dd1L, 0x53dc6066L,
0x4d9b3063L, 0x495a2dd4L, 0x44190b0dL, 0x40d816baL,
0xaca5c697L, 0xa864db20L, 0xa527fdf9L, 0xa1e6e04eL,
0xbfa1b04bL, 0xbb60adfcL, 0xb6238b25L, 0xb2e29692L,
0x8aad2b2fL, 0x8e6c3698L, 0x832f1041L, 0x87ee0df6L,
0x99a95df3L, 0x9d684044L, 0x902b669dL, 0x94ea7b2aL,
0xe0b41de7L, 0xe4750050L, 0xe9362689L, 0xedf73b3eL,
0xf3b06b3bL, 0xf771768cL, 0xfa325055L, 0xfef34de2L,
0xc6bcf05fL, 0xc27dede8L, 0xcf3ecb31L, 0xcbffd686L,
0xd5b88683L, 0xd1799b34L, 0xdc3abdedL, 0xd8fba05aL,
0x690ce0eeL, 0x6dcdfd59L, 0x608edb80L, 0x644fc637L,
0x7a089632L, 0x7ec98b85L, 0x738aad5cL, 0x774bb0ebL,
0x4f040d56L, 0x4bc510e1L, 0x46863638L, 0x42472b8fL,
0x5c007b8aL, 0x58c1663dL, 0x558240e4L, 0x51435d53L,
0x251d3b9eL, 0x21dc2629L, 0x2c9f00f0L, 0x285e1d47L,
0x36194d42L, 0x32d850f5L, 0x3f9b762cL, 0x3b5a6b9bL,
0x0315d626L, 0x07d4cb91L, 0x0a97ed48L, 0x0e56f0ffL,
0x1011a0faL, 0x14d0bd4dL, 0x19939b94L, 0x1d528623L,
0xf12f560eL, 0xf5ee4bb9L, 0xf8ad6d60L, 0xfc6c70d7L,
0xe22b20d2L, 0xe6ea3d65L, 0xeba91bbcL, 0xef68060bL,
0xd727bbb6L, 0xd3e6a601L, 0xdea580d8L, 0xda649d6fL,
0xc423cd6aL, 0xc0e2d0ddL, 0xcda1f604L, 0xc960ebb3L,
0xbd3e8d7eL, 0xb9ff90c9L, 0xb4bcb610L, 0xb07daba7L,
0xae3afba2L, 0xaafbe615L, 0xa7b8c0ccL, 0xa379dd7bL,
0x9b3660c6L, 0x9ff77d71L, 0x92b45ba8L, 0x9675461fL,
0x8832161aL, 0x8cf30badL, 0x81b02d74L, 0x857130c3L,
0x5d8a9099L, 0x594b8d2eL, 0x5408abf7L, 0x50c9b640L,
0x4e8ee645L, 0x4a4ffbf2L, 0x470cdd2bL, 0x43cdc09cL,
0x7b827d21L, 0x7f436096L, 0x7200464fL, 0x76c15bf8L,
0x68860bfdL, 0x6c47164aL, 0x61043093L, 0x65c52d24L,
0x119b4be9L, 0x155a565eL, 0x18197087L, 0x1cd86d30L,
0x029f3d35L, 0x065e2082L, 0x0b1d065bL, 0x0fdc1becL,
0x3793a651L, 0x3352bbe6L, 0x3e119d3fL, 0x3ad08088L,
0x2497d08dL, 0x2056cd3aL, 0x2d15ebe3L, 0x29d4f654L,
0xc5a92679L, 0xc1683bceL, 0xcc2b1d17L, 0xc8ea00a0L,
0xd6ad50a5L, 0xd26c4d12L, 0xdf2f6bcbL, 0xdbee767cL,
0xe3a1cbc1L, 0xe760d676L, 0xea23f0afL, 0xeee2ed18L,
0xf0a5bd1dL, 0xf464a0aaL, 0xf9278673L, 0xfde69bc4L,
0x89b8fd09L, 0x8d79e0beL, 0x803ac667L, 0x84fbdbd0L,
0x9abc8bd5L, 0x9e7d9662L, 0x933eb0bbL, 0x97ffad0cL,
0xafb010b1L, 0xab710d06L, 0xa6322bdfL, 0xa2f33668L,
0xbcb4666dL, 0xb8757bdaL, 0xb5365d03L, 0xb1f740b4L,
};
uint32_t calc_crc32(const uint8_t *data, uint32_t len)
{
#define M2 0xffffff00
const uint32_t init = 0xffffffff;
const uint32_t xor = 0xffffffff;
uint32_t crc = init;
while(len--) {
crc=((crc<<8)&M2)^CRC_TABLE[((crc>>24)&0xff)^*data++];
}
return crc ^ xor;
} | c |
pset3/find/less/tests/sort.c | UncleRumbert/osd-cs-cs50 | 0 | 8156766 | #include <cs50.h>
#include <stdio.h>
void sort(int values[], int n)
{
int temp = 0;
for (int i = 0; i < n - 1; i++)
{
if (values[i] > values[i + 1])
{
temp = values[i];
values[i] = values[i + 1];
values[i + 1] = temp;
i = 0;
}
}
return;
}
int main(void)
{
int test[] = {18, 12, 14, 13, 17, 15, 16};
sort(test, 7);
for (int i = 0; i < 7; i++)
{
printf("%i\n", test[i]);
}
} | c |
Homework/Homework5/minesweeper.h | RogelioASR/C | 0 | 4789949 | #define forloop(i, x) for(i = 0; i != x; i++)//i used it a lot so just to make it easier
#define BOMB -1 //set bombs
#define CONTL 10 //number of rows and columns (counter line)
#define LOST 'l'
#define WON 'O'
#define OK '?'
void bombs(int);
void neighbours(int);
int open();
void kaboom();
void empty(int, int);
char field(int, int);
void set(int, int, char); | c |
main.c | j000/expression | 0 | 39527 | #include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include "bool.h"
#include "stack.h"
int main(int argc, char **argv) {
printf("char: %zu\n", sizeof(char));
printf("int: %zu\n", sizeof(int));
printf("long: %zu\n", sizeof(long));
printf("double: %zu\n", sizeof(double));
printf("void *: %zu\n", sizeof(void *));
stack_t stack = stack_create(STACK_DOUBLE);
stack_push(stack, (double)1);
stack_push(stack, (unsigned long)0);
stack_push(stack, 2.);
stack_push(stack, 3);
while (!stack_is_empty(stack)) {
double tmp;
stack_pop(stack, &tmp);
printf("%f\n", tmp);
}
/* handle arguments */
FILE *input = stdin;
if (argc >= 2 && strcmp(argv[1], "-") != 0) {
input = fopen(argv[1], "r");
if (input == NULL) {
fprintf(
stderr,
"Unable to open file %s for reading: %s\n",
argv[1],
strerror(errno)
);
exit(EXIT_FAILURE);
}
}
FILE *output = stdout;
if (argc >= 3 && strcmp(argv[2], "-") != 0) {
output = fopen(argv[2], "w");
if (output == NULL) {
fprintf(
stderr,
"Unable to open file %s for writing: %s\n",
argv[2],
strerror(errno)
);
exit(EXIT_FAILURE);
}
}
/* TODO: tokenize */
/* TODO: parse */
/* TODO: generate tree */
return EXIT_SUCCESS;
} | c |
ompi/contrib/vt/vt/extlib/otf/tools/otfprofile-mpi/create_latex.h | bringhurst/ompi | 1 | 199976 | /*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2011.
Authors: <NAME>, <NAME>, <NAME>
*/
#ifndef CREATE_LATEX_H
#define CREATE_LATEX_H
#include "datastructs.h"
/* generate PGF output */
bool CreateTex( AllData& alldata );
#endif /* CREATE_LATEX_H */ | c |
freebsd5/sys/compat/svr4/svr4_proto.h | MarginC/kame | 91 | 3293745 | /*
* System call prototypes.
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD: src/sys/compat/svr4/svr4_proto.h,v 1.12 2002/03/20 05:41:38 alfred Exp $
* created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.11 2000/08/31 22:54:05 obrien Exp
*/
#ifndef _SVR4_SYSPROTO_H_
#define _SVR4_SYSPROTO_H_
#include <sys/signal.h>
#include <sys/acl.h>
struct proc;
struct thread;
#define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \
0 : sizeof(register_t) - sizeof(t))
struct svr4_sys_open_args {
char * path; char path_[PAD_(char *)];
int flags; char flags_[PAD_(int)];
int mode; char mode_[PAD_(int)];
};
struct svr4_sys_wait_args {
int * status; char status_[PAD_(int *)];
};
struct svr4_sys_creat_args {
char * path; char path_[PAD_(char *)];
int mode; char mode_[PAD_(int)];
};
struct svr4_sys_execv_args {
char * path; char path_[PAD_(char *)];
char ** argp; char argp_[PAD_(char **)];
};
struct svr4_sys_time_args {
time_t * t; char t_[PAD_(time_t *)];
};
struct svr4_sys_mknod_args {
char * path; char path_[PAD_(char *)];
int mode; char mode_[PAD_(int)];
int dev; char dev_[PAD_(int)];
};
struct svr4_sys_break_args {
caddr_t nsize; char nsize_[PAD_(caddr_t)];
};
struct svr4_sys_stat_args {
char * path; char path_[PAD_(char *)];
struct svr4_stat * ub; char ub_[PAD_(struct svr4_stat *)];
};
struct svr4_sys_alarm_args {
unsigned sec; char sec_[PAD_(unsigned)];
};
struct svr4_sys_fstat_args {
int fd; char fd_[PAD_(int)];
struct svr4_stat * sb; char sb_[PAD_(struct svr4_stat *)];
};
struct svr4_sys_pause_args {
register_t dummy;
};
struct svr4_sys_utime_args {
char * path; char path_[PAD_(char *)];
struct svr4_utimbuf * ubuf; char ubuf_[PAD_(struct svr4_utimbuf *)];
};
struct svr4_sys_access_args {
char * path; char path_[PAD_(char *)];
int flags; char flags_[PAD_(int)];
};
struct svr4_sys_nice_args {
int prio; char prio_[PAD_(int)];
};
struct svr4_sys_kill_args {
int pid; char pid_[PAD_(int)];
int signum; char signum_[PAD_(int)];
};
struct svr4_sys_pgrpsys_args {
int cmd; char cmd_[PAD_(int)];
int pid; char pid_[PAD_(int)];
int pgid; char pgid_[PAD_(int)];
};
struct svr4_sys_times_args {
struct tms * tp; char tp_[PAD_(struct tms *)];
};
struct svr4_sys_signal_args {
int signum; char signum_[PAD_(int)];
svr4_sig_t handler; char handler_[PAD_(svr4_sig_t)];
};
#if defined(NOTYET)
struct svr4_sys_msgsys_args {
int what; char what_[PAD_(int)];
int a2; char a2_[PAD_(int)];
int a3; char a3_[PAD_(int)];
int a4; char a4_[PAD_(int)];
int a5; char a5_[PAD_(int)];
};
#else
#endif
struct svr4_sys_sysarch_args {
int op; char op_[PAD_(int)];
void * a1; char a1_[PAD_(void *)];
};
struct svr4_sys_ioctl_args {
int fd; char fd_[PAD_(int)];
u_long com; char com_[PAD_(u_long)];
caddr_t data; char data_[PAD_(caddr_t)];
};
struct svr4_sys_utssys_args {
void * a1; char a1_[PAD_(void *)];
void * a2; char a2_[PAD_(void *)];
int sel; char sel_[PAD_(int)];
void * a3; char a3_[PAD_(void *)];
};
struct svr4_sys_execve_args {
char * path; char path_[PAD_(char *)];
char ** argp; char argp_[PAD_(char **)];
char ** envp; char envp_[PAD_(char **)];
};
struct svr4_sys_fcntl_args {
int fd; char fd_[PAD_(int)];
int cmd; char cmd_[PAD_(int)];
char * arg; char arg_[PAD_(char *)];
};
struct svr4_sys_ulimit_args {
int cmd; char cmd_[PAD_(int)];
long newlimit; char newlimit_[PAD_(long)];
};
struct svr4_sys_getdents_args {
int fd; char fd_[PAD_(int)];
char * buf; char buf_[PAD_(char *)];
int nbytes; char nbytes_[PAD_(int)];
};
struct svr4_sys_getmsg_args {
int fd; char fd_[PAD_(int)];
struct svr4_strbuf * ctl; char ctl_[PAD_(struct svr4_strbuf *)];
struct svr4_strbuf * dat; char dat_[PAD_(struct svr4_strbuf *)];
int * flags; char flags_[PAD_(int *)];
};
struct svr4_sys_putmsg_args {
int fd; char fd_[PAD_(int)];
struct svr4_strbuf * ctl; char ctl_[PAD_(struct svr4_strbuf *)];
struct svr4_strbuf * dat; char dat_[PAD_(struct svr4_strbuf *)];
int flags; char flags_[PAD_(int)];
};
struct svr4_sys_poll_args {
struct pollfd * fds; char fds_[PAD_(struct pollfd *)];
unsigned int nfds; char nfds_[PAD_(unsigned int)];
int timeout; char timeout_[PAD_(int)];
};
struct svr4_sys_lstat_args {
char * path; char path_[PAD_(char *)];
struct svr4_stat * ub; char ub_[PAD_(struct svr4_stat *)];
};
struct svr4_sys_sigprocmask_args {
int how; char how_[PAD_(int)];
svr4_sigset_t * set; char set_[PAD_(svr4_sigset_t *)];
svr4_sigset_t * oset; char oset_[PAD_(svr4_sigset_t *)];
};
struct svr4_sys_sigsuspend_args {
svr4_sigset_t * ss; char ss_[PAD_(svr4_sigset_t *)];
};
struct svr4_sys_sigaltstack_args {
struct svr4_sigaltstack * nss; char nss_[PAD_(struct svr4_sigaltstack *)];
struct svr4_sigaltstack * oss; char oss_[PAD_(struct svr4_sigaltstack *)];
};
struct svr4_sys_sigaction_args {
int signum; char signum_[PAD_(int)];
struct svr4_sigaction * nsa; char nsa_[PAD_(struct svr4_sigaction *)];
struct svr4_sigaction * osa; char osa_[PAD_(struct svr4_sigaction *)];
};
struct svr4_sys_sigpending_args {
int what; char what_[PAD_(int)];
svr4_sigset_t * mask; char mask_[PAD_(svr4_sigset_t *)];
};
struct svr4_sys_context_args {
int func; char func_[PAD_(int)];
struct svr4_ucontext * uc; char uc_[PAD_(struct svr4_ucontext *)];
};
struct svr4_sys_statvfs_args {
char * path; char path_[PAD_(char *)];
struct svr4_statvfs * fs; char fs_[PAD_(struct svr4_statvfs *)];
};
struct svr4_sys_fstatvfs_args {
int fd; char fd_[PAD_(int)];
struct svr4_statvfs * fs; char fs_[PAD_(struct svr4_statvfs *)];
};
struct svr4_sys_waitsys_args {
int grp; char grp_[PAD_(int)];
int id; char id_[PAD_(int)];
union svr4_siginfo * info; char info_[PAD_(union svr4_siginfo *)];
int options; char options_[PAD_(int)];
};
struct svr4_sys_hrtsys_args {
int cmd; char cmd_[PAD_(int)];
int fun; char fun_[PAD_(int)];
int sub; char sub_[PAD_(int)];
void * rv1; char rv1_[PAD_(void *)];
void * rv2; char rv2_[PAD_(void *)];
};
struct svr4_sys_pathconf_args {
char * path; char path_[PAD_(char *)];
int name; char name_[PAD_(int)];
};
struct svr4_sys_mmap_args {
caddr_t addr; char addr_[PAD_(caddr_t)];
svr4_size_t len; char len_[PAD_(svr4_size_t)];
int prot; char prot_[PAD_(int)];
int flags; char flags_[PAD_(int)];
int fd; char fd_[PAD_(int)];
svr4_off_t pos; char pos_[PAD_(svr4_off_t)];
};
struct svr4_sys_fpathconf_args {
int fd; char fd_[PAD_(int)];
int name; char name_[PAD_(int)];
};
struct svr4_sys_xstat_args {
int two; char two_[PAD_(int)];
char * path; char path_[PAD_(char *)];
struct svr4_xstat * ub; char ub_[PAD_(struct svr4_xstat *)];
};
struct svr4_sys_lxstat_args {
int two; char two_[PAD_(int)];
char * path; char path_[PAD_(char *)];
struct svr4_xstat * ub; char ub_[PAD_(struct svr4_xstat *)];
};
struct svr4_sys_fxstat_args {
int two; char two_[PAD_(int)];
int fd; char fd_[PAD_(int)];
struct svr4_xstat * sb; char sb_[PAD_(struct svr4_xstat *)];
};
struct svr4_sys_xmknod_args {
int two; char two_[PAD_(int)];
char * path; char path_[PAD_(char *)];
svr4_mode_t mode; char mode_[PAD_(svr4_mode_t)];
svr4_dev_t dev; char dev_[PAD_(svr4_dev_t)];
};
struct svr4_sys_setrlimit_args {
int which; char which_[PAD_(int)];
const struct svr4_rlimit * rlp; char rlp_[PAD_(const struct svr4_rlimit *)];
};
struct svr4_sys_getrlimit_args {
int which; char which_[PAD_(int)];
struct svr4_rlimit * rlp; char rlp_[PAD_(struct svr4_rlimit *)];
};
struct svr4_sys_memcntl_args {
void * addr; char addr_[PAD_(void *)];
svr4_size_t len; char len_[PAD_(svr4_size_t)];
int cmd; char cmd_[PAD_(int)];
void * arg; char arg_[PAD_(void *)];
int attr; char attr_[PAD_(int)];
int mask; char mask_[PAD_(int)];
};
struct svr4_sys_uname_args {
struct svr4_utsname * name; char name_[PAD_(struct svr4_utsname *)];
int dummy; char dummy_[PAD_(int)];
};
struct svr4_sys_sysconfig_args {
int name; char name_[PAD_(int)];
};
struct svr4_sys_systeminfo_args {
int what; char what_[PAD_(int)];
char * buf; char buf_[PAD_(char *)];
long len; char len_[PAD_(long)];
};
struct svr4_sys_fchroot_args {
int fd; char fd_[PAD_(int)];
};
struct svr4_sys_utimes_args {
char * path; char path_[PAD_(char *)];
struct timeval * tptr; char tptr_[PAD_(struct timeval *)];
};
struct svr4_sys_vhangup_args {
register_t dummy;
};
struct svr4_sys_gettimeofday_args {
struct timeval * tp; char tp_[PAD_(struct timeval *)];
};
struct svr4_sys_llseek_args {
int fd; char fd_[PAD_(int)];
long offset1; char offset1_[PAD_(long)];
long offset2; char offset2_[PAD_(long)];
int whence; char whence_[PAD_(int)];
};
struct svr4_sys_acl_args {
char * path; char path_[PAD_(char *)];
int cmd; char cmd_[PAD_(int)];
int num; char num_[PAD_(int)];
struct svr4_aclent * buf; char buf_[PAD_(struct svr4_aclent *)];
};
struct svr4_sys_auditsys_args {
int code; char code_[PAD_(int)];
int a1; char a1_[PAD_(int)];
int a2; char a2_[PAD_(int)];
int a3; char a3_[PAD_(int)];
int a4; char a4_[PAD_(int)];
int a5; char a5_[PAD_(int)];
};
struct svr4_sys_facl_args {
int fd; char fd_[PAD_(int)];
int cmd; char cmd_[PAD_(int)];
int num; char num_[PAD_(int)];
struct svr4_aclent * buf; char buf_[PAD_(struct svr4_aclent *)];
};
struct svr4_sys_resolvepath_args {
const char * path; char path_[PAD_(const char *)];
char * buf; char buf_[PAD_(char *)];
size_t bufsiz; char bufsiz_[PAD_(size_t)];
};
struct svr4_sys_getdents64_args {
int fd; char fd_[PAD_(int)];
struct svr4_dirent64 * dp; char dp_[PAD_(struct svr4_dirent64 *)];
int nbytes; char nbytes_[PAD_(int)];
};
struct svr4_sys_mmap64_args {
void * addr; char addr_[PAD_(void *)];
svr4_size_t len; char len_[PAD_(svr4_size_t)];
int prot; char prot_[PAD_(int)];
int flags; char flags_[PAD_(int)];
int fd; char fd_[PAD_(int)];
svr4_off64_t pos; char pos_[PAD_(svr4_off64_t)];
};
struct svr4_sys_stat64_args {
char * path; char path_[PAD_(char *)];
struct svr4_stat64 * sb; char sb_[PAD_(struct svr4_stat64 *)];
};
struct svr4_sys_lstat64_args {
char * path; char path_[PAD_(char *)];
struct svr4_stat64 * sb; char sb_[PAD_(struct svr4_stat64 *)];
};
struct svr4_sys_fstat64_args {
int fd; char fd_[PAD_(int)];
struct svr4_stat64 * sb; char sb_[PAD_(struct svr4_stat64 *)];
};
struct svr4_sys_statvfs64_args {
char * path; char path_[PAD_(char *)];
struct svr4_statvfs64 * fs; char fs_[PAD_(struct svr4_statvfs64 *)];
};
struct svr4_sys_fstatvfs64_args {
int fd; char fd_[PAD_(int)];
struct svr4_statvfs64 * fs; char fs_[PAD_(struct svr4_statvfs64 *)];
};
struct svr4_sys_setrlimit64_args {
int which; char which_[PAD_(int)];
const struct svr4_rlimit64 * rlp; char rlp_[PAD_(const struct svr4_rlimit64 *)];
};
struct svr4_sys_getrlimit64_args {
int which; char which_[PAD_(int)];
struct svr4_rlimit64 * rlp; char rlp_[PAD_(struct svr4_rlimit64 *)];
};
struct svr4_sys_creat64_args {
char * path; char path_[PAD_(char *)];
int mode; char mode_[PAD_(int)];
};
struct svr4_sys_open64_args {
char * path; char path_[PAD_(char *)];
int flags; char flags_[PAD_(int)];
int mode; char mode_[PAD_(int)];
};
struct svr4_sys_socket_args {
int domain; char domain_[PAD_(int)];
int type; char type_[PAD_(int)];
int protocol; char protocol_[PAD_(int)];
};
struct svr4_sys_recv_args {
int s; char s_[PAD_(int)];
caddr_t buf; char buf_[PAD_(caddr_t)];
int len; char len_[PAD_(int)];
int flags; char flags_[PAD_(int)];
};
struct svr4_sys_send_args {
int s; char s_[PAD_(int)];
caddr_t buf; char buf_[PAD_(caddr_t)];
int len; char len_[PAD_(int)];
int flags; char flags_[PAD_(int)];
};
struct svr4_sys_sendto_args {
int s; char s_[PAD_(int)];
void * buf; char buf_[PAD_(void *)];
size_t len; char len_[PAD_(size_t)];
int flags; char flags_[PAD_(int)];
struct sockaddr * to; char to_[PAD_(struct sockaddr *)];
int tolen; char tolen_[PAD_(int)];
};
int svr4_sys_open(struct thread *, struct svr4_sys_open_args *);
int svr4_sys_wait(struct thread *, struct svr4_sys_wait_args *);
int svr4_sys_creat(struct thread *, struct svr4_sys_creat_args *);
int svr4_sys_execv(struct thread *, struct svr4_sys_execv_args *);
int svr4_sys_time(struct thread *, struct svr4_sys_time_args *);
int svr4_sys_mknod(struct thread *, struct svr4_sys_mknod_args *);
int svr4_sys_break(struct thread *, struct svr4_sys_break_args *);
int svr4_sys_stat(struct thread *, struct svr4_sys_stat_args *);
int svr4_sys_alarm(struct thread *, struct svr4_sys_alarm_args *);
int svr4_sys_fstat(struct thread *, struct svr4_sys_fstat_args *);
int svr4_sys_pause(struct thread *, struct svr4_sys_pause_args *);
int svr4_sys_utime(struct thread *, struct svr4_sys_utime_args *);
int svr4_sys_access(struct thread *, struct svr4_sys_access_args *);
int svr4_sys_nice(struct thread *, struct svr4_sys_nice_args *);
int svr4_sys_kill(struct thread *, struct svr4_sys_kill_args *);
int svr4_sys_pgrpsys(struct thread *, struct svr4_sys_pgrpsys_args *);
int svr4_sys_times(struct thread *, struct svr4_sys_times_args *);
int svr4_sys_signal(struct thread *, struct svr4_sys_signal_args *);
#if defined(NOTYET)
int svr4_sys_msgsys(struct thread *, struct svr4_sys_msgsys_args *);
#else
#endif
int svr4_sys_sysarch(struct thread *, struct svr4_sys_sysarch_args *);
int svr4_sys_ioctl(struct thread *, struct svr4_sys_ioctl_args *);
int svr4_sys_utssys(struct thread *, struct svr4_sys_utssys_args *);
int svr4_sys_execve(struct thread *, struct svr4_sys_execve_args *);
int svr4_sys_fcntl(struct thread *, struct svr4_sys_fcntl_args *);
int svr4_sys_ulimit(struct thread *, struct svr4_sys_ulimit_args *);
int svr4_sys_getdents(struct thread *, struct svr4_sys_getdents_args *);
int svr4_sys_getmsg(struct thread *, struct svr4_sys_getmsg_args *);
int svr4_sys_putmsg(struct thread *, struct svr4_sys_putmsg_args *);
int svr4_sys_poll(struct thread *, struct svr4_sys_poll_args *);
int svr4_sys_lstat(struct thread *, struct svr4_sys_lstat_args *);
int svr4_sys_sigprocmask(struct thread *, struct svr4_sys_sigprocmask_args *);
int svr4_sys_sigsuspend(struct thread *, struct svr4_sys_sigsuspend_args *);
int svr4_sys_sigaltstack(struct thread *, struct svr4_sys_sigaltstack_args *);
int svr4_sys_sigaction(struct thread *, struct svr4_sys_sigaction_args *);
int svr4_sys_sigpending(struct thread *, struct svr4_sys_sigpending_args *);
int svr4_sys_context(struct thread *, struct svr4_sys_context_args *);
int svr4_sys_statvfs(struct thread *, struct svr4_sys_statvfs_args *);
int svr4_sys_fstatvfs(struct thread *, struct svr4_sys_fstatvfs_args *);
int svr4_sys_waitsys(struct thread *, struct svr4_sys_waitsys_args *);
int svr4_sys_hrtsys(struct thread *, struct svr4_sys_hrtsys_args *);
int svr4_sys_pathconf(struct thread *, struct svr4_sys_pathconf_args *);
int svr4_sys_mmap(struct thread *, struct svr4_sys_mmap_args *);
int svr4_sys_fpathconf(struct thread *, struct svr4_sys_fpathconf_args *);
int svr4_sys_xstat(struct thread *, struct svr4_sys_xstat_args *);
int svr4_sys_lxstat(struct thread *, struct svr4_sys_lxstat_args *);
int svr4_sys_fxstat(struct thread *, struct svr4_sys_fxstat_args *);
int svr4_sys_xmknod(struct thread *, struct svr4_sys_xmknod_args *);
int svr4_sys_setrlimit(struct thread *, struct svr4_sys_setrlimit_args *);
int svr4_sys_getrlimit(struct thread *, struct svr4_sys_getrlimit_args *);
int svr4_sys_memcntl(struct thread *, struct svr4_sys_memcntl_args *);
int svr4_sys_uname(struct thread *, struct svr4_sys_uname_args *);
int svr4_sys_sysconfig(struct thread *, struct svr4_sys_sysconfig_args *);
int svr4_sys_systeminfo(struct thread *, struct svr4_sys_systeminfo_args *);
int svr4_sys_fchroot(struct thread *, struct svr4_sys_fchroot_args *);
int svr4_sys_utimes(struct thread *, struct svr4_sys_utimes_args *);
int svr4_sys_vhangup(struct thread *, struct svr4_sys_vhangup_args *);
int svr4_sys_gettimeofday(struct thread *, struct svr4_sys_gettimeofday_args *);
int svr4_sys_llseek(struct thread *, struct svr4_sys_llseek_args *);
int svr4_sys_acl(struct thread *, struct svr4_sys_acl_args *);
int svr4_sys_auditsys(struct thread *, struct svr4_sys_auditsys_args *);
int svr4_sys_facl(struct thread *, struct svr4_sys_facl_args *);
int svr4_sys_resolvepath(struct thread *, struct svr4_sys_resolvepath_args *);
int svr4_sys_getdents64(struct thread *, struct svr4_sys_getdents64_args *);
int svr4_sys_mmap64(struct thread *, struct svr4_sys_mmap64_args *);
int svr4_sys_stat64(struct thread *, struct svr4_sys_stat64_args *);
int svr4_sys_lstat64(struct thread *, struct svr4_sys_lstat64_args *);
int svr4_sys_fstat64(struct thread *, struct svr4_sys_fstat64_args *);
int svr4_sys_statvfs64(struct thread *, struct svr4_sys_statvfs64_args *);
int svr4_sys_fstatvfs64(struct thread *, struct svr4_sys_fstatvfs64_args *);
int svr4_sys_setrlimit64(struct thread *, struct svr4_sys_setrlimit64_args *);
int svr4_sys_getrlimit64(struct thread *, struct svr4_sys_getrlimit64_args *);
int svr4_sys_creat64(struct thread *, struct svr4_sys_creat64_args *);
int svr4_sys_open64(struct thread *, struct svr4_sys_open64_args *);
int svr4_sys_socket(struct thread *, struct svr4_sys_socket_args *);
int svr4_sys_recv(struct thread *, struct svr4_sys_recv_args *);
int svr4_sys_send(struct thread *, struct svr4_sys_send_args *);
int svr4_sys_sendto(struct thread *, struct svr4_sys_sendto_args *);
#ifdef COMPAT_43
#if defined(NOTYET)
#else
#endif
#endif /* COMPAT_43 */
#undef PAD_
#endif /* !_SVR4_SYSPROTO_H_ */ | c |
JL/datastructure/ts_set.c | jeffreymanzione/jeff-vm-lang-2 | 1 | 215828 | /*
* ts_set.c
*
* Created on: Jan 6, 2019
* Author: Jeff
*/
#include "ts_set.h"
#include "../memory/memory.h"
TsSet *ts_set_create(uint32_t table_size, Hasher hasher, Comparator comparator) {
TsSet *set = ALLOC(TsSet);
ts_set_init(set, table_size, hasher, comparator);
return set;
}
TsSet *ts_set_create_default() {
TsSet *set = ALLOC(TsSet);
ts_set_init(set, DEFAULT_TABLE_SZ, default_hasher, default_comparator);
return set;
}
void ts_set_init(TsSet *set, uint32_t table_size, Hasher hasher,
Comparator comparator) {
set->is_wrapper = false;
set_init(&set->set, table_size, hasher, comparator);
set->set_ptr = &set->set;
// set->lock = create_rwlock();
set->lock = mutex_create(NULL);
}
void ts_set_init_default(TsSet *set) {
ts_set_init(set, DEFAULT_TABLE_SZ, default_hasher, default_comparator);
}
void ts_set_wrap(TsSet *tsset, Set *set) {
tsset->set_ptr = set;
tsset->is_wrapper = true;
// tsset->lock = create_rwlock();
tsset->lock = mutex_create(NULL);
}
void ts_set_delete(TsSet *set) {
ts_set_finalize(set);
DEALLOC(set);
}
void ts_set_finalize(TsSet *set) {
if (!set->is_wrapper) {
set_finalize(&set->set);
}
// close_rwlock(&set->lock);
mutex_close(set->lock);
}
bool ts_set_insert(TsSet *set, const void *v) {
// begin_write(&set->lock);
mutex_await(set->lock, INFINITE);
bool inserted = set_insert(set->set_ptr, v);
// end_write(&set->lock);
mutex_release(set->lock);
return inserted;
}
bool ts_set_remove(TsSet *set, const void *v) {
// begin_write(&set->lock);
mutex_await(set->lock, INFINITE);
bool removed = set_remove(set->set_ptr, v);
// end_write(&set->lock);
mutex_release(set->lock);
return removed;
}
void *ts_set_lookup(const TsSet *set, const void *v) {
// begin_read((RWLock *) &set->lock);
mutex_await(set->lock, INFINITE);
void *val = set_lookup(set->set_ptr, v);
// end_read((RWLock *) &set->lock);
mutex_release(set->lock);
return val;
}
void ts_set_iterate(const TsSet *set, Action action) {
// begin_read((RWLock *) &set->lock);
mutex_await(set->lock, INFINITE);
set_iterate(set->set_ptr, action);
// end_read((RWLock *) &set->lock);
mutex_release(set->lock);
}
int ts_set_size(const TsSet *set) {
// begin_read((RWLock *) &set->lock);
mutex_await(set->lock, INFINITE);
return set_size(set->set_ptr);
// end_read((RWLock *) &set->lock);
mutex_release(set->lock);
} | c |
include/battery_voltage_reader.h | ESaar-t/node-platform | 0 | 103111 | /*
* Battery voltage reader API.
*
* Copyright Thinnect Inc. 2021
* @license MIT
*/
#ifndef BATTERY_VOLTAGE_READER_H_
#define BATTERY_VOLTAGE_READER_H_
#include <stdint.h>
#include <stdbool.h>
/**
* Read battery voltage.
*
* The function will try to acquire the ADC from platform_adc and
* returns quickly with *false* if the ADC is not available.
*
* @param voltage_mV - pointer for returning battery voltage in millivolts.
* @return true if voltage read and returned.
*/
bool read_battery_voltage (uint16_t * voltage_mV);
#endif//BATTERY_VOLTAGE_READER_H_ | c |
platform/switch/switch_wrapper.h | GX-Plan/godot | 0 | 7169511 | /*************************************************************************/
/* switch_wrapper.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 <NAME>, <NAME>. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* 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. */
/*************************************************************************/
#define Mutex LibnxMutex
#define Semaphore LibnxSemaphore
#define Thread LibnxThread
#define AudioDriver LibnxAudioDriver
#define KEY_A LIBNX_KEY_A
#define KEY_B LIBNX_KEY_B
#define KEY_X LIBNX_KEY_X
#define KEY_Y LIBNX_KEY_Y
#define KEY_LSTICK LIBNX_KEY_LSTICK
#define KEY_RSTICK LIBNX_KEY_RSTICK
#define KEY_L LIBNX_KEY_L
#define KEY_R LIBNX_KEY_R
#define KEY_ZL LIBNX_KEY_ZL
#define KEY_ZR LIBNX_KEY_ZR
#define KEY_PLUS LIBNX_KEY_PLUS
#define KEY_MINUS LIBNX_KEY_MINUS
#define KEY_DLEFT LIBNX_KEY_DLEFT
#define KEY_DUP LIBNX_KEY_DUP
#define KEY_DRIGHT LIBNX_KEY_DRIGHT
#define KEY_DDOWN LIBNX_KEY_DDOWN
#define KEY_LSTICK_LEFT LIBNX_KEY_LSTICK_LEFT
#define KEY_LSTICK_UP LIBNX_KEY_LSTICK_UP
#define KEY_LSTICK_RIGHT LIBNX_KEY_LSTICK_RIGHT
#define KEY_LSTICK_DOWN LIBNX_KEY_LSTICK_DOWN
#define KEY_RSTICK_LEFT LIBNX_KEY_RSTICK_LEFT
#define KEY_RSTICK_UP LIBNX_KEY_RSTICK_UP
#define KEY_RSTICK_RIGHT LIBNX_KEY_RSTICK_RIGHT
#define KEY_RSTICK_DOWN LIBNX_KEY_RSTICK_DOWN
#define KEY_SL_LEFT LIBNX_KEY_SL_LEFT
#define KEY_SR_LEFT LIBNX_KEY_SR_LEFT
#define KEY_SL_RIGHT LIBNX_KEY_SL_RIGHT
#define KEY_SR_RIGHT LIBNX_KEY_SR_RIGHT
#define KEY_HOME LIBNX_KEY_HOME
#define KEY_CAPTURE LIBNX_KEY_CAPTURE
#define KEY_TOUCH LIBNX_KEY_TOUCH
#define KEY_JOYCON_RIGHT LIBNX_KEY_JOYCON_RIGHT
#define KEY_JOYCON_DOWN LIBNX_KEY_JOYCON_DOWN
#define KEY_JOYCON_UP LIBNX_KEY_JOYCON_UP
#define KEY_JOYCON_LEFT LIBNX_KEY_JOYCON_LEFT
#define KEY_UP LIBNX_KEY_UP
#define KEY_DOWN LIBNX_KEY_DOWN
#define KEY_LEFT LIBNX_KEY_LEFT
#define KEY_RIGHT LIBNX_KEY_RIGHT
#define KEY_SL LIBNX_KEY_SL
#define KEY_SR LIBNX_KEY_SR
#include <switch.h>
#undef AudioDriver
#undef Thread
#undef Mutex
#undef Semaphore
#undef KEY_A
#undef KEY_B
#undef KEY_X
#undef KEY_Y
#undef KEY_LSTICK
#undef KEY_RSTICK
#undef KEY_L
#undef KEY_R
#undef KEY_ZL
#undef KEY_ZR
#undef KEY_PLUS
#undef KEY_MINUS
#undef KEY_DLEFT
#undef KEY_DUP
#undef KEY_DRIGHT
#undef KEY_DDOWN
#undef KEY_LSTICK_LEFT
#undef KEY_LSTICK_UP
#undef KEY_LSTICK_RIGHT
#undef KEY_LSTICK_DOWN
#undef KEY_RSTICK_LEFT
#undef KEY_RSTICK_UP
#undef KEY_RSTICK_RIGHT
#undef KEY_RSTICK_DOWN
#undef KEY_SL_LEFT
#undef KEY_SR_LEFT
#undef KEY_SL_RIGHT
#undef KEY_SR_RIGHT
#undef KEY_HOME
#undef KEY_CAPTURE
#undef KEY_TOUCH
#undef KEY_JOYCON_RIGHT
#undef KEY_JOYCON_DOWN
#undef KEY_JOYCON_UP
#undef KEY_JOYCON_LEFT
#undef KEY_UP
#undef KEY_DOWN
#undef KEY_LEFT
#undef KEY_RIGHT
#undef KEY_SL
#undef KEY_SR | c |
experiment/aug202015_1/05_tas_true-unreach-call.c_anno.c | heryxpc/prototype | 0 | 5904908 | extern void __VERIFIER_error() __attribute__ ((__noreturn__));
//Simple test_and_set lock with exponential backoff
//
//From Algorithms for Scalable Synchronization on Shared-Memory Multiprocessors, 1991 (Fig. 1).
//Also available as pseudo-code here: http://www.cs.rochester.edu/research/synchronization/pseudocode/ss.html#tas
#include <pthread.h>
#define unlocked 0
#define locked 1
volatile int lock = unlocked;
#define assert(e) { if(!(e)) { ERROR: __VERIFIER_error();(void)0; } }
void __VERIFIER_atomic_TAS(
volatile int *v,
volatile int *o)
{
*o = *v;
*v = 1;
}
inline void acquire_lock(){
int delay;
int cond;
delay = 1;
__VERIFIER_atomic_TAS(&lock,&cond);
while(cond == locked){
//pause(delay);
if(delay*2 > delay)
delay *= 2;
__VERIFIER_atomic_TAS(&lock,&cond);
}
assert(cond != lock);
}
inline void release_lock(){
assert(lock != unlocked);
lock = unlocked;
}
int c = 0;
void* thr1(void *arg){
/* reachable */
while(1){
/* reachable */
acquire_lock();
c++; /* assert not proved */
assert(c == 1); c--;
release_lock();
}
return 0;
/* UNREACHABLE */
}
int main(){
pthread_t t;
/* reachable */
while(1) { /* reachable */
pthread_create(&t, 0, thr1, 0); }
/* UNREACHABLE */
} | c |
EXPERTconnect/UI/Sections/Forms/ECSTextFormItemViewController.h | humanifydev/SDK-iOS | 2 | 2316481 | //
// ECSTextFormItemViewController.h
// EXPERTconnect
//
// Copyright (c) 2015 Humanify, Inc. All rights reserved.
//
#import "ECSFormItemViewController.h"
/**
* View controller for presenting a single line text entry form item. Expected to be
* used as a child view controller of ECSFormViewController
*/
@interface ECSTextFormItemViewController : ECSFormItemViewController
@end | c |
programs/kF/De.c | mirrorscotty/regression | 0 | 7109128 | /**
* @file De.c
* Calculate Deborah number.
*/
#include <math.h>
#include "matrix.h"
#include "material-data.h"
#include "kf.h"
/**
* Determine the lowest number row in kF such that all rows after it contain
* positive values.
* @param kF Vector of kF values.
* @returns Row number
*/
int FindInitialPointkF(vector *kF)
{
int i;
for(i=len(kF); i>0; i--)
if(valV(kF, i) < 0)
return i+1;
return 0;
}
/**
* Determine the lowest number row in RH such that all rows after it fall within
* the tolerance.
* @param RH Vector of relative humidity values
* @returns Row number
*/
int FindInitialPointRH(vector *RH)
{
int i, /* Loop index */
nrows = len(RH); /* Number of data points */
double avg = 0, /* Set the average to zero initially */
tol = 0.05; /* How close to the average we need to be */
/* Calculate the average relative humidity */
for(i=0; i<nrows; i++)
avg += valV(RH, i);
avg = avg/nrows;
/* Find the lowest number row such that all rows after it fall within the
* tolerance */
for(i=nrows/2; i>0; i--)
if(fabs(valV(RH, i) - avg) > tol)
return i+1;
return 0;
}
/**
* Calculate the Deborah number. The characteristic length used to calculate
* diffusion time scale is taken to be half the thickness of the slab.
* @param initial Row number for the first data point to use.
* @param point Row number for the current data point.
* @param Xdb Vector of moisture contents [kg/kg db]
* @param kF Vector of kF values [1/s]
* @param L0 Initial slab thickness (full thickness) [m]
* @param T Temperature (assumed constant) [K]
* @param m Set of Maxwell parameters used for determining mean relaxation time.
* @returns Deborah number [-]
*/
double DeborahNumber(int initial,
int point,
vector *Xdb,
vector *kF,
double L0,
double T,
maxwell* m)
{
double Dkf0, /* Diffusivity at t=0 (calculated from kF values) */
D0, /* Diffusivity at t=0 (calculated from model) */
Di, /* Diffusivity at current time (from model) */
D, /* Diffusivity (adjusted) */
Li, /* Length at current time (from kF value) */
Xdb0, /* Initial moisture content */
kf0, /* Initial kF */
Xdbi, /* Current moisture content */
kFi, /* Current kF value */
tD, /* Characteristic diffusion time */
tr; /* Mean relaxation time */
/* Grab the initial moisture content and kF values */
Xdb0 = valV(Xdb, initial);
kf0 = valV(kF, initial);
/* Get the ones at the time we're interested in. */
Xdbi = valV(Xdb, point);
kFi = valV(kF, point);
/* Calculate diffusivities */
Dkf0 = kf0*L0*L0/(M_PI*M_PI);
D0 = DiffCh10(Xdb0, T);
Di = DiffCh10(Xdbi, T);
/* Normalize the model diffusivity based on the initial diffusivity from the
* kF value */
D = Di/D0*Dkf0;
/* Calculate the current length */
Li = sqrt(M_PI*M_PI*D/kFi);
Li = Li/2;
/* Calculate characteristic diffusion time and mean relaxation time. */
tD = Li*Li/D;
tr = MeanRelaxTime(m);
/* De = tr/tD */
return tr/tD;
}
/**
* Create a matrix of Deborah numbers, one of each data point.
* @param Xdb Row matrix of moisture contents [kg/kg db]
* @param kF Row matrix of kF values [1/s]
* @param L0 Initial length [m]
* @param T Drying temperature [K]
* @param m Set of Maxwell material parameters.
* @returns Vector of Deborah numbers.
*/
vector* DeborahMatrix(int initial,
vector *Xdb,
vector *kF,
double L0,
double T,
maxwell* m)
{
int i;
vector* De;
De = CreateVector(len(kF));
for(i=0; i<initial; i++)
setvalV(De, i, 0);
for(i=initial; i<len(De); i++)
setvalV(De, i, DeborahNumber(initial, i, Xdb, kF, L0, T, m));
return De;
}
/**
* Diffusivity calculations
*/
vector* DOswinVector(int initial, vector *X, double T)
{
int i;
vector *D;
D = CreateVector(len(X));
for(i=0; i<len(X); i++)
setvalV(D, i, DiffCh10(valV(X, i), T));
return D;
} | c |
C/Algorithm/FillMatrix.c | piovezan/SOpt | 148 | 4623107 | #include <stdio.h>
#include <math.h>
void receber_matriz(int l, int c) {
int M[l][c];
for (int linha = 0; linha < l ; linha++) {
for (int coluna = 0; coluna < c; coluna++) {
printf ("\nInsira o valor do numero da linha: %d e da coluna: %d", linha, coluna);
scanf ("%d", &M[linha][coluna]);
}
}
}
int main () {
int l = 3;
int c = 3;
receber_matriz(l, c);
}
//https://pt.stackoverflow.com/q/91682/101
//https://pt.stackoverflow.com/q/91682/101 | c |
include/II_K7/ch16_ddc_source_c.h | Innovative-DSP/gr-II_K7_310R | 0 | 8249676 | /* -*- c++ -*- */
/*
* Copyright 2016 Innovative Integration, Inc.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This software 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 software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_II_K7_CH16_DDC_SOURCE_C_H
#define INCLUDED_II_K7_CH16_DDC_SOURCE_C_H
#include <II_K7/api.h>
#include <gnuradio/sync_block.h>
namespace gr {
namespace II_K7 {
enum DdcFmcModule {DdcFmc250Module, DdcFmc310Module}; // AKA LibIoSelector in GRGpK7Interface
enum Ch16TriggerSource {Ch16Software, Ch16External};
enum Ch16Source {Adc0, Adc1, Adc2, Adc3, Test};
/*!
* \brief source of DDC data
* \ingroup II_K7
*
*/
class II_K7_API ch16_ddc_source_c : virtual public gr::sync_block
{
public:
typedef boost::shared_ptr<ch16_ddc_source_c> sptr;
/*!
* \brief Return a shared_ptr to a new instance of II_K7::ch16_ddc_source_c.
*
* To avoid accidental use of raw pointers, II_K7::ch16_ddc_source_c's
* constructor is in a private implementation
* class. II_K7::ch16_ddc_source_c::make is the public interface for
* creating new instances.
*/
static sptr make(II_K7::DdcFmcModule fmc_module, short max_ch, float rf_gain, II_K7::Ch16TriggerSource trigger_source,
const char* ddc_filter_path, bool is_rf_tuner, float rf_center_freq,
float ch0_offset_freq, float ch1_offset_freq, float ch2_offset_freq, float ch3_offset_freq,
float ch4_offset_freq, float ch5_offset_freq, float ch6_offset_freq, float ch7_offset_freq,
float ch8_offset_freq, float ch9_offset_freq, float ch10_offset_freq, float ch11_offset_freq,
float ch12_offset_freq, float ch13_offset_freq, float ch14_offset_freq,float ch15_offset_freq,
float ch0_tune_freq, float ch1_tune_freq, float ch2_tune_freq, float ch3_tune_freq,
float ch4_tune_freq, float ch5_tune_freq, float ch6_tune_freq, float ch7_tune_freq,
float ch8_tune_freq, float ch9_tune_freq, float ch10_tune_freq, float ch11_tune_freq,
float ch12_tune_freq, float ch13_tune_freq, float ch14_tune_freq, float ch15_tune_freq,
Ch16Source ch0_source, Ch16Source ch1_source, Ch16Source ch2_source, Ch16Source ch3_source,
Ch16Source ch4_source, Ch16Source ch5_source, Ch16Source ch6_source, Ch16Source ch7_source,
Ch16Source ch8_source, Ch16Source ch9_source, Ch16Source ch10_source, Ch16Source ch11_source,
Ch16Source ch12_source, Ch16Source ch13_source, Ch16Source ch14_source, Ch16Source ch15_source);
};
} // namespace II_K7
} // namespace gr
#endif /* INCLUDED_II_K7_CH16_DDC_SOURCE_C_H */ | c |
src/configuration.h | paper-lark/space-shooter | 0 | 7333969 | #ifndef SPACESHOOTER_CONFIGURATION_H
#define SPACESHOOTER_CONFIGURATION_H
//#define GOD_MODE
#endif | c |
GTpo/src/gtpo/utils.h | winterheart/QuickQanava | 768 | 5098499 | /*
Copyright (c) 2008-2020, <NAME> All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the author or Destrat.io 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 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.
*/
//-----------------------------------------------------------------------------
// This file is a part of the GTpo software library.
//
// \file utils.h
// \author <EMAIL>
// \date 2016 01 22
//-----------------------------------------------------------------------------
#ifndef gtpo_utils_h
#define gtpo_utils_h
// STD headers
#include <algorithm>
#include <exception> // std::runtime_error
#include <memory> // std::weak_ptr
#include <iostream> // std::cout
#include <utility> // std::index_sequence / std::make_index_sequence
namespace gtpo { // ::gtpo
//! Empty class
class empty { };
/*! \brief Exception thrown by GTpo to notify user that a topology related error occurs.
*
* Use what() to have a detailled error description.
*/
class bad_topology_error : public std::runtime_error
{
public:
explicit bad_topology_error (const std::string& what_arg) : std::runtime_error( what_arg ) { }
explicit bad_topology_error (const char* what_arg) : std::runtime_error( what_arg ) { }
bad_topology_error () : bad_topology_error( "GTpo topology unrecoverable error." ) { }
};
/*! Standard GTpo utility to assert an expression \c expr and throw an exception if \c expr is *false*.
*
* Used with no template parameter, assert_throw will throw a gtpo::bad_topology_error with a given \c message.
*
* \note This function does not rely on N_DEBUG, the test will be run even in release mode.
*/
template < class E = gtpo::bad_topology_error >
auto assert_throw( bool expr, std::string message = std::string{ "" } ) noexcept( false ) -> void {
if ( !expr )
throw E{ message };
}
//! Compare two std::weak_ptr that must have been checked for expired() and nullptr content (ie use_count()==0).
template < class T >
auto compare_weak_ptr( const std::weak_ptr<T>& left, const std::weak_ptr<T>& right ) noexcept -> bool {
return !left.owner_before( right ) && !right.owner_before( left );
}
/*! Find a weak_ptr<> element in a STL standard container.
*
* \return true if \c element is found in \c container, false otherwise.
* \throw gtpo::bad_topology_error if the searched element weak_ptr is expired.
*/
template < class C, class T >
auto find_weak_ptr( const C& container, const T& element ) -> bool {
assert_throw( !element.expired(), "gtpo::find_weak_ptr<>(): Error: element is expired." );
auto iter = std::find_if( container.begin(), container.end(),
[=](const T& containerElement ){ return ( compare_weak_ptr<>( containerElement, element ) ); } );
return ( iter != container.end() );
}
/*! Configuration interface for accessing graph containers.
*
* GTpo graph config configuration struct should inherit from ContainerAccessors since
* graph access its nodes, edges and groups container trought the generic insert()/remove() interface.
*
*/
struct container_accessors {
/*! \brief Generic "item inserter" for list/set/vector, specialize for your custom container types.
*/
template <typename T>
struct insert { };
/*! \brief Generic "item remover" for list/set/vector, specialize for your custom container types.
*
* \code
* using IntList = std::list< int >;
* IntList l;
* l.push_back( 42 );
* // Same interface for std::list/set/vector
* gtpo::Defaultconfig::remove<IntList>::from( l, 42 );
* \endcode
*/
template <typename T>
struct remove { };
};
} // ::gtpo
namespace std
{
//! Specialization of std::hash for weak_ptr type.
template< typename T >
struct hash< std::weak_ptr< T > >
{
typedef std::weak_ptr< T > argument_type;
typedef std::size_t result_type;
result_type operator()(argument_type const& key ) const {
return std::hash< typename std::shared_ptr<T> >()( key.lock() );
}
};
//! Specialization of std::equal_to for weak_ptr type.
template< typename T >
struct equal_to< std::weak_ptr< T > >
{
typedef bool result_type;
typedef std::weak_ptr< T > first_argument_type;
typedef std::weak_ptr< T > second_argument_type;
result_type operator()( const first_argument_type& left, const second_argument_type& right ) const
{
return !left.owner_before( right ) && !right.owner_before( left );
}
};
}
#endif // gtpo_utils_h | c |
sdk/sdk/codec/wmadecode/bswap.h | doyaGu/C0501Q_HWJL01 | 1 | 2152369 | /**
* @file bswap.h
* byte swap.
*/
#ifndef __BSWAP_H__
# define __BSWAP_H__
# ifdef ROCKBOX
/* rockbox' optimised inline functions */
# define bswap_16(x) swap16(x)
# define bswap_32(x) swap32(x)
static __inline uint64_t ByteSwap64(uint64_t x)
{
union {
uint64_t ll;
struct {
uint32_t l, h;
} l;
} r;
r.l.l = bswap_32(x);
r.l.h = bswap_32(x >> 32);
return r.ll;
}
# define bswap_64(x) ByteSwap64(x)
# elif defined(ARCH_X86)
static __inline unsigned short ByteSwap16(unsigned short x)
{
__asm("xchgb %b0,%h0": "=q"(x):"0"(x));
return x;
}
# define bswap_16(x) ByteSwap16(x)
static __inline unsigned int ByteSwap32(unsigned int x)
{
# if __CPU__ > 386
__asm("bswap %0": "=r"(x):"0"(x));
# else
__asm("xchgb %b0,%h0\n" " rorl $16,%0\n" " xchgb %b0,%h0": "=q"(x):"0"(x));
# endif
return x;
}
# define bswap_32(x) ByteSwap32(x)
static __inline uint64_t ByteSwap64(uint64_t x)
{
register union {
__extension__ uint64_t __ll;
uint32_t __l[2];
} __x;
asm("xchgl %0,%1": "=r"(__x.__l[0]), "=r"(__x.__l[1]):
"0"(bswap_32((unsigned long) x)), "1"(bswap_32((unsigned long) (x >> 32))));
return __x.__ll;
}
# define bswap_64(x) ByteSwap64(x)
# elif defined(ARCH_SH4)
static __inline uint16_t ByteSwap16(uint16_t x)
{
__asm__("swap.b %0,%0": "=r"(x):"0"(x));
return x;
}
static __inline uint32_t ByteSwap32(uint32_t x)
{
__asm__("swap.b %0,%0\n" "swap.w %0,%0\n" "swap.b %0,%0\n": "=r"(x):"0"(x));
return x;
}
# define bswap_16(x) ByteSwap16(x)
# define bswap_32(x) ByteSwap32(x)
static __inline uint64_t ByteSwap64(uint64_t x)
{
union {
uint64_t ll;
struct {
uint32_t l, h;
} l;
} r;
r.l.l = bswap_32(x);
r.l.h = bswap_32(x >> 32);
return r.ll;
}
# define bswap_64(x) ByteSwap64(x)
# else
# define bswap_16(x) ((((x) << 8) & 0xff00) | (((x) >> 8) & 0x00ff))
# define bswap_32(x) \
((((x) >> 24) & 0x000000ff) | (((x) >> 8 ) & 0x0000ff00) | \
(((x) << 8 ) & 0x00ff0000) | (((x) << 24) & 0xff000000))
static __inline uint64_t ByteSwap64(uint64_t x)
{
union {
uint64_t ll;
uint32_t l[2];
} w, r;
w.ll = x;
r.l[0] = (uint32_t) bswap_32(w.l[1]);
r.l[1] = (uint32_t) bswap_32(w.l[0]);
return r.ll;
}
# define bswap_64(x) ByteSwap64(x)
# endif /* !ARCH_X86 */
// be2me ... BigEndian to MachineEndian
// le2me ... LittleEndian to MachineEndian
# ifdef WORDS_BIGENDIAN
# define be2me_16(x) (x)
# define be2me_32(x) (x)
# define be2me_64(x) (x)
# define le2me_16(x) bswap_16(x)
# define le2me_32(x) bswap_32(x)
# define le2me_64(x) bswap_64(x)
# else
# define be2me_16(x) bswap_16(x)
# define be2me_32(x) bswap_32(x)
# define be2me_64(x) bswap_64(x)
# define le2me_16(x) (x)
# define le2me_32(x) (x)
# define le2me_64(x) (x)
# endif
#endif // __BSWAP_H__ | c |
cl/opencl1/Device.h | k-a-z-u/KLib | 2 | 6646587 | #ifndef K_CL_DEVICE_H
#define K_CL_DEVICE_H
#include "Base.h"
#include "DeviceAttributes.h"
#include <unordered_map>
#include <string>
#include <vector>
namespace K {
namespace CL {
class Platform;
class Device {
CLASS_NAME("Device");
private:
/** the platform this device belongs to */
Platform* platform;
/** the OpenCL internal ID */
cl_device_id id;
/** all loaded attributes */
std::vector<DeviceAttr*> attrs;
public:
/** ctor */
Device(Platform* platform, const cl_device_id id) : platform(platform), id(id) {
verboseMeID(id, "ctor");
fetchDetails(id);
}
/** dtor */
~Device() {
verboseMeID(id, "dtor");
clReleaseDevice(id);
for (DeviceAttr* attr : attrs) {delete attr;}
}
/** no-copy */
Device(const Device& o) = delete;
/** no-assign */
Device& operator = (const Device& o) = delete;
/** get the device's internal ID */
cl_device_id getID() const {
return id;
}
/** cast to string */
operator std::string() const {
return "DEVICE: '" + getAttr(DeviceAttribute::NAME)->toString() +
"' (" + getAttr(DeviceAttribute::VENDOR)->toString() + ")";
}
/** get the platform this device belongs to */
Platform* getPlatform() const {
return platform;
}
/** get a DeviceAttribute by its enum index */
const DeviceAttr* getAttr(const DeviceAttribute attr) const {
return attrs[attr];
}
/** dump all device attributes */
void dumpAttributes() {
std::cout << (std::string) *this << std::endl;
for (const DeviceAttr* attr : attrs) {
std::cout << "\t" << attr->name << ": " << attr->toString() << std::endl;
}
}
private:
/** feth some details for this device */
void fetchDetails(const cl_device_id id) {
verboseMeID(id, "fetching details");
attrs.resize(DeviceAttribute::_END);
// setup
attrs[DeviceAttribute::NAME] = new DeviceAttrString("name", CL_DEVICE_NAME);
attrs[DeviceAttribute::VENDOR] = new DeviceAttrString("vendor", CL_DEVICE_VENDOR);
attrs[DeviceAttribute::DEVICE_VERSION] = new DeviceAttrString("device version", CL_DEVICE_VERSION);
attrs[DeviceAttribute::DEVICE_PROFILE] = new DeviceAttrString("device profile", CL_DEVICE_PROFILE);
attrs[DeviceAttribute::DRIVER_VERSION] = new DeviceAttrString("driver version", CL_DRIVER_VERSION);
attrs[DeviceAttribute::MAX_DIMENSION] = new DeviceAttrInt("max dimension", CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS);
attrs[DeviceAttribute::MAX_WORK_GROUP_SIZE] = new DeviceAttrLong("max WorkGroup size", CL_DEVICE_MAX_WORK_GROUP_SIZE);
attrs[DeviceAttribute::MAX_WORK_ITEM_SIZE_PER_DIM] = new DeviceAttrLongArr("max WorkItem size per dimension", CL_DEVICE_MAX_WORK_ITEM_SIZES, 3);
attrs[DeviceAttribute::COMPILER_AVAILABLE] = new DeviceAttrBool("compiler available", CL_DEVICE_COMPILER_AVAILABLE);
attrs[DeviceAttribute::HAS_ECC] = new DeviceAttrBool("has ECC", CL_DEVICE_ERROR_CORRECTION_SUPPORT);
attrs[DeviceAttribute::MAX_MEM_ALLOC_SIZE] = new DeviceAttrLong("max mem alloc size", CL_DEVICE_MAX_MEM_ALLOC_SIZE);
attrs[DeviceAttribute::GLOBAL_MEM_CACHE_SIZE] = new DeviceAttrLong("global mem cache size", CL_DEVICE_GLOBAL_MEM_CACHE_SIZE);
attrs[DeviceAttribute::GLOBAL_MEM_SIZE] = new DeviceAttrLong("global mem size", CL_DEVICE_GLOBAL_MEM_SIZE);
attrs[DeviceAttribute::LOCAL_MEM_SIZE] = new DeviceAttrLong("local mem size", CL_DEVICE_LOCAL_MEM_SIZE);
attrs[DeviceAttribute::HAS_IMAGE_SUPPORT] = new DeviceAttrBool("image support", CL_DEVICE_IMAGE_SUPPORT);
attrs[DeviceAttribute::IMAGE2D_MAX_WIDTH] = new DeviceAttrSizeT("max 2D image width", CL_DEVICE_IMAGE2D_MAX_WIDTH);
attrs[DeviceAttribute::IMAGE2D_MAX_HEIGHT] = new DeviceAttrSizeT("max 2D image height", CL_DEVICE_IMAGE2D_MAX_HEIGHT);
attrs[DeviceAttribute::IMAGE3D_MAX_WIDTH] = new DeviceAttrSizeT("max 3D image width", CL_DEVICE_IMAGE3D_MAX_WIDTH);
attrs[DeviceAttribute::IMAGE3D_MAX_HEIGHT] = new DeviceAttrSizeT("max 3D image height", CL_DEVICE_IMAGE3D_MAX_HEIGHT);
attrs[DeviceAttribute::IMAGE3D_MAX_DEPTH] = new DeviceAttrSizeT("max 3D image depth", CL_DEVICE_IMAGE3D_MAX_DEPTH);
attrs[DeviceAttribute::MAX_COMPUTE_UNITS] = new DeviceAttrInt("max compue units", CL_DEVICE_MAX_COMPUTE_UNITS);
attrs[DeviceAttribute::MAX_SAMPLERS_PER_KERNEL] = new DeviceAttrInt("max samplers/kernel", CL_DEVICE_MAX_SAMPLERS);
attrs[DeviceAttribute::DEVICE_MAX_CLOCK_FREQ] = new DeviceAttrInt("max clock frequency", CL_DEVICE_MAX_CLOCK_FREQUENCY);
// load
for (DeviceAttr* attr : attrs) {
if (attr != nullptr) {attr->fetch(id);}
}
}
};
}
}
#endif // K_CL_DEVICE_H | c |
code/src/mupen64plus-rsp-paraLLEl/lightning/lib/jit_hppa-fpu.c | OotinnyoO1/N64Wasm | 335 | 7189092 | /*
* Copyright (C) 2013-2019 Free Software Foundation, Inc.
*
* This file is part of GNU lightning.
*
* GNU lightning 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, or (at your option)
* any later version.
*
* GNU lightning 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.
*
* Authors:
* <NAME>
*/
#if PROTO
/* FIXME should actually be hw model/version/etc or other constraint
* that causes a SIGSEGV/SIGILL if using these instructions */
#if 1 //defined(__hpux)
# define FSTXR 0
# define FLDXR 0
#else
# define FSTXR 1
# define FLDXR 1
#endif
#define f39(o,b,x,t) _f39(_jit,o,b,x,t)
static void _f39(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t,jit_int32_t);
#define f40(o,b,x,r) _f40(_jit,o,b,x,r)
static void _f40(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t,jit_int32_t)
maybe_unused;
#define f41(o,b,x,t) _f41(_jit,o,b,x,t)
static void _f41(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t,jit_int32_t);
#define f42(o,b,i,r) _f42(_jit,o,b,i,r)
static void _f42(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t,jit_int32_t);
#define f43(o,b,t,i) f1(o,b,t,i)
#define f45(o,r,a,b,fmt,c,d,e,t) _f45(_jit,o,r,a,b,fmt,c,d,e,t)
static void _f45(jit_state_t*,jit_int32_t,
jit_int32_t,jit_int32_t,jit_int32_t,jit_int32_t,
jit_int32_t,jit_int32_t,jit_int32_t,jit_int32_t) maybe_unused;
#define f46(o,r,a,s,df,sf,b,c,d,t) _f46(_jit,o,r,a,s,df,sf,b,c,d,t)
static void _f46(jit_state_t*,jit_int32_t,jit_int32_t,
jit_int32_t,jit_int32_t,jit_int32_t,jit_int32_t,
jit_int32_t,jit_int32_t,jit_int32_t,jit_int32_t);
#define f47(o,r1,r2,a,fmt,b,c,d,t) f47_48(o,r1,r2,a,fmt,b,c,d,t)
#define f48(o,r1,r2,a,fmt,b,c,d,t) f47_48(o,r1,r2,a,fmt,b,c,d,t)
#define f47_48(o,r1,r2,y,fmt,b,c,d,t) _f47_48(_jit,o,r1,r2,y,fmt,b,c,d,t)
static void _f47_48(jit_state_t*,jit_int32_t,
jit_int32_t,jit_int32_t,jit_int32_t,jit_int32_t,
jit_int32_t,jit_int32_t,jit_int32_t,jit_int32_t);
#define f49(o,r,a,b,c,f,d,e,g,h,i,t) f49_52(o,r,a,b,c,f,d,e,g,h,i,t)
#define f51(o,r1,r2,y,a,f,b,d,e,g,h,c) f49_52(o,r1,r2,y,a,f,b,d,e,g,h,c)
#define f52(o,r1,r2,a,b,f,c,d,e,g,h,t) f49_52(o,r1,r2,a,b,f,c,d,e,g,h,t)
#define f49_52(o,r1,r2,y,v,f,a,b,u,c,d,t) _f49_52(_jit,o,r1,r2,y,v,f,a,b,u,c,d,t)
static void _f49_52(jit_state_t*,jit_int32_t,
jit_int32_t,jit_int32_t,jit_int32_t,
jit_int32_t,jit_int32_t,jit_int32_t,jit_int32_t,
jit_int32_t,jit_int32_t,jit_int32_t,jit_int32_t);
#define f53(o,r1,r2,ta,ra,f,tm) _f53(_jit,o,r1,r2,ta,ra,f,tm)
static void _f53(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t,
jit_int32_t,jit_int32_t,jit_int32_t,jit_int32_t) maybe_unused;
#define f54(o,r1,r2,a,b,f,c,d,e,g,t) _f54(_jit,o,r1,r2,a,b,f,c,d,e,g,t)
static void _f54(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t,
jit_int32_t,jit_int32_t,jit_int32_t,jit_int32_t,
jit_int32_t,jit_int32_t,jit_int32_t,jit_int32_t) maybe_unused;
#define FABS_(f,r,t) f49(0xe,r,0,3,0,f,0,0,0,0,0,t)
#define FABS_S(r,t) FABS_(0,r,t)
#define FABS_D(r,t) FABS_(1,r,t)
#define FABS_Q(r,t) f45(0xc,r,0,3,3,0,0,0,t)
#define FADD_(f,r1,r2,t) f52(0xe,r1,r2,0,0,f,3,0,0,0,0,t)
#define FADD_S(r1,r2,t) FADD_(0,r1,r2,t)
#define FADD_D(r1,r2,t) FADD_(1,r1,r2,t)
#define FADD_Q(r1,r2,t) f48(0xc,r1,r2,0,3,3,0,0,t)
#define FPSR_GT 1
#define FPSR_LT 2
#define FPSR_EQ 4
#define FPSR_UN 8
/*
Actually these are reversed, but easier for the FTEST after the FCMP
fcmp,dbl,false? fr4,fr12 0
fcmp,dbl,false fr4,fr12 1
fcmp,dbl,? fr4,fr12 2
fcmp,dbl,!<=> fr4,fr12 3 ORD
fcmp,dbl,= fr4,fr12 4 NE
fcmp,dbl,=t fr4,fr12 5
fcmp,dbl,?= fr4,fr12 6
fcmp,dbl,!<> fr4,fr12 7 LTGT
fcmp,dbl,!?>= fr4,fr12 8
fcmp,dbl,< fr4,fr12 9 UNGE
fcmp,dbl,?< fr4,fr12 10
fcmp,dbl,!>= fr4,fr12 11 GE
fcmp,dbl,!?> fr4,fr12 12
fcmp,dbl,<= fr4,fr12 13 UNGT
fcmp,dbl,?<= fr4,fr12 14
fcmp,dbl,!> fr4,fr12 15 GT
fcmp,dbl,!?<= fr4,fr12 16
fcmp,dbl,> fr4,fr12 17 UNLE
fcmp,dbl,?> fr4,fr12 18
fcmp,dbl,!<= fr4,fr12 19 LE
fcmp,dbl,!?< fr4,fr12 20
fcmp,dbl,>= fr4,fr12 21 UNLT
fcmp,dbl,?>= fr4,fr12 22
fcmp,dbl,!< fr4,fr12 23 LT
fcmp,dbl,!?= fr4,fr12 24
fcmp,dbl,<> fr4,fr12 25 UNEQ
fcmp,dbl,!= fr4,fr12 26 EQ
fcmp,dbl,!=t fr4,fr12 27
fcmp,dbl,!? fr4,fr12 28
fcmp,dbl,<=> fr4,fr12 29 UNORD
fcmp,dbl,true? fr4,fr12 30
fcmp,dbl,true fr4,fr12 31
*/
#define FCMP_LT 23
#define FCMP_LE 19
#define FCMP_EQ 26
#define FCMP_GE 11
#define FCMP_GT 15
#define FCMP_NE 4
#define FCMP_UNLT 21
#define FCMP_UNLE 17
#define FCMP_UNEQ 25
#define FCMP_UNGE 9
#define FCMP_UNGT 13
#define FCMP_LTGT 7
#define FCMP_ORD 3
#define FCMP_UNORD 29
#define FCMP_(f,r1,r2,c) f51(0xe,r1,r2,0,0,f,2,0,0,0,0,c)
#define FCMP_S_(r1,r2,c) FCMP_(0,r1,r2,c)
#define FCMP_D_(r1,r2,c) FCMP_(1,r1,r2,c)
#define FCMP_Q_(r1,r2,c) f47(0xc,r1,r2,0,3,2,0,0,c)
#define FCMP_S_LT(r1,r2) FCMP_S_(r1,r2,FCMP_LT)
#define FCMP_D_LT(r1,r2) FCMP_D_(r1,r2,FCMP_LT)
#define FCMP_Q_LT(r1,r2) FCMP_Q_(r1,r2,FCMP_LT)
#define FCMP_S_LE(r1,r2) FCMP_S_(r1,r2,FCMP_LE)
#define FCMP_D_LE(r1,r2) FCMP_D_(r1,r2,FCMP_LE)
#define FCMP_Q_LE(r1,r2) FCMP_Q_(r1,r2,FCMP_LE)
#define FCMP_S_EQ(r1,r2) FCMP_S_(r1,r2,FCMP_EQ)
#define FCMP_D_EQ(r1,r2) FCMP_D_(r1,r2,FCMP_EQ)
#define FCMP_Q_EQ(r1,r2) FCMP_Q_(r1,r2,FCMP_EQ)
#define FCMP_S_GE(r1,r2) FCMP_S_(r1,r2,FCMP_GE)
#define FCMP_D_GE(r1,r2) FCMP_D_(r1,r2,FCMP_GE)
#define FCMP_Q_GE(r1,r2) FCMP_Q_(r1,r2,FCMP_GE)
#define FCMP_S_GT(r1,r2) FCMP_S_(r1,r2,FCMP_GT)
#define FCMP_D_GT(r1,r2) FCMP_D_(r1,r2,FCMP_GT)
#define FCMP_Q_GT(r1,r2) FCMP_Q_(r1,r2,FCMP_GT)
#define FCMP_S_NE(r1,r2) FCMP_S_(r1,r2,FCMP_NE)
#define FCMP_D_NE(r1,r2) FCMP_D_(r1,r2,FCMP_NE)
#define FCMP_Q_NE(r1,r2) FCMP_Q_(r1,r2,FCMP_NE)
#define FCMP_S_UNLT(r1,r2) FCMP_S_(r1,r2,FCMP_UNLT)
#define FCMP_D_UNLT(r1,r2) FCMP_D_(r1,r2,FCMP_UNLT)
#define FCMP_Q_UNLT(r1,r2) FCMP_Q_(r1,r2,FCMP_UNLT)
#define FCMP_S_UNLE(r1,r2) FCMP_S_(r1,r2,FCMP_UNLE)
#define FCMP_D_UNLE(r1,r2) FCMP_D_(r1,r2,FCMP_UNLE)
#define FCMP_Q_UNLE(r1,r2) FCMP_Q_(r1,r2,FCMP_UNLE)
#define FCMP_S_UNEQ(r1,r2) FCMP_S_(r1,r2,FCMP_UNEQ)
#define FCMP_D_UNEQ(r1,r2) FCMP_D_(r1,r2,FCMP_UNEQ)
#define FCMP_Q_UNEQ(r1,r2) FCMP_Q_(r1,r2,FCMP_UNEQ)
#define FCMP_S_UNGE(r1,r2) FCMP_S_(r1,r2,FCMP_UNGE)
#define FCMP_D_UNGE(r1,r2) FCMP_D_(r1,r2,FCMP_UNGE)
#define FCMP_Q_UNGE(r1,r2) FCMP_Q_(r1,r2,FCMP_UNGE)
#define FCMP_S_UNGT(r1,r2) FCMP_S_(r1,r2,FCMP_UNGT)
#define FCMP_D_UNGT(r1,r2) FCMP_D_(r1,r2,FCMP_UNGT)
#define FCMP_Q_UNGT(r1,r2) FCMP_Q_(r1,r2,FCMP_UNGT)
#define FCMP_S_LTGT(r1,r2) FCMP_S_(r1,r2,FCMP_LTGT)
#define FCMP_D_LTGT(r1,r2) FCMP_D_(r1,r2,FCMP_LTGT)
#define FCMP_Q_LTGT(r1,r2) FCMP_Q_(r1,r2,FCMP_LTGT)
#define FCMP_S_ORD(r1,r2) FCMP_S_(r1,r2,FCMP_ORD)
#define FCMP_D_ORD(r1,r2) FCMP_D_(r1,r2,FCMP_ORD)
#define FCMP_Q_ORD(r1,r2) FCMP_Q_(r1,r2,FCMP_ORD)
#define FCMP_S_UNORD(r1,r2) FCMP_S_(r1,r2,FCMP_UNORD)
#define FCMP_D_UNORD(r1,r2) FCMP_D_(r1,r2,FCMP_UNORD)
#define FCMP_Q_UNORD(r1,r2) FCMP_Q_(r1,r2,FCMP_UNORD)
#define XFNVFF(s,d,r,t) f46(0xc,r,0,0,d,s,1,0,0,t)
#define FCNVFF_Q_S(r,t) XFNVFF(3,0,r,t)
#define FCNVFF_Q_D(r,t) XFNVFF(3,1,r,t)
#define FCNVFF_S_Q(r,t) XFNVFF(0,3,r,t)
#define FCNVFF_D_Q(r,t) XFNVFF(1,3,r,t)
#define FCNVFF_(s,d,r,t) f46(0xc,r,0,0,d,s,1,0,0,t)
#define FCNVFF_S_D(r,t) FCNVFF_(0,1,r,t)
#define FCNVFF_D_S(r,t) FCNVFF_(1,0,r,t)
#define FCNVXF_(s,d,r,t) f46(0xc,r,0,1,d,s,1,0,0,t)
#define FCNVXF_S_S(r,t) FCNVXF_(0,0,r,t)
#define FCNVXF_S_D(r,t) FCNVXF_(0,1,r,t)
#define FCNVXT_(s,d,r,t) f46(0xc,r,0,3,d,s,1,0,0,t)
#define FCNVXT_S_S(r,t) FCNVXT_(0,0,r,t)
#define FCNVXT_D_S(r,t) FCNVXT_(1,0,r,t)
#define FCPY_(f,r,t) f49(0xe,r,0,2,0,f,0,0,0,0,0,t)
#define FCPY_S(r,t) FCPY_(0,r,t)
#define FCPY_D(r,t) FCPY_(1,r,t)
#define FCPY_Q(r,t) f45(0xc,r,0,2,2,0,0,0,t)
#define FDIV_(f,r1,r2,t) f52(0xe,r1,r2,3,0,f,3,0,0,0,0,t)
#define FDIV_S(r1,r2,t) FDIV_(0,r1,r2,t)
#define FDIV_D(r1,r2,t) FDIV_(1,r1,r2,t)
#define FDIV_Q(r1,r2,t) f48(0xc,r1,r2,3,3,3,0,0,t)
#define FID() f45(0xc,0,0,0,2,0,0,0,0)
#define FLDDL(i,b,t) f3(0x14,b,t,i,1)
#define FLDD(x,b,t) f39(0xb,b,x,t)
#define FLDDI(i,b,t) f41(0xb,b,i,t)
#define FLDWL(i,b,t) f43(0x17,b,t,i)
#define FLDW(x,b,t) f39(0x9,b,x,t)
#define FLDWI(i,b,t) f41(0x9,b,i,t)
#define FMPY_(f,r1,r2,t) f52(0xe,r1,r2,2,0,f,3,0,0,0,0,t)
#define FMPY_S(r1,r2,t) FMPY_(0,r1,r2,t)
#define FMPY_D(r1,r2,t) FMPY_(1,r1,r2,t)
#define FMPY_Q(r1,r2,t) f48(0xc,r1,r2,2,3,3,0,0,t)
/* FIXME not disassembled */
#define FMPYADD_(f,r1,r2,ta,ra,tm) f53(0x6,r1,r2,ta,ra,f,tm)
#define FMPYADD_S(r1,r2,ta,ra,tm) FMPYADD_(0,r1,r2,ta,ra,tm)
#define FMPYADD_D(r1,r2,ta,ra,tm) FMPYADD_(1,r1,r2,ta,ra,tm)
#define FMPYFADD_(f,r1,r2,ra,t) f54(0x2e,r1,r2,ra>>3,0,f,(ra)&7,0,0,0,t)
#define FMPYFADD_S(r1,r2,ra,t) FMPYFADD_(0,r1,r2,ra,t)
#define FMPYFADD_D(r1,r2,ra,t) FMPYFADD_(1,r1,r2,ra,t)
#define FMPYNFADD_(f,r1,r2,ra,t) f54(0x2e,r1,r2,ra>>3,0,f,(ra)&7,0,0,1,t)
#define FMPYNFADD_S(r1,r2,ra,t) FMPYNFADD_(0,r1,r2,ra,t)
#define FMPYNFADD_D(r1,r2,ra,t) FMPYNFADD_(1,r1,r2,ra,t)
#define FMPYSUB_(f,r1,r2,ta,ra,tm) f53(0x26,r1,r2,ta,ra,f,tm)
#define FMPYSUB_S(r1,r2,ta,ra,tm) FMPYSUB_(0,r1,r2,ta,ra,tm)
#define FMPYSUB_D(r1,r2,ta,ra,tm) FMPYSUB_(1,r1,r2,ta,ra,tm)
#define FNEG_(f,r,t) f49(0xe,r,0,6,0,f,0,0,0,0,0,t)
#define FNEG_S(r,t) FNEG_(0,r,t)
#define FNEG_D(r,t) FNEG_(1,r,t)
/* FIXME not disassembled */
#define FNEG_Q(r,t) f45(0xc,r,0,6,3,0,0,0,t)
#define FNEGABS_(f,r,t) f49(0xe,r,0,7,0,f,0,0,0,0,0,t)
#define FNEGABS_S(r,t) FNEGABS_(0,r,t)
#define FNEGABS_D(r,t) FNEGABS_(1,r,t)
#define FNEGABS_Q(r,t) f45(0xc,r,0,7,3,0,0,0,t)
#define FRND_(f,r,t) f49(0xe,r,0,5,0,f,0,0,0,0,0,t)
#define FRND_S(r,t) FRND_(0,r,t)
#define FRND_D(r,t) FRND_(1,r,t)
#define FRND_Q(r,t) f45(0xc,r,0,5,3,0,0,0,t)
#define FSQRT_(f,r,t) f49(0xe,r,0,4,0,f,0,0,0,0,0,t)
#define FSQRT_S(r,t) FSQRT_(0,r,t)
#define FSQRT_D(r,t) FSQRT_(1,r,t)
#define FSQRT_Q(r,t) f45(0xc,r,0,4,3,0,0,0,t)
#define FSTDL(r,i,b) f3(0x1c,b,r,i,1)
#define FSTD(r,x,b) f40(0xb,b,x,r)
#define FSTDI(r,i,b) f42(0xb,b,i,r)
#define FSTWL(r,i,b) f43(0x1f,b,r,i)
#define FSTW(r,x,b) f40(0x9,b,x,r)
#define FSTWI(r,i,b) f42(0x9,b,i,r)
#define FSUB_(f,r1,r2,t) f52(0xe,r1,r2,1,0,f,3,0,0,0,0,t)
#define FSUB_S(r1,r2,t) FSUB_(0,r1,r2,t)
#define FSUB_D(r1,r2,t) FSUB_(1,r1,r2,t)
#define FSUB_Q(r1,r2,t) f48(0xc,r1,r2,1,3,3,0,0,t)
#define FTEST_(c) f47(0xc,0,0,0,0,2,0,1,c)
#define FTEST() f47(0xc,0,0,1,0,2,0,1,0)
#define FTEST_LT() FTEST_(FCMP_LT)
#define FTEST_LE() FTEST_(FCMP_LE)
#define FTEST_EQ() FTEST_(FCMP_EQ)
#define FTEST_GE() FTEST_(FCMP_GE)
#define FTEST_GT() FTEST_(FCMP_GT)
#define FTEST_NE() FTEST_(FCMP_NE)
#define FTEST_UNLT() FTEST_(FCMP_UNLT)
#define FTEST_UNLE() FTEST_(FCMP_UNLE)
#define FTEST_UNEQ() FTEST_(FCMP_UNEQ)
#define FTEST_UNGE() FTEST_(FCMP_UNGE)
#define FTEST_UNGT() FTEST_(FCMP_UNGT)
#define FTEST_LTGT() FTEST_(FCMP_LTGT)
#define FTEST_ORD() FTEST_(FCMP_ORD)
#define FTEST_UNORD() FTEST_(FCMP_UNORD)
#define XMPYU(r1,r2,t) f52(0xe,r1,r2,2,0,0,3,1,0,0,0,t)
#define XMPYU_L_R(r1,r2,t) f52(0xe,r1,r2,2,1,0,3,1,0,0,0,t)
#define XMPYU_R_L(r1,r2,t) f52(0xe,r1,r2,2,0,0,3,1,1,0,0,t)
#define XMPYU_R_R(r1,r2,t) f52(0xe,r1,r2,2,1,0,3,1,1,0,0,t)
#define negr_f(r0,r1) FNEG_S(r1,r0)
#define negr_d(r0,r1) FNEG_D(r1,r0)
#define sqrtr_f(r0,r1) FSQRT_S(r1,r0)
#define sqrtr_d(r0,r1) FSQRT_D(r1,r0)
#define extr_f(r0,r1) _extr_f(_jit,r0,r1)
static void _extr_f(jit_state_t*,jit_int32_t,jit_int32_t);
#define extr_d(r0,r1) _extr_d(_jit,r0,r1)
static void _extr_d(jit_state_t*,jit_int32_t,jit_int32_t);
#define extr_f_d(r0,r1) FCNVFF_S_D(r1,r0)
#define extr_d_f(r0,r1) FCNVFF_D_S(r1,r0)
#define truncr_f(r0,r1) truncr_f_i(r0,r1)
#define truncr_f_i(r0,r1) _truncr_f_i(_jit,r0,r1)
static void _truncr_f_i(jit_state_t*,jit_int32_t,jit_int32_t);
#define truncr_d(r0,r1) truncr_d_i(r0,r1)
#define truncr_d_i(r0,r1) _truncr_d_i(_jit,r0,r1)
static void _truncr_d_i(jit_state_t*,jit_int32_t,jit_int32_t);
#define movr_f(r0,r1) FCPY_S(r1,r0)
#define movi_f(r0,i0) _movi_f(_jit,r0,i0)
static void _movi_f(jit_state_t*,jit_int32_t,jit_float32_t*);
#define movr_d(r0,r1) FCPY_D(r1,r0)
#define movi_d(r0,i0) _movi_d(_jit,r0,i0)
static void _movi_d(jit_state_t*,jit_int32_t,jit_float64_t*);
#define absr_f(r0,r1) FABS_S(r1,r0)
#define absr_d(r0,r1) FABS_D(r1,r0)
#define addr_f(r0,r1,r2) FADD_S(r1,r2,r0)
#define addi_f(r0,r1,i0) _addi_f(_jit,r0,r1,i0)
static void _addi_f(jit_state_t*,jit_int32_t,jit_int32_t,jit_float32_t*);
#define addr_d(r0,r1,r2) FADD_D(r1,r2,r0)
#define addi_d(r0,r1,i0) _addi_d(_jit,r0,r1,i0)
static void _addi_d(jit_state_t*,jit_int32_t,jit_int32_t,jit_float64_t*);
#define subr_f(r0,r1,r2) FSUB_S(r1,r2,r0)
#define subi_f(r0,r1,i0) _subi_f(_jit,r0,r1,i0)
static void _subi_f(jit_state_t*,jit_int32_t,jit_int32_t,jit_float32_t*);
#define subr_d(r0,r1,r2) FSUB_D(r1,r2,r0)
#define subi_d(r0,r1,i0) _subi_d(_jit,r0,r1,i0)
static void _subi_d(jit_state_t*,jit_int32_t,jit_int32_t,jit_float64_t*);
#define rsbr_f(r0,r1,r2) subr_f(r0,r2,r1)
#define rsbi_f(r0,r1,i0) _rsbi_f(_jit,r0,r1,i0)
static void _rsbi_f(jit_state_t*,jit_int32_t,jit_int32_t,jit_float32_t*);
#define rsbr_d(r0,r1,r2) subr_d(r0,r2,r1)
#define rsbi_d(r0,r1,i0) _rsbi_d(_jit,r0,r1,i0)
static void _rsbi_d(jit_state_t*,jit_int32_t,jit_int32_t,jit_float64_t*);
#define mulr_f(r0,r1,r2) FMPY_S(r1,r2,r0)
#define muli_f(r0,r1,i0) _muli_f(_jit,r0,r1,i0)
static void _muli_f(jit_state_t*,jit_int32_t,jit_int32_t,jit_float32_t*);
#define mulr_d(r0,r1,r2) FMPY_D(r1,r2,r0)
#define muli_d(r0,r1,i0) _muli_d(_jit,r0,r1,i0)
static void _muli_d(jit_state_t*,jit_int32_t,jit_int32_t,jit_float64_t*);
#define divr_f(r0,r1,r2) FDIV_S(r1,r2,r0)
#define divi_f(r0,r1,i0) _divi_f(_jit,r0,r1,i0)
static void _divi_f(jit_state_t*,jit_int32_t,jit_int32_t,jit_float32_t*);
#define divr_d(r0,r1,r2) FDIV_D(r1,r2,r0)
#define divi_d(r0,r1,i0) _divi_d(_jit,r0,r1,i0)
static void _divi_d(jit_state_t*,jit_int32_t,jit_int32_t,jit_float64_t*);
#define cmpr_f(c,r0,r1,r2) _cmpr_f(_jit,c,r0,r1,r2)
static void _cmpr_f(jit_state_t*,jit_word_t,
jit_int32_t,jit_int32_t,jit_int32_t);
#define cmpi_f(c,r0,r1,i0) _cmpi_f(_jit,c,r0,r1,i0)
static void _cmpi_f(jit_state_t*,jit_word_t,
jit_int32_t,jit_int32_t,jit_float32_t*);
#define cmpr_d(c,r0,r1,r2) _cmpr_d(_jit,c,r0,r1,r2)
static void _cmpr_d(jit_state_t*,jit_word_t,
jit_int32_t,jit_int32_t,jit_int32_t);
#define cmpi_d(c,r0,r1,i0) _cmpi_d(_jit,c,r0,r1,i0)
static void _cmpi_d(jit_state_t*,jit_word_t,
jit_int32_t,jit_int32_t,jit_float64_t*);
#define ltr_f(r0,r1,r2) cmpr_f(FCMP_LT,r0,r1,r2)
#define lti_f(r0,r1,i0) cmpi_f(FCMP_LT,r0,r1,i0)
#define ltr_d(r0,r1,r2) cmpr_d(FCMP_LT,r0,r1,r2)
#define lti_d(r0,r1,i0) cmpi_d(FCMP_LT,r0,r1,i0)
#define ler_f(r0,r1,r2) cmpr_f(FCMP_LE,r0,r1,r2)
#define lei_f(r0,r1,i0) cmpi_f(FCMP_LE,r0,r1,i0)
#define ler_d(r0,r1,r2) cmpr_d(FCMP_LE,r0,r1,r2)
#define lei_d(r0,r1,i0) cmpi_d(FCMP_LE,r0,r1,i0)
#define eqr_f(r0,r1,r2) cmpr_f(FCMP_EQ,r0,r1,r2)
#define eqi_f(r0,r1,i0) cmpi_f(FCMP_EQ,r0,r1,i0)
#define eqr_d(r0,r1,r2) cmpr_d(FCMP_EQ,r0,r1,r2)
#define eqi_d(r0,r1,i0) cmpi_d(FCMP_EQ,r0,r1,i0)
#define ger_f(r0,r1,r2) cmpr_f(FCMP_GE,r0,r1,r2)
#define gei_f(r0,r1,i0) cmpi_f(FCMP_GE,r0,r1,i0)
#define ger_d(r0,r1,r2) cmpr_d(FCMP_GE,r0,r1,r2)
#define gei_d(r0,r1,i0) cmpi_d(FCMP_GE,r0,r1,i0)
#define gtr_f(r0,r1,r2) cmpr_f(FCMP_GT,r0,r1,r2)
#define gti_f(r0,r1,i0) cmpi_f(FCMP_GT,r0,r1,i0)
#define gtr_d(r0,r1,r2) cmpr_d(FCMP_GT,r0,r1,r2)
#define gti_d(r0,r1,i0) cmpi_d(FCMP_GT,r0,r1,i0)
#define ner_f(r0,r1,r2) cmpr_f(FCMP_NE,r0,r1,r2)
#define nei_f(r0,r1,i0) cmpi_f(FCMP_NE,r0,r1,i0)
#define ner_d(r0,r1,r2) cmpr_d(FCMP_NE,r0,r1,r2)
#define nei_d(r0,r1,i0) cmpi_d(FCMP_NE,r0,r1,i0)
#define unltr_f(r0,r1,r2) cmpr_f(FCMP_UNLT,r0,r1,r2)
#define unlti_f(r0,r1,i0) cmpi_f(FCMP_UNLT,r0,r1,i0)
#define unltr_d(r0,r1,r2) cmpr_d(FCMP_UNLT,r0,r1,r2)
#define unlti_d(r0,r1,i0) cmpi_d(FCMP_UNLT,r0,r1,i0)
#define unler_f(r0,r1,r2) cmpr_f(FCMP_UNLE,r0,r1,r2)
#define unlei_f(r0,r1,i0) cmpi_f(FCMP_UNLE,r0,r1,i0)
#define unler_d(r0,r1,r2) cmpr_d(FCMP_UNLE,r0,r1,r2)
#define unlei_d(r0,r1,i0) cmpi_d(FCMP_UNLE,r0,r1,i0)
#define uneqr_f(r0,r1,r2) cmpr_f(FCMP_UNEQ,r0,r1,r2)
#define uneqi_f(r0,r1,i0) cmpi_f(FCMP_UNEQ,r0,r1,i0)
#define uneqr_d(r0,r1,r2) cmpr_d(FCMP_UNEQ,r0,r1,r2)
#define uneqi_d(r0,r1,i0) cmpi_d(FCMP_UNEQ,r0,r1,i0)
#define unger_f(r0,r1,r2) cmpr_f(FCMP_UNGE,r0,r1,r2)
#define ungei_f(r0,r1,i0) cmpi_f(FCMP_UNGE,r0,r1,i0)
#define unger_d(r0,r1,r2) cmpr_d(FCMP_UNGE,r0,r1,r2)
#define ungei_d(r0,r1,i0) cmpi_d(FCMP_UNGE,r0,r1,i0)
#define ungtr_f(r0,r1,r2) cmpr_f(FCMP_UNGT,r0,r1,r2)
#define ungti_f(r0,r1,i0) cmpi_f(FCMP_UNGT,r0,r1,i0)
#define ungtr_d(r0,r1,r2) cmpr_d(FCMP_UNGT,r0,r1,r2)
#define ungti_d(r0,r1,i0) cmpi_d(FCMP_UNGT,r0,r1,i0)
#define ltgtr_f(r0,r1,r2) cmpr_f(FCMP_LTGT,r0,r1,r2)
#define ltgti_f(r0,r1,i0) cmpi_f(FCMP_LTGT,r0,r1,i0)
#define ltgtr_d(r0,r1,r2) cmpr_d(FCMP_LTGT,r0,r1,r2)
#define ltgti_d(r0,r1,i0) cmpi_d(FCMP_LTGT,r0,r1,i0)
#define ordr_f(r0,r1,r2) cmpr_f(FCMP_ORD,r0,r1,r2)
#define ordi_f(r0,r1,i0) cmpi_f(FCMP_ORD,r0,r1,i0)
#define ordr_d(r0,r1,r2) cmpr_d(FCMP_ORD,r0,r1,r2)
#define ordi_d(r0,r1,i0) cmpi_d(FCMP_ORD,r0,r1,i0)
#define unordr_f(r0,r1,r2) cmpr_f(FCMP_UNORD,r0,r1,r2)
#define unordi_f(r0,r1,i0) cmpi_f(FCMP_UNORD,r0,r1,i0)
#define unordr_d(r0,r1,r2) cmpr_d(FCMP_UNORD,r0,r1,r2)
#define unordi_d(r0,r1,i0) cmpi_d(FCMP_UNORD,r0,r1,i0)
#define ldr_f(r0,r1) FLDWI(0,r1,r0)
#define ldi_f(r0,i0) _ldi_f(_jit,r0,i0)
static void _ldi_f(jit_state_t*,jit_int32_t,jit_word_t);
#if FLDXR
# define ldxr_f(r0,r1,r2) FLDW(r2,r1,r0)
# define ldxr_d(r0,r1,r2) FLDD(r2,r1,r0)
#else
#define ldxr_f(r0,r1,r2) _ldxr_f(_jit,r0,r1,r2)
static void _ldxr_f(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
#define ldxr_d(r0,r1,r2) _ldxr_d(_jit,r0,r1,r2)
static void _ldxr_d(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
#endif
#define ldxi_f(r0,r1,i0) _ldxi_f(_jit,r0,r1,i0)
static void _ldxi_f(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
#define ldr_d(r0,r1) FLDDI(0,r1,r0)
#define ldi_d(r0,i0) _ldi_d(_jit,r0,i0)
static void _ldi_d(jit_state_t*,jit_int32_t,jit_word_t);
#define ldxi_d(r0,r1,i0) _ldxi_d(_jit,r0,r1,i0)
static void _ldxi_d(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
#define str_f(r0,r1) FSTWI(r1,0,r0)
#define sti_f(i0,r0) _sti_f(_jit,i0,r0)
static void _sti_f(jit_state_t*,jit_word_t,jit_int32_t);
#if FSTXR
# define stxr_f(r0,r1,r2) FSTW(r2,r1,r0)
# define stxr_d(r0,r1,r2) FSTD(r2,r1,r0)
#else
# define stxr_f(r0,r1,r2) _stxr_f(_jit,r0,r1,r2)
static void _stxr_f(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define stxr_d(r0,r1,r2) _stxr_d(_jit,r0,r1,r2)
static void _stxr_d(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
#endif
#define stxi_f(i0,r0,r1) _stxi_f(_jit,i0,r0,r1)
static void _stxi_f(jit_state_t*,jit_word_t,jit_int32_t,jit_int32_t);
#define str_d(r0,r1) FSTDI(r1,0,r0)
#define sti_d(i0,r0) _sti_d(_jit,i0,r0)
static void _sti_d(jit_state_t*,jit_word_t,jit_int32_t);
#define stxi_d(i0,r0,r1) _stxi_d(_jit,i0,r0,r1)
static void _stxi_d(jit_state_t*,jit_word_t,jit_int32_t,jit_int32_t);
#define bcmpr_f(c,i0,r0,r1) _bcmpr_f(_jit,c,i0,r0,r1)
static jit_word_t _bcmpr_f(jit_state_t*,jit_word_t,
jit_word_t,jit_int32_t,jit_int32_t);
#define bcmpi_f(c,i0,r0,i1) _bcmpi_f(_jit,c,i0,r0,i1)
static jit_word_t _bcmpi_f(jit_state_t*,jit_word_t,
jit_word_t,jit_int32_t,jit_float32_t*);
#define bcmpr_d(c,i0,r0,r1) _bcmpr_d(_jit,c,i0,r0,r1)
static jit_word_t _bcmpr_d(jit_state_t*,jit_word_t,
jit_word_t,jit_int32_t,jit_int32_t);
#define bcmpi_d(c,i0,r0,i1) _bcmpi_d(_jit,c,i0,r0,i1)
static jit_word_t _bcmpi_d(jit_state_t*,jit_word_t,
jit_word_t,jit_int32_t,jit_float64_t*);
#define bltr_f(i0,r0,r1) bcmpr_f(FCMP_LT,i0,r0,r1)
#define blti_f(i0,r0,i1) bcmpi_f(FCMP_LT,i0,r0,i1)
#define bltr_d(i0,r0,r1) bcmpr_d(FCMP_LT,i0,r0,r1)
#define blti_d(i0,r0,i1) bcmpi_d(FCMP_LT,i0,r0,i1)
#define bler_f(i0,r0,r1) bcmpr_f(FCMP_LE,i0,r0,r1)
#define blei_f(i0,r0,i1) bcmpi_f(FCMP_LE,i0,r0,i1)
#define bler_d(i0,r0,r1) bcmpr_d(FCMP_LE,i0,r0,r1)
#define blei_d(i0,r0,i1) bcmpi_d(FCMP_LE,i0,r0,i1)
#define beqr_f(i0,r0,r1) bcmpr_f(FCMP_EQ,i0,r0,r1)
#define beqi_f(i0,r0,i1) bcmpi_f(FCMP_EQ,i0,r0,i1)
#define beqr_d(i0,r0,r1) bcmpr_d(FCMP_EQ,i0,r0,r1)
#define beqi_d(i0,r0,i1) bcmpi_d(FCMP_EQ,i0,r0,i1)
#define bger_f(i0,r0,r1) bcmpr_f(FCMP_GE,i0,r0,r1)
#define bgei_f(i0,r0,i1) bcmpi_f(FCMP_GE,i0,r0,i1)
#define bger_d(i0,r0,r1) bcmpr_d(FCMP_GE,i0,r0,r1)
#define bgei_d(i0,r0,i1) bcmpi_d(FCMP_GE,i0,r0,i1)
#define bgtr_f(i0,r0,r1) bcmpr_f(FCMP_GT,i0,r0,r1)
#define bgti_f(i0,r0,i1) bcmpi_f(FCMP_GT,i0,r0,i1)
#define bgtr_d(i0,r0,r1) bcmpr_d(FCMP_GT,i0,r0,r1)
#define bgti_d(i0,r0,i1) bcmpi_d(FCMP_GT,i0,r0,i1)
#define bner_f(i0,r0,r1) bcmpr_f(FCMP_NE,i0,r0,r1)
#define bnei_f(i0,r0,i1) bcmpi_f(FCMP_NE,i0,r0,i1)
#define bner_d(i0,r0,r1) bcmpr_d(FCMP_NE,i0,r0,r1)
#define bnei_d(i0,r0,i1) bcmpi_d(FCMP_NE,i0,r0,i1)
#define bunltr_f(i0,r0,r1) bcmpr_f(FCMP_UNLT,i0,r0,r1)
#define bunlti_f(i0,r0,i1) bcmpi_f(FCMP_UNLT,i0,r0,i1)
#define bunltr_d(i0,r0,r1) bcmpr_d(FCMP_UNLT,i0,r0,r1)
#define bunlti_d(i0,r0,i1) bcmpi_d(FCMP_UNLT,i0,r0,i1)
#define bunler_f(i0,r0,r1) bcmpr_f(FCMP_UNLE,i0,r0,r1)
#define bunlei_f(i0,r0,i1) bcmpi_f(FCMP_UNLE,i0,r0,i1)
#define bunler_d(i0,r0,r1) bcmpr_d(FCMP_UNLE,i0,r0,r1)
#define bunlei_d(i0,r0,i1) bcmpi_d(FCMP_UNLE,i0,r0,i1)
#define buneqr_f(i0,r0,r1) bcmpr_f(FCMP_UNEQ,i0,r0,r1)
#define buneqi_f(i0,r0,i1) bcmpi_f(FCMP_UNEQ,i0,r0,i1)
#define buneqr_d(i0,r0,r1) bcmpr_d(FCMP_UNEQ,i0,r0,r1)
#define buneqi_d(i0,r0,i1) bcmpi_d(FCMP_UNEQ,i0,r0,i1)
#define bunger_f(i0,r0,r1) bcmpr_f(FCMP_UNGE,i0,r0,r1)
#define bungei_f(i0,r0,i1) bcmpi_f(FCMP_UNGE,i0,r0,i1)
#define bunger_d(i0,r0,r1) bcmpr_d(FCMP_UNGE,i0,r0,r1)
#define bungei_d(i0,r0,i1) bcmpi_d(FCMP_UNGE,i0,r0,i1)
#define bungtr_f(i0,r0,r1) bcmpr_f(FCMP_UNGT,i0,r0,r1)
#define bungti_f(i0,r0,i1) bcmpi_f(FCMP_UNGT,i0,r0,i1)
#define bungtr_d(i0,r0,r1) bcmpr_d(FCMP_UNGT,i0,r0,r1)
#define bungti_d(i0,r0,i1) bcmpi_d(FCMP_UNGT,i0,r0,i1)
#define bltgtr_f(i0,r0,r1) bcmpr_f(FCMP_LTGT,i0,r0,r1)
#define bltgti_f(i0,r0,i1) bcmpi_f(FCMP_LTGT,i0,r0,i1)
#define bltgtr_d(i0,r0,r1) bcmpr_d(FCMP_LTGT,i0,r0,r1)
#define bltgti_d(i0,r0,i1) bcmpi_d(FCMP_LTGT,i0,r0,i1)
#define bordr_f(i0,r0,r1) bcmpr_f(FCMP_ORD,i0,r0,r1)
#define bordi_f(i0,r0,i1) bcmpi_f(FCMP_ORD,i0,r0,i1)
#define bordr_d(i0,r0,r1) bcmpr_d(FCMP_ORD,i0,r0,r1)
#define bordi_d(i0,r0,i1) bcmpi_d(FCMP_ORD,i0,r0,i1)
#define bunordr_f(i0,r0,r1) bcmpr_f(FCMP_UNORD,i0,r0,r1)
#define bunordi_f(i0,r0,i1) bcmpi_f(FCMP_UNORD,i0,r0,i1)
#define bunordr_d(i0,r0,r1) bcmpr_d(FCMP_UNORD,i0,r0,r1)
#define bunordi_d(i0,r0,i1) bcmpi_d(FCMP_UNORD,i0,r0,i1)
#define vaarg_d(r0, r1) _vaarg_d(_jit, r0, r1)
static void _vaarg_d(jit_state_t*, jit_int32_t, jit_int32_t);
#endif
#if CODE
static void
_f39(jit_state_t *_jit, jit_int32_t o,
jit_int32_t b, jit_int32_t x, jit_int32_t t)
{
assert(!(o & ~0x3f));
assert(!(b & ~0x1f));
assert(!(x & ~0x1f));
assert(!(t & ~0x1f));
ii((o<<26)|(b<<21)|(x<<16)|t);
}
static void
_f40(jit_state_t *_jit, jit_int32_t o,
jit_int32_t b, jit_int32_t x, jit_int32_t r)
{
assert(!(o & ~0x3f));
assert(!(b & ~0x1f));
assert(!(x & ~0x1f));
assert(!(r & ~0x1f));
ii((o<<26)|(b<<21)|(x<<16)|(1<<9)|r);
}
static void
_f41(jit_state_t *_jit, jit_int32_t o,
jit_int32_t b, jit_int32_t x, jit_int32_t t)
{
assert(!(o & ~0x3f));
assert(!(b & ~0x1f));
assert(x >= -16 && x < 15);
assert(!(t & ~0x1f));
ii((o<<26)|(b<<21)|(low_sign_unext(x,5)<<16)|(1<<12)|t);
}
static void
_f42(jit_state_t *_jit, jit_int32_t o,
jit_int32_t b, jit_int32_t i, jit_int32_t r)
{
assert(!(o & ~0x3f));
assert(!(b & ~0x1f));
assert(i >= -16 && i < 15);
assert(!(r & ~0x1f));
ii((o<<26)|(b<<21)|(low_sign_unext(i,5)<<16)|(1<<12)|(1<<9)|r);
}
static void
_f45(jit_state_t *_jit, jit_int32_t o,
jit_int32_t r, jit_int32_t a, jit_int32_t b, jit_int32_t fmt,
jit_int32_t c, jit_int32_t d, jit_int32_t e, jit_int32_t t)
{
assert(!(o & ~0x3f));
assert(!(r & ~0x1f));
assert(!(a & ~0x1f));
assert(!(b & ~0x7));
assert(!(fmt & ~0x3));
assert(!(c & ~0x3));
assert(!(d & ~0x7));
assert(!(e & ~0x1));
assert(!(t & ~0x1f));
ii((o<<26)|(r<<21)|(a<<16)|(fmt<<13)|(b<<11)|(c<<9)|(d<<6)|(e<<5)|t);
}
static void
_f46(jit_state_t *_jit, jit_int32_t o, jit_int32_t r,
jit_int32_t a, jit_int32_t s, jit_int32_t df, jit_int32_t sf,
jit_int32_t b, jit_int32_t c, jit_int32_t d, jit_int32_t t)
{
assert(!(o & ~0x3f));
assert(!(r & ~0x1f));
assert(!(a & ~0x7));
assert(!(s & ~0x7));
assert(!(df & ~0x3));
assert(!(sf & ~0x3));
assert(!(b & ~0x3));
assert(!(c & ~0x7));
assert(!(d & ~0x1));
assert(!(t & ~0x1f));
ii((o<<26)|(r<<21)|(a<<18)|(s<<15)|
(df<<13)|(sf<<11)|(b<<9)|(c<<6)|(d<<5)|t);
}
static void
_f47_48(jit_state_t *_jit, jit_int32_t o,
jit_int32_t r2, jit_int32_t r1, jit_int32_t y, jit_int32_t fmt,
jit_int32_t a, jit_int32_t b, jit_int32_t c, jit_int32_t t)
{
assert(!(o & ~0x3f));
assert(!(r2 & ~0x1f));
assert(!(r1 & ~0x1f));
assert(!(y & ~0x7));
assert(!(fmt & ~0x3));
assert(!(a & ~0x3));
assert(!(b & ~0x7));
assert(!(c & ~0x1));
assert(!(t & ~0x1f));
ii((o<<26)|(r2<<21)|(r1<<16)|(y<<13)|(fmt<<11)|(a<<9)|(b<<6)|(c<<5)|t);
}
static void
_f49_52(jit_state_t *_jit, jit_int32_t o,
jit_int32_t r1, jit_int32_t r2, jit_int32_t y,
jit_int32_t v, jit_int32_t f, jit_int32_t a, jit_int32_t b,
jit_int32_t u, jit_int32_t c, jit_int32_t d, jit_int32_t t)
{
assert(!(o & ~0x3f));
assert(!(r1 & ~0x1f));
assert(!(r2 & ~0x3f));
assert(!(y & ~0x7));
assert(!(v & ~0x1));
assert(!(f & ~0x1));
assert(!(a & ~0x3));
assert(!(b & ~0x1));
assert(!(u & ~0x1));
assert(!(c & ~0x1));
assert(!(d & ~0x1));
assert(!(t & ~0x1f));
ii((o<<26)|(r1<<21)|(r2<<16)|(y<<13)|(v<<12)|
(f<<11)|(a<<9)|(b<<8)|(u<<7)|(c<<6)|(d<<5)|t);
}
static void
_f53(jit_state_t *_jit, jit_int32_t o, jit_int32_t r1, jit_int32_t r2,
jit_int32_t ta, jit_int32_t ra, jit_int32_t f, jit_int32_t tm)
{
assert(!(o & ~0x3f));
assert(!(r1 & ~0x1f));
assert(!(r2 & ~0x1f));
assert(!(ta & ~0x1f));
assert(!(ra & ~0x1f));
assert(!(f & ~0x1));
assert(!(tm & ~0x1f));
assert(ra != tm ||
(ta == r1 || ta == r2 || ta == tm) ||
(f && ra == 1) || (!f && !ra));
ii((o<<26)|(r1<<21)|(r2<<16)|(ta<<11)|(ra<<6)|(f<<5)|tm);
}
static void
_f54(jit_state_t *_jit, jit_int32_t o, jit_int32_t r1, jit_int32_t r2,
jit_int32_t a, jit_int32_t b, jit_int32_t f, jit_int32_t c,
jit_int32_t d, jit_int32_t e, jit_int32_t g, jit_int32_t t)
{
assert(!(o & ~0x3f));
assert(!(r1 & ~0x1f));
assert(!(r2 & ~0x1f));
assert(!(a & ~0x7));
assert(!(b & ~0x1));
assert(!(f & ~0x1));
assert(!(c & ~0x7));
assert(!(e & ~0x1));
assert(!(e & ~0x1));
assert(!(g & ~0x1));
assert(!(t & ~0x1f));
ii((o<<26)|(r1<<21)|(r2<<16)|(a<<13)|
(b<<12)|(f<11)|(c<<8)|(d<<7)|(e<<6)|(g<<5)|t);
}
static void
_extr_f(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
stxi(alloca_offset - 8, _FP_REGNO, r1);
ldxi_f(r0, _FP_REGNO, alloca_offset - 8);
FCNVXF_S_S(r0, r0);
}
static void
_extr_d(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
stxi(alloca_offset - 8, _FP_REGNO, r1);
ldxi_f(r0, _FP_REGNO, alloca_offset - 8);
FCNVXF_S_D(r0, r0);
}
static void
_truncr_f_i(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
jit_int32_t reg;
reg = jit_get_reg(jit_class_fpr);
FCNVXT_S_S(r1, rn(reg));
stxi_f(alloca_offset - 8, _FP_REGNO, rn(reg));
ldxi(r0, _FP_REGNO, alloca_offset - 8);
jit_unget_reg(reg);
}
static void
_truncr_d_i(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
jit_int32_t reg;
reg = jit_get_reg(jit_class_fpr);
FCNVXT_D_S(r1, rn(reg));
stxi_d(alloca_offset - 8, _FP_REGNO, rn(reg));
ldxi(r0, _FP_REGNO, alloca_offset - 8);
jit_unget_reg(reg);
}
static void
_movi_f(jit_state_t *_jit, jit_int32_t r0, jit_float32_t *i0)
{
union {
jit_int32_t i;
jit_float32_t f;
} data;
jit_int32_t reg;
if (_jitc->no_data) {
data.f = *i0;
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), data.i);
stxi_i(alloca_offset - 8, _FP_REGNO, rn(reg));
jit_unget_reg(reg);
ldxi_f(r0, _FP_REGNO, alloca_offset - 8);
}
else
ldi_f(r0, (jit_word_t)i0);
}
static void
_movi_d(jit_state_t *_jit, jit_int32_t r0, jit_float64_t *i0)
{
union {
jit_int32_t ii[2];
jit_word_t w;
jit_float64_t d;
} data;
jit_int32_t reg;
data.d = *i0;
if (_jitc->no_data) {
data.d = *i0;
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), data.ii[0]);
stxi_i(alloca_offset - 8, _FP_REGNO, rn(reg));
movi(rn(reg), data.ii[1]);
stxi_i(alloca_offset - 4, _FP_REGNO, rn(reg));
jit_unget_reg(reg);
ldxi_d(r0, _FP_REGNO, alloca_offset - 8);
}
else
ldi_d(r0, (jit_word_t)i0);
}
#define fpr_opi(name, type, size) \
static void \
_##name##i_##type(jit_state_t *_jit, \
jit_int32_t r0, jit_int32_t r1, \
jit_float##size##_t *i0) \
{ \
jit_int32_t reg = jit_get_reg(jit_class_fpr); \
movi_##type(rn(reg), i0); \
name##r_##type(r0, r1, rn(reg)); \
jit_unget_reg(reg); \
}
#define fopi(name) fpr_opi(name, f, 32)
#define dopi(name) fpr_opi(name, d, 64)
fopi(add)
dopi(add)
fopi(sub)
dopi(sub)
fopi(rsb)
dopi(rsb)
fopi(mul)
dopi(mul)
fopi(div)
dopi(div)
static void
_cmpr_f(jit_state_t *_jit, jit_word_t c,
jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
LDI(0, r0);
FCMP_S_(r1, r2, c);
FTEST();
LDI(1, r0);
}
static void
_cmpi_f(jit_state_t *_jit, jit_word_t c,
jit_int32_t r0, jit_int32_t r1, jit_float32_t *i0)
{
jit_int32_t reg = jit_get_reg(jit_class_fpr);
movi_f(rn(reg), i0);
cmpr_f(c, r0, r1, rn(reg));
jit_unget_reg(reg);
}
static void
_cmpr_d(jit_state_t *_jit, jit_word_t c,
jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
LDI(0, r0);
FCMP_D_(r1, r2, c);
FTEST();
LDI(1, r0);
}
static void
_cmpi_d(jit_state_t *_jit, jit_word_t c,
jit_int32_t r0, jit_int32_t r1, jit_float64_t *i0)
{
jit_int32_t reg = jit_get_reg(jit_class_fpr);
movi_d(rn(reg), i0);
cmpr_d(c, r0, r1, rn(reg));
jit_unget_reg(reg);
}
static void
_ldi_f(jit_state_t *_jit, jit_int32_t r0, jit_word_t i0)
{
jit_int32_t reg;
assert(!(i0 & 3));
if (i0 >= -8192 && i0 <= 8191 && !(re_assemble_16(i0) & 6))
FLDWL(i0, _R0_REGNO, r0);
else {
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), i0);
ldr_f(r0, rn(reg));
jit_unget_reg(reg);
}
}
#if !FLDXR
static void
_ldxr_f(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr);
addr(rn(reg), r1, r2);
ldr_f(r0, rn(reg));
jit_unget_reg(reg);
}
static void
_ldxr_d(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr);
addr(rn(reg), r1, r2);
ldr_d(r0, rn(reg));
jit_unget_reg(reg);
}
#endif
static void
_ldxi_f(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
if (i0 >= -16 && i0 <= 15)
FLDWI(i0, r1, r0);
/* |im11a|0|t|i| */
else if (FLDXR && i0 >= -8192 && i0 <= 8191 && !(re_assemble_16(i0) & 6))
FLDWL(i0, r1, r0);
else {
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), i0);
ldxr_f(r0, r1, rn(reg));
jit_unget_reg(reg);
}
}
static void
_ldi_d(jit_state_t *_jit, jit_int32_t r0, jit_word_t i0)
{
jit_int32_t reg;
assert(!(i0 & 7));
if (i0 >= -8192 && i0 <= 8191 && !(re_assemble_16(i0) & 14))
FLDDL(i0, _R0_REGNO, r0);
else {
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), i0);
ldr_d(r0, rn(reg));
jit_unget_reg(reg);
}
}
static void
_ldxi_d(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
if (i0 >= -16 && i0 <= 15)
FLDDI(i0, r1, r0);
/* |im10a|m|a|1|i| */
else if (FLDXR && i0 >= -8192 && i0 <= 8191 && !(re_assemble_16(i0) & 14))
FLDDL(i0, r1, r0);
else {
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), i0);
ldxr_d(r0, r1, rn(reg));
jit_unget_reg(reg);
}
}
static void
_sti_f(jit_state_t *_jit, jit_word_t i0, jit_int32_t r0)
{
jit_int32_t reg;
assert(!(i0 & 3));
if (i0 >= -8192 && i0 <= 8191 && !(re_assemble_16(i0) & 6))
FSTWL(r0, i0, _R0_REGNO);
else {
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), i0);
str_f(rn(reg), r0);
jit_unget_reg(reg);
}
}
#if !FSTXR
static void
_stxr_f(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr);
addr(rn(reg), r0, r1);
str_f(rn(reg), r2);
jit_unget_reg(reg);
}
static void
_stxr_d(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr);
addr(rn(reg), r0, r1);
str_d(rn(reg), r2);
jit_unget_reg(reg);
}
#endif
static void
_stxi_f(jit_state_t *_jit, jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
jit_int32_t reg;
if (i0 >= -16 && i0 <= 15)
FSTWI(r1, i0, r0);
/* |im11a|0|t|i| */
else if (FSTXR && i0 >= -8192 && i0 <= 8191 && !(re_assemble_16(i0) & 6))
FSTWL(r1, i0, r0);
else {
reg = jit_get_reg(jit_class_gpr);
#if FSTXR
movi(rn(reg), i0);
stxr_f(rn(reg), r0, r1);
#else
addi(rn(reg), r0, i0);
str_f(rn(reg), r1);
#endif
jit_unget_reg(reg);
}
}
static void
_sti_d(jit_state_t *_jit, jit_word_t i0, jit_int32_t r0)
{
jit_int32_t reg;
assert(!(i0 & 7));
if (i0 >= -8192 && i0 <= 8191 && !(re_assemble_16(i0) & 14))
FSTDL(r0, i0, _R0_REGNO);
else {
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), i0);
str_d(rn(reg), r0);
jit_unget_reg(reg);
}
}
static void
_stxi_d(jit_state_t *_jit, jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
jit_int32_t reg;
if (i0 >= -16 && i0 <= 15)
FSTDI(r1, i0, r0);
/* |im10a|m|a|1|i| */
else if (FSTXR && i0 >= -8192 && i0 <= 8191 && !(re_assemble_16(i0) & 14))
FSTDL(r1, i0, r0);
else {
reg = jit_get_reg(jit_class_gpr);
#if FSTXR
movi(rn(reg), i0);
stxr_d(rn(reg), r0, r1);
#else
addi(rn(reg), r0, i0);
str_d(rn(reg), r1);
#endif
jit_unget_reg(reg);
}
}
static jit_word_t
_bcmpr_f(jit_state_t *_jit, jit_word_t c,
jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
jit_word_t w;
FCMP_S_(r0, r1, c);
FTEST();
w = _jit->pc.w;
B_N(((i0 - w) >> 2) - 2, _R0_REGNO);
NOP();
return (w);
}
static jit_word_t
_bcmpi_f(jit_state_t *_jit, jit_word_t c,
jit_word_t i0, jit_int32_t r0, jit_float32_t *i1)
{
jit_word_t w;
jit_int32_t reg;
reg = jit_get_reg(jit_class_fpr|jit_class_nospill);
movi_f(rn(reg), i1);
FCMP_S_(r0, rn(reg), c);
FTEST();
w = _jit->pc.w;
B_N(((i0 - w) >> 2) - 2, _R0_REGNO);
NOP();
jit_unget_reg(reg);
return (w);
}
static jit_word_t
_bcmpr_d(jit_state_t *_jit, jit_word_t c,
jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
jit_word_t w;
FCMP_D_(r0, r1, c);
FTEST();
w = _jit->pc.w;
B_N(((i0 - w) >> 2) - 2, _R0_REGNO);
NOP();
return (w);
}
static jit_word_t
_bcmpi_d(jit_state_t *_jit, jit_word_t c,
jit_word_t i0, jit_int32_t r0, jit_float64_t *i1)
{
jit_word_t w;
jit_int32_t reg;
reg = jit_get_reg(jit_class_fpr|jit_class_nospill);
movi_d(rn(reg), i1);
FCMP_D_(r0, rn(reg), c);
FTEST();
w = _jit->pc.w;
B_N(((i0 - w) >> 2) - 2, _R0_REGNO);
NOP();
jit_unget_reg(reg);
return (w);
}
static void
_vaarg_d(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
jit_int32_t reg;
assert(_jitc->function->self.call & jit_call_varargs);
/* Align pointer if required. */
reg = jit_get_reg(jit_class_gpr);
andi(rn(reg), r1, 7);
subr(r1, r1, rn(reg));
jit_unget_reg(reg);
/* Adjust vararg stack pointer. */
subi(r1, r1, 8);
/* Load argument. */
ldr_d(r0, r1);
}
#endif | c |
timer_blink_led.c | alexjaw/atmel_xmega_e | 0 | 2217880 | /*
* timer_blink_led.c
*
* Blink LED using the Timer/Counter module on atxmega e
* Based on examples in AVR1501, http://www.microchip.com//wwwAppNotes/AppNotes.aspx?appnote=en591816
*
* Created: 2017-06-28 11:24:31
* Author: alexander
*/
#ifndef F_CPU
#define F_CPU 1000000UL
#endif
#include <avr/io.h>
#include <util/delay.h>
#define LEDPORT PORTD
#define LEDMASK PIN5_bm
// Using code from AVR1501 so need to redifne some macros for xmega_e mcu
#define TCC0 TCC4 //TCC4 is TC4_t struct
#define TC0_CLKSEL_gm TC4_CLKSEL_gm
#define TC0_OVFIF_bm TC4_OVFIF_bm
#define TC_CLKSEL_DIV1_gc TC45_CLKSEL_DIV1_gc
#define TC_CLKSEL_DIV1024_gc TC45_CLKSEL_DIV1024_gc
int main(void)
{
LEDPORT.DIR |= LEDMASK;
/* The CLKSEL bits in CTRLA is used to set the clock source for the counter
* see AVR1500 for details about gc, configuration masks.*/
TCC0.CTRLA = ( TCC0.CTRLA & ~TC0_CLKSEL_gm ) | TC_CLKSEL_DIV1024_gc; // Start Timer with prescaling 1024
/* The Period (PER) register (32bit) sets the TOP value for the counter,
* i.e. how far it will count
* 1MHz clock with prescaler 1024 ticks every 1.024ms, which is 977 (976.56...) times per second.
* So we let the TOP value of the counter be 0x03d0.*/
TCC0.PER = 0x03d0; // 1Hz
//TCC0.PER = 0x0062; // 10Hz
while(1)
{
/* Check if the overflow flag (OVFIF) is set,
* clear flag and toggle LEDs
*/
if((TCC0.INTFLAGS & TC0_OVFIF_bm) != 0)
{
TCC0.INTFLAGS = TC0_OVFIF_bm; //Clear the IF by writing a logical 1 to the flag
LEDPORT.OUTTGL = LEDMASK;
}
}
} | c |
net/message.h | wanchuanheng/wtaf | 0 | 6574998 | #ifndef WTAF__NET__MESSAGE_H_
#define WTAF__NET__MESSAGE_H_
#include <memory>
#include <rapidjson/rapidjson.h>
#include <rapidjson/document.h>
#include <rapidjson/stringbuffer.h>
#include <rapidjson/writer.h>
#include "base/common.h"
namespace wtaf {
namespace net {
class Connection;
class Message
{
friend class Connection;
public:
Message(std::shared_ptr<Connection> connection);
rapidjson::Document& doc();
const std::string& raw_data();
uint32 type();
uint32 cmd();
uint32 length();
std::shared_ptr<Connection> get_connection();
private:
rapidjson::Document m_doc;
std::shared_ptr<Connection> m_connection;
std::string m_raw_data;
uint32 m_length;
uint32 m_type;
uint32 m_cmd;
};
}
}
#endif | c |
Engine/Plugins/Runtime/OculusLibrary/Source/OculusLibrary/Public/IOculusLibraryPlugin.h | PopCap/GameIdea | 0 | 2693780 | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "ModuleManager.h"
/**
* The public interface to this module
*/
class IOculusLibraryPlugin : public IModuleInterface
{
public:
/**
* Singleton-like access to this module's interface. This is just for convenience!
* Beware of calling this during the shutdown phase, though. Your module might have been unloaded already.
*
* @return Returns singleton instance, loading the module on demand if needed
*/
static inline IOculusLibraryPlugin& Get()
{
return FModuleManager::LoadModuleChecked< IOculusLibraryPlugin >( "OculusLibrary" );
}
/**
* Checks to see if this module is loaded and ready. It is only valid to call Get() if IsAvailable() returns true.
*
* @return True if the module is loaded and ready to use
*/
static inline bool IsAvailable()
{
return FModuleManager::Get().IsModuleLoaded( "OculusLibrary" );
}
/**
* Grabs the current orientation and position for the HMD. If positional tracking is not available, DevicePosition will be a zero vector
*
* @param DeviceRotation (out) The device's current rotation
* @param DevicePosition (out) The device's current position, in its own tracking space
* @param NeckPosition (out) The estimated neck position, calculated using NeckToEye vector from User Profile. Same coordinate space as DevicePosition.
* @param bUseOrienationForPlayerCamera (in) Should be set to 'true' if the orientation is going to be used to update orientation of the camera manually.
* @param bUsePositionForPlayerCamera (in) Should be set to 'true' if the position is going to be used to update position of the camera manually.
* @param PositionScale (in) The 3D scale that will be applied to position.
*/
virtual void GetPose(FRotator& DeviceRotation, FVector& DevicePosition, FVector& NeckPosition, bool bUseOrienationForPlayerCamera = false, bool bUsePositionForPlayerCamera = false, const FVector PositionScale = FVector::ZeroVector) = 0;
/**
* Reports raw sensor data. If HMD doesn't support any of the parameters then it will be set to zero.
*
* @param Accelerometer (out) Acceleration reading in m/s^2.
* @param Gyro (out) Rotation rate in rad/s.
* @param Magnetometer (out) Magnetic field in Gauss.
* @param Temperature (out) Temperature of the sensor in degrees Celsius.
* @param TimeInSeconds (out) Time when the reported IMU reading took place, in seconds.
*/
virtual void GetRawSensorData(FVector& Accelerometer, FVector& Gyro, FVector& Magnetometer, float& Temperature, float& TimeInSeconds) = 0;
/**
* Returns current user profile.
*
* @param Profile (out) Structure to hold current user profile.
* @return (boolean) True, if user profile was acquired.
*/
virtual bool GetUserProfile(struct FHmdUserProfile& Profile)=0;
/**
* Sets 'base rotation' - the rotation that will be subtracted from
* the actual HMD orientation.
* Sets base position offset (in meters). The base position offset is the distance from the physical (0, 0, 0) position
* to current HMD position (bringing the (0, 0, 0) point to the current HMD position)
* Note, this vector is set by ResetPosition call; use this method with care.
* The axis of the vector are the same as in Unreal: X - forward, Y - right, Z - up.
*
* @param Rotation (in) Rotator object with base rotation
* @param BaseOffsetInMeters (in) the vector to be set as base offset, in meters.
* @param Options (in) specifies either position, orientation or both should be set.
*/
virtual void SetBaseRotationAndBaseOffsetInMeters(FRotator Rotation, FVector BaseOffsetInMeters, EOrientPositionSelector::Type Options) = 0;
/**
* Returns current base rotation and base offset.
* The base offset is currently used base position offset, previously set by the
* ResetPosition or SetBasePositionOffset calls. It represents a vector that translates the HMD's position
* into (0,0,0) point, in meters.
* The axis of the vector are the same as in Unreal: X - forward, Y - right, Z - up.
*
* @param OutRotation (out) Rotator object with base rotation
* @param OutBaseOffsetInMeters (out) base position offset, vector, in meters.
*/
virtual void GetBaseRotationAndBaseOffsetInMeters(FRotator& OutRotation, FVector& OutBaseOffsetInMeters) = 0;
/**
* Turns on/off default PlayerController's behavior to follow HMD orientation/position
*/
virtual void EnablePlayerControllerFollowHmd(bool bEnable) = 0;
/**
* Returns true if PlayerController follows HMD orientation/position. False, otherwise.
*/
virtual bool IsPlayerControllerFollowHmdEnabled() = 0;
/**
* Controls how PlayerCameraManager follows HMD. Note, this works for any active PlayerCameraManager
* with bFollowHmdOrientation property set to true.
*
* @param bFollowHmdOrientation (in) True if camera's orientation should be updated by most recent HMD orientation.
* @param bFollowHmdPosition (in) Whether the camera's position should be updated by most recent HMD orientation or not.
*/
virtual void EnablePlayerCameraManagerFollowHmd(bool bFollowHmdOrientation, bool bFollowHmdPosition) = 0;
/**
* Returns current settings for PlayerCameraManager's overrides for following HMD orientation and position.
*
* @param bFollowHmdOrientation (out) True if camera's orientation should be updated by most recent HMD orientation.
* @param bFollowHmdPosition (out) Whether the camera's position should be updated by most recent HMD orientation or not.
*/
virtual void GetPlayerCameraManagerFollowHmd(bool& bFollowHmdOrientation, bool& bFollowHmdPosition) = 0;
/**
* Sets 'base rotation' - the rotation that will be subtracted from
* the actual HMD orientation.
* The position offset might be added to current HMD position,
* effectively moving the virtual camera by the specified offset. The addition
* occurs after the HMD orientation and position are applied.
*
* @param BaseRot (in) Rotator object with base rotation
* @param PosOffset (in) the vector to be added to HMD position.
* @param Options (in) specifies either position, orientation or both should be set.
*/
virtual void SetBaseRotationAndPositionOffset(FRotator BaseRot, FVector PosOffset, EOrientPositionSelector::Type Options) = 0;
/**
* Returns current base rotation and position offset.
*
* @param OutRot (out) Rotator object with base rotation
* @param OutPosOffset (out) the vector with previously set position offset.
*/
virtual void GetBaseRotationAndPositionOffset(FRotator& OutRot, FVector& OutPosOffset) = 0;
}; | c |
code/User_Code/pvalue.h | idnewfeel/temp_measure | 0 | 1261376 | #ifndef _pvalue_h_
#define _pvalue_h_
#include "main.h"
extern uc16 pressure[1501];
/* Exported functions ------------------------------------------------------- */
float P_Calc(s16 temperature,u8 state);
u16 RH_Calc(s16 tdp,s16 temperature);
s16 DP_Calc(u16 RH,s16 temperature);
u16 pw_Calc(s16 tdp,s16 temperature);
u32 s_Calc(s16 tdp,s16 temperature);
s32 i_Calc(s16 tdp,s16 temperature);
#endif// _pvalue_h_ | c |
PrivateFrameworks/AppleAccount/AAFamilyMember.h | phatblat/macOSPrivateFrameworks | 17 | 5841462 | //
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by <NAME>.
//
#import "NSObject.h"
@class NSDate, NSNumber, NSString;
@interface AAFamilyMember : NSObject
{
BOOL _isMe;
BOOL _isChild;
BOOL _isSharingPurchases;
BOOL _isOrganizer;
BOOL _areParentalControlsEnabled;
BOOL _isAskToBuyEnabled;
NSString *_firstName;
NSString *_lastName;
NSString *_appleID;
NSNumber *_personID;
NSString *_personIDHash;
NSString *_altDSID;
NSString *_title;
NSDate *_joinDate;
NSString *_iTunesNotLinkedMessage;
NSString *_linkediTunesAppleID;
NSNumber *_linkediTunesDSID;
}
@property(nonatomic) BOOL isAskToBuyEnabled; // @synthesize isAskToBuyEnabled=_isAskToBuyEnabled;
@property(nonatomic) BOOL areParentalControlsEnabled; // @synthesize areParentalControlsEnabled=_areParentalControlsEnabled;
@property(copy, nonatomic) NSNumber *linkediTunesDSID; // @synthesize linkediTunesDSID=_linkediTunesDSID;
@property(copy, nonatomic) NSString *linkediTunesAppleID; // @synthesize linkediTunesAppleID=_linkediTunesAppleID;
@property(copy, nonatomic) NSString *iTunesNotLinkedMessage; // @synthesize iTunesNotLinkedMessage=_iTunesNotLinkedMessage;
@property(nonatomic) BOOL isOrganizer; // @synthesize isOrganizer=_isOrganizer;
@property(nonatomic) BOOL isSharingPurchases; // @synthesize isSharingPurchases=_isSharingPurchases;
@property(nonatomic) BOOL isChild; // @synthesize isChild=_isChild;
@property(nonatomic) BOOL isMe; // @synthesize isMe=_isMe;
@property(copy, nonatomic) NSDate *joinDate; // @synthesize joinDate=_joinDate;
@property(copy, nonatomic) NSString *title; // @synthesize title=_title;
@property(copy, nonatomic) NSString *altDSID; // @synthesize altDSID=_altDSID;
@property(copy, nonatomic) NSString *personIDHash; // @synthesize personIDHash=_personIDHash;
@property(copy, nonatomic) NSNumber *personID; // @synthesize personID=_personID;
@property(copy, nonatomic) NSString *appleID; // @synthesize appleID=_appleID;
@property(copy, nonatomic) NSString *lastName; // @synthesize lastName=_lastName;
@property(copy, nonatomic) NSString *firstName; // @synthesize firstName=_firstName;
- (void).cxx_destruct;
@end | c |
src/measures.c | victormatheus/LibOPF | 7 | 5777398 | #include "common.h"
#include "measures.h"
// Normalized cut
double
opf_graph_normalized_cut (struct opf_graph * sg)
{
int l, p, q;
struct set *Saux;
double ncut, dist;
double *acumIC; //acumulate weights inside each class
double *acumEC; //acumulate weights between the class and a distinct one
ncut = 0.0;
acumIC = alloc_double (sg->label_n);
acumEC = alloc_double (sg->label_n);
for (p = 0; p < sg->node_n; p++)
{
for (Saux = sg->node[p].adj; Saux != NULL; Saux = Saux->next)
{
q = Saux->elem;
dist = opf_graph_get_distance (sg, &sg->node[p], &sg->node[q]);
if (dist > 0.0)
{
if (sg->node[p].label == sg->node[q].label)
{
acumIC[sg->node[p].label] += 1.0 / dist; // intra-class weight
}
else // inter - class weight
{
acumEC[sg->node[p].label] += 1.0 / dist; // inter-class weight
}
}
}
}
for (l = 0; l < sg->label_n; l++)
{
if (acumIC[l] + acumEC[l] > 0.0)
ncut += (double) acumEC[l] / (acumIC[l] + acumEC[l]);
}
free (acumEC);
free (acumIC);
return (ncut);
} | c |
src/Game/zEntTeleportBox.h | DarkRTA/bfbbdecomp | 0 | 4353876 | #ifndef ZENTTELEPORTBOX_H
#define ZENTTELEPORTBOX_H
#endif | c |
Microblink.xcframework/ios-arm64_x86_64-maccatalyst/Microblink.framework/Versions/5.10.0/Headers/MBRecognizerRunnerViewControllerMetadataDelegates.h | MoathOthman/blinkid-ios | 377 | 3376762 | //
// MBRecognizerRunnerViewControllerMetadataDelegates.h
//
// AUTOMATICALLY GENERATED SOURCE. DO NOT EDIT!
//
#import "MBDebugRecognizerRunnerViewControllerDelegate.h"
#import "MBDetectionRecognizerRunnerViewControllerDelegate.h"
#import "MBOcrRecognizerRunnerViewControllerDelegate.h"
#import "MBGlareRecognizerRunnerViewControllerDelegate.h"
#import "MBFirstSideFinishedRecognizerRunnerViewControllerDelegate.h"
#import "MBMicroblinkDefines.h"
#import <Foundation/Foundation.h>
/**
* Class containing all metadata delegates
*/
MB_CLASS_AVAILABLE_IOS(8.0) MB_FINAL
@interface MBRecognizerRunnerViewControllerMetadataDelegates : NSObject
@property (nonatomic, weak, nullable) id<MBDebugRecognizerRunnerViewControllerDelegate> debugRecognizerRunnerViewControllerDelegate;
@property (nonatomic, weak, nullable) id<MBDetectionRecognizerRunnerViewControllerDelegate> detectionRecognizerRunnerViewControllerDelegate;
@property (nonatomic, weak, nullable) id<MBOcrRecognizerRunnerViewControllerDelegate> ocrRecognizerRunnerViewControllerDelegate;
@property (nonatomic, weak, nullable) id<MBGlareRecognizerRunnerViewControllerDelegate> glareRecognizerRunnerViewControllerDelegate;
@property (nonatomic, weak, nullable) id<MBFirstSideFinishedRecognizerRunnerViewControllerDelegate> firstSideFinishedRecognizerRunnerViewControllerDelegate;
@end | c |
libhipl/lsidb.c | levush/hipl | 0 | 2219499 | /*
* Copyright (c) 2012 Aalto University and RWTH Aachen University.
*
* 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.
*/
/**
* @file
* Implementation of the local scope identifier (LSI) database.
* The LSIDB manages which LSIs are assigned to network interfaces on the local
* host and which LSIs are still available.
*/
#include <netinet/in.h>
#include <stdbool.h>
#include "libcore/common.h"
#include "libcore/debug.h"
#include "libcore/protodefs.h"
#include "lsidb.h"
static unsigned lsi_index = 1;
/**
* Allocate an unused LSI that is still available to be used on the local host.
* This function merely keeps track of LSIs allocated through this interface.
* It does no check the actual network interfaces or other data structures in
* the HIP daemon to determine whether LSIs are in use or not.
*
* @param lsi Points to an LSI object that receives the LSI if this function
* returns successfully.
* The result of calling this function with @a lsi == @c NULL or
* @a lsi not pointing to a valid LSI object is undefined.
* @return This function returns true if an available LSI was successfully
* allocated and stored in @a lsi.
* This function returns false if no more LSIs are available on
* the local host.
*
* @internal
* The current implementation is extremely primitive and returns successively
* incremented LSIs.
* Freeing an LSI has no effect.
* This is currently acceptable because LSIs are allocated together with host
* identities when HIPD starts up and LSIs are only freed when HIPD exits.
* This interface is intended to hide potentially more complex allocation
* schemes, too.
*/
bool lsidb_allocate_lsi(hip_lsi_t *const lsi)
{
HIP_ASSERT(lsi);
/* the index may not be 0 because that does not lead to a valid network
* address */
HIP_ASSERT(lsi_index != 0);
/* does the index still fit into the allowed address prefix length of
* LSIs (-1 because the highest address is the broadcast address) */
if (lsi_index < HIP_LSI_TYPE_MASK_CLEAR) {
*lsi = (hip_lsi_t) { htonl(HIP_LSI_PREFIX | lsi_index) };
lsi_index++;
return true;
}
return false;
}
/**
* Free a previously allocated LSI so it is available to allocation again.
* This function should be called only after the LSI has been de-registered
* from the system is no longer in active use.
*
* @param lsi The LSI object to free.
* @return This function returns true if @a lsi is an LSI that was
* previously allocated via lsidb_allocate_lsi() and if it was
* freed successfully.
* This function returns false if @a lsi could not be freed and
* made available through allocation again.
*/
bool lsidb_free_lsi(const hip_lsi_t lsi)
{
/* is this a valid LSI? */
if ((ntohl(lsi.s_addr) & ~HIP_LSI_TYPE_MASK_CLEAR) == HIP_LSI_PREFIX) {
/* we currently do not support freeing the LSI */
return true;
}
return false;
} | c |
include/xenomai/cobalt/uapi/kernel/pipe.h | thomasfaingnaert/scriptable-guitar-pedal | 7 | 3495786 | /*
* Copyright (C) 2014 <NAME> <<EMAIL>>.
*
* 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 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.
*/
#ifndef _COBALT_UAPI_KERNEL_PIPE_H
#define _COBALT_UAPI_KERNEL_PIPE_H
#define XNPIPE_IOCTL_BASE 'p'
#define XNPIPEIOC_GET_NRDEV _IOW(XNPIPE_IOCTL_BASE, 0, int)
#define XNPIPEIOC_IFLUSH _IO(XNPIPE_IOCTL_BASE, 1)
#define XNPIPEIOC_OFLUSH _IO(XNPIPE_IOCTL_BASE, 2)
#define XNPIPEIOC_FLUSH XNPIPEIOC_OFLUSH
#define XNPIPEIOC_SETSIG _IO(XNPIPE_IOCTL_BASE, 3)
#define XNPIPE_NORMAL 0x0
#define XNPIPE_URGENT 0x1
#define XNPIPE_IFLUSH 0x1
#define XNPIPE_OFLUSH 0x2
#define XNPIPE_MINOR_AUTO (-1)
#endif /* !_COBALT_UAPI_KERNEL_PIPE_H */ | c |
src/notary_server/notary_server.h | blur-network/blur-dpow | 0 | 513365 | // Copyright (c) 2019-2022, Blur Network
// Copyright (c) 2017-2018, The Masari Project
// Copyright (c) 2014-2018, The Monero Project
//
// 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 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.
//
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
#pragma once
#include <boost/program_options/options_description.hpp>
#include <boost/program_options/variables_map.hpp>
#include <string>
#include "common/util.h"
#include "net/http_server_impl_base.h"
#include "notary_server_commands_defs.h"
#include "wallet/wallet2.h"
#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "wallet.rpc"
namespace tools
{
/************************************************************************/
/* */
/************************************************************************/
class notary_server: public epee::http_server_impl_base<notary_server>
{
public:
typedef epee::net_utils::connection_context_base connection_context;
static const char* tr(const char* str);
notary_server();
~notary_server();
bool init(const boost::program_options::variables_map *vm);
bool run();
void stop();
void set_wallet(wallet2 *cr);
private:
CHAIN_HTTP_TO_MAP2(connection_context);
BEGIN_URI_MAP2()
BEGIN_JSON_RPC_MAP("/json_rpc")
MAP_JON_RPC_WE("get_balance", on_getbalance, notary_rpc::COMMAND_RPC_GET_BALANCE)
MAP_JON_RPC_WE("get_address", on_getaddress, notary_rpc::COMMAND_RPC_GET_ADDRESS)
MAP_JON_RPC_WE("getbalance", on_getbalance, notary_rpc::COMMAND_RPC_GET_BALANCE)
MAP_JON_RPC_WE("getaddress", on_getaddress, notary_rpc::COMMAND_RPC_GET_ADDRESS)
MAP_JON_RPC_WE("create_address", on_create_address, notary_rpc::COMMAND_RPC_CREATE_ADDRESS)
MAP_JON_RPC_WE("label_address", on_label_address, notary_rpc::COMMAND_RPC_LABEL_ADDRESS)
MAP_JON_RPC_WE("get_accounts", on_get_accounts, notary_rpc::COMMAND_RPC_GET_ACCOUNTS)
MAP_JON_RPC_WE("create_account", on_create_account, notary_rpc::COMMAND_RPC_CREATE_ACCOUNT)
MAP_JON_RPC_WE("label_account", on_label_account, notary_rpc::COMMAND_RPC_LABEL_ACCOUNT)
MAP_JON_RPC_WE("get_account_tags", on_get_account_tags, notary_rpc::COMMAND_RPC_GET_ACCOUNT_TAGS)
MAP_JON_RPC_WE("tag_accounts", on_tag_accounts, notary_rpc::COMMAND_RPC_TAG_ACCOUNTS)
MAP_JON_RPC_WE("untag_accounts", on_untag_accounts, notary_rpc::COMMAND_RPC_UNTAG_ACCOUNTS)
MAP_JON_RPC_WE("set_account_tag_description", on_set_account_tag_description, notary_rpc::COMMAND_RPC_SET_ACCOUNT_TAG_DESCRIPTION)
MAP_JON_RPC_WE("get_height", on_getheight, notary_rpc::COMMAND_RPC_GET_HEIGHT)
MAP_JON_RPC_WE("getheight", on_getheight, notary_rpc::COMMAND_RPC_GET_HEIGHT)
MAP_JON_RPC_WE("transfer", on_transfer, notary_rpc::COMMAND_RPC_TRANSFER)
MAP_JON_RPC_WE("transfer_split", on_transfer_split, notary_rpc::COMMAND_RPC_TRANSFER_SPLIT)
MAP_JON_RPC_WE("create_ntz_transfer",on_create_ntz_transfer,notary_rpc::COMMAND_RPC_CREATE_NTZ_TRANSFER)
MAP_JON_RPC_WE("append_ntz_sig", on_append_ntz_sig, notary_rpc::COMMAND_RPC_APPEND_NTZ_SIG)
MAP_JON_RPC_WE("sweep_all", on_sweep_all, notary_rpc::COMMAND_RPC_SWEEP_ALL)
MAP_JON_RPC_WE("sweep_single", on_sweep_single, notary_rpc::COMMAND_RPC_SWEEP_SINGLE)
MAP_JON_RPC_WE("relay_tx", on_relay_tx, notary_rpc::COMMAND_RPC_RELAY_TX)
MAP_JON_RPC_WE("store", on_store, notary_rpc::COMMAND_RPC_STORE)
MAP_JON_RPC_WE("get_payments", on_get_payments, notary_rpc::COMMAND_RPC_GET_PAYMENTS)
MAP_JON_RPC_WE("get_bulk_payments", on_get_bulk_payments, notary_rpc::COMMAND_RPC_GET_BULK_PAYMENTS)
MAP_JON_RPC_WE("incoming_transfers", on_incoming_transfers, notary_rpc::COMMAND_RPC_INCOMING_TRANSFERS)
MAP_JON_RPC_WE("query_key", on_query_key, notary_rpc::COMMAND_RPC_QUERY_KEY)
MAP_JON_RPC_WE("make_integrated_address", on_make_integrated_address, notary_rpc::COMMAND_RPC_MAKE_INTEGRATED_ADDRESS)
MAP_JON_RPC_WE("split_integrated_address", on_split_integrated_address, notary_rpc::COMMAND_RPC_SPLIT_INTEGRATED_ADDRESS)
MAP_JON_RPC_WE("stop_wallet", on_stop_wallet, notary_rpc::COMMAND_RPC_STOP_WALLET)
MAP_JON_RPC_WE("rescan_blockchain", on_rescan_blockchain, notary_rpc::COMMAND_RPC_RESCAN_BLOCKCHAIN)
MAP_JON_RPC_WE("set_tx_notes", on_set_tx_notes, notary_rpc::COMMAND_RPC_SET_TX_NOTES)
MAP_JON_RPC_WE("get_tx_notes", on_get_tx_notes, notary_rpc::COMMAND_RPC_GET_TX_NOTES)
MAP_JON_RPC_WE("set_attribute", on_set_attribute, notary_rpc::COMMAND_RPC_SET_ATTRIBUTE)
MAP_JON_RPC_WE("get_attribute", on_get_attribute, notary_rpc::COMMAND_RPC_GET_ATTRIBUTE)
MAP_JON_RPC_WE("get_tx_key", on_get_tx_key, notary_rpc::COMMAND_RPC_GET_TX_KEY)
MAP_JON_RPC_WE("check_tx_key", on_check_tx_key, notary_rpc::COMMAND_RPC_CHECK_TX_KEY)
MAP_JON_RPC_WE("get_tx_proof", on_get_tx_proof, notary_rpc::COMMAND_RPC_GET_TX_PROOF)
MAP_JON_RPC_WE("check_tx_proof", on_check_tx_proof, notary_rpc::COMMAND_RPC_CHECK_TX_PROOF)
MAP_JON_RPC_WE("get_spend_proof", on_get_spend_proof, notary_rpc::COMMAND_RPC_GET_SPEND_PROOF)
MAP_JON_RPC_WE("check_spend_proof", on_check_spend_proof, notary_rpc::COMMAND_RPC_CHECK_SPEND_PROOF)
MAP_JON_RPC_WE("get_reserve_proof", on_get_reserve_proof, notary_rpc::COMMAND_RPC_GET_RESERVE_PROOF)
MAP_JON_RPC_WE("check_reserve_proof", on_check_reserve_proof, notary_rpc::COMMAND_RPC_CHECK_RESERVE_PROOF)
MAP_JON_RPC_WE("get_transfers", on_get_transfers, notary_rpc::COMMAND_RPC_GET_TRANSFERS)
MAP_JON_RPC_WE("get_transfer_by_txid", on_get_transfer_by_txid, notary_rpc::COMMAND_RPC_GET_TRANSFER_BY_TXID)
MAP_JON_RPC_WE("sign", on_sign, notary_rpc::COMMAND_RPC_SIGN)
MAP_JON_RPC_WE("verify", on_verify, notary_rpc::COMMAND_RPC_VERIFY)
MAP_JON_RPC_WE("export_key_images", on_export_key_images, notary_rpc::COMMAND_RPC_EXPORT_KEY_IMAGES)
MAP_JON_RPC_WE("import_key_images", on_import_key_images, notary_rpc::COMMAND_RPC_IMPORT_KEY_IMAGES)
MAP_JON_RPC_WE("make_uri", on_make_uri, notary_rpc::COMMAND_RPC_MAKE_URI)
MAP_JON_RPC_WE("parse_uri", on_parse_uri, notary_rpc::COMMAND_RPC_PARSE_URI)
MAP_JON_RPC_WE("get_address_book", on_get_address_book, notary_rpc::COMMAND_RPC_GET_ADDRESS_BOOK_ENTRY)
MAP_JON_RPC_WE("add_address_book", on_add_address_book, notary_rpc::COMMAND_RPC_ADD_ADDRESS_BOOK_ENTRY)
MAP_JON_RPC_WE("delete_address_book",on_delete_address_book,notary_rpc::COMMAND_RPC_DELETE_ADDRESS_BOOK_ENTRY)
MAP_JON_RPC_WE("rescan_spent", on_rescan_spent, notary_rpc::COMMAND_RPC_RESCAN_SPENT)
MAP_JON_RPC_WE("start_mining", on_start_mining, notary_rpc::COMMAND_RPC_START_MINING)
MAP_JON_RPC_WE("stop_mining", on_stop_mining, notary_rpc::COMMAND_RPC_STOP_MINING)
MAP_JON_RPC_WE("get_languages", on_get_languages, notary_rpc::COMMAND_RPC_GET_LANGUAGES)
MAP_JON_RPC_WE("create_wallet", on_create_wallet, notary_rpc::COMMAND_RPC_CREATE_WALLET)
MAP_JON_RPC_WE("open_wallet", on_open_wallet, notary_rpc::COMMAND_RPC_OPEN_WALLET)
END_JSON_RPC_MAP()
END_URI_MAP2()
//json_rpc
bool on_getbalance(const notary_rpc::COMMAND_RPC_GET_BALANCE::request& req, notary_rpc::COMMAND_RPC_GET_BALANCE::response& res, epee::json_rpc::error& er);
bool on_getaddress(const notary_rpc::COMMAND_RPC_GET_ADDRESS::request& req, notary_rpc::COMMAND_RPC_GET_ADDRESS::response& res, epee::json_rpc::error& er);
bool on_create_address(const notary_rpc::COMMAND_RPC_CREATE_ADDRESS::request& req, notary_rpc::COMMAND_RPC_CREATE_ADDRESS::response& res, epee::json_rpc::error& er);
bool on_label_address(const notary_rpc::COMMAND_RPC_LABEL_ADDRESS::request& req, notary_rpc::COMMAND_RPC_LABEL_ADDRESS::response& res, epee::json_rpc::error& er);
bool on_get_accounts(const notary_rpc::COMMAND_RPC_GET_ACCOUNTS::request& req, notary_rpc::COMMAND_RPC_GET_ACCOUNTS::response& res, epee::json_rpc::error& er);
bool on_create_account(const notary_rpc::COMMAND_RPC_CREATE_ACCOUNT::request& req, notary_rpc::COMMAND_RPC_CREATE_ACCOUNT::response& res, epee::json_rpc::error& er);
bool on_label_account(const notary_rpc::COMMAND_RPC_LABEL_ACCOUNT::request& req, notary_rpc::COMMAND_RPC_LABEL_ACCOUNT::response& res, epee::json_rpc::error& er);
bool on_get_account_tags(const notary_rpc::COMMAND_RPC_GET_ACCOUNT_TAGS::request& req, notary_rpc::COMMAND_RPC_GET_ACCOUNT_TAGS::response& res, epee::json_rpc::error& er);
bool on_tag_accounts(const notary_rpc::COMMAND_RPC_TAG_ACCOUNTS::request& req, notary_rpc::COMMAND_RPC_TAG_ACCOUNTS::response& res, epee::json_rpc::error& er);
bool on_untag_accounts(const notary_rpc::COMMAND_RPC_UNTAG_ACCOUNTS::request& req, notary_rpc::COMMAND_RPC_UNTAG_ACCOUNTS::response& res, epee::json_rpc::error& er);
bool on_set_account_tag_description(const notary_rpc::COMMAND_RPC_SET_ACCOUNT_TAG_DESCRIPTION::request& req, notary_rpc::COMMAND_RPC_SET_ACCOUNT_TAG_DESCRIPTION::response& res, epee::json_rpc::error& er);
bool on_getheight(const notary_rpc::COMMAND_RPC_GET_HEIGHT::request& req, notary_rpc::COMMAND_RPC_GET_HEIGHT::response& res, epee::json_rpc::error& er);
bool validate_transfer(const std::list<notary_rpc::transfer_destination>& destinations, const std::string& payment_id, std::vector<cryptonote::tx_destination_entry>& dsts, std::vector<uint8_t>& extra, bool at_least_one_destination, epee::json_rpc::error& er);
bool validate_ntz_transfer(const std::vector<notary_rpc::transfer_destination>& destinations, const std::string& payment_id, std::vector<cryptonote::tx_destination_entry>& dsts, std::vector<uint8_t>& extra, bool at_least_one_destination, int& sig_count, std::vector<int>& signer_index_vec, bool& already_signed, epee::json_rpc::error& er);
bool on_transfer(const notary_rpc::COMMAND_RPC_TRANSFER::request& req, notary_rpc::COMMAND_RPC_TRANSFER::response& res, epee::json_rpc::error& er);
bool on_transfer_split(const notary_rpc::COMMAND_RPC_TRANSFER_SPLIT::request& req, notary_rpc::COMMAND_RPC_TRANSFER_SPLIT::response& res, epee::json_rpc::error& er);
bool on_create_ntz_transfer(const notary_rpc::COMMAND_RPC_CREATE_NTZ_TRANSFER::request& req, notary_rpc::COMMAND_RPC_CREATE_NTZ_TRANSFER::response& res, epee::json_rpc::error& er);
bool on_append_ntz_sig(const notary_rpc::COMMAND_RPC_APPEND_NTZ_SIG::request& req, notary_rpc::COMMAND_RPC_APPEND_NTZ_SIG::response& res, epee::json_rpc::error& er);
bool on_sweep_all(const notary_rpc::COMMAND_RPC_SWEEP_ALL::request& req, notary_rpc::COMMAND_RPC_SWEEP_ALL::response& res, epee::json_rpc::error& er);
bool on_sweep_single(const notary_rpc::COMMAND_RPC_SWEEP_SINGLE::request& req, notary_rpc::COMMAND_RPC_SWEEP_SINGLE::response& res, epee::json_rpc::error& er);
bool on_relay_tx(const notary_rpc::COMMAND_RPC_RELAY_TX::request& req, notary_rpc::COMMAND_RPC_RELAY_TX::response& res, epee::json_rpc::error& er);
bool on_make_integrated_address(const notary_rpc::COMMAND_RPC_MAKE_INTEGRATED_ADDRESS::request& req, notary_rpc::COMMAND_RPC_MAKE_INTEGRATED_ADDRESS::response& res, epee::json_rpc::error& er);
bool on_split_integrated_address(const notary_rpc::COMMAND_RPC_SPLIT_INTEGRATED_ADDRESS::request& req, notary_rpc::COMMAND_RPC_SPLIT_INTEGRATED_ADDRESS::response& res, epee::json_rpc::error& er);
bool on_store(const notary_rpc::COMMAND_RPC_STORE::request& req, notary_rpc::COMMAND_RPC_STORE::response& res, epee::json_rpc::error& er);
bool on_get_payments(const notary_rpc::COMMAND_RPC_GET_PAYMENTS::request& req, notary_rpc::COMMAND_RPC_GET_PAYMENTS::response& res, epee::json_rpc::error& er);
bool on_get_bulk_payments(const notary_rpc::COMMAND_RPC_GET_BULK_PAYMENTS::request& req, notary_rpc::COMMAND_RPC_GET_BULK_PAYMENTS::response& res, epee::json_rpc::error& er);
bool on_incoming_transfers(const notary_rpc::COMMAND_RPC_INCOMING_TRANSFERS::request& req, notary_rpc::COMMAND_RPC_INCOMING_TRANSFERS::response& res, epee::json_rpc::error& er);
bool on_stop_wallet(const notary_rpc::COMMAND_RPC_STOP_WALLET::request& req, notary_rpc::COMMAND_RPC_STOP_WALLET::response& res, epee::json_rpc::error& er);
bool on_rescan_blockchain(const notary_rpc::COMMAND_RPC_RESCAN_BLOCKCHAIN::request& req, notary_rpc::COMMAND_RPC_RESCAN_BLOCKCHAIN::response& res, epee::json_rpc::error& er);
bool on_set_tx_notes(const notary_rpc::COMMAND_RPC_SET_TX_NOTES::request& req, notary_rpc::COMMAND_RPC_SET_TX_NOTES::response& res, epee::json_rpc::error& er);
bool on_get_tx_notes(const notary_rpc::COMMAND_RPC_GET_TX_NOTES::request& req, notary_rpc::COMMAND_RPC_GET_TX_NOTES::response& res, epee::json_rpc::error& er);
bool on_set_attribute(const notary_rpc::COMMAND_RPC_SET_ATTRIBUTE::request& req, notary_rpc::COMMAND_RPC_SET_ATTRIBUTE::response& res, epee::json_rpc::error& er);
bool on_get_attribute(const notary_rpc::COMMAND_RPC_GET_ATTRIBUTE::request& req, notary_rpc::COMMAND_RPC_GET_ATTRIBUTE::response& res, epee::json_rpc::error& er);
bool on_get_tx_key(const notary_rpc::COMMAND_RPC_GET_TX_KEY::request& req, notary_rpc::COMMAND_RPC_GET_TX_KEY::response& res, epee::json_rpc::error& er);
bool on_check_tx_key(const notary_rpc::COMMAND_RPC_CHECK_TX_KEY::request& req, notary_rpc::COMMAND_RPC_CHECK_TX_KEY::response& res, epee::json_rpc::error& er);
bool on_get_tx_proof(const notary_rpc::COMMAND_RPC_GET_TX_PROOF::request& req, notary_rpc::COMMAND_RPC_GET_TX_PROOF::response& res, epee::json_rpc::error& er);
bool on_check_tx_proof(const notary_rpc::COMMAND_RPC_CHECK_TX_PROOF::request& req, notary_rpc::COMMAND_RPC_CHECK_TX_PROOF::response& res, epee::json_rpc::error& er);
bool on_get_spend_proof(const notary_rpc::COMMAND_RPC_GET_SPEND_PROOF::request& req, notary_rpc::COMMAND_RPC_GET_SPEND_PROOF::response& res, epee::json_rpc::error& er);
bool on_check_spend_proof(const notary_rpc::COMMAND_RPC_CHECK_SPEND_PROOF::request& req, notary_rpc::COMMAND_RPC_CHECK_SPEND_PROOF::response& res, epee::json_rpc::error& er);
bool on_get_reserve_proof(const notary_rpc::COMMAND_RPC_GET_RESERVE_PROOF::request& req, notary_rpc::COMMAND_RPC_GET_RESERVE_PROOF::response& res, epee::json_rpc::error& er);
bool on_check_reserve_proof(const notary_rpc::COMMAND_RPC_CHECK_RESERVE_PROOF::request& req, notary_rpc::COMMAND_RPC_CHECK_RESERVE_PROOF::response& res, epee::json_rpc::error& er);
bool on_get_transfers(const notary_rpc::COMMAND_RPC_GET_TRANSFERS::request& req, notary_rpc::COMMAND_RPC_GET_TRANSFERS::response& res, epee::json_rpc::error& er);
bool on_get_transfer_by_txid(const notary_rpc::COMMAND_RPC_GET_TRANSFER_BY_TXID::request& req, notary_rpc::COMMAND_RPC_GET_TRANSFER_BY_TXID::response& res, epee::json_rpc::error& er);
bool on_sign(const notary_rpc::COMMAND_RPC_SIGN::request& req, notary_rpc::COMMAND_RPC_SIGN::response& res, epee::json_rpc::error& er);
bool on_verify(const notary_rpc::COMMAND_RPC_VERIFY::request& req, notary_rpc::COMMAND_RPC_VERIFY::response& res, epee::json_rpc::error& er);
bool on_export_key_images(const notary_rpc::COMMAND_RPC_EXPORT_KEY_IMAGES::request& req, notary_rpc::COMMAND_RPC_EXPORT_KEY_IMAGES::response& res, epee::json_rpc::error& er);
bool on_import_key_images(const notary_rpc::COMMAND_RPC_IMPORT_KEY_IMAGES::request& req, notary_rpc::COMMAND_RPC_IMPORT_KEY_IMAGES::response& res, epee::json_rpc::error& er);
bool on_make_uri(const notary_rpc::COMMAND_RPC_MAKE_URI::request& req, notary_rpc::COMMAND_RPC_MAKE_URI::response& res, epee::json_rpc::error& er);
bool on_parse_uri(const notary_rpc::COMMAND_RPC_PARSE_URI::request& req, notary_rpc::COMMAND_RPC_PARSE_URI::response& res, epee::json_rpc::error& er);
bool on_get_address_book(const notary_rpc::COMMAND_RPC_GET_ADDRESS_BOOK_ENTRY::request& req, notary_rpc::COMMAND_RPC_GET_ADDRESS_BOOK_ENTRY::response& res, epee::json_rpc::error& er);
bool on_add_address_book(const notary_rpc::COMMAND_RPC_ADD_ADDRESS_BOOK_ENTRY::request& req, notary_rpc::COMMAND_RPC_ADD_ADDRESS_BOOK_ENTRY::response& res, epee::json_rpc::error& er);
bool on_delete_address_book(const notary_rpc::COMMAND_RPC_DELETE_ADDRESS_BOOK_ENTRY::request& req, notary_rpc::COMMAND_RPC_DELETE_ADDRESS_BOOK_ENTRY::response& res, epee::json_rpc::error& er);
bool on_rescan_spent(const notary_rpc::COMMAND_RPC_RESCAN_SPENT::request& req, notary_rpc::COMMAND_RPC_RESCAN_SPENT::response& res, epee::json_rpc::error& er);
bool on_start_mining(const notary_rpc::COMMAND_RPC_START_MINING::request& req, notary_rpc::COMMAND_RPC_START_MINING::response& res, epee::json_rpc::error& er);
bool on_stop_mining(const notary_rpc::COMMAND_RPC_STOP_MINING::request& req, notary_rpc::COMMAND_RPC_STOP_MINING::response& res, epee::json_rpc::error& er);
bool on_get_languages(const notary_rpc::COMMAND_RPC_GET_LANGUAGES::request& req, notary_rpc::COMMAND_RPC_GET_LANGUAGES::response& res, epee::json_rpc::error& er);
bool on_create_wallet(const notary_rpc::COMMAND_RPC_CREATE_WALLET::request& req, notary_rpc::COMMAND_RPC_CREATE_WALLET::response& res, epee::json_rpc::error& er);
bool on_open_wallet(const notary_rpc::COMMAND_RPC_OPEN_WALLET::request& req, notary_rpc::COMMAND_RPC_OPEN_WALLET::response& res, epee::json_rpc::error& er);
//json rpc v2
bool on_query_key(const notary_rpc::COMMAND_RPC_QUERY_KEY::request& req, notary_rpc::COMMAND_RPC_QUERY_KEY::response& res, epee::json_rpc::error& er);
// helpers
void fill_transfer_entry(tools::notary_rpc::transfer_entry &entry, const crypto::hash &txid, const crypto::hash &payment_id, const tools::wallet2::payment_details &pd);
void fill_transfer_entry(tools::notary_rpc::transfer_entry &entry, const crypto::hash &txid, const tools::wallet2::confirmed_transfer_details &pd);
void fill_transfer_entry(tools::notary_rpc::transfer_entry &entry, const crypto::hash &txid, const tools::wallet2::unconfirmed_transfer_details &pd);
void fill_transfer_entry(tools::notary_rpc::transfer_entry &entry, const crypto::hash &payment_id, const tools::wallet2::pool_payment_details &pd);
void get_ntzpool_tx_infos(std::vector<cryptonote::ntz_tx_info>& tx_infos);
bool check_if_sent_to_pool();
bool not_open(epee::json_rpc::error& er);
void handle_rpc_exception(const std::exception_ptr& e, epee::json_rpc::error& er, int default_error_code);
template<typename Ts, typename Tu>
bool fill_response(std::vector<tools::wallet2::pending_tx> &ptx_vector,
bool get_tx_key, Ts& tx_key, Tu &amount, Tu &fee, std::string &multisig_txset, bool do_not_relay,
Ts &tx_hash, bool get_tx_hex, Ts &tx_blob, bool get_tx_metadata, Ts &tx_metadata, epee::json_rpc::error &er);
wallet2 *m_wallet;
std::string m_notary_wallet_dir;
tools::private_file rpc_login_file;
std::atomic<bool> m_stop;
bool m_trusted_daemon;
const boost::program_options::variables_map *m_vm;
};
} | c |
BMPHEADER.h | K3rne132/Stegano-BMP | 0 | 7461071 | #ifndef BMPHEADER_H
#define BMPHEADER_H
#define WORD unsigned short
#define DWORD unsigned long
#pragma pack(push, 1)
typedef struct {
WORD bfType;
DWORD bfSize;
WORD bfReserved1;
WORD bfReserved2;
DWORD bfOffBits;
} BITMAPFILEHEADER;
#pragma pack(pop)
#endif | c |
project752/src/testComponent910/headers/testComponent910/lib2.h | gradle/perf-native-large | 2 | 8187488 | #ifndef PROJECT_HEADER_testComponent910_2_H
#define PROJECT_HEADER_testComponent910_2_H
int testComponent910_2();
#endif // PROJECT_HEADER_testComponent910_2_H | c |
bare-metal-apps/lib/include/libc.h | zanon005/hellfire-hypervisor | 3 | 3050470 | /*
Copyright (c) 2016, prpl Foundation
Permission to use, copy, modify, and/or distribute this software for any purpose with or without
fee is hereby granted, provided that the above copyright notice and this permission notice appear
in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
This code was written by <NAME> at Embedded System Group (GSE) at PUCRS/Brazil.
*/
#ifndef _LIBC_H
#define _LIBC_H
#include <types.h>
/*
constants, tests and transformations
*/
#define NULL ((void *)0)
//#define USED 1
#define TRUE 1
#define FALSE 0
#define isprint(c) (' '<=(c)&&(c)<='~')
#define isspace(c) ((c)==' '||(c)=='\t'||(c)=='\n'||(c)=='\r')
#define isdigit(c) ('0'<=(c)&&(c)<='9')
/*#define islower(c) ('a'<=(c)&&(c)<='z')
#define isupper(c) ('A'<=(c)&&(c)<='Z')
#define isalpha(c) (islower(c)||isupper(c))
#define isalnum(c) (isalpha(c)||isdigit(c))*/
#define min(a,b) ((a)<(b)?(a):(b))
#define ntohs(A) (((A)>>8) | (((A)&0xff)<<8))
#define ntohl(A) (((A)>>24) | (((A)&0xff0000)>>8) | (((A)&0xff00)<<8) | ((A)<<24))
/* FIXME: picoTCP includes stdlib which conflicts with the following
* definitions.
*/
#ifndef PICOTCP
extern int32_t serial_select(uint32_t serial_number);
extern void putchar(int32_t value);
extern int32_t kbhit(void);
extern uint32_t getchar(void);
extern char *strcpy(char *dst, const char *src);
extern char *strncpy(char *s1, char *s2, int32_t n);
extern char *strcat(char *dst, const char *src);
extern char *strncat(char *s1, char *s2, int32_t n);
extern int32_t strcmp(const char *s1, const char *s2);
extern int32_t strncmp(char *s1, char *s2, int32_t n);
extern char *strstr(const char *string, const char *find);
extern int32_t strlen(const char *s);
extern char *strchr(const char *s, int32_t c);
extern char *strpbrk(char *str, char *set);
extern char *strsep(char **pp, char *delim);
extern char *strtok(char *s, const char *delim);
extern void *memcpy(void *dst, const void *src, uint32_t n);
extern void *memmove(void *dst, const void *src, uint32_t n);
extern int32_t memcmp(const void *cs, const void *ct, uint32_t n);
extern void *memset(void *s, int32_t c, uint32_t n);
extern int32_t strtol(const char *s, char **end, int32_t base);
extern int32_t atoi(const char *s);
extern float atof(const int8_t *p);
extern char *itoa(int32_t i, char *s, int32_t base);
extern int32_t puts(const char *str);
extern char *gets(char *s);
extern int32_t abs(int32_t n);
extern int32_t random(void);
extern void srand(uint32_t seed);
extern int32_t printf(char *fmt, ...);
extern int32_t sprintf(char *out, const char *fmt, ...);
extern uint32_t calc_diff_time(uint32_t now, uint32_t old);
extern uint32_t toupper (uint32_t c);
extern uint32_t tolower (uint32_t c);
extern uint8_t* strdup(uint8_t* s);
#endif
typedef volatile unsigned int mutex_t;
void lock(mutex_t *mutex);
void spinlock(mutex_t *mutex);
void unlock(mutex_t *mutex);
#define UART2 2
#define UART6 6
/* IEEE single-precision definitions */
#define SNG_EXPBITS 8
#define SNG_FRACBITS 23
#define SNG_EXP_BIAS 127
#define SNG_EXP_INFNAN 255
#define EXCESS 126
#define EXCESSD 1022
#define SIGNBIT 0x80000000
#define HIDDEN (1 << 23)
#define HIDDEND (1 << 20)
#define SIGN(fp) ((fp) & SIGNBIT)
#define SIGND(fp) ((fp.l.upper) & SIGNBIT)
#define EXP(fp) (((fp) >> 23) & 0xFF)
#define EXPD(fp) (((fp.l.upper) >> 20) & 0x7FF)
#define MANT(fp) (((fp) & 0x7FFFFF) | HIDDEN)
#define MANTD(fp) (((((fp.l.upper) & 0xFFFFF) | HIDDEND) << 10) | (fp.l.lower >> 22))
#define PACK(s,e,m) ((s) | ((e) << 23) | (m))
union float_long{
float f;
int32_t l;
};
union double_long {
double d;
struct {
#ifdef LITTLE_ENDIAN
unsigned long lower;
long upper;
#else
long upper;
unsigned long lower;
#endif
} l;
long long ll;
};
#endif | c |
src/SynchronizationInstrumentor/CodeTransformer.h | mozafari/vprofiler | 107 | 4171788 | // Clang libs
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Parse/ParseAST.h"
#include "clang/Basic/TargetOptions.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Rewrite/Core/Rewriter.h"
// STL libs
#include <vector>
#include <unordered_map>
#include <string>
// VProf libs
#include "ClangBase.h"
class CodeTransformer {
public:
static CodeTransformer* GetInstance();
// Engine class which runs clang related source translation
// Runs the source translation on a single source file.
bool TransformFile(std::string &filename);
// Creates the singleton instance of CodeTranslator.
// functionNames maps fully qualified function names which
// the user would like profiled to their VProfiler equivalent.
static void CreateCodeTransformer(const std::unordered_map<std::string, std::string> &functionNames);
private:
// Copy ctor
CodeTransformer(const CodeTransformer *other);
// Ctor only called in GetInstance
CodeTransformer(const std::unordered_map<std::string, std::string> &functionNames);
// Creates and sets compiler state. Called once per file.
void CreateCompiler();
// Singleton pattern
static std::unique_ptr<CodeTransformer> singleton;
// Maps fully qualified function names which the user would like profiled
// to their VProfiler equivalent.
std::unordered_map<std::string, std::string> functionNames;
// Clang internals
std::shared_ptr<clang::CompilerInstance> compiler;
std::shared_ptr<clang::Rewriter> rewriter;
clang::FileManager *fileManager;
clang::SourceManager *sourceManager;
// VProf clang overrides
std::unique_ptr<VProfASTConsumer> astConsumer;
}; | c |
lib/AerisWeatherKit.xcframework/tvos-arm64_x86_64-simulator/AerisWeatherKit.framework/Headers/AWFLightningStrikes.h | aerisweather/aerisweather-ios | 0 | 3321873 | //
// AFLightningStrikesLoader.h
// Aeris
//
// Created by <NAME> on 9/6/13.
// Copyright (c) 2013 AerisWeather, LLC. All rights reserved.
//
#import <AerisWeatherKit/AWFWeatherEndpoint.h>
#import <AerisWeatherKit/AWFLightningStrike.h>
NS_ASSUME_NONNULL_BEGIN
typedef NSString * AWFLightningStrikeFilter NS_TYPED_EXTENSIBLE_ENUM;
FOUNDATION_EXPORT AWFLightningStrikeFilter const AWFLightningStrikeFilterAll;
FOUNDATION_EXPORT AWFLightningStrikeFilter const AWFLightningStrikeFilterCloudToGround;
FOUNDATION_EXPORT AWFLightningStrikeFilter const AWFLightningStrikeFilterCloudToCloud;
typedef NSString * AWFLightningStrikeField NS_TYPED_EXTENSIBLE_ENUM;
FOUNDATION_EXPORT AWFLightningStrikeField const AWFLightningStrikeFieldDateTime;
/**
`AWFLightningStrikes` provides convenience methods for interacting with the
[`lightning` endpoint](https://www.aerisweather.com/support/docs/api/reference/endpoints/lightning) of the Aeris API. All requests will
return instances of `AWFLightningStrike` that will be populated by the data returned by the API unless otherwise indicated.
*/
@interface AWFLightningStrikes : AWFWeatherEndpoint
@end
NS_ASSUME_NONNULL_END | c |
src/skeleton_model.h | huhwang/skeleton-based-robot-reasoning | 0 | 2753133 | #pragma once
#include <vector>
#include <string>
#include <fstream>
#include <sstream>
#include <map>
using namespace std;
#ifndef _SKELETON_POSITION_
#define _SKELETON_POSITION_
struct position {
float x;
float y;
float z;
position() {
x = 0;
y = 0;
z = 0;
}
position(float tx, float ty, float tz) {
x = tx;
y = ty;
z = tz;
}
};
#endif // !_SKELETON_POSITION_
#ifndef _SKELETON_DATA_STRUCT_
#define _SKELETON_DATA_STRUCT_
typedef map<size_t, position> positions_of_frame;
typedef vector<positions_of_frame> positions_of_instance;
#endif // !_SKELETON_DATA_STRUCT_
class skeleton_model {
public:
skeleton_model() {};
~skeleton_model() {};
virtual void start() = 0;
protected:
void get_file_list();
void load_instances();
void write_to_file();
double dist_between(position &a, position &b);
const char *testFolder_ = "dataset/test/";
const char *trainFolder_ = "dataset/train/";
bool use_test_;
bool svm_output;
string out_file_name_;
vector<string> file_list_;
vector<positions_of_instance> positions_instances;
vector<string> instance_names;
ostringstream os_buff_;
const size_t HIP_CENTER = 1;
const size_t SPINE = 2;
const size_t SHOULDER_CENTER = 3;
const size_t HEAD = 4;
const size_t SHOULDER_LEFT = 5;
const size_t ELBOW_LEFT = 6;
const size_t WRIST_LEFT = 7;
const size_t HAND_LEFT = 8;
const size_t SHOULDER_RIGHT = 9;
const size_t ELBOW_RIGHT = 10;
const size_t WRIST_RIGHT = 11;
const size_t HAND_RIGHT = 12;
const size_t HIP_LEFT = 13;
const size_t KNEE_LEFT = 14;
const size_t ANKLE_LEFT = 15;
const size_t FOOT_LEFT = 16;
const size_t HIP_RIGHT = 17;
const size_t KNEE_RIGHT = 18;
const size_t ANKLE_RIGHT = 19;
const size_t FOOT_RIGHT = 20;
private:
positions_of_instance get_joint_pos_of_instance(string &filename);
positions_of_frame get_joint_pos_of_frame(ifstream &fin);
}; | c |
MapwizeUI/Scenes/SearchScene/MWZUISearchViewControllerOptions.h | Mapwize/mapwize-ui-ios | 18 | 4677439 | #import <Foundation/Foundation.h>
@import MapwizeSDK;
NS_ASSUME_NONNULL_BEGIN
@interface MWZUISearchViewControllerOptions : NSObject
@property (assign) BOOL isDirection;
@property (assign) BOOL isFrom;
@property (assign) BOOL isTo;
@property (nonatomic, copy) NSString* language;
@property (nonatomic, copy) NSString* venueId;
@property (nonatomic, copy) NSString* universeId;
@property (nonatomic, copy) NSArray<MWZUniverse*>* groupByUniverses;
@property (nonatomic, copy) ILIndoorLocation* indoorLocation;
@property (nonatomic, copy) MWZApiFilter* apiFilter;
@end
NS_ASSUME_NONNULL_END | c |
YtelAPIV3/Models/Type36EnumHelper.h | mgrofsky/Ytel-API-OBJC-iOS | 0 | 4842797 | //
// YtelAPIV3
//
// This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
//
#ifndef APIMATIC_TYPE36ENUMHELPER
#define APIMATIC_TYPE36ENUMHELPER
#include "Type36Enum.h"
/**
* Helper class interface for Type36Enum to NSString conversion
*/
@interface Type36EnumHelper : NSObject
+(id) stringFromType36Enum:(enum Type36Enum) type36Enum withDefault: (id) defaultValue;
+(NSArray<NSString*>*) stringArrayFromType36EnumArray:(NSArray<NSNumber*>*) array;
+(enum Type36Enum) type36EnumFromString:(NSString*) strValue;
+(NSArray<NSNumber*>*) type36EnumArrayFromStringArray:(NSArray<NSString*>*) array;
@end
#endif | c |
ArcFaceDemo-master/android-extend/src/main/jni/image/image.h | Tokymin/Face | 1 | 4463783 | /*
* image.h
*
* Created on: 2015年6月18日
* Author: gqj3375
*/
#ifndef JNI_IMAGE_IMAGE_H_
#define JNI_IMAGE_IMAGE_H_
#define CP_MJPEG 0xA000
#define CP_PNG 0xB000
#define CP_RGBA8888 1
#define CP_RGB565 4
#define CP_RGBA4444 7
#define CP_ALPHA8 8
#define CP_PAF_NV21 0x802
#define CP_PAF_NV12 0x801
#define CP_PAF_NV12 0x801
#define CP_PAF_YUYV 0x501
#define CP_PAF_I420 0x601
#ifdef __cplusplus
extern "C"{
#endif
void convert_565_8888(unsigned char *p565, unsigned char * p8888, int width, int height);
void convert_8888_565(unsigned char * p8888, unsigned char *p565, int width, int height);
void convert_4444_8888(unsigned char *p4444, unsigned char * p8888, int width, int height);
void convert_8888_4444(unsigned char * p8888, unsigned char *p4444, int width, int height);
void convert_4444_565(unsigned char *p4444, unsigned char *p565, int width, int height);
void convert_565_4444(unsigned char *p565, unsigned char *p4444, int width, int height);
void convert_8888_NV12(unsigned char * p8888, unsigned char *pNV12, int width, int height);
void convert_8888_NV21(unsigned char * p8888, unsigned char *pNV12, int width, int height);
void convert_565_NV12(unsigned char * p565, unsigned char *pNV21, int width, int height);
void convert_565_NV21(unsigned char * p565, unsigned char *pNV21, int width, int height);
void convert_YUYV_NV21(unsigned char * YUYV, unsigned char *pNV21, int width, int height);
void convert_YUYV_NV12(unsigned char * YUYV, unsigned char *pNV21, int width, int height);
int calcImageSize(int width, int height, int format);
#ifdef __cplusplus
}
#endif
#endif /* JNI_IMAGE_IMAGE_H_ */ | c |
Example/CYYKit/YYViewController.h | caoyuanyuan/CYYKit | 0 | 2891242 | //
// YYViewController.h
// CYYKit
//
// Created by caoyuanyuan on 08/05/2019.
// Copyright (c) 2019 caoyuanyuan. All rights reserved.
//
@import UIKit;
@interface YYViewController : UIViewController
@end | c |
pfl/utils/typedump/typedump.c | zhihui-slash2/slash2-stable | 0 | 5098515 | /* $Id$ */
/*
* %ISC_START_LICENSE%
* ---------------------------------------------------------------------
* Copyright (c) 2006-2015, Pittsburgh Supercomputing Center (PSC).
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
* --------------------------------------------------------------------
* %END_LICENSE%
*/
#include <sys/param.h>
#include <err.h>
#include <stdio.h>
#include <unistd.h>
/* start includes */
#include "pfl/_atomic32.h"
#include "pfl/acl.h"
#include "pfl/acsvc.h"
#include "pfl/aio.h"
#include "pfl/alloc.h"
#include "pfl/atomic.h"
#include "pfl/base64.h"
#include "pfl/bitflag.h"
#include "pfl/buf.h"
#include "pfl/cdefs.h"
#include "pfl/compat.h"
#include "pfl/completion.h"
#include "pfl/crc.h"
#include "pfl/ctl.h"
#include "pfl/ctlcli.h"
#include "pfl/ctlsvr.h"
#include "pfl/dynarray.h"
#include "pfl/endian.h"
#include "pfl/eqpollthr.h"
#include "pfl/err.h"
#include "pfl/explist.h"
#include "pfl/export.h"
#include "pfl/fault.h"
#include "pfl/fcntl.h"
#include "pfl/fmt.h"
#include "pfl/fmtstr.h"
#include "pfl/fs.h"
#include "pfl/fts.h"
#include "pfl/getopt.h"
#include "pfl/hashtbl.h"
#include "pfl/heap.h"
#include "pfl/hostname.h"
#include "pfl/journal.h"
#include "pfl/list.h"
#include "pfl/listcache.h"
#include "pfl/lock.h"
#include "pfl/lockedlist.h"
#include "pfl/log.h"
#include "pfl/mem.h"
#include "pfl/memnode.h"
#include "pfl/meter.h"
#include "pfl/mkdirs.h"
#include "pfl/mlist.h"
#include "pfl/mspinlock.h"
#include "pfl/multiwait.h"
#include "pfl/net.h"
#include "pfl/odtable.h"
#include "pfl/opstats.h"
#include "pfl/parity.h"
#include "pfl/pfl.h"
#include "pfl/pool.h"
#include "pfl/printhex.h"
#include "pfl/procenv.h"
#include "pfl/prsig.h"
#include "pfl/pthrutil.h"
#include "pfl/random.h"
#include "pfl/rlimit.h"
#include "pfl/rpc.h"
#include "pfl/rpc_intrfc.h"
#include "pfl/rpclog.h"
#include "pfl/rsx.h"
#include "pfl/service.h"
#include "pfl/setresuid.h"
#include "pfl/stat.h"
#include "pfl/str.h"
#include "pfl/stree.h"
#include "pfl/subsys.h"
#include "pfl/sys.h"
#include "pfl/syspaths.h"
#include "pfl/thread.h"
#include "pfl/time.h"
#include "pfl/timerthr.h"
#include "pfl/treeutil.h"
#include "pfl/types.h"
#include "pfl/umask.h"
#include "pfl/usklndthr.h"
#include "pfl/vbitmap.h"
#include "pfl/waitq.h"
#include "pfl/walk.h"
#include "pfl/wndmap.h"
#include "pfl/workthr.h"
/* end includes */
#include "lnet/socklnd.h"
const char *progname;
void
pr(const char *name, uint64_t value)
{
static int i;
int n;
if (i++ % 2) {
n = printf("%s ", name);
while (n++ <= 50)
putchar('-');
if (n < 53)
printf("> ");
printf("%"PRIu64"\n", value);
} else
printf("%-52s %"PRIu64"\n", name, value);
}
__dead void
usage(void)
{
fprintf(stderr, "usage: %s\n", progname);
exit(1);
}
int
main(int argc, char *argv[])
{
int c;
progname = argv[0];
while ((c = getopt(argc, argv, "")) != -1)
switch (c) {
default:
usage();
}
argc -= optind;
if (argc)
usage();
#define PRTYPE(type) pr(#type, sizeof(type))
#define PRVAL(val) pr(#val, (unsigned long)(val))
/* base types/values */
PRTYPE(int);
PRTYPE(unsigned char);
PRTYPE(unsigned short);
PRTYPE(void *);
PRTYPE(uint8_t);
PRTYPE(uint16_t);
PRTYPE(uint32_t);
PRTYPE(uint64_t);
PRTYPE(int8_t);
PRTYPE(int16_t);
PRTYPE(int32_t);
PRTYPE(int64_t);
PRTYPE(INT_MAX);
PRTYPE(UINT64_MAX);
/* system types/values */
PRVAL(PATH_MAX);
PRVAL(sizeof(((struct stat *)NULL)->st_dev));
PRVAL(sizeof(((struct stat *)NULL)->st_nlink));
PRVAL(sizeof(((struct stat *)NULL)->st_blksize));
PRVAL(sizeof(((struct stat *)NULL)->st_size));
PRVAL(sizeof(((struct stat *)NULL)->st_mtime));
#ifdef HAVE_STB_MTIM
PRVAL(sizeof(((struct stat *)NULL)->st_mtim));
#endif
PRTYPE(dev_t);
PRTYPE(ino_t);
PRTYPE(mode_t);
PRTYPE(nlink_t);
PRTYPE(uid_t);
PRTYPE(gid_t);
PRTYPE(off_t);
PRTYPE(typeof(((struct stat *)NULL)->st_blksize));
PRTYPE(typeof(((struct stat *)NULL)->st_blocks));
PRTYPE(time_t);
PRTYPE(rlim_t);
PRTYPE(lnet_nid_t);
PRTYPE(lnet_pid_t);
PRTYPE(lnet_process_id_t);
PRTYPE(ksock_msg_t);
/* start structs */
printf("structures:\n");
PRTYPE(atomic_t);
PRTYPE(blkcnt_t);
PRTYPE(blksize_t);
PRTYPE(psc_atomic_t);
PRTYPE(pscfs_fgen_t);
PRTYPE(pscfs_inum_t);
PRTYPE(struct _ftsent);
PRTYPE(struct aiocb);
PRTYPE(struct ifaddrs);
PRTYPE(struct l_wait_info);
PRTYPE(struct pfl_callerinfo);
PRTYPE(struct pfl_hashentry);
PRTYPE(struct pfl_heap);
PRTYPE(struct pfl_heap_entry);
PRTYPE(struct pfl_iostats_grad);
PRTYPE(struct pfl_iostats_rw);
PRTYPE(struct pfl_logpoint);
PRTYPE(struct pfl_mutex);
PRTYPE(struct pfl_odt);
PRTYPE(struct pfl_odt_entftr);
PRTYPE(struct pfl_odt_hdr);
PRTYPE(struct pfl_odt_ops);
PRTYPE(struct pfl_odt_receipt);
PRTYPE(struct pfl_odt_stats);
PRTYPE(struct pfl_opstat);
PRTYPE(struct pfl_rwlock);
PRTYPE(struct pfl_strbuf);
PRTYPE(struct pfl_timespec);
PRTYPE(struct pfl_wk_thread);
PRTYPE(struct pfl_workrq);
PRTYPE(struct psc_atomic16);
PRTYPE(struct psc_atomic32);
PRTYPE(struct psc_atomic64);
PRTYPE(struct psc_compl);
PRTYPE(struct psc_ctlacthr);
PRTYPE(struct psc_ctlcmd_req);
PRTYPE(struct psc_ctlmsg_error);
PRTYPE(struct psc_ctlmsg_fault);
PRTYPE(struct psc_ctlmsg_hashtable);
PRTYPE(struct psc_ctlmsg_journal);
PRTYPE(struct psc_ctlmsg_listcache);
PRTYPE(struct psc_ctlmsg_lnetif);
PRTYPE(struct psc_ctlmsg_loglevel);
PRTYPE(struct psc_ctlmsg_meter);
PRTYPE(struct psc_ctlmsg_mlist);
PRTYPE(struct psc_ctlmsg_odtable);
PRTYPE(struct psc_ctlmsg_opstat);
PRTYPE(struct psc_ctlmsg_param);
PRTYPE(struct psc_ctlmsg_pool);
PRTYPE(struct psc_ctlmsg_prfmt);
PRTYPE(struct psc_ctlmsg_rpcrq);
PRTYPE(struct psc_ctlmsg_rpcsvc);
PRTYPE(struct psc_ctlmsg_subsys);
PRTYPE(struct psc_ctlmsg_thread);
PRTYPE(struct psc_ctlmsghdr);
PRTYPE(struct psc_ctlop);
PRTYPE(struct psc_ctlopt);
PRTYPE(struct psc_ctlshow_ent);
PRTYPE(struct psc_ctlthr);
PRTYPE(struct psc_dynarray);
PRTYPE(struct psc_explist);
PRTYPE(struct psc_fault);
PRTYPE(struct psc_hashbkt);
PRTYPE(struct psc_hashtbl);
PRTYPE(struct psc_journal);
PRTYPE(struct psc_journal_cursor);
PRTYPE(struct psc_journal_enthdr);
PRTYPE(struct psc_journal_hdr);
PRTYPE(struct psc_journal_xidhndl);
PRTYPE(struct psc_listcache);
PRTYPE(struct psc_lockedlist);
PRTYPE(struct psc_memnode);
PRTYPE(struct psc_meter);
PRTYPE(struct psc_mlist);
PRTYPE(struct psc_mspinlock);
PRTYPE(struct psc_multiwait);
PRTYPE(struct psc_multiwaitcond);
PRTYPE(struct psc_nodemask);
PRTYPE(struct psc_poolmaster);
PRTYPE(struct psc_poolmgr);
PRTYPE(struct psc_poolset);
PRTYPE(struct psc_spinlock);
PRTYPE(struct psc_streenode);
PRTYPE(struct psc_thread);
PRTYPE(struct psc_usklndthr);
PRTYPE(struct psc_vbitmap);
PRTYPE(struct psc_waitq);
PRTYPE(struct psc_wndmap);
PRTYPE(struct psc_wndmap_block);
PRTYPE(struct pscfs);
PRTYPE(struct pscfs_clientctx);
PRTYPE(struct pscfs_creds);
PRTYPE(struct pscfs_dirent);
PRTYPE(struct psclist_head);
PRTYPE(struct psclog_data);
PRTYPE(struct pscrpc_async_args);
PRTYPE(struct pscrpc_bulk_desc);
PRTYPE(struct pscrpc_cb_id);
PRTYPE(struct pscrpc_connection);
PRTYPE(struct pscrpc_export);
PRTYPE(struct pscrpc_handle);
PRTYPE(struct pscrpc_import);
PRTYPE(struct pscrpc_msg);
PRTYPE(struct pscrpc_peer_qlen);
PRTYPE(struct pscrpc_reply_state);
PRTYPE(struct pscrpc_request);
PRTYPE(struct pscrpc_request_buffer_desc);
PRTYPE(struct pscrpc_request_pool);
PRTYPE(struct pscrpc_request_set);
PRTYPE(struct pscrpc_service);
PRTYPE(struct pscrpc_svc_handle);
PRTYPE(struct pscrpc_thread);
PRTYPE(struct pscrpc_uuid);
PRTYPE(struct pscrpc_wait_callback);
PRTYPE(struct rnd_iterator);
PRTYPE(struct rsx_msg_conversion);
PRTYPE(struct rsx_msg_portablizer);
PRTYPE(struct sigevent);
/* end structs */
/* start typedefs */
/* end typedefs */
/* start constants */
/* end constants */
/* start enums */
printf("\nenums:\n");
PRVAL(ACSOP_ACCESS);
PRVAL(ACSOP_CHMOD);
PRVAL(ACSOP_CHOWN);
PRVAL(ACSOP_LINK);
PRVAL(ACSOP_LSTAT);
PRVAL(ACSOP_MKDIR);
PRVAL(ACSOP_MKNOD);
PRVAL(ACSOP_OPEN);
PRVAL(ACSOP_READLINK);
PRVAL(ACSOP_RENAME);
PRVAL(ACSOP_RMDIR);
PRVAL(ACSOP_STAT);
PRVAL(ACSOP_STATFS);
PRVAL(ACSOP_SYMLINK);
PRVAL(ACSOP_TRUNCATE);
PRVAL(ACSOP_UNLINK);
PRVAL(ACSOP_UTIMES);
PRVAL(NPCMT);
PRVAL(PCMT_ERROR);
PRVAL(PCMT_GETFAULT);
PRVAL(PCMT_GETHASHTABLE);
PRVAL(PCMT_GETJOURNAL);
PRVAL(PCMT_GETLISTCACHE);
PRVAL(PCMT_GETLNETIF);
PRVAL(PCMT_GETLOGLEVEL);
PRVAL(PCMT_GETMETER);
PRVAL(PCMT_GETMLIST);
PRVAL(PCMT_GETODTABLE);
PRVAL(PCMT_GETOPSTATS);
PRVAL(PCMT_GETPARAM);
PRVAL(PCMT_GETPOOL);
PRVAL(PCMT_GETRPCRQ);
PRVAL(PCMT_GETRPCSVC);
PRVAL(PCMT_GETSUBSYS);
PRVAL(PCMT_GETTHREAD);
PRVAL(PCMT_SETPARAM);
PRVAL(PCOF_FLAG);
PRVAL(PCOF_FUNC);
PRVAL(PFLCTL_PARAMT_ATOMIC32);
PRVAL(PFLCTL_PARAMT_INT);
PRVAL(PFLCTL_PARAMT_NONE);
PRVAL(PFLCTL_PARAMT_STR);
PRVAL(PFLCTL_PARAMT_UINT64);
PRVAL(PSCRPC_IMP_CLOSED);
PRVAL(PSCRPC_IMP_CONNECTING);
PRVAL(PSCRPC_IMP_DISCON);
PRVAL(PSCRPC_IMP_EVICTED);
PRVAL(PSCRPC_IMP_FULL);
PRVAL(PSCRPC_IMP_NEW);
PRVAL(PSCRPC_IMP_NOOP);
PRVAL(PSCRPC_IMP_RECOVER);
PRVAL(PSCRPC_IMP_REPLAY);
PRVAL(PSCRPC_IMP_REPLAY_LOCKS);
PRVAL(PSCRPC_IMP_REPLAY_WAIT);
PRVAL(PSCRPC_RQ_PHASE_BULK);
PRVAL(PSCRPC_RQ_PHASE_COMPLETE);
PRVAL(PSCRPC_RQ_PHASE_INTERPRET);
PRVAL(PSCRPC_RQ_PHASE_NEW);
PRVAL(PSCRPC_RQ_PHASE_RPC);
PRVAL(PSL_LOCKED);
PRVAL(PSL_UNLOCKED);
/* end enums */
PRVAL(offsetof(struct psc_listcache, plc_listhd));
PRVAL(offsetof(struct psc_journal_enthdr, pje_data));
PRVAL(PSCFMT_HUMAN_BUFSIZ);
PRVAL(PSCFMT_RATIO_BUFSIZ);
PRVAL(PSCRPC_NIDSTR_SIZE);
exit(0);
} | c |
usr.bin/f77/libI77/wrtfmt.c | weiss/original-bsd | 114 | 1390135 | /*-
* Copyright (c) 1980 The Regents of the University of California.
* All rights reserved.
*
* %sccs.include.proprietary.c%
*/
#ifndef lint
static char sccsid[] = "@(#)wrtfmt.c 5.2 (Berkeley) 04/12/91";
#endif /* not lint */
/*
* formatted write routines
*/
#include "fio.h"
#include "format.h"
extern char *icvt();
extern char *s_init;
#define abs(x) (x<0?-x:x)
w_ed(p,ptr,len) char *ptr; struct syl *p; ftnlen len;
{ int n;
if(cursor && (n=wr_mvcur())) return(n);
switch(p->op)
{
case I:
case IM:
return(wrt_IM(ptr,p->p1,p->p2,len));
case L:
return(wrt_L(ptr,p->p1,len));
case A:
return(wrt_AW(ptr,len,len));
case AW:
return(wrt_AW(ptr,p->p1,len));
case D:
return(wrt_E(ptr,p->p1,p->p2,2,len,'d'));
case DE:
return(wrt_E(ptr,p->p1,(p->p2)&0xff,((p->p2)>>8)&0xff,len,'d'));
case E:
return(wrt_E(ptr,p->p1,p->p2,2,len,'e'));
case EE:
return(wrt_E(ptr,p->p1,(p->p2)&0xff,((p->p2)>>8)&0xff,len,'e'));
case G:
return(wrt_G(ptr,p->p1,p->p2,2,len));
case GE:
return(wrt_G(ptr,p->p1,(p->p2)&0xff,((p->p2)>>8)&0xff,len));
case F:
return(wrt_F(ptr,p->p1,p->p2,len));
default:
return(errno=F_ERFMT);
}
}
w_ned(p,ptr) char *ptr; struct syl *p;
{
switch(p->op)
{
case SLASH:
return((*donewrec)());
case T:
if(p->p1) cursor = p->p1 - recpos - 1;
#ifndef KOSHER
else cursor = 8*p->p2 - recpos%8; /* NOT STANDARD FORT */
#endif
tab = YES;
return(OK);
case TL:
cursor -= p->p1;
if ((recpos + cursor) < 0) cursor = -recpos; /* ANSI req'd */
tab = YES;
return(OK);
case TR:
case X:
cursor += p->p1;
/* tab = (p->op == TR); this would implement destructive X */
tab = YES;
return(OK);
case APOS:
return(wrt_AP(&s_init[p->p1]));
case H:
return(wrt_H(p->p1,&s_init[p->p2]));
default:
return(errno=F_ERFMT);
}
}
LOCAL
wr_mvcur()
{ int n;
if(tab) return((*dotab)());
if (cursor < 0) return(errno=F_ERSEEK);
while(cursor--) PUT(' ')
return(cursor=0);
}
LOCAL
wrt_IM(ui,w,m,len) uint *ui; ftnlen len;
{ int ndigit,sign,spare,i,xsign,n;
long x;
char *ans;
if(sizeof(short)==len) x=ui->is;
/* else if(len == sizeof(char)) x = ui->ic; */
else x=ui->il;
if(x==0 && m==0)
{ for(i=0;i<w;i++) PUT(' ')
return(OK);
}
ans=icvt(x,&ndigit,&sign);
if(sign || cplus) xsign=1;
else xsign=0;
if(ndigit+xsign>w || m+xsign>w)
{ for(i=0;i<w;i++) PUT('*')
return(OK);
}
if(ndigit>=m)
spare=w-ndigit-xsign;
else
spare=w-m-xsign;
for(i=0;i<spare;i++) PUT(' ')
if(sign) PUT('-')
else if(cplus) PUT('+')
for(i=0;i<m-ndigit;i++) PUT('0')
for(i=0;i<ndigit;i++) PUT(*ans++)
return(OK);
}
LOCAL
wrt_AP(p)
{ char *s,quote;
int n;
if(cursor && (n=wr_mvcur())) return(n);
s=(char *)p;
quote = *s++;
for(; *s; s++)
{ if(*s!=quote) PUT(*s)
else if(*++s==quote) PUT(*s)
else return(OK);
}
return(OK);
}
LOCAL
wrt_H(a,b)
{ char *s=(char *)b;
int n;
if(cursor && (n=wr_mvcur())) return(n);
while(a--) PUT(*s++)
return(OK);
}
wrt_L(l,width,len) uint *l; ftnlen len;
{ int i,n;
for(i=0;i<width-1;i++) PUT(' ')
if(len == sizeof (short))
i = l->is;
else
i = l->il;
if(i) PUT('t')
else PUT('f')
return(OK);
}
LOCAL
wrt_AW(p,w,len) char * p; ftnlen len;
{ int n;
while(w>len)
{ w--;
PUT(' ')
}
while(w-- > 0)
PUT(*p++)
return(OK);
}
wrt_E(p,w,d,e,len,expch) ufloat *p; ftnlen len; char expch;
{ char *s,ex[4];
int dd,dp,sign,i,delta,pad,n;
char *ecvt();
if((len==sizeof(float)?p->pf:p->pd)==0.0)
{
n = cblank;
cblank = 1; /* force '0' fill */
wrt_F(p,w-(e+2),d,len);
cblank = n;
PUT(expch)
PUT('+')
/* for(i=0;i<(e-1);i++)PUT(' ')
deleted PUT('0')
*/
/* added */ for(i=0;i<e;i++) PUT('0')
return(OK);
}
if (scale > 0) { /* insane ANSI requirement */
dd = d + 1;
d = dd - scale;
} else
dd = d + scale;
if (dd <= 0 || d < 0) goto E_badfield;
s=ecvt( (len==sizeof(float)?(double)p->pf:p->pd) ,dd,&dp,&sign);
delta = 3+e;
if(sign||cplus) delta++;
pad=w-(delta+d)-(scale>0? scale:0);
if(pad<0) {
E_badfield:
for(i=0;i<w;i++) PUT('*')
return(OK);
}
for(i=0;i<(pad-(scale<=0?1:0));i++) PUT(' ')
if(sign) PUT('-')
else if(cplus) PUT('+')
if(scale<=0 && pad) PUT('0')
if(scale<0 && scale > -d)
{
PUT('.')
for(i=0;i<-scale;i++)
PUT('0')
for(i=0;i<d+scale;i++)
PUT(*s++)
}
else
{
if(scale>0)
for(i=0;i<scale;i++)
PUT(*s++)
PUT('.')
for(i=0;i<d;i++)
PUT(*s++)
}
dp -= scale;
sprintf(ex,"%d",abs(dp));
if((pad=strlen(ex))>e)
{ if(pad>(++e))
{ PUT(expch)
for(i=0;i<e;i++) PUT('*')
return(OK);
}
}
else PUT(expch)
PUT(dp<0?'-':'+')
for(i=0;i<(e-pad);i++) PUT('0') /* was ' ' */
s= &ex[0];
while(*s) PUT(*s++)
return(OK);
}
LOCAL
wrt_G(p,w,d,e,len) ufloat *p; ftnlen len;
{ double uplim = 1.0, x;
int i,oldscale,n,j,ne;
x=(len==sizeof(float)?(double)p->pf:p->pd);
i=d;
if(x==0.0) goto zero;
x = abs(x);
if(x>=0.1)
{
for(i=0; i<=d; i++, uplim*=10.0)
{ if(x>=uplim) continue;
zero: oldscale=scale;
scale=0;
ne = e+2;
if(n = wrt_F(p,w-ne,d-i,len)) return(n);
for(j=0; j<ne; j++) PUT(' ')
scale=oldscale;
return(OK);
}
/* falling off the bottom implies E format */
}
return(wrt_E(p,w,d,e,len,'e'));
}
wrt_F(p,w,d,len) ufloat *p; ftnlen len;
{ int i,delta,dp,sign,n,nf;
double x;
char *s,*fcvt();
x= (len==sizeof(float)?(double)p->pf:p->pd);
if(scale && x!=0.0)
{ if(scale>0)
for(i=0;i<scale;i++) x*=10;
else for(i=0;i<-scale;i++) x/=10;
}
s=fcvt(x,d,&dp,&sign);
/* if(-dp>=d) sign=0; ?? */
delta=1;
if(sign || cplus) delta++;
nf = w - (d + delta + (dp>0?dp:0));
if(nf<0)
{
for(i=0;i<w;i++) PUT('*')
return(OK);
}
if(nf>0) for(i=0; i<(nf-(dp<=0?1:0)); i++) PUT(' ')
if(sign) PUT('-')
else if(cplus) PUT('+')
if(dp>0) for(i=0;i<dp;i++) PUT(*s++)
else if(nf>0) PUT('0')
PUT('.')
for(i=0; i< -dp && i<d; i++) PUT('0')
for(;i<d;i++)
{ if(x==0.0 && !cblank) PUT(' ') /* exactly zero */
else if(*s) PUT(*s++)
else PUT('0')
}
return(OK);
} | c |
kernel/linux-5.4/drivers/media/rc/keymaps/rc-cec.c | josehu07/SplitFS | 27 | 6333122 | // SPDX-License-Identifier: GPL-2.0-or-later
/* Keytable for the CEC remote control
*
* Copyright (c) 2015 by <NAME>
*/
#include <media/rc-map.h>
#include <linux/module.h>
/*
* CEC Spec "High-Definition Multimedia Interface Specification" can be obtained
* here: http://xtreamerdev.googlecode.com/files/CEC_Specs.pdf
* The list of control codes is listed in Table 27: User Control Codes p. 95
*/
static struct rc_map_table cec[] = {
{ 0x00, KEY_OK },
{ 0x01, KEY_UP },
{ 0x02, KEY_DOWN },
{ 0x03, KEY_LEFT },
{ 0x04, KEY_RIGHT },
{ 0x05, KEY_RIGHT_UP },
{ 0x06, KEY_RIGHT_DOWN },
{ 0x07, KEY_LEFT_UP },
{ 0x08, KEY_LEFT_DOWN },
{ 0x09, KEY_ROOT_MENU }, /* CEC Spec: Device Root Menu - see Note 2 */
/*
* Note 2: This is the initial display that a device shows. It is
* device-dependent and can be, for example, a contents menu, setup
* menu, favorite menu or other menu. The actual menu displayed
* may also depend on the device's current state.
*/
{ 0x0a, KEY_SETUP },
{ 0x0b, KEY_MENU }, /* CEC Spec: Contents Menu */
{ 0x0c, KEY_FAVORITES }, /* CEC Spec: Favorite Menu */
{ 0x0d, KEY_EXIT },
/* 0x0e-0x0f: Reserved */
{ 0x10, KEY_MEDIA_TOP_MENU },
{ 0x11, KEY_CONTEXT_MENU },
/* 0x12-0x1c: Reserved */
{ 0x1d, KEY_DIGITS }, /* CEC Spec: select/toggle a Number Entry Mode */
{ 0x1e, KEY_NUMERIC_11 },
{ 0x1f, KEY_NUMERIC_12 },
/* 0x20-0x29: Keys 0 to 9 */
{ 0x20, KEY_NUMERIC_0 },
{ 0x21, KEY_NUMERIC_1 },
{ 0x22, KEY_NUMERIC_2 },
{ 0x23, KEY_NUMERIC_3 },
{ 0x24, KEY_NUMERIC_4 },
{ 0x25, KEY_NUMERIC_5 },
{ 0x26, KEY_NUMERIC_6 },
{ 0x27, KEY_NUMERIC_7 },
{ 0x28, KEY_NUMERIC_8 },
{ 0x29, KEY_NUMERIC_9 },
{ 0x2a, KEY_DOT },
{ 0x2b, KEY_ENTER },
{ 0x2c, KEY_CLEAR },
/* 0x2d-0x2e: Reserved */
{ 0x2f, KEY_NEXT_FAVORITE }, /* CEC Spec: Next Favorite */
{ 0x30, KEY_CHANNELUP },
{ 0x31, KEY_CHANNELDOWN },
{ 0x32, KEY_PREVIOUS }, /* CEC Spec: Previous Channel */
{ 0x33, KEY_SOUND }, /* CEC Spec: Sound Select */
{ 0x34, KEY_VIDEO }, /* 0x34: CEC Spec: Input Select */
{ 0x35, KEY_INFO }, /* CEC Spec: Display Information */
{ 0x36, KEY_HELP },
{ 0x37, KEY_PAGEUP },
{ 0x38, KEY_PAGEDOWN },
/* 0x39-0x3f: Reserved */
{ 0x40, KEY_POWER },
{ 0x41, KEY_VOLUMEUP },
{ 0x42, KEY_VOLUMEDOWN },
{ 0x43, KEY_MUTE },
{ 0x44, KEY_PLAYCD },
{ 0x45, KEY_STOPCD },
{ 0x46, KEY_PAUSECD },
{ 0x47, KEY_RECORD },
{ 0x48, KEY_REWIND },
{ 0x49, KEY_FASTFORWARD },
{ 0x4a, KEY_EJECTCD }, /* CEC Spec: Eject */
{ 0x4b, KEY_FORWARD },
{ 0x4c, KEY_BACK },
{ 0x4d, KEY_STOP_RECORD }, /* CEC Spec: Stop-Record */
{ 0x4e, KEY_PAUSE_RECORD }, /* CEC Spec: Pause-Record */
/* 0x4f: Reserved */
{ 0x50, KEY_ANGLE },
{ 0x51, KEY_TV2 },
{ 0x52, KEY_VOD }, /* CEC Spec: Video on Demand */
{ 0x53, KEY_EPG },
{ 0x54, KEY_TIME }, /* CEC Spec: Timer */
{ 0x55, KEY_CONFIG },
/*
* The following codes are hard to implement at this moment, as they
* carry an additional additional argument. Most likely changes to RC
* framework are necessary.
* For now they are interpreted by the CEC framework as non keycodes
* and are passed as messages enabling user application to parse them.
*/
/* 0x56: CEC Spec: Select Broadcast Type */
/* 0x57: CEC Spec: Select Sound presentation */
{ 0x58, KEY_AUDIO_DESC }, /* CEC 2.0 and up */
{ 0x59, KEY_WWW }, /* CEC 2.0 and up */
{ 0x5a, KEY_3D_MODE }, /* CEC 2.0 and up */
/* 0x5b-0x5f: Reserved */
{ 0x60, KEY_PLAYCD }, /* CEC Spec: Play Function */
{ 0x6005, KEY_FASTFORWARD },
{ 0x6006, KEY_FASTFORWARD },
{ 0x6007, KEY_FASTFORWARD },
{ 0x6015, KEY_SLOW },
{ 0x6016, KEY_SLOW },
{ 0x6017, KEY_SLOW },
{ 0x6009, KEY_FASTREVERSE },
{ 0x600a, KEY_FASTREVERSE },
{ 0x600b, KEY_FASTREVERSE },
{ 0x6019, KEY_SLOWREVERSE },
{ 0x601a, KEY_SLOWREVERSE },
{ 0x601b, KEY_SLOWREVERSE },
{ 0x6020, KEY_REWIND },
{ 0x6024, KEY_PLAYCD },
{ 0x6025, KEY_PAUSECD },
{ 0x61, KEY_PLAYPAUSE }, /* CEC Spec: Pause-Play Function */
{ 0x62, KEY_RECORD }, /* Spec: Record Function */
{ 0x63, KEY_PAUSE_RECORD }, /* CEC Spec: Pause-Record Function */
{ 0x64, KEY_STOPCD }, /* CEC Spec: Stop Function */
{ 0x65, KEY_MUTE }, /* CEC Spec: Mute Function */
{ 0x66, KEY_UNMUTE }, /* CEC Spec: Restore the volume */
/*
* The following codes are hard to implement at this moment, as they
* carry an additional additional argument. Most likely changes to RC
* framework are necessary.
* For now they are interpreted by the CEC framework as non keycodes
* and are passed as messages enabling user application to parse them.
*/
/* 0x67: CEC Spec: Tune Function */
/* 0x68: CEC Spec: Seleect Media Function */
/* 0x69: CEC Spec: Select A/V Input Function */
/* 0x6a: CEC Spec: Select Audio Input Function */
{ 0x6b, KEY_POWER }, /* CEC Spec: Power Toggle Function */
{ 0x6c, KEY_SLEEP }, /* CEC Spec: Power Off Function */
{ 0x6d, KEY_WAKEUP }, /* CEC Spec: Power On Function */
/* 0x6e-0x70: Reserved */
{ 0x71, KEY_BLUE }, /* CEC Spec: F1 (Blue) */
{ 0x72, KEY_RED }, /* CEC Spec: F2 (Red) */
{ 0x73, KEY_GREEN }, /* CEC Spec: F3 (Green) */
{ 0x74, KEY_YELLOW }, /* CEC Spec: F4 (Yellow) */
{ 0x75, KEY_F5 },
{ 0x76, KEY_DATA }, /* CEC Spec: Data - see Note 3 */
/*
* Note 3: This is used, for example, to enter or leave a digital TV
* data broadcast application.
*/
/* 0x77-0xff: Reserved */
};
static struct rc_map_list cec_map = {
.map = {
.scan = cec,
.size = ARRAY_SIZE(cec),
.rc_proto = RC_PROTO_CEC,
.name = RC_MAP_CEC,
}
};
static int __init init_rc_map_cec(void)
{
return rc_map_register(&cec_map);
}
static void __exit exit_rc_map_cec(void)
{
rc_map_unregister(&cec_map);
}
module_init(init_rc_map_cec);
module_exit(exit_rc_map_cec);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("<NAME>"); | c |
Corsair Ambience/UpdateManager.h | hamodyk/Corsair-Ambience | 12 | 3194855 | #pragma once
class UpdateManager {
public:
static void checkForAnUpdate();
}; | c |
Src/bsp_driver_sram.c | todo-assert/STM32F407VET6 | 1 | 3683839 | /* USER CODE BEGIN Header */
/**
******************************************************************************
* @file bsp_driver_sram.c for F4 (based on stm32469i_eval_sram.c)
* @brief This file includes a generic SRAM driver.
******************************************************************************
* @attention
*
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under Ultimate Liberty license
* SLA0044, the "License"; You may not use this file except in compliance with
* the License. You may obtain a copy of the License at:
* www.st.com/SLA0044
*
******************************************************************************
*/
/* USER CODE END Header */
#ifdef OLD_CODE
/* Kept to avoid issue when migrating old projects (as some user sections were renamed/changed). */
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
#else
/* Includes ------------------------------------------------------------------*/
#include "bsp_driver_sram.h"
/* Extern variables ----------------------------------------------------------*/
extern SRAM_HandleTypeDef hsram1;
/* USER CODE BEGIN Init */
/**
* @brief Initializes the SRAM device.
* @retval SRAM status
*/
uint8_t BSP_SRAM_Init(void)
{
uint8_t sramstatus = SRAM_OK;
/* place for user code */
return sramstatus;
}
/* USER CODE END Init */
/* USER CODE BEGIN BeforeReadSection */
/* can be used to modify / undefine following code or add code */
/* USER CODE END BeforeReadSection */
/**
* @brief Reads an amount of data from the SRAM device in polling mode.
* @param uwStartAddress: Read start address
* @param pData: Pointer to data to be read
* @param uwDataSize: Size of read data from the memory
* @retval SRAM status
*/
uint8_t BSP_SRAM_ReadData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
{
uint8_t sramstatus = SRAM_OK;
if(HAL_SRAM_Read_16b(&hsram1, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
{
sramstatus = SRAM_ERROR;
}
return sramstatus;
}
/**
* @brief Reads an amount of data from the SRAM device in DMA mode.
* @param uwStartAddress: Read start address
* @param pData: Pointer to data to be read
* @param uwDataSize: Size of read data from the memory
* @retval SRAM status
*/
uint8_t BSP_SRAM_ReadData_DMA(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
{
uint8_t sramstatus = SRAM_OK;
if(HAL_SRAM_Read_DMA(&hsram1, (uint32_t *)uwStartAddress, (uint32_t *)pData, uwDataSize) != HAL_OK)
{
sramstatus = SRAM_ERROR;
}
return sramstatus;
}
/* USER CODE BEGIN BeforeWriteSection */
/* can be used to modify / undefine following code or add code */
/* USER CODE END BeforeWriteSection */
/**
* @brief Writes an amount of data from the SRAM device in polling mode.
* @param uwStartAddress: Write start address
* @param pData: Pointer to data to be written
* @param uwDataSize: Size of written data from the memory
* @retval SRAM status
*/
uint8_t BSP_SRAM_WriteData(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
{
uint8_t sramstatus = SRAM_OK;
if(HAL_SRAM_Write_16b(&hsram1, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
{
sramstatus = SRAM_ERROR;
}
return sramstatus;
}
/**
* @brief Writes an amount of data from the SRAM device in DMA mode.
* @param uwStartAddress: Write start address
* @param pData: Pointer to data to be written
* @param uwDataSize: Size of written data from the memory
* @retval SRAM status
*/
uint8_t BSP_SRAM_WriteData_DMA(uint32_t uwStartAddress, uint16_t *pData, uint32_t uwDataSize)
{
uint8_t sramstatus = SRAM_OK;
if(HAL_SRAM_Write_DMA(&hsram1, (uint32_t *)uwStartAddress, (uint32_t *)pData, uwDataSize) != HAL_OK)
{
sramstatus = SRAM_ERROR;
}
return sramstatus;
}
/**
* @brief Handles SRAM DMA transfer interrupt request.
*/
void BSP_SRAM_DMA_IRQHandler(void)
{
HAL_DMA_IRQHandler(hsram1.hdma);
}
/* USER CODE BEGIN AdditionalCode */
/* user code can be inserted here */
/* USER CODE END AdditionalCode */
#endif
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | c |
src/nvmpool/pmalloc.h | lh2debug/quartzmemkv2 | 0 | 959013 | /***************************************************************************
Copyright 2016 Hewlett Packard Enterprise Development LP.
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 __PMALLOC_H
#define __PMALLOC_H
/**
* \file
*
* \page pmalloc_api Persistent Memory API
*
* Methods to be used by clients to allocate and free emulated NVRAM.
*/
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
void *pmalloc(size_t size);
void *prealloc(void *old_addr, size_t old_size, size_t new_size);
void pfree(void *start, size_t size);
#ifdef __cplusplus
}
#endif
#endif /* __PMALLOC_H */ | c |
boards/frdmk28fa/driver_examples/dspi/interrupt/pin_mux.c | flit/mcux-sdk | 1 | 5564679 | /*
* Copyright (c) 2016, Freescale Semiconductor, Inc.
* Copyright 2016-2017 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/* clang-format off */
/*
* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
!!GlobalInfo
product: Pins v3.0
processor: MK28FN2M0Axxx15
package_id: MK28FN2M0AVMI15
mcu_data: ksdk2_0
processor_version: 0.0.8
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
*/
/* clang-format on */
#include "fsl_common.h"
#include "fsl_port.h"
#include "pin_mux.h"
/* clang-format off */
/*
* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
BOARD_InitPins:
- options: {callFromInitBoot: 'true', coreID: core0, enableClock: 'true'}
- pin_list:
- {pin_num: K13, peripheral: SPI0, signal: PCS0_SS, pin_signal: PTA14/SPI0_PCS0/LPUART0_TX/TRACE_D2/FXIO0_D20/I2S0_RX_BCLK/I2S0_TXD1}
- {pin_num: K12, peripheral: SPI0, signal: SCK, pin_signal: PTA15/SPI0_SCK/LPUART0_RX/TRACE_D1/FXIO0_D21/I2S0_RXD0}
- {pin_num: J13, peripheral: SPI0, signal: SOUT, pin_signal: PTA16/SPI0_SOUT/LPUART0_CTS_b/TRACE_D0/FXIO0_D22/I2S0_RX_FS/I2S0_RXD1}
- {pin_num: J12, peripheral: SPI0, signal: SIN, pin_signal: PTA17/SPI0_SIN/LPUART0_RTS_b/FXIO0_D23/I2S0_MCLK/I2S1_MCLK}
- {pin_num: C2, peripheral: SPI2, signal: PCS0_SS, pin_signal: PTD11/LLWU_P25/SPI2_PCS0/LPUART1_CTS_b/FB_A19/FXIO0_D27}
- {pin_num: B2, peripheral: SPI2, signal: SCK, pin_signal: PTD12/SPI2_SCK/FTM3_FLT0/FB_A20/FXIO0_D28}
- {pin_num: B3, peripheral: SPI2, signal: SOUT, pin_signal: PTD13/SPI2_SOUT/FB_A21/FXIO0_D29}
- {pin_num: A2, peripheral: SPI2, signal: SIN, pin_signal: PTD14/SPI2_SIN/FB_A22/FXIO0_D30}
- {pin_num: A7, peripheral: LPUART0, signal: RX, pin_signal: PTC25/LPUART0_RX/FB_A4/SDRAM_D4/QSPI0A_SCLK}
- {pin_num: B7, peripheral: LPUART0, signal: TX, pin_signal: PTC24/LPUART0_TX/FB_A5/SDRAM_D5/QSPI0A_DATA3}
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
*/
/* clang-format on */
/* FUNCTION ************************************************************************************************************
*
* Function Name : BOARD_InitPins
* Description : Configures pin routing and optionally pin electrical features.
*
* END ****************************************************************************************************************/
void BOARD_InitPins(void)
{
/* Port A Clock Gate Control: Clock enabled */
CLOCK_EnableClock(kCLOCK_PortA);
/* Port C Clock Gate Control: Clock enabled */
CLOCK_EnableClock(kCLOCK_PortC);
/* Port D Clock Gate Control: Clock enabled */
CLOCK_EnableClock(kCLOCK_PortD);
/* PORTA14 (pin K13) is configured as SPI0_PCS0 */
PORT_SetPinMux(PORTA, 14U, kPORT_MuxAlt2);
/* PORTA15 (pin K12) is configured as SPI0_SCK */
PORT_SetPinMux(PORTA, 15U, kPORT_MuxAlt2);
/* PORTA16 (pin J13) is configured as SPI0_SOUT */
PORT_SetPinMux(PORTA, 16U, kPORT_MuxAlt2);
/* PORTA17 (pin J12) is configured as SPI0_SIN */
PORT_SetPinMux(PORTA, 17U, kPORT_MuxAlt2);
/* PORTC24 (pin B7) is configured as LPUART0_TX */
PORT_SetPinMux(PORTC, 24U, kPORT_MuxAlt3);
/* PORTC25 (pin A7) is configured as LPUART0_RX */
PORT_SetPinMux(PORTC, 25U, kPORT_MuxAlt3);
/* PORTD11 (pin C2) is configured as SPI2_PCS0 */
PORT_SetPinMux(PORTD, 11U, kPORT_MuxAlt2);
/* PORTD12 (pin B2) is configured as SPI2_SCK */
PORT_SetPinMux(PORTD, 12U, kPORT_MuxAlt2);
/* PORTD13 (pin B3) is configured as SPI2_SOUT */
PORT_SetPinMux(PORTD, 13U, kPORT_MuxAlt2);
/* PORTD14 (pin A2) is configured as SPI2_SIN */
PORT_SetPinMux(PORTD, 14U, kPORT_MuxAlt2);
SIM->SOPT5 = ((SIM->SOPT5 &
/* Mask bits to zero which are setting */
(~(SIM_SOPT5_LPUART0TXSRC_MASK | SIM_SOPT5_LPUART0RXSRC_MASK)))
/* LPUART0 transmit data source select: LPUART0_TX pin. */
| SIM_SOPT5_LPUART0TXSRC(SOPT5_LPUART0TXSRC_LPUART_TX)
/* LPUART0 receive data source select: LPUART0_RX pin. */
| SIM_SOPT5_LPUART0RXSRC(SOPT5_LPUART0RXSRC_LPUART_RX));
}
/***********************************************************************************************************************
* EOF
**********************************************************************************************************************/ | c |
mlir/include/Dialect/HiSPN/HiSPNEnums.h | lukasmweber/spn-compiler | 8 | 7506206 | //==============================================================================
// This file is part of the SPNC project under the Apache License v2.0 by the
// Embedded Systems and Applications Group, TU Darmstadt.
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
// SPDX-License-Identifier: Apache-2.0
//==============================================================================
#ifndef SPNC_MLIR_INCLUDE_DIALECT_HISPN_HISPNENUMS_H
#define SPNC_MLIR_INCLUDE_DIALECT_HISPN_HISPNENUMS_H
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/StringSwitch.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "HiSPN/HiSPNEnums.h.inc"
#endif //SPNC_MLIR_INCLUDE_DIALECT_HISPN_HISPNENUMS_H | c |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.