blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
250
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
58
| license_type
stringclasses 2
values | repo_name
stringlengths 5
107
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 185
values | visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 15.7k
664M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 17
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 68
values | src_encoding
stringclasses 27
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 6
9.36M
| extension
stringclasses 31
values | content
stringlengths 4
9.36M
| authors
sequencelengths 1
1
| author
stringlengths 0
73
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
766f4d1166e7f6aef2a48a7335bbf4094d50771e | 1390cb4f58bd09087184a64fe2838dec29600d8a | /493.c | ae14250f58622d970fb965fe3436a472e0580a9e | [] | no_license | imasker/obfuscatorTestCases | bf21352be1dbd6c8bdd868b093af03f315d92a45 | 5f5561846ec09a040b42dc12842c9581e7be6b4d | refs/heads/master | 2023-03-27T11:35:21.843689 | 2021-03-25T07:38:05 | 2021-03-25T07:38:05 | 351,342,479 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 3,814 | c | /*
* This is a RANDOMLY GENERATED PROGRAM.
*
* Generator: csmith 2.3.0
* Git version: 30dccd7
* Options: -o /home/x/obfuscator/data/programs/493.c
* Seed: 4208951624
*/
#include "csmith.h"
static long __undefined;
/* --- Struct/Union Declarations --- */
/* --- GLOBAL VARIABLES --- */
static int32_t g_3 = 0x5C96DD1EL;
static uint32_t g_9 = 0xB13281D2L;
/* --- FORWARD DECLARATIONS --- */
static uint32_t func_1(void);
/* --- FUNCTIONS --- */
/* ------------------------------------------ */
/*
* reads : g_9 g_3
* writes: g_9 g_3
*/
static uint32_t func_1(void)
{ /* block id: 0 */
int32_t *l_2 = &g_3;
int32_t *l_4 = &g_3;
int32_t *l_5 = &g_3;
int32_t l_6[1][1][10] = {{{0xE2FDE2BBL,0xEF72D4EAL,0xE2FDE2BBL,0xE2FDE2BBL,0xEF72D4EAL,0xE2FDE2BBL,0xE2FDE2BBL,0xEF72D4EAL,0xE2FDE2BBL,0xE2FDE2BBL}}};
int32_t *l_7 = (void*)0;
int32_t *l_8 = &l_6[0][0][1];
int i, j, k;
g_9++;
for (g_3 = 0; (g_3 < 21); g_3 = safe_add_func_uint8_t_u_u(g_3, 6))
{ /* block id: 4 */
(*l_8) = g_3;
for (g_9 = (-22); (g_9 <= 47); g_9 = safe_add_func_uint16_t_u_u(g_9, 1))
{ /* block id: 8 */
return (*l_4);
}
}
return g_3;
}
/* ---------------------------------------- */
int main (int argc, char* argv[])
{
int print_hash_value = 0;
if (argc == 2 && strcmp(argv[1], "1") == 0) print_hash_value = 1;
platform_main_begin();
crc32_gentab();
func_1();
transparent_crc(g_3, "g_3", print_hash_value);
transparent_crc(g_9, "g_9", print_hash_value);
platform_main_end(crc32_context ^ 0xFFFFFFFFUL, print_hash_value);
return 0;
}
/************************ statistics *************************
XXX max struct depth: 0
breakdown:
depth: 0, occurrence: 2
XXX total union variables: 0
XXX non-zero bitfields defined in structs: 0
XXX zero bitfields defined in structs: 0
XXX const bitfields defined in structs: 0
XXX volatile bitfields defined in structs: 0
XXX structs with bitfields in the program: 0
breakdown:
XXX full-bitfields structs in the program: 0
breakdown:
XXX times a bitfields struct's address is taken: 0
XXX times a bitfields struct on LHS: 0
XXX times a bitfields struct on RHS: 0
XXX times a single bitfield on LHS: 0
XXX times a single bitfield on RHS: 0
XXX max expression depth: 2
breakdown:
depth: 1, occurrence: 6
depth: 2, occurrence: 2
XXX total number of pointers: 5
XXX times a variable address is taken: 4
XXX times a pointer is dereferenced on RHS: 1
breakdown:
depth: 1, occurrence: 1
XXX times a pointer is dereferenced on LHS: 1
breakdown:
depth: 1, occurrence: 1
XXX times a pointer is compared with null: 0
XXX times a pointer is compared with address of another variable: 0
XXX times a pointer is compared with another pointer: 0
XXX times a pointer is qualified to be dereferenced: 11
XXX max dereference level: 1
breakdown:
level: 0, occurrence: 0
level: 1, occurrence: 3
XXX number of pointers point to pointers: 0
XXX number of pointers point to scalars: 5
XXX number of pointers point to structs: 0
XXX percent of pointers has null in alias set: 20
XXX average alias set size: 1
XXX times a non-volatile is read: 6
XXX times a non-volatile is write: 5
XXX times a volatile is read: 0
XXX times read thru a pointer: 0
XXX times a volatile is write: 0
XXX times written thru a pointer: 0
XXX times a volatile is available for access: 0
XXX percentage of non-volatile access: 100
XXX forward jumps: 0
XXX backward jumps: 0
XXX stmts: 6
XXX max block depth: 2
breakdown:
depth: 0, occurrence: 3
depth: 1, occurrence: 2
depth: 2, occurrence: 1
XXX percentage a fresh-made variable is used: 33.3
XXX percentage an existing variable is used: 66.7
********************* end of statistics **********************/
| [
"13277988207@163.com"
] | 13277988207@163.com |
243a2b6345ac35b22d21245eafe3b719e7981227 | bd111f77d5d2f988eb17ff20b588439f6caf5984 | /apps/sam_e70_xpld/getting_started_drivers_middleware/firmware/src/config/sam_e70_xpld/peripheral/clk/plib_clk.c | db18608896d340dda5cd16691c136fae4b1e6e88 | [
"ISC",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | SyedThaseemuddin/MPLAB-Harmony-Reference-Apps | d10e472b9504bdadbae77552ba16007bd897e75a | 16e4da0b1d071a9c1f454697b275a2577c70a0aa | refs/heads/main | 2022-07-28T17:43:06.953592 | 2021-01-28T01:53:21 | 2021-01-28T01:53:21 | 300,107,782 | 0 | 0 | NOASSERTION | 2020-10-01T01:52:13 | 2020-10-01T01:37:31 | null | UTF-8 | C | false | false | 6,586 | c | /*******************************************************************************
* Copyright (C) 2019 Microchip Technology Inc. and its subsidiaries.
*
* Subject to your compliance with these terms, you may use Microchip software
* and any derivatives exclusively with Microchip products. It is your
* responsibility to comply with third party license terms applicable to your
* use of third party software (including open source software) that may
* accompany Microchip software.
*
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
* EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
* WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
* PARTICULAR PURPOSE.
*
* IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
* INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
* WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
* BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
* FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
* ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
*******************************************************************************/
#include "device.h"
#include "plib_clk.h"
/*********************************************************************************
Initialize Main Clock (MAINCK)
*********************************************************************************/
static void CLK_MainClockInitialize(void)
{
/* Enable Main Crystal Oscillator */
PMC_REGS->CKGR_MOR = (PMC_REGS->CKGR_MOR & ~CKGR_MOR_MOSCXTST_Msk) | CKGR_MOR_KEY_PASSWD | CKGR_MOR_MOSCXTST(255) | CKGR_MOR_MOSCXTEN_Msk;
/* Wait until the main oscillator clock is ready */
while ( (PMC_REGS->PMC_SR & PMC_SR_MOSCXTS_Msk) != PMC_SR_MOSCXTS_Msk);
/* Main Crystal Oscillator is selected as the Main Clock (MAINCK) source.
Switch Main Clock (MAINCK) to Main Crystal Oscillator clock */
PMC_REGS->CKGR_MOR|= CKGR_MOR_KEY_PASSWD | CKGR_MOR_MOSCSEL_Msk;
/* Wait until MAINCK is switched to Main Crystal Oscillator */
while ( (PMC_REGS->PMC_SR & PMC_SR_MOSCSELS_Msk) != PMC_SR_MOSCSELS_Msk);
/* Enable the RC Oscillator */
PMC_REGS->CKGR_MOR|= CKGR_MOR_KEY_PASSWD | CKGR_MOR_MOSCRCEN_Msk;
/* Wait until the RC oscillator clock is ready. */
while( (PMC_REGS->PMC_SR & PMC_SR_MOSCRCS_Msk) != PMC_SR_MOSCRCS_Msk);
/* Configure the RC Oscillator frequency */
PMC_REGS->CKGR_MOR = (PMC_REGS->CKGR_MOR & ~CKGR_MOR_MOSCRCF_Msk) | CKGR_MOR_KEY_PASSWD | CKGR_MOR_MOSCRCF_12_MHz;
/* Wait until the RC oscillator clock is ready */
while( (PMC_REGS->PMC_SR& PMC_SR_MOSCRCS_Msk) != PMC_SR_MOSCRCS_Msk);
}
/*********************************************************************************
Initialize PLLA (PLLACK)
*********************************************************************************/
static void CLK_PLLAInitialize(void)
{
/* Configure and Enable PLLA */
PMC_REGS->CKGR_PLLAR = CKGR_PLLAR_ONE_Msk | CKGR_PLLAR_PLLACOUNT(0x3f) |
CKGR_PLLAR_MULA(25 - 1) |
CKGR_PLLAR_DIVA(1);
while ( (PMC_REGS->PMC_SR & PMC_SR_LOCKA_Msk) != PMC_SR_LOCKA_Msk);
}
/*********************************************************************************
Initialize UTMI PLL (UPLLCK)
*********************************************************************************/
static void CLK_UTMIPLLInitialize(void)
{
/* Configure Crystal Clock Frequency (12MHz or 16MHz) to select USB PLL (UPLL) multiplication factor
UPLL multiplication factor is x40 to generate 480MHz from 12MHz
UPLL multiplication factor is x30 to generate 480MHz from 16MHz */
UTMI_REGS->UTMI_CKTRIM= UTMI_CKTRIM_FREQ_XTAL12;
/* Enable UPLL and configure UPLL lock time */
PMC_REGS->CKGR_UCKR = CKGR_UCKR_UPLLEN_Msk | CKGR_UCKR_UPLLCOUNT(0x3F);
/* Wait until PLL Lock occurs */
while ((PMC_REGS->PMC_SR & PMC_SR_LOCKU_Msk) != PMC_SR_LOCKU_Msk);
/* UPLL clock frequency is 480MHz (Divider=1) */
PMC_REGS->PMC_MCKR &= (~PMC_MCKR_UPLLDIV2_Msk);
/* Wait until clock is ready */
while ( (PMC_REGS->PMC_SR & PMC_SR_MCKRDY_Msk) != PMC_SR_MCKRDY_Msk);
}
/*********************************************************************************
Initialize Master clock (MCK)
*********************************************************************************/
static void CLK_MasterClockInitialize(void)
{
/* Program PMC_MCKR.PRES and wait for PMC_SR.MCKRDY to be set */
PMC_REGS->PMC_MCKR = (PMC_REGS->PMC_MCKR & ~PMC_MCKR_PRES_Msk) | PMC_MCKR_PRES_CLK_1;
while ((PMC_REGS->PMC_SR & PMC_SR_MCKRDY_Msk) != PMC_SR_MCKRDY_Msk);
/* Program PMC_MCKR.MDIV and Wait for PMC_SR.MCKRDY to be set */
PMC_REGS->PMC_MCKR = (PMC_REGS->PMC_MCKR & ~PMC_MCKR_MDIV_Msk) | PMC_MCKR_MDIV_PCK_DIV2;
while ((PMC_REGS->PMC_SR & PMC_SR_MCKRDY_Msk) != PMC_SR_MCKRDY_Msk);
/* Program PMC_MCKR.CSS and Wait for PMC_SR.MCKRDY to be set */
PMC_REGS->PMC_MCKR = (PMC_REGS->PMC_MCKR & ~PMC_MCKR_CSS_Msk) | PMC_MCKR_CSS_PLLA_CLK;
while ((PMC_REGS->PMC_SR & PMC_SR_MCKRDY_Msk) != PMC_SR_MCKRDY_Msk);
}
/*********************************************************************************
Initialize USB FS clock
*********************************************************************************/
static void CLK_USBClockInitialize ( void )
{
/* Configure Full-Speed USB Clock source and Clock Divider */
PMC_REGS->PMC_USB = PMC_USB_USBDIV(9) | PMC_USB_USBS_Msk;
/* Enable Full-Speed USB Clock Output */
PMC_REGS->PMC_SCER = PMC_SCER_USBCLK_Msk;
}
/*********************************************************************************
Clock Initialize
*********************************************************************************/
void CLOCK_Initialize( void )
{
/* Initialize Main Clock */
CLK_MainClockInitialize();
/* Initialize PLLA */
CLK_PLLAInitialize();
/* Initialize UTMI PLL */
CLK_UTMIPLLInitialize();
/* Initialize Master Clock */
CLK_MasterClockInitialize();
/* Initialize USB Clock */
CLK_USBClockInitialize();
/* Enable Peripheral Clock */
PMC_REGS->PMC_PCER0=0x8b1c00;
PMC_REGS->PMC_PCER1=0x104;
}
| [
"syed.thaseemuddin@microchip.com"
] | syed.thaseemuddin@microchip.com |
6ae058e881eb84b647351a56e761f03a8503c514 | 754d24464fd40a47b4ae1b4b2f0d40ce2de2c214 | /Ex3/company.h | 61275168a9304e679fa36b37d26391147e996c01 | [] | no_license | alexbondar92/IntroSystemsProgrammingCourse | 7e7a20b794c893db716da37fc1b997de485e3069 | 6a4dfec736a312934830f22658c0f2ae6d82a923 | refs/heads/master | 2020-08-22T06:43:00.983857 | 2019-10-20T10:08:52 | 2019-10-20T10:08:52 | 216,340,059 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 6,427 | h | #ifndef COMPANY_H_
#define COMPANY_H_
#include <stdbool.h>
#include "escape_utilitis.h"
#include "mtm_ex3.h"
#include "room.h"
/**
* Company Container
*
* Implements a company container type.
*
* The following functions are available:
*
* companyCreate - Creates a new company
* companyDestroy - Deletes an existing company and frees all resources
* companyGetEmail - Getting the Email of a company
* companyGetFaculty - Getting the faculty of a company
* companyCopy - Make a copy of a company
* companyAddRoom - Add new room to company
* companyRemoveRoom - Remove room from company
* companyCompare - Comparing to companies(by email)
* companyGetNumberOfTotalOrders - get number of orders for company
* companyDecNumberOfOrderIsInRoom - decreases the number of rooms at the company
* companyRoomIsIn - check if there is a room with the same id
* companyGetRoom - returns the room at the company
* companyRecommendedRoom - find the most recommended room at the company
*/
/**
* This type defines all errors for the Company ADT.
*/
typedef enum {
COMPANY_OUT_OF_MEMORY, // You should exit program after this error
COMPANY_NULL_PARAMETER,
COMPANY_INVALID_PARAMETER,
COMPANY_ID_ALREADY_EXIST,
COMPANY_RESERVATION_EXISTS,
COMPANY_ID_DOES_NOT_EXIST,
COMPANY_SUCCESS
} CompanyErrorCode;
/** Type for defining the company */
typedef struct Company_t *Company;
/**
* Create a new Company.
*
* Creates a new company. This function resive all the data for first initial of
* new company, and reset the rest.
*
* @param email of the current new Company assumption that null won't be sent.
* @param faculty the fuculty that ownes this company.
* @param error the error returning parameter code
* @return
* in case of invaild one or more of parameters,return COMPANY_INVALID_PARAMETER
* in case of allocation fail, return CMAPNY_OUT_OF_MEMORY
* in case of success, returns new escaper object and COMPANY_SUCCESS
*/
Company companyCreate(char* email, TechnionFaculty faculty,
CompanyErrorCode* error);
/**
* Deallocates an existing company. Clears all elements by using the
* stored free function.
*
* @param company Target to be deallocated. If company is NULL nothing will be
* done
*/
void companyDestroy(Company company);
/**
* Returns the email of the current company.
*
* @param company the current company object to get from(its assume that room
* not null)
* @return
* the email of the company.
*/
Email companyGetEmail(Company company);
/**
* Returns the faculty of the current company.
*
* @param company The target company which faculty is requested.
* @return
* the faculty of the company.
*/
TechnionFaculty companyGetFaculty(Company company);
/**
* create a copy of this company
*
* @param company The company copy with.
* @return
* returns a copy of the copmany element
*/
Company companyCopy(Company company);
/**
* Adding new room to the current company.
*
* @param company The company that own the new room
* @param room a room element with data that we copy to the new room
* @return
* COMPANY_ID_ALREADY_EXIST - in case there is already a room with the same id
* COMAPNY_OUT_OF_MEMORY in case of allocation fail
* COMPANY_SUCCESS - in case of success, the new room added
*/
CompanyErrorCode companyAddRoom(Company company, Room room);
/**
* Removing room from the current company.
*
* @param company The company to remove room from
* @param room_id The room id that needed to remove
* @return
* COMPANY_INVALID_PARAMETER - in case param room_id is invalid
* COMPANY_ID_DOES_NOT_EXIST - in case there isn't relevant room in this company
* with the same id
* COMPANY_RESERVATION_EXISTS - in case there is an open orders for that room
* COMPANY_SUCCESS - in case of success, the room had been removed
*/
CompanyErrorCode companyRemoveRoom(Company company,int room_id);
/**
* comparing the companies by thier emails(uniq).
*
* @param company1 The first company to compare with
* @param company2 The second company to compare to
* @return
* A positive integer if the first element is greater,
* 0 if they're equal,
* A negative integer if the second element is greater.
*/
int companyCompare(Company company1, Company company2);
/**
* this function get the number of orders for rooms at current company
* @param company the current company object to get from(its assume that company
* not null)
* @return
* the number of active orders for this company
*/
int companyGetNumberOfTotalOrders(Company company);
/**
* this function decrease the number of orders for room at current company
* @param company the current company witch own the room(its assume that company
* not null)
* @param room_id the id of the room witch needed to decrease number of orders
*/
void companyDecNumberOfOrdersInRoom(Company company, int room_id);
/**
* this function checks if there is already a room with the same id
* @param company the current company object to check(its assume that company
* not null)
* @return
* true if there is a room with the same id, false if there is no room with the
* same id
*/
bool companyRoomIsIn(Company company, Room room);
/**
* this function checks if there is a room with the same id
* @param company the current company object to check(its assume that company
* not null)
* @param room_id the id of the room
* @param error error code
* @return
* the room if there is a room with the same id, NULL if there is no room with
* the same id
*/
Room companyGetRoom(Company company, int room_id, CompanyErrorCode* error);
/**
* this function returns the calculation for the most recommended room
* @param company the current company object to check(its assume that company
* not null)
* @param p_e the number of people that are sent to the most recommended order
* @param skill_level the skill level of the escaper that wants to make order
* @param id a ptr
* @return
* the calculetion for the most recommended room at the company
* id will get the room id of the most recommended room at the company
*/
int companyRecommendedRoom (Company company, int p_e, int skill_level, int* id);
#endif /*COMPANY_H_*/
| [
"Alex.Bondar@campus.technion.ac.il"
] | Alex.Bondar@campus.technion.ac.il |
1a3ee92f79fdef5d5aa08a216c34635a8487a550 | 2bc3398063fd7251c46a2d93d2e301cd063befcd | /nitan/d/gaibang/underxs.c | 5014eb973f48a401b7186610ab0d9cb4c4381336 | [
"MIT"
] | permissive | HKMUD/NT6 | ae6a3c173ea07c156e8dc387b3ec21f3280ee0be | bb518e2831edc6a83d25eccd99271da06eba8176 | refs/heads/master | 2020-03-18T08:44:12.400598 | 2018-05-23T06:55:18 | 2018-05-23T06:55:18 | 134,525,191 | 9 | 4 | null | null | null | null | GB18030 | C | false | false | 653 | c | // Room: /d/gaibang/undertree.c
// Date: Haa 96/03/22
#include <room.h>
inherit ROOM;
void create()
{
set("short", "雪坑小洞");
set("long", @LONG
这里是大雪山雪坑下的一个密洞。里面破破烂烂的,丢满各种
杂物,还有丐帮弟子收集的破铜烂铁等。从这里通往丐帮的秘密通
道。
LONG );
set("exits", ([
"out" : "d/xuedao/hollow",
"northeast" : __DIR__"xsandao2",
]));
set("no_clean_up", 0);
set("coor/x", -30000);
set("coor/y", -10000);
set("coor/z", -20);
setup();
replace_program(ROOM);
} | [
"xmlsdk@gmail.com"
] | xmlsdk@gmail.com |
a5f5cca1cee5d21359d5402436f5ebc6028a2a3e | 91a882547e393d4c4946a6c2c99186b5f72122dd | /Source/XPSP1/NT/base/ntos/ke/amd64/intplt.c | 1fdd6f4c4d5f6b3d6b99c54f829b4733c1700a80 | [] | no_license | IAmAnubhavSaini/cryptoAlgorithm-nt5src | 94f9b46f101b983954ac6e453d0cf8d02aa76fc7 | d9e1cdeec650b9d6d3ce63f9f0abe50dabfaf9e2 | refs/heads/master | 2023-09-02T10:14:14.795579 | 2021-11-20T13:47:06 | 2021-11-20T13:47:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,787 | c | /*++
Copyright (c) 2000 Microsoft Corporation
Module Name:
intplt.c
Abstract:
This module implements platform specific code to support the processing
of interrupts.
Author:
David N. Cutler (davec) 30-Aug-2000
Environment:
Kernel mode only.
Revision History:
--*/
#include "ki.h"
BOOLEAN
KeSynchronizeExecution (
IN PKINTERRUPT Interrupt,
IN PKSYNCHRONIZE_ROUTINE SynchronizeRoutine,
IN PVOID SynchronizeContext
)
/*++
Routine Description:
This function synchronizes the execution of the specified routine with
the execution of the service routine associated with the specified
interrupt object.
Arguments:
Interrupt - Supplies a pointer to an interrupt object.
SynchronizeRoutine - Supplies a pointer to the function whose
execution is to be synchronized with the execution of the service
routine associated with the specified interrupt object.
SynchronizeContext - Supplies a context pointer which is to be
passed to the synchronization function as a parameter.
Return Value:
The value returned by the synchronization routine is returned as the
function value.
--*/
{
KIRQL OldIrql;
BOOLEAN Status;
//
// Raise IRQL to the interrupt synchronization level and acquire the
// actual interrupt spinlock.
//
OldIrql = KfRaiseIrql(Interrupt->SynchronizeIrql);
KiAcquireSpinLock(Interrupt->ActualLock);
//
// Call the specfied synchronization routine.
//
Status = (SynchronizeRoutine)(SynchronizeContext);
//
// Release the spin lock, lower IRQL to its previous value, and return
// the sysnchronization routine status.
//
KiReleaseSpinLock(Interrupt->ActualLock);
KeLowerIrql(OldIrql);
return Status;
}
| [
"support@cryptoalgo.cf"
] | support@cryptoalgo.cf |
0828045f16f61ed15d59a314f537abd2c376abe8 | 8740da46d81d5e06509f6545c1700785243930be | /Build/GRANTLEY/RELEASE_MYTOOLS/X64/GrantleySocketPkg/Library/ProcessorPowerManagement/CpuPpmLib/DEBUG/AutoGen.h | 2b40386c3e9f2cb80c59dd68d37236eec08ac822 | [] | no_license | microwave89-hv/LoginDemo | 8e0fda6de978657740c547c561014653c95f38df | dddea67b7cfc169fb681f86cbc1c8c06e712d793 | refs/heads/master | 2020-09-28T02:07:53.924999 | 2019-12-08T12:28:41 | 2019-12-08T12:28:41 | 226,663,767 | 0 | 0 | null | 2019-12-08T12:26:14 | 2019-12-08T12:26:13 | null | UTF-8 | C | false | false | 423 | h | /**
DO NOT EDIT
FILE auto-generated
Module name:
AutoGen.h
Abstract: Auto-generated AutoGen.h for building module or library.
**/
#ifndef _AUTOGENH_C55F8D50_271C_4779_9C22_67A77ACAB713
#define _AUTOGENH_C55F8D50_271C_4779_9C22_67A77ACAB713
#ifdef __cplusplus
extern "C" {
#endif
#include <Base.h>
extern GUID gEfiCallerIdGuid;
extern CHAR8 *gEfiCallerBaseName;
#ifdef __cplusplus
}
#endif
#endif
| [
"yourEmail@xxx.com"
] | yourEmail@xxx.com |
4a1c01152bb8c0ef56b6d5051d7be67a5c6a4c17 | f175bcab3c2f0aad7378c94ac220256982ab2027 | /ios_v1/Classes/Native/Facebook_Unity_Facebook_Unity_Constants3246017429MethodDeclarations.h | 16f1a7c5b76a14dcb24f685ecffb9dd74536c6d0 | [] | no_license | al2css/erpkunity | 6618387e9a5b44378e70ccb859d3b33a7837268c | c618dc989963bcd7b7ec9fa9b17c39fff88bb89b | refs/heads/master | 2020-07-22T04:59:49.139202 | 2017-06-23T16:33:13 | 2017-06-23T16:33:13 | 94,344,128 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,749 | h | #pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include <assert.h>
#include <exception>
// System.Uri
struct Uri_t19570940;
// System.String
struct String_t;
#include "codegen/il2cpp-codegen.h"
#include "Facebook_Unity_Facebook_Unity_FacebookUnityPlatfor1867507902.h"
// System.Uri Facebook.Unity.Constants::get_GraphUrl()
extern "C" Uri_t19570940 * Constants_get_GraphUrl_m957731240 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.String Facebook.Unity.Constants::get_GraphApiUserAgent()
extern "C" String_t* Constants_get_GraphApiUserAgent_m1861542476 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Boolean Facebook.Unity.Constants::get_IsMobile()
extern "C" bool Constants_get_IsMobile_m868982319 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Boolean Facebook.Unity.Constants::get_IsEditor()
extern "C" bool Constants_get_IsEditor_m2386263146 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Boolean Facebook.Unity.Constants::get_IsWeb()
extern "C" bool Constants_get_IsWeb_m4203885467 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Boolean Facebook.Unity.Constants::get_IsArcade()
extern "C" bool Constants_get_IsArcade_m2679673779 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.String Facebook.Unity.Constants::get_UnitySDKUserAgentSuffixLegacy()
extern "C" String_t* Constants_get_UnitySDKUserAgentSuffixLegacy_m2356657125 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.String Facebook.Unity.Constants::get_UnitySDKUserAgent()
extern "C" String_t* Constants_get_UnitySDKUserAgent_m571192471 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Boolean Facebook.Unity.Constants::get_DebugMode()
extern "C" bool Constants_get_DebugMode_m550911271 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// Facebook.Unity.FacebookUnityPlatform Facebook.Unity.Constants::get_CurrentPlatform()
extern "C" int32_t Constants_get_CurrentPlatform_m1755241047 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR;
// Facebook.Unity.FacebookUnityPlatform Facebook.Unity.Constants::GetCurrentPlatform()
extern "C" int32_t Constants_GetCurrentPlatform_m1625561608 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR;
| [
"alecsdulgheru@gmail.com"
] | alecsdulgheru@gmail.com |
497e93028df7e59aeedb74e8a9107e28fd3c4802 | cee0d45f8f17088044aed801e8343e398c06f086 | /includes/libft/ft_strmapi.c | bbade357a8d7a553c77129d7b9856c5d623ee8dc | [] | no_license | WickElementz/FdF | 373dc0b966dddbe06b25c17d7192d06819855203 | e05c45179597a6c8d7137faa73061bd06ea8fd17 | refs/heads/master | 2020-06-04T00:35:59.708291 | 2019-09-05T16:10:59 | 2019-09-05T16:10:59 | 191,798,039 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,242 | c | /* ************************************************************************** */
/* LE - / */
/* / */
/* ft_strmapi.c .:: .:/ . .:: */
/* +:+:+ +: +: +:+:+ */
/* By: jominodi <marvin@le-101.fr> +:+ +: +: +:+ */
/* #+# #+ #+ #+# */
/* Created: 2018/10/09 11:29:13 by jominodi #+# ## ## #+# */
/* Updated: 2018/10/09 11:30:27 by jominodi ### #+. /#+ ###.fr */
/* / */
/* / */
/* ************************************************************************** */
#include "./libft.h"
char *ft_strmapi(char const *s, char (*f)(unsigned int, char))
{
char *str;
int i;
if (!s || !f)
return (0);
i = 0;
if (!(str = ft_strnew(ft_strlen(s))))
return (0);
while (s[i])
{
str[i] = (*f)(i, s[i]);
i++;
}
return (str);
}
| [
"jominodi@z1r9p1.le-101.fr"
] | jominodi@z1r9p1.le-101.fr |
d4d4815018d4543b91038aeb24e9f8d3ada8a8bf | 5c255f911786e984286b1f7a4e6091a68419d049 | /code/7979e534-33b0-413b-abb2-19462d0fbcff.c | 8957649587a3db65d5275b6a2b1f6580a6bfb92a | [] | no_license | nmharmon8/Deep-Buffer-Overflow-Detection | 70fe02c8dc75d12e91f5bc4468cf260e490af1a4 | e0c86210c86afb07c8d4abcc957c7f1b252b4eb2 | refs/heads/master | 2021-09-11T19:09:59.944740 | 2018-04-06T16:26:34 | 2018-04-06T16:26:34 | 125,521,331 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 217 | c | #include <stdio.h>
int main() {
int i=0;
int j=12;
int k;
int l;
k = 53;
l = 64;
k = i/j;
l = i%j;
l = j%j;
k = l-i*i;
printf("vulnerability");
printf("%d%d\n",k,l);
return 0;
}
| [
"nharmon8@gmail.com"
] | nharmon8@gmail.com |
0b1484532ada0d008c41c4ebfed34d62b3622b82 | dcf26a6bcf853a3f8f6f50f9379998ef4d8aad40 | /vendor/hisi/hi35xx/third_party/uboot/test/dm/test-driver.c | 317c3ab9352c3b308d5afdb64485034f8046c691 | [] | no_license | small-seven/testmem | c5f3202dce1c369e9d84cdaaccc2008b827c16d8 | 2771460c617439bd1be562ffdc94543ea170a736 | refs/heads/main | 2023-03-12T22:16:28.824577 | 2021-03-03T04:24:59 | 2021-03-03T04:24:59 | 343,847,762 | 1 | 0 | null | null | null | null | UTF-8 | C | false | false | 426 | c | #include <common.h>
#include <dm.h>
#include <errno.h>
#include <malloc.h>
#include <dm/test.h>
#include <test/ut.h>
#include <asm/io.h>
static int test_remove(struct udevice *dev)
{
/* Private data should still be allocated */
ut_assert(dev_get_priv(dev));
dm_testdrv_op_count[DM_TEST_OP_REMOVE]++;
return 0;
}
static int test_manual_remove(struct udevice *dev)
{
dm_testdrv_op_count[DM_TEST_OP_REMOVE]++;
return 0;
}
| [
"huihuigong@users.noreply.github.com"
] | huihuigong@users.noreply.github.com |
684db2fcc906b6fda39f2bc3bb251c650a2112dc | 2845a764b27704e333f9c809f42cf23a10c15d53 | /libft/ft_strchr.c | 0428bc0e7130460e140a47b6d9240ebb8af02402 | [] | no_license | jongoad/printf | 2dd012c3fdae7fc8119f64b92ea5c3821dc24019 | 1465f2fd64111f247dcee8a335d6e3c194db57ad | refs/heads/master | 2023-08-25T20:05:14.869282 | 2021-11-12T21:55:16 | 2021-11-12T21:55:16 | 427,506,048 | 1 | 1 | null | null | null | null | UTF-8 | C | false | false | 1,089 | c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jgoad <jgoad@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/09/14 16:57:28 by jgoad #+# #+# */
/* Updated: 2021/09/20 18:09:01 by jgoad ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strchr(const char *s, int c)
{
size_t i;
i = 0;
while (i < ft_strlen(s) + 1)
{
if (*(s + i) == (char)c)
return ((char *)(s + i));
i++;
}
return (NULL);
}
| [
"jon@weareopensunday.com"
] | jon@weareopensunday.com |
4b4104b0ca9c32c963419ecbe3450afb54c3cd18 | 976f5e0b583c3f3a87a142187b9a2b2a5ae9cf6f | /source/linux/drivers/media/dvb-frontends/extr_mn88443x.c_mn88443x_set_frontend.c | b7b4204826aad9acdef4ad08d2289d1d443ef019 | [] | no_license | isabella232/AnghaBench | 7ba90823cf8c0dd25a803d1688500eec91d1cf4e | 9a5f60cdc907a0475090eef45e5be43392c25132 | refs/heads/master | 2023-04-20T09:05:33.024569 | 2021-05-07T18:36:26 | 2021-05-07T18:36:26 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 3,640 | c | #define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef int u8 ;
struct regmap {int dummy; } ;
struct mn88443x_priv {struct regmap* regmap_t; struct regmap* regmap_s; } ;
struct TYPE_3__ {int /*<<< orphan*/ (* set_params ) (struct dvb_frontend*) ;} ;
struct TYPE_4__ {int /*<<< orphan*/ (* i2c_gate_ctrl ) (struct dvb_frontend*,int) ;TYPE_1__ tuner_ops; } ;
struct dtv_frontend_properties {scalar_t__ delivery_system; } ;
struct dvb_frontend {TYPE_2__ ops; struct dtv_frontend_properties dtv_property_cache; struct mn88443x_priv* demodulator_priv; } ;
/* Variables and functions */
int /*<<< orphan*/ DOSET1_S ;
int /*<<< orphan*/ DOSET1_T ;
scalar_t__ SYS_ISDBS ;
scalar_t__ SYS_ISDBT ;
int /*<<< orphan*/ TSSET1 ;
int TSSET1_TSASEL_ISDBS ;
int TSSET1_TSASEL_ISDBT ;
int TSSET1_TSASEL_MASK ;
int TSSET1_TSBSEL_MASK ;
int TSSET1_TSBSEL_NONE ;
int /*<<< orphan*/ TSSET2 ;
int /*<<< orphan*/ TSSET3 ;
int TSSET3_INTASEL_MASK ;
int TSSET3_INTASEL_S ;
int TSSET3_INTASEL_T ;
int TSSET3_INTBSEL_MASK ;
int TSSET3_INTBSEL_NONE ;
int /*<<< orphan*/ mn88443x_s_sleep (struct mn88443x_priv*) ;
int /*<<< orphan*/ mn88443x_s_tune (struct mn88443x_priv*,struct dtv_frontend_properties*) ;
int /*<<< orphan*/ mn88443x_s_wake (struct mn88443x_priv*) ;
int /*<<< orphan*/ mn88443x_t_set_freq (struct mn88443x_priv*) ;
int /*<<< orphan*/ mn88443x_t_sleep (struct mn88443x_priv*) ;
int /*<<< orphan*/ mn88443x_t_tune (struct mn88443x_priv*,struct dtv_frontend_properties*) ;
int /*<<< orphan*/ mn88443x_t_wake (struct mn88443x_priv*) ;
int /*<<< orphan*/ regmap_update_bits (struct regmap*,int /*<<< orphan*/ ,int,int) ;
int /*<<< orphan*/ regmap_write (struct regmap*,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ stub1 (struct dvb_frontend*,int) ;
int /*<<< orphan*/ stub2 (struct dvb_frontend*) ;
int /*<<< orphan*/ stub3 (struct dvb_frontend*,int) ;
__attribute__((used)) static int mn88443x_set_frontend(struct dvb_frontend *fe)
{
struct mn88443x_priv *chip = fe->demodulator_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct regmap *r_s = chip->regmap_s;
struct regmap *r_t = chip->regmap_t;
u8 tssel = 0, intsel = 0;
if (c->delivery_system == SYS_ISDBS) {
mn88443x_s_wake(chip);
mn88443x_t_sleep(chip);
tssel = TSSET1_TSASEL_ISDBS;
intsel = TSSET3_INTASEL_S;
} else if (c->delivery_system == SYS_ISDBT) {
mn88443x_s_sleep(chip);
mn88443x_t_wake(chip);
mn88443x_t_set_freq(chip);
tssel = TSSET1_TSASEL_ISDBT;
intsel = TSSET3_INTASEL_T;
}
regmap_update_bits(r_t, TSSET1,
TSSET1_TSASEL_MASK | TSSET1_TSBSEL_MASK,
tssel | TSSET1_TSBSEL_NONE);
regmap_write(r_t, TSSET2, 0);
regmap_update_bits(r_t, TSSET3,
TSSET3_INTASEL_MASK | TSSET3_INTBSEL_MASK,
intsel | TSSET3_INTBSEL_NONE);
regmap_write(r_t, DOSET1_T, 0x95);
regmap_write(r_s, DOSET1_S, 0x80);
if (c->delivery_system == SYS_ISDBS)
mn88443x_s_tune(chip, c);
else if (c->delivery_system == SYS_ISDBT)
mn88443x_t_tune(chip, c);
if (fe->ops.tuner_ops.set_params) {
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}
return 0;
} | [
"brenocfg@gmail.com"
] | brenocfg@gmail.com |
333a56c5f6f30d52aaa59ef291f890bbfbad06ef | 2388e5f4f1605fd0e24236c0e52b343bff0ebbba | /MessCenter/src/ComnFunc.h | 6b472cd517e5073f67b4b54cf3c9e5ae5fa88528 | [] | no_license | BlueLeen/SUHome_Proj | cc2b794b6dab4703be3292e68be0f88974f9f739 | b33a3a4ce918d3b9830c864914ce3773bedb88ad | refs/heads/master | 2021-01-16T18:40:27.668121 | 2015-11-06T09:31:20 | 2015-11-06T09:31:20 | 18,625,492 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 338 | h | #ifndef COMNFUNC_H_
#define COMNFUNC_H_
/*
* The file contains common functions
*/
//#include <time.h>
#include <sys/time.h>
// 返回自系统开机以来的毫秒数(tick)
unsigned long GetTickCount()
{
struct timeval tv;
if(gettimeofday(&tv, NULL) != 0)
return 0;
return (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
}
#endif
| [
"blueleen@163.com"
] | blueleen@163.com |
54ba5072044843af84a624f91edf02fea5f85b2c | b0c030fdf05c8cce9d6cae01424d91c390deb3ab | /system_clock.h | e84c91e4916d13f08bef1a810203a4643649cb28 | [
"MIT"
] | permissive | kzyapkov/bluepill-serial-monster | 75614204cc9c2c8bef73b6a2b9f1c2f3a1d16180 | a1b6948cf641c0f31ac7f94d0ae9bfeca50a8be0 | refs/heads/main | 2023-07-13T11:14:11.665838 | 2021-08-24T07:23:11 | 2021-08-24T07:23:11 | 391,440,457 | 0 | 0 | MIT | 2021-07-31T18:56:18 | 2021-07-31T18:56:17 | null | UTF-8 | C | false | false | 168 | h | /*
* MIT License
*
* Copyright (c) 2020 Kirill Kotyagin
*/
#ifndef SYSTEM_CLOCK_H
#define SYSTEM_CLOCK_H
void system_clock_init();
#endif /* SYSTEM_CLOCK_H */
| [
"kirill.kotyagin@gmail.com"
] | kirill.kotyagin@gmail.com |
df23831641eb128480ac080d71bfcfad1c45b93f | 1adee3e6fcb94e9d3bf448565909cc099ed2ef14 | /emBODY/eBcode/arch-arm/embobj/plus/mc/Pid.h | 08697382a54855c1abe5eac0c69c20b673b96d84 | [] | no_license | uincore/icub-firmware | 34b98820b16e1aa3f99592d5c7227e49d93b32cd | 7b2c869a96e97318b48d94f2962f3ed1ec6d9a12 | refs/heads/master | 2020-12-14T09:50:34.466689 | 2016-08-19T14:00:54 | 2016-08-19T14:00:54 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 920 | h | #ifndef MC_PID_H___
#define MC_PID_H___
#include "EoCommon.h"
#include "EoMotionControl.h"
#include "EOemsControllerCfg.h"
typedef struct //PID
{
float Ko;
float Kp;
float Kd;
float Ki;
float Kff;
float Kbemf;
float Ktau;
float Dn;
float En;
float In;
float Imax;
float A,B;
float stiction_up;
float stiction_down;
float out_max;
float out_lpf;
float out;
uint8_t filter;
} PID;
PID* PID_new(uint8_t n);
extern void PID_init(PID* o);
extern void PID_config(PID* o, eOmc_PID_t* config);
extern void PID_config_friction(PID *o, float Kbemf, float Ktau);
extern void PID_config_filter(PID *o, uint8_t filter);
extern void PID_reset(PID* o);
extern void PID_get_state(PID* o, float *out, float *err);
extern float PID_do_out(PID* o, float En);
extern float PID_do_friction_comp(PID *o, float vel, float Tr);
#endif
| [
"valentina.gaggero@iit.it"
] | valentina.gaggero@iit.it |
755a1910af1966196a7130fd2cbee3cc8a8770b7 | dc69894297aec1ad83e424a633ffe4d79f70371d | /asd/main.c | 18ae43250688b6b6d44cb2a0a7ebeb9807d668a1 | [] | no_license | Jinay98/Algorithms | d63e23fae92862ad41b9cedbc0092d6ece6d222c | eb85e7755167c4fe26b68db608fe61671b7e93fa | refs/heads/master | 2020-04-22T05:09:37.740778 | 2019-02-11T15:11:00 | 2019-02-11T15:11:00 | 170,149,515 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 189 | c | #include <stdio.h>
#include <stdlib.h>
void main()
{
int c=2;
printcv();
printf("Hello world main! = %d",c);
}
void printcv(){
printf("Hello world! = %d",c);
}
| [
"jinayparekh98@gmail.com"
] | jinayparekh98@gmail.com |
c7c814416aba1d8c3bdbc305ef5e94914d38f475 | c2a52f7e362dcc3a0a4d643a2570a0b60a6d5884 | /42 Piscine/rush02/includes/rect_detect.h | 2e11d58c59ac9eb28b07cb033fa0e2733b33274c | [] | no_license | mgia/Piscine42 | 5f330256c5d744c54a4bf8542810656347f15c92 | 4d3678b4c5cccf08ffd8b607b193dacbad45a11a | refs/heads/master | 2021-01-20T04:53:26.533723 | 2017-04-28T22:00:44 | 2017-04-28T22:00:44 | 89,745,767 | 3 | 1 | null | null | null | null | UTF-8 | C | false | false | 1,079 | h | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* rect_detect.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: anazar <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/04/23 15:51:50 by anazar #+# #+# */
/* Updated: 2017/04/23 15:57:51 by anazar ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef RECT_DETECT_H
# define RECT_DETECT_H
typedef struct s_fucknorm
{
int x;
int y;
int len;
} t_fucknorm;
int stlen(char *str);
int is_square(char *str);
#endif
| [
"mtan@e1z2r1p12.42.us.org"
] | mtan@e1z2r1p12.42.us.org |
5fdfd86849c8fb53ac1dec1c72b1bb86b0e56c07 | 83655028cb115fefcd6f5b98e17e5865b2a8db83 | /segue-parede/segue-parede.c | 5647f2c7fb57f289cf881ada4589144d6b3891e0 | [] | no_license | prafael18/trabalho02 | c96e6d7b0ed1cce15044043227f42a90c1fc3471 | 01b14c6ad786848e5c01b34bb2aabda68bc3e486 | refs/heads/master | 2021-09-08T01:23:41.769547 | 2018-03-05T04:07:46 | 2018-03-05T04:07:46 | 110,749,436 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 5,006 | c | #include "api_robot2.h"
#define SHARP_TURN 1
#define SLOW_TURN 0
void testFunction();
void testFunction2();
void turn_left(unsigned char sharp_turn);
void turn_right(unsigned char sharp_turn);
void turn_sharp_right();
void segue_parede(motor_cfg_t *right_motor, motor_cfg_t *left_motor);
void busca_parede(motor_cfg_t *right_motor, motor_cfg_t *left_motor);
void busca_obstaculo(motor_cfg_t* right_motor, motor_cfg_t*left_motor);
void align_left(motor_cfg_t* right_motor, motor_cfg_t* left_motor);
void keep_following();
void move_forward();
//testar colocar a logica do zig zag dentro de uma funcao que vai chamar a si mesma no final
//mas que seta o tempo para 0 e chama a si com um alarmes
int _start(int argv, char** argc) {
motor_cfg_t right_motor, left_motor;
right_motor.id = 0;
left_motor.id = 1;
// right_motor.speed = 20;
// left_motor.speed = 20;
// set_motors_speed(&right_motor, &left_motor);
// register_proximity_callback(4, 1200, *turn_sharp_right);
// while (1) {
// }
busca_parede(&right_motor, &left_motor);
segue_parede(&right_motor, &left_motor);
return 0;
}
void turn_right(unsigned char sharp_turn) {
motor_cfg_t right_motor, left_motor;
unsigned int sonar3;
right_motor.id = 0;
left_motor.id = 1;
if (sharp_turn) {
right_motor.speed = 2;
left_motor.speed = 8;
set_motors_speed(&right_motor, &left_motor);
do {
sonar3 = read_sonar(3);
}
while (sonar3 < 900);
right_motor.speed = 0;
left_motor.speed = 0;
set_motors_speed(&right_motor, &left_motor);
}
else {
right_motor.speed = 6;
left_motor.speed = 8;
}
// for (i; i < 10; i++) {
// set_motors_speed(&right_motor, &left_motor);
// }
set_motors_speed(&right_motor, &left_motor);
}
void turn_left(unsigned char sharp_turn) {
motor_cfg_t right_motor, left_motor;
right_motor.id = 0;
left_motor.id = 1;
if (sharp_turn) {
right_motor.speed = 8;
left_motor.speed = 2;
}
else {
right_motor.speed = 8;
left_motor.speed = 6;
}
set_motors_speed(&right_motor, &left_motor);
// for (i; i < 10; i++) {
// set_motors_speed(&right_motor, &left_motor);
// }
}
// void turn_sharp_right() {
// motor_cfg_t right_motor, left_motor;
// int i = 0;
// right_motor.id = 0;
// left_motor.id = 1;
// right_motor.speed = 0;
// left_motor.speed = 10;
// for (i; i < 10; i++) {
// set_motors_speed(&right_motor, &left_motor);
// }
// register_proximity_callback(4, 1200, *turn_sharp_right);
// }
void move_forward() {
motor_cfg_t right_motor, left_motor;
right_motor.id = 0;
left_motor.id = 1;
right_motor.speed = 20;
left_motor.speed = 20;
set_motors_speed(&right_motor, &left_motor);
}
void keep_following() {
unsigned int sonar0, sonar15, sonar4;
//Casos onde se eu verificasse o sonar 3 tambem poderia evitar uma colisao.
sonar4 = read_sonar(4);
if (sonar4 <= 1200) {
turn_right(SHARP_TURN);
}
else {
sonar0 = read_sonar(0);
sonar15 = read_sonar(15);
// write_sonar_dist(sonar0, sonar15);
if (sonar0 <= 400 || sonar15 <= 400) {
// write_slow_turn_right();
turn_right(SLOW_TURN);
}
else if (sonar0 >= 800 && sonar15 >= 800) {
turn_left(SHARP_TURN);
// write_sharp_turn_left();
}
else if (sonar0 >= 450 && sonar15 >= 450) {
// write_slow_turn_left();
turn_left(SLOW_TURN);
}
else {
move_forward();
}
}
// set_time(0);
// add_alarm(*keep_following, 2);
}
void segue_parede(motor_cfg_t *right_motor, motor_cfg_t *left_motor) {
int aligned_left;
unsigned short sonar0, sonar15;
// register_proximity_callback(4, 1200, *turn_sharp_right);
right_motor->speed = 10;
left_motor->speed = 10;
set_motors_speed(right_motor, left_motor);
while (1) {
keep_following();
}
}
void busca_parede(motor_cfg_t *right_motor, motor_cfg_t *left_motor) {
busca_obstaculo(right_motor, left_motor);
align_left(right_motor, left_motor);
}
void align_left(motor_cfg_t* right_motor, motor_cfg_t* left_motor) {
int dist_diff;
short sonar1, sonar14;
do {
sonar1 = read_sonar(0);
sonar14 = read_sonar(15);
dist_diff = sonar1 - sonar14;
right_motor->speed = 4;
left_motor->speed = 10;
set_motors_speed(right_motor, left_motor);
}
while (dist_diff < -30 || sonar1 > 2000 || sonar14 > 2000 );
right_motor->speed = 0;
left_motor->speed = 0;
set_motors_speed(right_motor, left_motor);
}
void busca_obstaculo(motor_cfg_t* right_motor, motor_cfg_t*left_motor) {
//Busca a primeira parede e para ao encontra-la
unsigned short left_dist, right_dist;
right_motor->speed = 30;
left_motor->speed = 30;
set_motors_speed(right_motor, left_motor);
do {
left_dist = read_sonar(3);
right_dist = read_sonar(5);
}
while (left_dist > 1200 && right_dist > 1200);
right_motor->speed = 0;
left_motor->speed = 0;
set_motors_speed(right_motor, left_motor);
}
| [
"mc404@localhost.localdomain"
] | mc404@localhost.localdomain |
8cadb2a55eb7647462315a92de216c73efe3d1d6 | 572cee95cd60e5bffe3aeee6132f0409efc5eda8 | /generateproject/EIFGENs/generateproject/W_code/C1/ge958.c | 0320138edc785a9888cf1e7601f9192436ba743a | [] | no_license | crodom/Testing-for-Project | 323416f8cb09a322c2d968421385f78eb51ee513 | a6dab6c5161333a1860e9e824d9736fe533d920e | refs/heads/master | 2021-07-20T08:28:29.503452 | 2017-10-28T13:00:03 | 2017-10-28T13:00:03 | 108,643,391 | 0 | 0 | null | 2017-10-28T11:24:03 | 2017-10-28T11:24:03 | null | UTF-8 | C | false | false | 1,193 | c | /*
* Code for class GENERATE
*/
#include "eif_eiffel.h"
#include "../E1/estructure.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void F958_7078(EIF_REFERENCE);
extern void EIF_Minit958(void);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* {GENERATE}.make */
void F958_7078 (EIF_REFERENCE Current)
{
GTCX
char *l_feature_name = "make";
RTEX;
EIF_TYPED_VALUE ur1x = {{0}, SK_REF};
#define ur1 ur1x.it_r
EIF_REFERENCE tr1 = NULL;
RTSN;
RTDA;
RTLD;
RTLI(3);
RTLR(0,tr1);
RTLR(1,ur1);
RTLR(2,Current);
RTLIU(3);
RTLU (SK_VOID, NULL);
RTLU (SK_REF, &Current);
RTEAA(l_feature_name, 957, Current, 0, 0, 13351);
RTSA(Dtype(Current));
RTSC;
RTME(Dtype(Current), 0);
RTGC;
RTDBGEAA(957, Current, 13351);
RTIV(Current, RTAL);
RTHOOK(1);
tr1 = RTMS_EX_H("Hello Eiffel World!\012",20,1206243338);
ur1 = tr1;
(FUNCTION_CAST(void, (EIF_REFERENCE, EIF_TYPED_VALUE)) RTWF(30, Dtype(Current)))(Current, ur1x);
RTVI(Current, RTAL);
RTRS;
RTHOOK(2);
RTDBGLE;
RTMD(0);
RTLE;
RTLO(2);
RTEE;
#undef ur1
}
void EIF_Minit958 (void)
{
GTCX
}
#ifdef __cplusplus
}
#endif
| [
"crodom@bluewin.ch"
] | crodom@bluewin.ch |
f219380096f4307b1eb930f39c1d1fe5b3f70b09 | a876814998869c75c379cc57c593f50b1d07e1ca | /callByValue.c | 72f3b79c954dace3e2918024a174edadee893167 | [] | no_license | karorimesh/c_programming | 45dde71383a9a036c97809d98a4c5a2ba49fa0e2 | 3899dc675459cc2d7242de45a793eca020a60a6a | refs/heads/master | 2023-09-01T11:32:16.443749 | 2021-10-05T11:12:57 | 2021-10-05T11:12:57 | 411,176,667 | 1 | 0 | null | null | null | null | UTF-8 | C | false | false | 486 | c | //
// Created by Student1 on 10/1/2021.
//
#include <stdio.h>
//Prototype
void swap(int,int);
int main(){
int a,b;
a=10,b=20;
printf("Values before swap a = %d, b = %d",a,b);
swap(a,b);
printf("Values after swap a = %d, b = %d",a,b);
return 0;
}
void swap(int a, int b){
int temp;
printf("Values in function before swap a = %d, b = %d",a,b);
a = temp;
a = b;
b = temp;
printf("Values in function after swap a = %d, b = %d",a,b);
}
| [
"karorimesh@gmail.com"
] | karorimesh@gmail.com |
169f75d5a4819f0e4e35eb5f7aedfaec972a7590 | 1a2eca50d932696507542a1f952d52d8e224260a | /src/main/c/jni-common.h | 0f50804b36ddfea5d64a4c9e1d858d4be1e54c65 | [] | no_license | simonhaines/icedtea-sound | d2add7bd32feb817008fb136bf63b6304dd31d6b | 601c25bedf944fbff2840c926eb4ab0b32ae4e4a | refs/heads/master | 2023-02-03T07:05:56.639723 | 2020-12-20T03:30:51 | 2020-12-20T03:30:51 | 322,149,386 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 3,596 | h | /* jni-common.h
Copyright (C) 2008 Red Hat, Inc.
This file is part of IcedTea-Sound.
IcedTea-Sound is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 2.
IcedTea-Sound 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 IcedTea-Sound; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.
*/
#ifndef _JNI_COMMON_H
#define _JNI_COMMON_H
#include <jni.h>
/*
* This file contains some commonly used functions
*
*/
// Sets the field with name field_name from jclass clz to pa_prefix_field_name.
#define SET_JAVA_STATIC_LONG_FIELD_TO_PA_ENUM(env, clz, java_prefix, pa_prefix, name) \
do { \
char *java_full_name = #java_prefix #name; \
jfieldID fid = (*env)->GetStaticFieldID(env, clz, java_full_name, "J"); \
assert(fid); \
(*env)->SetStaticLongField(env, clz, fid, PA_##pa_prefix##_##name); \
} while(0);
typedef struct java_context_t {
JNIEnv* env;
jobject obj;
} java_context_t;
/* Exception Handling */
void throwByName(JNIEnv* const env, const char* const name,
const char* const msg);
#define ILLEGAL_ARGUMENT_EXCEPTION "java/lang/IllegalArgumentException"
#define ILLEGAL_STATE_EXCEPTION "java/lang/IllegalStateException"
/* Threading and Synchronization */
jobject getLockObject(JNIEnv* env);
void notifyWaitingOperations(JNIEnv* env);
/* Storing and Loading Values */
jint getJavaIntField(JNIEnv* env, jobject obj, char* fieldName);
void setJavaIntField(JNIEnv* env, jobject obj, char* fieldName, jint value);
jlong getJavaLongField(JNIEnv* env, jobject obj, char* name);
void setJavaLongField(JNIEnv* env, jobject, char* name, jlong value);
jbyteArray getJavaByteArrayField(JNIEnv* env, jobject obj, char* name);
void setJavaByteArrayField(JNIEnv* env, jobject obj, char* name,
jbyteArray array);
/* Pointers and Java */
void* getJavaPointer(JNIEnv* env, jobject obj, char* name);
void setJavaPointer(JNIEnv* env, jobject obj, char*name, void* pointer_value);
void* convertJavaPointerToNative(JNIEnv* env, jbyteArray pointer);
jbyteArray convertNativePointerToJava(JNIEnv* env, void* pointer);
/* Calling Java Functions */
void callJavaVoidMethod(JNIEnv* env, jobject obj, const char* method_name);
#endif
| [
"simon.haines@scalardata.com"
] | simon.haines@scalardata.com |
7a2d4e85e1a8aebd5aa75c9b1172dd6bea2a303d | 806c23cba0d7fd3ea07a358eda573c28179c25ca | /13/13/13.c | 16df9e7dedc8f1747cbfc362a4002f697832f2c2 | [] | no_license | yuyonshen/147852 | e1219be90cb6d1b118309e2fd8dfa80f11a8ac68 | 1017d583191051b3551180b5895f48863d28d942 | refs/heads/master | 2020-09-21T12:59:26.097697 | 2020-04-01T08:30:02 | 2020-04-01T08:30:02 | 224,795,574 | 0 | 0 | null | null | null | null | GB18030 | C | false | false | 472 | c | #include<stdio.h>
struct student//结构体与函数
{
int num;
char *name;
char sex;
float score;
char *rank;
};
void grade(struct student *p)
{
if (p->score < 60)
p->rank = "PAIL";
else
p->rank = "SUCCESS";
}
void print(struct student s)
{
printf("num=%d\nname=%s\nsex=%c\nscore=%f\nrank=%s\n\n", s.num, s.name, s.sex, s.score, s.rank);
}
void main(){
struct student stu1 = { 102, "zhang ping", 'M', 78.5 };
grade(&stu1);
print(stu1);
system("pause");
} | [
"2280629901@qq.com"
] | 2280629901@qq.com |
b2962fb8f326b817dcda2ee5beb015d68ef7e1fa | d33c3de4cd681d84fecb38223201d6b7ddb7357b | /src/sool/Memory/Vector/VectorUint16_array.c | 406d486a1d6adcd973e662f089a80b057ed8e0ea | [] | no_license | rayvburn/STM32_SOOL | d216e6e466e193e564194e4562192ae20ae9fbf6 | c5ad0c636e04da2f6d228eed385dca6f2d0f2cb2 | refs/heads/master | 2021-11-14T01:25:33.556587 | 2021-05-22T14:59:45 | 2021-05-22T14:59:45 | 236,792,595 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,097 | c | /*
* VectorUint16_array.c
*
* Created on: 09.08.2019
* Author: user
*/
#include "sool/Memory/Vector/VectorUint16_array.h"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uint8_t SOOL_Memory_Vector_Uint16_Extend(SOOL_Vector_Uint16 *v_ptr, uint8_t size_curr) {
if ( size_curr == 0 ) {
/* -------------- Allocate memory -------------- */
v_ptr = (SOOL_Vector_Uint16 *)calloc( (size_t)1, sizeof(SOOL_Vector_Uint16) );
if ( v_ptr != NULL ) {
return (1);
}
return (0);
} else {
/* -------------- Resize buffer -------------- */
/* Backup some info */
uint16_t *ptr_backup = v_ptr;
/* Try to reallocate memory */
v_ptr = realloc( (SOOL_Vector_Uint16*)v_ptr->_data, (size_curr + 1) * sizeof(SOOL_Vector_Uint16) );
/* Check if the reallocation was successful */
if ( v_ptr != NULL ) {
return (1);
}
/* If the reallocation failed - restore a previous pointer and return 0 */
v_ptr = ptr_backup;
// TODO: some error message
return (0);
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| [
"j.karwowski@stud.elka.pw.edu.pl"
] | j.karwowski@stud.elka.pw.edu.pl |
85eb931d8c88dd63a9f1a2f77d62af88d4b959ce | a5a5fefedca01bcb299e4a4b99a33d5922d13cda | /src/java/native/com_libmailcore_NativeObject.h | 39b7bd6123067867cd2149da76f0606fd88a3a52 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | agent8/mailcore2 | 1d56023f5e6a0513140ab85ebb21c5fcb7a87656 | bed5864b06704353264d442fd70eabd5bd20a319 | refs/heads/master | 2023-08-31T01:07:24.947784 | 2023-08-25T10:23:10 | 2023-08-25T10:23:10 | 41,720,802 | 1 | 0 | NOASSERTION | 2023-08-25T10:23:12 | 2015-09-01T06:19:52 | C++ | UTF-8 | C | false | true | 1,618 | h | /* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class com_libmailcore_NativeObject */
#ifndef _Included_com_libmailcore_NativeObject
#define _Included_com_libmailcore_NativeObject
#ifdef __cplusplus
extern "C" {
#endif
#undef com_libmailcore_NativeObject_serialVersionUID
#define com_libmailcore_NativeObject_serialVersionUID 1LL
/*
* Class: com_libmailcore_NativeObject
* Method: initWithNative
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_com_libmailcore_NativeObject_initWithNative
(JNIEnv *, jobject, jlong);
/*
* Class: com_libmailcore_NativeObject
* Method: unsetupNative
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_libmailcore_NativeObject_unsetupNative
(JNIEnv *, jobject);
/*
* Class: com_libmailcore_NativeObject
* Method: toString
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_libmailcore_NativeObject_toString
(JNIEnv *, jobject);
/*
* Class: com_libmailcore_NativeObject
* Method: clone
* Signature: ()Ljava/lang/Object;
*/
JNIEXPORT jobject JNICALL Java_com_libmailcore_NativeObject_clone
(JNIEnv *, jobject);
/*
* Class: com_libmailcore_NativeObject
* Method: serializableData
* Signature: ()[B
*/
JNIEXPORT jbyteArray JNICALL Java_com_libmailcore_NativeObject_serializableData
(JNIEnv *, jobject);
/*
* Class: com_libmailcore_NativeObject
* Method: importSerializableData
* Signature: ([B)V
*/
JNIEXPORT void JNICALL Java_com_libmailcore_NativeObject_importSerializableData
(JNIEnv *, jobject, jbyteArray);
#ifdef __cplusplus
}
#endif
#endif
| [
"dinh.viet.hoa@gmail.com"
] | dinh.viet.hoa@gmail.com |
e96dff35f1ae19421fa9768b1b9ca520047c9134 | 24ae6d51b0a12d0671771a21fff35109f5f45148 | /app/BCM53101 sdk-all-6.5.7/src/shared/swstate/access/sw_state_dpp_soc_arad_pp_bfd_access.c | 8505c158561f605c9ed177bf12924e8a4f5110c1 | [] | no_license | jiaotilizi/cross | e3b7d37856353a20c55f0ddf4c49aaf3c36c79fc | aa3c064fc0fe0494129ddd57114a6f538175b205 | refs/heads/master | 2020-04-08T14:47:57.798814 | 2018-11-03T09:16:17 | 2018-11-03T09:16:17 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 17,193 | c | /* $Id: $
*
* $Copyright: (c) 2016 Broadcom.
* Broadcom Proprietary and Confidential. All rights reserved.$
*
* DO NOT EDIT THIS FILE!
* This file is auto-generated.
* Edits to this file will be lost when it is regenerated.
*/
#include <sal/core/libc.h>
#include <shared/swstate/sw_state.h>
#include <shared/error.h>
#include <shared/swstate/sw_state_defs.h>
#include <shared/bsl.h>
#include <shared/swstate/access/sw_state_access.h>
#include <shared/swstate/access/sw_state_dpp_soc_arad_pp_bfd_access.h>
#ifdef _ERR_MSG_MODULE_NAME
#error "_ERR_MSG_MODULE_NAME redefined"
#endif
#define _ERR_MSG_MODULE_NAME BSL_LS_SHARED_SWSTATE
extern shr_sw_state_t *sw_state[BCM_MAX_NUM_UNITS];
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_set(int unit, CONST ARAD_PP_BFD_SW_STATE *bfd){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.bfd.verify( unit));
SHR_SW_STATE_MEMSET(
unit,
sw_state[unit]->dpp.soc.arad.pp->bfd[0],
bfd,
ARAD_PP_BFD_SW_STATE,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_bfd_set");
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_get(int unit, ARAD_PP_BFD_SW_STATE *bfd){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.bfd.verify( unit));
*bfd = sw_state[unit]->dpp.soc.arad.pp->bfd[0];
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_alloc(int unit){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_ALLOC(
unit,
sw_state[unit]->dpp.soc.arad.pp->bfd,
sizeof(ARAD_PP_BFD_SW_STATE),
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_bfd_alloc");
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_is_allocated(int unit, uint8 *is_allocated){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_IS_ALLOC(
unit,
sw_state[unit]->dpp.soc.arad.pp->bfd,
is_allocated,
SW_STATE_NONE,
"sw_state_dpp_soc_arad_pp_bfd_alloc");
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_free(int unit){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_FREE(
unit,
sw_state[unit]->dpp.soc.arad.pp->bfd,
SW_STATE_NONE,
"sw_state_dpp_soc_arad_pp_bfd_alloc");
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_verify(int unit){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.verify( unit);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_NULL_ACCESS_CHECK(sw_state[unit]->dpp.soc.arad.pp->bfd);
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_trap_code_trap_to_cpu_set(int unit, uint32 trap_code_trap_to_cpu){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_trap_to_cpu.verify( unit));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->bfd->trap_code_trap_to_cpu,
trap_code_trap_to_cpu,
uint32,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_bfd_trap_code_trap_to_cpu_set");
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_trap_code_trap_to_cpu_get(int unit, uint32 *trap_code_trap_to_cpu){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_trap_to_cpu.verify( unit));
*trap_code_trap_to_cpu = sw_state[unit]->dpp.soc.arad.pp->bfd->trap_code_trap_to_cpu;
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_trap_code_trap_to_cpu_verify(int unit){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.bfd.verify( unit);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_cc_mpls_tp_set(int unit, uint32 trap_code_oamp_bfd_cc_mpls_tp){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_oamp_bfd_cc_mpls_tp.verify( unit));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->bfd->trap_code_oamp_bfd_cc_mpls_tp,
trap_code_oamp_bfd_cc_mpls_tp,
uint32,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_cc_mpls_tp_set");
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_cc_mpls_tp_get(int unit, uint32 *trap_code_oamp_bfd_cc_mpls_tp){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_oamp_bfd_cc_mpls_tp.verify( unit));
*trap_code_oamp_bfd_cc_mpls_tp = sw_state[unit]->dpp.soc.arad.pp->bfd->trap_code_oamp_bfd_cc_mpls_tp;
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_cc_mpls_tp_verify(int unit){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.bfd.verify( unit);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_ipv4_set(int unit, uint32 trap_code_oamp_bfd_ipv4){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_oamp_bfd_ipv4.verify( unit));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->bfd->trap_code_oamp_bfd_ipv4,
trap_code_oamp_bfd_ipv4,
uint32,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_ipv4_set");
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_ipv4_get(int unit, uint32 *trap_code_oamp_bfd_ipv4){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_oamp_bfd_ipv4.verify( unit));
*trap_code_oamp_bfd_ipv4 = sw_state[unit]->dpp.soc.arad.pp->bfd->trap_code_oamp_bfd_ipv4;
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_ipv4_verify(int unit){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.bfd.verify( unit);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_mpls_set(int unit, uint32 trap_code_oamp_bfd_mpls){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_oamp_bfd_mpls.verify( unit));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->bfd->trap_code_oamp_bfd_mpls,
trap_code_oamp_bfd_mpls,
uint32,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_mpls_set");
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_mpls_get(int unit, uint32 *trap_code_oamp_bfd_mpls){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_oamp_bfd_mpls.verify( unit));
*trap_code_oamp_bfd_mpls = sw_state[unit]->dpp.soc.arad.pp->bfd->trap_code_oamp_bfd_mpls;
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_mpls_verify(int unit){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.bfd.verify( unit);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_pwe_set(int unit, uint32 trap_code_oamp_bfd_pwe){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_oamp_bfd_pwe.verify( unit));
SHR_SW_STATE_SET(
unit,
sw_state[unit]->dpp.soc.arad.pp->bfd->trap_code_oamp_bfd_pwe,
trap_code_oamp_bfd_pwe,
uint32,
SW_STATE_IS_WB_CHECK | SW_STATE_ALLOW_AUTOSYNC,
"sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_pwe_set");
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_pwe_get(int unit, uint32 *trap_code_oamp_bfd_pwe){
SW_STATE_INIT_FUNC_DEFS;
SHR_SW_STATE_VERIFY( sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_oamp_bfd_pwe.verify( unit));
*trap_code_oamp_bfd_pwe = sw_state[unit]->dpp.soc.arad.pp->bfd->trap_code_oamp_bfd_pwe;
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
/* AUTO-GENERATED - DO NOT MODIFY */
int sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_pwe_verify(int unit){
SW_STATE_INIT_FUNC_DEFS;
_rv = sw_state_access[unit].dpp.soc.arad.pp.bfd.verify( unit);
_SOC_IF_ERR_EXIT(_rv);
SW_STATE_FUNC_RETURN;
}
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
int
sw_state_dpp_soc_arad_pp_bfd_access_cb_init(int unit){
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.set = sw_state_dpp_soc_arad_pp_bfd_set;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.get = sw_state_dpp_soc_arad_pp_bfd_get;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.alloc = sw_state_dpp_soc_arad_pp_bfd_alloc;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.is_allocated = sw_state_dpp_soc_arad_pp_bfd_is_allocated;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.free = sw_state_dpp_soc_arad_pp_bfd_free;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.verify = sw_state_dpp_soc_arad_pp_bfd_verify;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_trap_to_cpu.set = sw_state_dpp_soc_arad_pp_bfd_trap_code_trap_to_cpu_set;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_trap_to_cpu.get = sw_state_dpp_soc_arad_pp_bfd_trap_code_trap_to_cpu_get;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_trap_to_cpu.verify = sw_state_dpp_soc_arad_pp_bfd_trap_code_trap_to_cpu_verify;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_oamp_bfd_cc_mpls_tp.set = sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_cc_mpls_tp_set;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_oamp_bfd_cc_mpls_tp.get = sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_cc_mpls_tp_get;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_oamp_bfd_cc_mpls_tp.verify = sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_cc_mpls_tp_verify;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_oamp_bfd_ipv4.set = sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_ipv4_set;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_oamp_bfd_ipv4.get = sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_ipv4_get;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_oamp_bfd_ipv4.verify = sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_ipv4_verify;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_oamp_bfd_mpls.set = sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_mpls_set;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_oamp_bfd_mpls.get = sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_mpls_get;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_oamp_bfd_mpls.verify = sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_mpls_verify;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_oamp_bfd_pwe.set = sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_pwe_set;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_oamp_bfd_pwe.get = sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_pwe_get;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
#if defined(BCM_PETRA_SUPPORT)
#ifdef BCM_PETRA_SUPPORT
sw_state_access[unit].dpp.soc.arad.pp.bfd.trap_code_oamp_bfd_pwe.verify = sw_state_dpp_soc_arad_pp_bfd_trap_code_oamp_bfd_pwe_verify;
#endif /* BCM_PETRA_SUPPORT*/
#endif /* defined(BCM_PETRA_SUPPORT)*/
return _SHR_E_NONE;
}
#undef _ERR_MSG_MODULE_NAME
| [
"andy.4.liu@nokia-sbell.com"
] | andy.4.liu@nokia-sbell.com |
365c2896d251ea3984222a5a979769ae5c626ed2 | fe01b163455ccdd9279cbd2a53fd03ef750b8ef2 | /src/pipes/pipe_ls_wc.c | cdca7dc22f9dd56b6fbe575c61996e0400f8d5aa | [] | no_license | ysouyno/study_notes_the_linux_programming_interface | bc9e1d5fccbeae8caed5a07f720dceabb73b4cbb | 67110b1589e43493382f50134c9b6313bc98a6e8 | refs/heads/master | 2021-06-12T12:35:56.529501 | 2019-12-09T06:01:42 | 2019-12-09T06:01:42 | 186,344,621 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,721 | c | #include <sys/wait.h>
#include "tlpi_hdr.h"
int main(int argc, char *argv[])
{
int pfd[2];
if (pipe(pfd) == -1) {
errExit("pipe");
}
switch (fork()) {
case -1:
errExit("fork");
case 0: // Firsh child: exec `ls` to write to pipe
if (close(pfd[0]) == -1) { // Read end is unused
errExit("close 1");
}
// Duplicate stdout on write end of pipe; close duplicated descriptor
if (pfd[1] != STDOUT_FILENO) { // Defensive check
if (dup2(pfd[1], STDOUT_FILENO) == -1) {
errExit("dup2 1");
}
if (close(pfd[1]) == -1) {
errExit("close 2");
}
}
execlp("ls", "ls", (char *)NULL); // Writes to pipe
errExit("execlp ls");
default: // Parent falls through to create next child
break;
}
switch (fork()) {
case -1:
errExit("fork");
case 0: // Second child: exec `wc` to read from pipe
if (close(pfd[1]) == -1) { // Write end is unused
errExit("close 3");
}
// Duplicate stdin on read end of pipe; close duplicated descriptor
if (pfd[0] != STDIN_FILENO) { // Defensive check
if (dup2(pfd[0], STDIN_FILENO) == -1) {
errExit("dup2 2");
}
if (close(pfd[0]) == -1) {
errExit("close 4");
}
}
execlp("wc", "wc", "-l", (char *)NULL); // Reads from pipe
errExit("execlp wc");
default: // Parent falls through
break;
}
// Parent closes unused file descriptors for pipe, and waits for children
if (close(pfd[0]) == -1) {
errExit("close 5");
}
if (close(pfd[1]) == -1) {
errExit("close 6");
}
if (wait(NULL) == -1) {
errExit("wait 1");
}
if (wait(NULL) == -1) {
errExit("wait 2");
}
exit(EXIT_SUCCESS);
}
| [
"ysouyno@163.com"
] | ysouyno@163.com |
5c6b9e95298969d302bcf38bad444fe9388d6766 | d51198a1cecf4f7db0bb36f7e18946e9aaca33f0 | /mu_platform_nxp/MU_BASECORE/UefiCpuPkg/CpuMpPei/CpuBist.c | 57fec08bf449fb129f32ea55e3360d5ce21e155c | [
"BSD-2-Clause"
] | permissive | nlshipp/WinIoT-Coral | 96b2f05865fdf2d43ea2dfe7bf932bda8f8fb123 | 015e0bc3384feddc8f85e78412d478549e65e64c | refs/heads/master | 2022-10-15T16:08:43.588577 | 2020-03-25T14:54:10 | 2021-06-28T04:46:03 | 226,706,431 | 0 | 0 | null | 2020-04-15T20:53:23 | 2019-12-08T17:40:07 | C | UTF-8 | C | false | false | 10,555 | c | /** @file
Update and publish processors' BIST information.
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CpuMpPei.h"
EFI_SEC_PLATFORM_INFORMATION2_PPI mSecPlatformInformation2Ppi = {
SecPlatformInformation2
};
EFI_PEI_PPI_DESCRIPTOR mPeiSecPlatformInformation2Ppi = {
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEfiSecPlatformInformation2PpiGuid,
&mSecPlatformInformation2Ppi
};
/**
Implementation of the PlatformInformation2 service in EFI_SEC_PLATFORM_INFORMATION2_PPI.
@param PeiServices The pointer to the PEI Services Table.
@param StructureSize The pointer to the variable describing size of the input buffer.
@param PlatformInformationRecord2 The pointer to the EFI_SEC_PLATFORM_INFORMATION_RECORD2.
@retval EFI_SUCCESS The data was successfully returned.
@retval EFI_BUFFER_TOO_SMALL The buffer was too small. The current buffer size needed to
hold the record is returned in StructureSize.
**/
EFI_STATUS
EFIAPI
SecPlatformInformation2 (
IN CONST EFI_PEI_SERVICES **PeiServices,
IN OUT UINT64 *StructureSize,
OUT EFI_SEC_PLATFORM_INFORMATION_RECORD2 *PlatformInformationRecord2
)
{
EFI_HOB_GUID_TYPE *GuidHob;
VOID *DataInHob;
UINTN DataSize;
GuidHob = GetFirstGuidHob (&gEfiSecPlatformInformation2PpiGuid);
if (GuidHob == NULL) {
*StructureSize = 0;
return EFI_SUCCESS;
}
DataInHob = GET_GUID_HOB_DATA (GuidHob);
DataSize = GET_GUID_HOB_DATA_SIZE (GuidHob);
//
// return the information from BistHob
//
if ((*StructureSize) < (UINT64) DataSize) {
*StructureSize = (UINT64) DataSize;
return EFI_BUFFER_TOO_SMALL;
}
*StructureSize = (UINT64) DataSize;
CopyMem (PlatformInformationRecord2, DataInHob, DataSize);
return EFI_SUCCESS;
}
/**
Worker function to get CPUs' BIST by calling SecPlatformInformationPpi
or SecPlatformInformation2Ppi.
@param PeiServices Pointer to PEI Services Table
@param Guid PPI Guid
@param PpiDescriptor Return a pointer to instance of the
EFI_PEI_PPI_DESCRIPTOR
@param BistInformationData Pointer to BIST information data
@param BistInformationSize Return the size in bytes of BIST information
@retval EFI_SUCCESS Retrieve of the BIST data successfully
@retval EFI_NOT_FOUND No sec platform information(2) ppi export
@retval EFI_DEVICE_ERROR Failed to get CPU Information
**/
EFI_STATUS
GetBistInfoFromPpi (
IN CONST EFI_PEI_SERVICES **PeiServices,
IN CONST EFI_GUID *Guid,
OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor,
OUT VOID **BistInformationData,
OUT UINT64 *BistInformationSize OPTIONAL
)
{
EFI_STATUS Status;
EFI_SEC_PLATFORM_INFORMATION2_PPI *SecPlatformInformation2Ppi;
EFI_SEC_PLATFORM_INFORMATION_RECORD2 *SecPlatformInformation2;
UINT64 InformationSize;
Status = PeiServicesLocatePpi (
Guid, // GUID
0, // INSTANCE
PpiDescriptor, // EFI_PEI_PPI_DESCRIPTOR
(VOID **)&SecPlatformInformation2Ppi // PPI
);
if (Status == EFI_NOT_FOUND) {
return EFI_NOT_FOUND;
}
if (Status == EFI_SUCCESS) {
//
// Get the size of the sec platform information2(BSP/APs' BIST data)
//
InformationSize = 0;
SecPlatformInformation2 = NULL;
Status = SecPlatformInformation2Ppi->PlatformInformation2 (
PeiServices,
&InformationSize,
SecPlatformInformation2
);
if (Status == EFI_BUFFER_TOO_SMALL) {
Status = PeiServicesAllocatePool (
(UINTN) InformationSize,
(VOID **) &SecPlatformInformation2
);
if (Status == EFI_SUCCESS) {
//
// Retrieve BIST data
//
Status = SecPlatformInformation2Ppi->PlatformInformation2 (
PeiServices,
&InformationSize,
SecPlatformInformation2
);
if (Status == EFI_SUCCESS) {
*BistInformationData = SecPlatformInformation2;
if (BistInformationSize != NULL) {
*BistInformationSize = InformationSize;
}
return EFI_SUCCESS;
}
}
}
}
return EFI_DEVICE_ERROR;
}
/**
Collects BIST data from PPI.
This function collects BIST data from Sec Platform Information2 PPI
or SEC Platform Information PPI.
@param PeiServices Pointer to PEI Services Table
**/
VOID
CollectBistDataFromPpi (
IN CONST EFI_PEI_SERVICES **PeiServices
)
{
EFI_STATUS Status;
EFI_PEI_PPI_DESCRIPTOR *SecInformationDescriptor;
EFI_SEC_PLATFORM_INFORMATION_RECORD2 *SecPlatformInformation2;
EFI_SEC_PLATFORM_INFORMATION_RECORD *SecPlatformInformation;
UINTN NumberOfData;
EFI_SEC_PLATFORM_INFORMATION_CPU *CpuInstance;
EFI_SEC_PLATFORM_INFORMATION_CPU BspCpuInstance;
UINTN ProcessorNumber;
UINTN CpuIndex;
EFI_PROCESSOR_INFORMATION ProcessorInfo;
EFI_HEALTH_FLAGS BistData;
UINTN NumberOfProcessors;
UINTN NumberOfEnabledProcessors;
UINTN BistInformationSize;
EFI_SEC_PLATFORM_INFORMATION_RECORD2 *PlatformInformationRecord2;
EFI_SEC_PLATFORM_INFORMATION_CPU *CpuInstanceInHob;
MpInitLibGetNumberOfProcessors(&NumberOfProcessors, &NumberOfEnabledProcessors);
BistInformationSize = sizeof (EFI_SEC_PLATFORM_INFORMATION_RECORD2) +
sizeof (EFI_SEC_PLATFORM_INFORMATION_CPU) * NumberOfProcessors;
Status = PeiServicesAllocatePool (
(UINTN) BistInformationSize,
(VOID **) &PlatformInformationRecord2
);
ASSERT_EFI_ERROR (Status);
PlatformInformationRecord2->NumberOfCpus = (UINT32)NumberOfProcessors;
SecPlatformInformation2 = NULL;
SecPlatformInformation = NULL;
NumberOfData = 0;
CpuInstance = NULL;
//
// Get BIST information from Sec Platform Information2 Ppi firstly
//
Status = GetBistInfoFromPpi (
PeiServices,
&gEfiSecPlatformInformation2PpiGuid,
&SecInformationDescriptor,
(VOID *) &SecPlatformInformation2,
NULL
);
if (Status == EFI_SUCCESS) {
//
// Sec Platform Information2 PPI includes BSP/APs' BIST information
//
NumberOfData = SecPlatformInformation2->NumberOfCpus;
CpuInstance = SecPlatformInformation2->CpuInstance;
} else {
//
// Otherwise, get BIST information from Sec Platform Information Ppi
//
Status = GetBistInfoFromPpi (
PeiServices,
&gEfiSecPlatformInformationPpiGuid,
&SecInformationDescriptor,
(VOID *) &SecPlatformInformation,
NULL
);
if (Status == EFI_SUCCESS) {
NumberOfData = 1;
//
// SEC Platform Information only includes BSP's BIST information
// and does not have BSP's APIC ID
//
BspCpuInstance.CpuLocation = GetInitialApicId ();
BspCpuInstance.InfoRecord.IA32HealthFlags.Uint32 = SecPlatformInformation->IA32HealthFlags.Uint32;
CpuInstance = &BspCpuInstance;
} else {
DEBUG ((EFI_D_INFO, "Does not find any stored CPU BIST information from PPI!\n"));
}
}
for (ProcessorNumber = 0; ProcessorNumber < NumberOfProcessors; ProcessorNumber ++) {
MpInitLibGetProcessorInfo (ProcessorNumber, &ProcessorInfo, &BistData);
for (CpuIndex = 0; CpuIndex < NumberOfData; CpuIndex ++) {
ASSERT (CpuInstance != NULL);
if (ProcessorInfo.ProcessorId == CpuInstance[CpuIndex].CpuLocation) {
//
// Update processor's BIST data if it is already stored before
//
BistData = CpuInstance[CpuIndex].InfoRecord.IA32HealthFlags;
}
}
if (BistData.Uint32 != 0) {
//
// Report Status Code that self test is failed
//
REPORT_STATUS_CODE (
EFI_ERROR_CODE | EFI_ERROR_MAJOR,
(EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_SELF_TEST)
);
}
DEBUG ((EFI_D_INFO, " APICID - 0x%08x, BIST - 0x%08x\n",
(UINT32) ProcessorInfo.ProcessorId,
BistData
));
CpuInstanceInHob = PlatformInformationRecord2->CpuInstance;
CpuInstanceInHob[ProcessorNumber].CpuLocation = (UINT32) ProcessorInfo.ProcessorId;
CpuInstanceInHob[ProcessorNumber].InfoRecord.IA32HealthFlags = BistData;
}
//
// Build SecPlatformInformation2 PPI GUIDed HOB that also could be consumed
// by CPU MP driver to get CPU BIST data
//
BuildGuidDataHob (
&gEfiSecPlatformInformation2PpiGuid,
PlatformInformationRecord2,
(UINTN) BistInformationSize
);
if (SecPlatformInformation2 != NULL) {
if (NumberOfData < NumberOfProcessors) {
//
// Reinstall SecPlatformInformation2 PPI to include new BIST information
//
Status = PeiServicesReInstallPpi (
SecInformationDescriptor,
&mPeiSecPlatformInformation2Ppi
);
ASSERT_EFI_ERROR (Status);
}
} else {
//
// Install SecPlatformInformation2 PPI
//
Status = PeiServicesInstallPpi (&mPeiSecPlatformInformation2Ppi);
ASSERT_EFI_ERROR(Status);
}
}
| [
"nlshipp@yahoo.com"
] | nlshipp@yahoo.com |
442fe536eb4165c931490d4f17cb1e17e83f3b51 | ab493423f33412bb0fad5ca2a1933b8c7f4a778f | /LAB5/Code/libft/ft_tolower.c | 8c9456a29609359f770b5d5c2270922a0a617831 | [] | no_license | ciresannamaria/MIDPS | 01312b7f9dd981894ed80a16a53f6e9c12fac682 | aa93a27db97682a7306a6dd4fbfdafb254968e62 | refs/heads/master | 2023-03-15T16:00:25.985983 | 2017-04-30T09:59:41 | 2017-04-30T09:59:41 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,004 | c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_tolower.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ebitca <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/10/22 13:29:49 by ebitca #+# #+# */
/* Updated: 2016/10/22 13:29:51 by ebitca ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_tolower(int c)
{
if (c >= 'A' && c <= 'Z')
return (c + 32);
else
return (c);
}
| [
"bitca@inbox.ru"
] | bitca@inbox.ru |
94f79d9696e8b3cf7ae3206e38cf97157e14be13 | 9781dfb4c446be3d168543634ffcae86c88c4da6 | /linked_list_test_framework/example.c | 75748ec381005e4aaef2a77182139c6b4dec8170 | [] | no_license | amhats/Linkedlist-inplace-parallel-merge-sort | 402186e3b98602700780bee6a6660a0fe6bfdb80 | 3ebc36f5b6a9987fdc5b420edf26951d61c34017 | refs/heads/master | 2020-04-01T12:13:34.999397 | 2018-10-16T00:20:22 | 2018-10-16T00:20:22 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 914 | c | #include <stdio.h>
#include "test_framework.h"
#include "maple_evaluate.h"
int main(int argc, char** argv) {
ASSERT_EQUAL(1, 0);
parser_test("1 and 0", NULL);
ASSERT_STRING_EQUAL("JOKE", "JOKE");
parser_test("JOKE", NULL);
ASSERT_STRING_EQUAL("JOKE", "joke");
parser_test("JOKE and joke", NULL);
ASSERT_EQUAL(maple_evaluate_equal("[x]-x", "-x"), 0);
parser_test("-x", NULL);
ASSERT_EQUAL(maple_evaluate_equal("[x,y](x+y)^2", "x^2+2*x*y+y^2"), 0);
parser_test("(x+y)^2", NULL);
ASSERT_STRING_EQUAL(maple_evaluate("[x,y,z,t](x+y+z+2*t)^2"), "4*t^2+4*t*x+4*t*y+4*t*z+x^2+2*x*y+2*x*z+y^2+2*y*z+z^2");
parser_test("(x+y+z+2*t)^2", NULL);
ASSERT_STRING_EQUAL(maple_evaluate("[x,y,z,t](1-x-y-z+t)^2"), "t^2-2*t*x-2*t*y-2*t*z+x^2+2*x*y+2*x*z+y^2+2*y*z+z^2+2*t-2*x-2*y-2*z+1");
parser_test("(1-x-y-z+t)^2", NULL);
parser_report();
return (EXIT_SUCCESS);
}
| [
"dummy@dummy"
] | dummy@dummy |
d2bcfb600b13b979ef1f61ce5a6796d9e6708300 | 21b854202b4ffb7c8c45d970d5e524f20636dc6b | /hardware/neopixel/ws2812.h | 39ee152fe9f71de154dde708a582dcc673f0d3b5 | [] | no_license | msgre/europe | ffc290b5bc84aa366f22b6887b8ab6f4b76cc16e | e32e6a85128c55a1a7830627b7e44f1be1a3e582 | refs/heads/master | 2020-04-06T07:12:39.926850 | 2017-12-03T11:54:40 | 2017-12-03T11:54:40 | 31,181,083 | 0 | 1 | null | 2016-04-18T11:25:03 | 2015-02-22T21:19:11 | Eagle | IBM852 | C | false | false | 1,881 | h | /*
* light weight WS2812 lib include
*
* Version 2.4 - Mar 28th, 2016
* Author: Tim (cpldcpu@gmail.com)
*
* Please do not change this file! All configuration is handled in "config.h"
*
* License: GNU GPL v2 (see License.txt)
+
*/
#ifndef LIGHT_WS2812_H_
#define LIGHT_WS2812_H_
#include <avr/io.h>
#include <avr/interrupt.h>
#include "config.h"
/*
* Structure of the LED array
*
* cRGB: RGB for WS2812S/B/C/D, SK6812, SK6812Mini, SK6812WWA, APA104, APA106
* cRGBW: RGBW for SK6812RGBW
*/
struct cRGB { uint8_t g; uint8_t r; uint8_t b; };
struct cRGBW { uint8_t g; uint8_t r; uint8_t b; uint8_t w;};
/* User Interface
*
* Input:
* ledarray: An array of GRB data describing the LED colors
* number_of_leds: The number of LEDs to write
* pinmask (optional): Bitmask describing the output bin. e.g. _BV(PB0)
*
* The functions will perform the following actions:
* - Set the data-out pin as output
* - Send out the LED data
* - Wait 50Ás to reset the LEDs
*/
void ws2812_setleds (struct cRGB *ledarray, uint16_t number_of_leds);
void ws2812_setleds_pin (struct cRGB *ledarray, uint16_t number_of_leds,uint8_t pinmask);
void ws2812_setleds_rgbw(struct cRGBW *ledarray, uint16_t number_of_leds);
/*
* Old interface / Internal functions
*
* The functions take a byte-array and send to the data output as WS2812 bitstream.
* The length is the number of bytes to send - three per LED.
*/
void ws2812_sendarray (uint8_t *array,uint16_t length);
void ws2812_sendarray_mask(uint8_t *array,uint16_t length, uint8_t pinmask);
/*
* Internal defines
*/
#define CONCAT(a, b) a ## b
#define CONCAT_EXP(a, b) CONCAT(a, b)
#define ws2812_PORTREG CONCAT_EXP(PORT,WS2812_PORT)
#define ws2812_DDRREG CONCAT_EXP(DDR,WS2812_PORT)
#endif /* LIGHT_WS2812_H_ */
| [
"slintak@uart.cz"
] | slintak@uart.cz |
4e2a2272c542edc48f135b8b960668197eb20853 | 34db04001db1c6204b7953849cd0852efe548f64 | /pet/tests/struct8.c | 0bc49c4273c6faa85b6829e130e09cdad0e5be9f | [
"MIT"
] | permissive | yaozhujia/ppcg | 8fb676ca370f575e549d75e234b71b17d98acf5f | e5ec097899611c86a238fb7656534a2f77bf6b37 | refs/heads/master | 2020-03-29T00:40:33.926966 | 2020-02-27T01:25:38 | 2020-02-27T01:25:38 | 149,306,257 | 0 | 0 | MIT | 2018-09-18T15:02:50 | 2018-09-18T14:56:45 | C | UTF-8 | C | false | false | 227 | c | struct s {
struct {
struct {
int a[10];
} f[10];
int b;
};
};
void foo()
{
struct s s;
#pragma scop
for (int i = 0; i < 10; ++i)
for (int j = 0; j < 10; ++j)
s.f[i].a[j] = i * j;
s.b = 1;
#pragma endscop
}
| [
"peter.nie@huawei.com"
] | peter.nie@huawei.com |
6c75edb9e9f42ba94d3756c5e6a0241da7f68649 | 8fa5f87889164dc77a95cf7039941c9972a754ca | /libft/ft_strncpy.c | 34ce06a7d55b60707b48e37d4513932b6a8051b0 | [] | no_license | andreeimiron/ACADEMY-PLUS | 32a02eb34cd23038a8935baca33d16c0e875ebce | 7a4f13704be01c3cceb1f25a5c48fd901f871714 | refs/heads/master | 2022-04-19T09:08:11.911355 | 2020-04-13T11:48:49 | 2020-04-13T11:48:49 | 255,309,237 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,108 | c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strncpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: anmiron <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/28 16:55:23 by anmiron #+# #+# */
/* Updated: 2016/12/30 15:16:38 by anmiron ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strncpy(char *dst, const char *src, size_t n)
{
size_t i;
i = 0;
while (i < n && src[i])
{
dst[i] = src[i];
i++;
}
while (i < n)
{
dst[i] = '\0';
i++;
}
return (dst);
}
| [
"andrei.dear@yahoo.com"
] | andrei.dear@yahoo.com |
0d7737875e6d86580556c3c7c6555bff7950a467 | ed7189bcb31973648dca4cb9f0d67cb4653d0e70 | /sysdeps/dripos/include/abi-bits/access.h | 171f75f81b1a9568449de4020ff30b6e6f521fff | [
"MIT"
] | permissive | managarm/mlibc | 6dedaa86ed74f26a52e300d97f6e5949bac0f93c | 74efefb5e9e546adab60a5730d95165334d7ee15 | refs/heads/master | 2023-09-01T05:17:26.709378 | 2023-08-29T08:33:01 | 2023-08-29T08:33:01 | 63,353,495 | 717 | 173 | MIT | 2023-09-10T10:55:53 | 2016-07-14T16:46:51 | C | UTF-8 | C | false | false | 31 | h | ../../../../abis/mlibc/access.h | [
"mstaveleytaylor@gmail.com"
] | mstaveleytaylor@gmail.com |
9959a8e9d2849466133f020e7c4ad2ca14065359 | 9e42660973181e8699f1f917c12db0321c72c1bc | /Task2ATL/Component/stdafx.h | c89ceaccd61694c667f4ff24946118c496a7529a | [] | no_license | terehin11/study | 09b2edafa16c33e17dff749ccc62926436b76335 | faee0b21dfe5986b08fcbb41b4a807b876799da4 | refs/heads/master | 2020-04-28T17:14:04.618548 | 2019-05-12T08:11:32 | 2019-05-12T08:11:32 | 175,438,548 | 1 | 0 | null | null | null | null | WINDOWS-1251 | C | false | false | 720 | h | // stdafx.h: включаемый файл для стандартных системных включаемых файлов
// или включаемых файлов для конкретного проекта, которые часто используются,
// но не часто изменяются
#pragma once
#ifndef STRICT
#define STRICT
#endif
#include "targetver.h"
#define _ATL_APARTMENT_THREADED
#define _ATL_NO_AUTOMATIC_NAMESPACE
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // некоторые конструкторы CString будут явными
#define ATL_NO_ASSERT_ON_DESTROY_NONEXISTENT_WINDOW
#include "resource.h"
#include <atlbase.h>
#include <atlcom.h>
#include <atlctl.h>
| [
"Freddy152@ya.ru"
] | Freddy152@ya.ru |
aabca13b1e987b3b745a9d24921f32ac6b6a1580 | a0c4ed3070ddff4503acf0593e4722140ea68026 | /source/WINDBG/WINDBG/LINE.C | 71e5ffe013d5271f6424fde90bf63a3c7f3c7361 | [] | no_license | cjacker/windows.xp.whistler | a88e464c820fbfafa64fbc66c7f359bbc43038d7 | 9f43e5fef59b44e47ba1da8c2b4197f8be4d4bc8 | refs/heads/master | 2022-12-10T06:47:33.086704 | 2020-09-19T15:06:48 | 2020-09-19T15:06:48 | 299,932,617 | 0 | 1 | null | 2020-09-30T13:43:42 | 2020-09-30T13:43:41 | null | UTF-8 | C | false | false | 1,528 | c | #include "precomp.h"
#pragma hdrstop
/*** DlgLine
**
** Synopsis:
** bool = DlgLine(hDlg, message, wParam, lParam)
**
** Entry:
** hDlg - Handle to current dialog open
** message - dialog message to be processed
** wParam - info about message
** lParam - info about message
**
** Returns:
**
** Description:
** This function processes messages for the "LINE" dialog box.
**
** MESSAGES:
**
** WM_INITDIALOG - Initialize dialog box
** WM_COMMAND- Input received
**
*/
BOOL FAR PASCAL EXPORT
DlgLine(
HWND hDlg,
UINT message,
WPARAM wParam,
LONG lParam
)
{
int y;
Unused(lParam);
switch (message) {
case WM_COMMAND:
switch (wParam) {
case IDOK:
// Retrieve selected item text and compute line nbr
y = GetDlgItemInt(hDlg, ID_LINE_LINE, NULL, FALSE);
if (y <= 0) {
ErrorBox2(hDlg, MB_TASKMODAL, ERR_Goto_Line);
SetFocus(GetDlgItem(hDlg, ID_LINE_LINE));
} else {
GotoLine(curView, y, FALSE);
EndDialog(hDlg, TRUE);
}
return (TRUE);
case IDCANCEL :
EndDialog(hDlg, TRUE);
return (TRUE);
case IDHELP :
Dbg(WinHelp(hDlg,szHelpFileName,HELP_CONTEXT,ID_LINE_HELP));
return (TRUE);
}
break;
}
return (FALSE);
} /* DlgLine() */
| [
"71558585+window-chicken@users.noreply.github.com"
] | 71558585+window-chicken@users.noreply.github.com |
67e58fe2ab87436ca4efe5138dff70809acfc8c9 | 21d1532c413268875af3cea810e933a39099b719 | /danlianbiao/experiment.h | 5e94f8eff66ad94603624b27ca115fffcbb311a7 | [] | no_license | Fanyinsi/A1922fanyinsi | 25d2bb141e1d5a7821c5b70e73dd9d46e9203f30 | f8b51d1cc0c730c381a18aae78193bffcaf4b194 | refs/heads/master | 2023-01-27T21:25:45.147500 | 2020-12-13T16:04:43 | 2020-12-13T16:04:43 | 314,239,979 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 679 | h | #ifndef experiment_h
#define experiment_h
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#define n 11
#define m 3
typedef int dataType;
typedef struct node {
dataType data;
struct node *next;
}LinkList;
typedef struct Node {
int no;
struct Node *next;
}Node;
LinkList* CreatList();
int Size(LinkList *list);
void Insert(LinkList *list, int k, dataType x);
void Delete(LinkList *list, int k);
int Empty(LinkList *list);
dataType GetData(LinkList *list, int k);
LinkList* Find(LinkList *list, dataType x);
void Print(LinkList *list);
void ClearList (LinkList *list);
#endif
| [
"2635858969@qq.com"
] | 2635858969@qq.com |
884f9aa562d3c66d5dad367d52e3020e9e20ea10 | fa53cc8d858ae79f21ac24028046c674bd8411fa | /sr/arch.h | 200a5db4f6ac9a80af325ce701273974254a23a3 | [
"LicenseRef-scancode-public-domain"
] | permissive | programming-langugages/lexical_analysis | 797e0f97508fd29ac885bd9e68c168eef64ab4b5 | 55bbd3a73d3d0be71fe16fcb83501dc926a9e7d3 | refs/heads/master | 2020-07-31T19:18:15.126504 | 2019-09-25T04:09:44 | 2019-09-25T04:09:44 | 210,724,633 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 3,216 | h | /* arch.h - define symbols according to host architecture.
*
* ARCH descriptive name of the architecture
* SFILE assembly language code (.s) file to include in runtime system
* LOW_REAL low(real), if not obtainable from <float.h>
* HIGH_REAL high(real)
* BIGCC arguments passed to CC to enlarge tree space (if needed)
*/
#ifndef ARCH
#ifdef apollo
#if _ISP__M68K == 1
#define ARCH "Motorola 68000 (Apollo)"
#define SFILE "ap3000.s"
#endif
#endif
#ifdef hp9000s800
#define ARCH "HP Precision"
#define SFILE "precision.s"
#endif
#ifdef i386
#define ARCH "Intel 386"
#define SFILE "i386.s"
#define LOW_REAL 2.2250738585072023e-308
#define HIGH_REAL 1.797693134862315e+308
#ifdef sequent
#define BIGCC "-W0,-Nt3000"
#endif
#endif
#ifdef __mips
#ifndef mips
#define mips
#endif
#endif
#ifdef mips
#if defined(_ABIN32)
#define ARCH "SGI N32"
#define SFILE "sgi.s"
#elif defined(_ABI64)
#define ARCH "SGI N64"
ERROR ERROR ERROR -- N64 ABI is not supported
#else
#define ARCH "MIPS"
#define SFILE "mips.s"
#endif
/* max value limited so as to be acceptable to Iris cc & printf */
#define LOW_REAL 2.2250738585072014e-308
#define HIGH_REAL 1.797693134862313e+308
#ifndef __DECC
#define BIGCC "-Wf,-XNh3000"
#endif
#endif /*mips*/
#ifdef __alpha
#define ARCH "alpha"
#define SFILE "alpha.s"
#endif
#ifdef mc68000
#define ARCH "Motorola 68000"
#define SFILE "m68k.s"
#define LOW_REAL 4.94065645841246544e-324
#define HIGH_REAL 1.797693134862315708e+308
#endif
#ifdef sysV68
#define ARCH "Motorola 68000 (System V/68)"
#define SFILE "v68.s"
#define LOW_REAL 4.94065645841246544e-324
#define HIGH_REAL 1.797693134862315708e+308
#endif
#ifdef hp9000s300
#define ARCH "Motorola 68000 (HP-UX)"
#define SFILE "bobcat.s"
#define LOW_REAL 4.94065645841246544e-324
#define HIGH_REAL 1.797693134862315708e+308
#define BIGCC "+Ne700"
#endif
#ifdef __m88k__
#define ARCH "Motorola 88000"
#define SFILE "m88k.s"
#endif
#ifdef ns32000
#define ARCH "National 32000"
#define SFILE "encore.s"
/*
* Real range is from <values.h> although neither number printf's as shown.
* HIGH_REAL should be 1.7976931348623140e+308 but that causes floating exceptn.
*/
#define LOW_REAL 2.2250738585072030e-308
#define HIGH_REAL 1.7976931348622e+308
#define NO_FMOD /* no fmod() in math library */
#endif
#ifdef _AIX
#define ARCH "IBM RS/6000"
#define SFILE "rs6000.s"
#endif
#ifdef sparc
#define ARCH "SPARC"
#define SFILE "sparc.s"
#define HIGH_REAL 1.797693134862315708e+308 /* from <values.h> */
#ifdef __svr4__
#define LOW_REAL 2.2251e-308 /* empirical; limited by Solaris asm */
#else
#define LOW_REAL 4.94065645841246544e-324
#endif
#endif
#ifdef tahoe /* hope that's right... perhaps "cci"?... */
#define ARCH "Tahoe"
#define SFILE "tahoe.s"
#endif
#ifdef hcx
#define ARCH "Harris"
#define SFILE "tahoe.s"
#endif
#ifdef vax
#define ARCH "Vax"
#define SFILE "vax.s"
#endif
#ifdef __PARAGON__
#define ARCH "Intel Paragon"
#define SFILE "paragon.s"
#define HIGH_REAL 1.7976931348623157e+308 /* from <values.h> */
#define LOW_REAL 2.2251e-308 /* empirical cc minimum */
#endif
#endif /* ARCH */
/* If no architecture was selected, we have an error */
#ifndef ARCH
ERROR -- no architecture selected
#endif
| [
"nrestrepot@unal.edu.co"
] | nrestrepot@unal.edu.co |
f5c4cd1f6f89b619716c713ea6d6d1dfbc93b868 | a33db1cd48a511308f177fe81a7b8b5cb895da3b | /Progetto_Tesi_2015/HardCoded_Sort/permutation.c | 2dceaa5eede993fa17f9c778a18b911dfd775f44 | [] | no_license | MOlivato/Progetto_Tesi_2015 | bef3b97997741de2e3df94f5df1c4210de419143 | 6d344df99ef0fbbe755fe2f7b979868bb6ea0a4a | refs/heads/master | 2021-01-10T17:03:28.779337 | 2016-02-03T14:33:03 | 2016-02-03T14:33:03 | 49,413,823 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 3,597 | c | #include <stdio.h>
#include <math.h>
int globalcounter=0;
FILE *f;
//Funzione che stampa un vettore
void printv(int v[], int n){
int i;
for(i=0;i<n;i++)
printf(" %i", v[i]);
printf("\n");
}
//Funzione che copia un vettore v in w
void copyv(int v[], int w[], int nmax){
int i;
for(i=0;i<nmax;i++)
w[i]=v[i];
}
//Funzione che scambia due elementi di un vettore
void swap(int v[], int a, int b){
int c = v[a];
v[a] = v[b];
v[b] = c;
}
//Funzione che esegue il setup del vettore con elementi da 0 a nmax-1
void setup_vector(int v[], int nmax){
int i;
for(i=0;i<nmax;i++)
v[i]=i;
}
//Stampo il vettore sul file
void printvf(int v[], int nmax, int back){
int i=0;
for(i=0;i<nmax;i++)
fprintf(f, "%i ", v[i]);
if(back) fprintf(f, "\n");
}
//Funzione che ordina con il minor numero di scritture nel vettore
int cyclesort(int v[], int nmax){
int i, j, change, temp, temppos;
//Scorro gli elementi nel vettore
for(i=0; i<nmax; i++){
temp=v[i];
//Valuto la posizione in cui dovrò inserire l'elemento
temppos = i;
for(j=i+1; j<nmax; j++)
if(temp>v[j])
temppos++;
//Se l'elemento è già nella posizione ordinata non lo riscrivo e continuo
if(temppos == i) continue;
fprintf(f, " %i",i);
//Altrimenti inizio a riposizionare ciclicamente gli elementi nella loro posizione corretta
while(temppos != i){
fprintf(f, " %i",temppos);
//Se ho più elementi con lo stesso valore rimappo la posizione
while(temp == v[temppos]) temppos++;
//Inserisco l'elemento nella sua posizione
change = v[temppos];
v[temppos]=temp;
temp=change;
//globalcounter++;
//usleep(100);
//Trovo la mia prossima posizione
temppos = i;
for(j=i+1; j<nmax; j++)
if(temp>v[j])
temppos++;
}
//Scrivo nella posizione di arrivo l'elemento salvato in temp
v[temppos]=temp;
fprintf(f, " %i",temppos);
//globalcounter++;
//usleep(100);
}
fprintf(f, "\n");
}
//Trasformo un vettore di binari in numero intero
int binvtoint(int v[], int nmax){
int i, j, temp=1;
for(i=nmax-1;i>=0;i--)
if(v[i]==1)
temp += pow(2,nmax-1-i);
return temp;
}
//Funzione che tenta di enumerare la combinazione
void enum_combo(int v[], int nmax){
int i,j;
int c[nmax*(nmax-1)/2];
int n=0;
for(i=0;i<nmax;i++)
for(j=i+1;j<nmax;j++){
fprintf(f, "%i ", (v[i]<v[j]?1:0));
c[n]=(v[i]<v[j]?1:0);
n++;
}
fprintf(f, " : %i : ",binvtoint(c,n));
}
//Funzione che tenta di enumerare la combinazione
void enum_combo2(int v[], int nmax){
int i,j;
int c[nmax*(nmax-1)/2];
int n=0;
for(i=1;i<nmax;i++)
for(j=0;j<nmax-i;j++){
fprintf(f, "%i ", (v[j]<=v[j+i]?1:0));
c[n]=(v[j]<=v[j+i]?1:0);
n++;
}
fprintf(f, " : %i : ",binvtoint(c,n));
}
//Funzione che genera tutte le permutazioni di un vettore di interi
void permute(int v[], int l, int r, int nmax){
int i;
int temp[nmax];
if(l == r){
enum_combo2(v, nmax);
printvf(v, nmax, 0);
//Copio il vettore in quello temporaneo
copyv(v, temp, nmax);
fprintf(f, " : ");
//Stampo i cicli trovati dal cyclesort
cyclesort(temp, nmax);
}else{
for(i=l;i<=r;i++){
swap(v, l, i);
permute(v, l+1, r, nmax);
swap(v, l, i);
}
}
}
int main(int argc, char *argv[]) {
//Recupero il numero di elementi da generare
int nmax;
nmax = atoi(argv[1]);
int intervallo = nmax;
int v[nmax];
f = fopen("file.txt", "w");
if(f == NULL){
printf("Error opening file!\n");
return(1);
}
setup_vector(v,nmax);
//printv(v, nmax);
permute(v,0,nmax-1,nmax);
fclose(f);
}
| [
"matteoolivato@yahoo.it"
] | matteoolivato@yahoo.it |
7d2e3e45cf901067140337d7cda81527a6381401 | 4fb2940150e1279168ee69c71e7cffd96e2f6920 | /arch/arm/mach-at91/board-sam9261ek.c | 7e9e9ae975b586a3c450e05c6d2251ae2b3123e9 | [] | no_license | mhrsolanki2020/Dhollmen_Kernel | 740d33825301dd191cc6243f5fc7ef9cb67ed3fb | c144e86a40e514c21c28621ba43f37fae8f1c0d1 | refs/heads/master | 2021-01-18T20:17:29.719478 | 2014-04-15T00:16:49 | 2014-04-15T00:16:49 | 19,468,965 | 0 | 1 | null | null | null | null | UTF-8 | C | false | false | 14,979 | c | /*
* linux/arch/arm/mach-at91/board-sam9261ek.c
*
* Copyright (C) 2005 SAN People
* Copyright (C) 2006 Atmel
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <linux/types.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
#include <linux/spi/ads7846.h>
#include <linux/spi/at73c213.h>
#include <linux/clk.h>
#include <linux/dm9000.h>
#include <linux/fb.h>
#include <linux/gpio_keys.h>
#include <linux/input.h>
#include <video/atmel_lcdc.h>
#include <asm/setup.h>
#include <asm/mach-types.h>
#include <asm/irq.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/irq.h>
#include <mach/hardware.h>
#include <mach/board.h>
#include <mach/gpio.h>
#include <mach/at91sam9_smc.h>
#include <mach/at91_shdwc.h>
#include <mach/system_rev.h>
#include "sam9_smc.h"
#include "generic.h"
static void __init ek_init_early(void)
{
/* Initialize processor: 18.432 MHz crystal */
at91sam9261_initialize(18432000);
/* Setup the LEDs */
at91_init_leds(AT91_PIN_PA13, AT91_PIN_PA14);
/* DBGU on ttyS0. (Rx & Tx only) */
at91_register_uart(0, 0, 0);
/* set serial console to ttyS0 (ie, DBGU) */
at91_set_serial_console(0);
}
static void __init ek_init_irq(void)
{
at91sam9261_init_interrupts(NULL);
}
/*
* DM9000 ethernet device
*/
#if defined(CONFIG_DM9000)
static struct resource dm9000_resource[] = {
[0] = {
.start = AT91_CHIPSELECT_2,
.end = AT91_CHIPSELECT_2 + 3,
.flags = IORESOURCE_MEM
},
[1] = {
.start = AT91_CHIPSELECT_2 + 0x44,
.end = AT91_CHIPSELECT_2 + 0xFF,
.flags = IORESOURCE_MEM
},
[2] = {
.start = AT91_PIN_PC11,
.end = AT91_PIN_PC11,
.flags = IORESOURCE_IRQ
| IORESOURCE_IRQ_LOWEDGE | IORESOURCE_IRQ_HIGHEDGE,
}
};
static struct dm9000_plat_data dm9000_platdata = {
.flags = DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM,
};
static struct platform_device dm9000_device = {
.name = "dm9000",
.id = 0,
.num_resources = ARRAY_SIZE(dm9000_resource),
.resource = dm9000_resource,
.dev = {
.platform_data = &dm9000_platdata,
}
};
/*
* SMC timings for the DM9000.
* Note: These timings were calculated for MASTER_CLOCK = 100000000 according to the DM9000 timings.
*/
static struct sam9_smc_config __initdata dm9000_smc_config = {
.ncs_read_setup = 0,
.nrd_setup = 2,
.ncs_write_setup = 0,
.nwe_setup = 2,
.ncs_read_pulse = 8,
.nrd_pulse = 4,
.ncs_write_pulse = 8,
.nwe_pulse = 4,
.read_cycle = 16,
.write_cycle = 16,
.mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_BAT_WRITE | AT91_SMC_DBW_16,
.tdf_cycles = 1,
};
static void __init ek_add_device_dm9000(void)
{
/* Configure chip-select 2 (DM9000) */
sam9_smc_configure(2, &dm9000_smc_config);
/* Configure Reset signal as output */
at91_set_gpio_output(AT91_PIN_PC10, 0);
/* Configure Interrupt pin as input, no pull-up */
at91_set_gpio_input(AT91_PIN_PC11, 0);
platform_device_register(&dm9000_device);
}
#else
static void __init ek_add_device_dm9000(void) {}
#endif /* CONFIG_DM9000 */
/*
* USB Host Port
*/
static struct at91_usbh_data __initdata ek_usbh_data = {
.ports = 2,
};
/*
* USB Device Port
*/
static struct at91_udc_data __initdata ek_udc_data = {
.vbus_pin = AT91_PIN_PB29,
.pullup_pin = 0, /* pull-up driven by UDC */
};
/*
* NAND flash
*/
static struct mtd_partition __initdata ek_nand_partition[] = {
{
.name = "Partition 1",
.offset = 0,
.size = SZ_256K,
},
{
.name = "Partition 2",
.offset = MTDPART_OFS_NXTBLK,
.size = MTDPART_SIZ_FULL,
},
};
static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
{
*num_partitions = ARRAY_SIZE(ek_nand_partition);
return ek_nand_partition;
}
static struct atmel_nand_data __initdata ek_nand_data = {
.ale = 22,
.cle = 21,
// .det_pin = ... not connected
.rdy_pin = AT91_PIN_PC15,
.enable_pin = AT91_PIN_PC14,
.partition_info = nand_partitions,
};
static struct sam9_smc_config __initdata ek_nand_smc_config = {
.ncs_read_setup = 0,
.nrd_setup = 1,
.ncs_write_setup = 0,
.nwe_setup = 1,
.ncs_read_pulse = 3,
.nrd_pulse = 3,
.ncs_write_pulse = 3,
.nwe_pulse = 3,
.read_cycle = 5,
.write_cycle = 5,
.mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE,
.tdf_cycles = 2,
};
static void __init ek_add_device_nand(void)
{
ek_nand_data.bus_width_16 = board_have_nand_16bit();
/* setup bus-width (8 or 16) */
if (ek_nand_data.bus_width_16)
ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
else
ek_nand_smc_config.mode |= AT91_SMC_DBW_8;
/* configure chip-select 3 (NAND) */
sam9_smc_configure(3, &ek_nand_smc_config);
at91_add_device_nand(&ek_nand_data);
}
/*
* SPI related devices
*/
#if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
/*
* ADS7846 Touchscreen
*/
#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
static int ads7843_pendown_state(void)
{
return !at91_get_gpio_value(AT91_PIN_PC2); /* Touchscreen PENIRQ */
}
static struct ads7846_platform_data ads_info = {
.model = 7843,
.x_min = 150,
.x_max = 3830,
.y_min = 190,
.y_max = 3830,
.vref_delay_usecs = 100,
.x_plate_ohms = 450,
.y_plate_ohms = 250,
.pressure_max = 15000,
.debounce_max = 1,
.debounce_rep = 0,
.debounce_tol = (~0),
.get_pendown_state = ads7843_pendown_state,
};
static void __init ek_add_device_ts(void)
{
at91_set_B_periph(AT91_PIN_PC2, 1); /* External IRQ0, with pullup */
at91_set_gpio_input(AT91_PIN_PA11, 1); /* Touchscreen BUSY signal */
}
#else
static void __init ek_add_device_ts(void) {}
#endif
/*
* Audio
*/
static struct at73c213_board_info at73c213_data = {
.ssc_id = 1,
#if defined(CONFIG_MACH_AT91SAM9261EK)
.shortname = "AT91SAM9261-EK external DAC",
#else
.shortname = "AT91SAM9G10-EK external DAC",
#endif
};
#if defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE)
static void __init at73c213_set_clk(struct at73c213_board_info *info)
{
struct clk *pck2;
struct clk *plla;
pck2 = clk_get(NULL, "pck2");
plla = clk_get(NULL, "plla");
/* AT73C213 MCK Clock */
at91_set_B_periph(AT91_PIN_PB31, 0); /* PCK2 */
clk_set_parent(pck2, plla);
clk_put(plla);
info->dac_clk = pck2;
}
#else
static void __init at73c213_set_clk(struct at73c213_board_info *info) {}
#endif
/*
* SPI devices
*/
static struct spi_board_info ek_spi_devices[] = {
{ /* DataFlash chip */
.modalias = "mtd_dataflash",
.chip_select = 0,
.max_speed_hz = 15 * 1000 * 1000,
.bus_num = 0,
},
#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
{
.modalias = "ads7846",
.chip_select = 2,
.max_speed_hz = 125000 * 26, /* (max sample rate @ 3V) * (cmd + data + overhead) */
.bus_num = 0,
.platform_data = &ads_info,
.irq = AT91SAM9261_ID_IRQ0,
.controller_data = (void *) AT91_PIN_PA28, /* CS pin */
},
#endif
#if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
{ /* DataFlash card - jumper (J12) configurable to CS3 or CS0 */
.modalias = "mtd_dataflash",
.chip_select = 3,
.max_speed_hz = 15 * 1000 * 1000,
.bus_num = 0,
},
#elif defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE)
{ /* AT73C213 DAC */
.modalias = "at73c213",
.chip_select = 3,
.max_speed_hz = 10 * 1000 * 1000,
.bus_num = 0,
.mode = SPI_MODE_1,
.platform_data = &at73c213_data,
.controller_data = (void*) AT91_PIN_PA29, /* default for CS3 is PA6, but it must be PA29 */
},
#endif
};
#else /* CONFIG_SPI_ATMEL_* */
/* spi0 and mmc/sd share the same PIO pins: cannot be used at the same time */
/*
* MCI (SD/MMC)
* det_pin, wp_pin and vcc_pin are not connected
*/
static struct at91_mmc_data __initdata ek_mmc_data = {
.wire4 = 1,
};
#endif /* CONFIG_SPI_ATMEL_* */
/*
* LCD Controller
*/
#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
#if defined(CONFIG_FB_ATMEL_STN)
/* STN */
static struct fb_videomode at91_stn_modes[] = {
{
.name = "SP06Q002 @ 75",
.refresh = 75,
.xres = 320, .yres = 240,
.pixclock = KHZ2PICOS(1440),
.left_margin = 1, .right_margin = 1,
.upper_margin = 0, .lower_margin = 0,
.hsync_len = 1, .vsync_len = 1,
.sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
.vmode = FB_VMODE_NONINTERLACED,
},
};
static struct fb_monspecs at91fb_default_stn_monspecs = {
.manufacturer = "HIT",
.monitor = "SP06Q002",
.modedb = at91_stn_modes,
.modedb_len = ARRAY_SIZE(at91_stn_modes),
.hfmin = 15000,
.hfmax = 64000,
.vfmin = 50,
.vfmax = 150,
};
#define AT91SAM9261_DEFAULT_STN_LCDCON2 (ATMEL_LCDC_MEMOR_LITTLE \
| ATMEL_LCDC_DISTYPE_STNMONO \
| ATMEL_LCDC_CLKMOD_ALWAYSACTIVE \
| ATMEL_LCDC_IFWIDTH_4 \
| ATMEL_LCDC_SCANMOD_SINGLE)
static void at91_lcdc_stn_power_control(int on)
{
/* backlight */
if (on) { /* power up */
at91_set_gpio_value(AT91_PIN_PC14, 0);
at91_set_gpio_value(AT91_PIN_PC15, 0);
} else { /* power down */
at91_set_gpio_value(AT91_PIN_PC14, 1);
at91_set_gpio_value(AT91_PIN_PC15, 1);
}
}
static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
.default_bpp = 1,
.default_dmacon = ATMEL_LCDC_DMAEN,
.default_lcdcon2 = AT91SAM9261_DEFAULT_STN_LCDCON2,
.default_monspecs = &at91fb_default_stn_monspecs,
.atmel_lcdfb_power_control = at91_lcdc_stn_power_control,
.guard_time = 1,
#if defined(CONFIG_MACH_AT91SAM9G10EK)
.lcd_wiring_mode = ATMEL_LCDC_WIRING_RGB,
#endif
};
#else
/* TFT */
static struct fb_videomode at91_tft_vga_modes[] = {
{
.name = "TX09D50VM1CCA @ 60",
.refresh = 60,
.xres = 240, .yres = 320,
.pixclock = KHZ2PICOS(4965),
.left_margin = 1, .right_margin = 33,
.upper_margin = 1, .lower_margin = 0,
.hsync_len = 5, .vsync_len = 1,
.sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
.vmode = FB_VMODE_NONINTERLACED,
},
};
static struct fb_monspecs at91fb_default_tft_monspecs = {
.manufacturer = "HIT",
.monitor = "TX09D50VM1CCA",
.modedb = at91_tft_vga_modes,
.modedb_len = ARRAY_SIZE(at91_tft_vga_modes),
.hfmin = 15000,
.hfmax = 64000,
.vfmin = 50,
.vfmax = 150,
};
#define AT91SAM9261_DEFAULT_TFT_LCDCON2 (ATMEL_LCDC_MEMOR_LITTLE \
| ATMEL_LCDC_DISTYPE_TFT \
| ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)
static void at91_lcdc_tft_power_control(int on)
{
if (on)
at91_set_gpio_value(AT91_PIN_PA12, 0); /* power up */
else
at91_set_gpio_value(AT91_PIN_PA12, 1); /* power down */
}
static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
.lcdcon_is_backlight = true,
.default_bpp = 16,
.default_dmacon = ATMEL_LCDC_DMAEN,
.default_lcdcon2 = AT91SAM9261_DEFAULT_TFT_LCDCON2,
.default_monspecs = &at91fb_default_tft_monspecs,
.atmel_lcdfb_power_control = at91_lcdc_tft_power_control,
.guard_time = 1,
#if defined(CONFIG_MACH_AT91SAM9G10EK)
.lcd_wiring_mode = ATMEL_LCDC_WIRING_RGB,
#endif
};
#endif
#else
static struct atmel_lcdfb_info __initdata ek_lcdc_data;
#endif
/*
* GPIO Buttons
*/
#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
static struct gpio_keys_button ek_buttons[] = {
{
.gpio = AT91_PIN_PA27,
.code = BTN_0,
.desc = "Button 0",
.active_low = 1,
.wakeup = 1,
},
{
.gpio = AT91_PIN_PA26,
.code = BTN_1,
.desc = "Button 1",
.active_low = 1,
.wakeup = 1,
},
{
.gpio = AT91_PIN_PA25,
.code = BTN_2,
.desc = "Button 2",
.active_low = 1,
.wakeup = 1,
},
{
.gpio = AT91_PIN_PA24,
.code = BTN_3,
.desc = "Button 3",
.active_low = 1,
.wakeup = 1,
}
};
static struct gpio_keys_platform_data ek_button_data = {
.buttons = ek_buttons,
.nbuttons = ARRAY_SIZE(ek_buttons),
};
static struct platform_device ek_button_device = {
.name = "gpio-keys",
.id = -1,
.num_resources = 0,
.dev = {
.platform_data = &ek_button_data,
}
};
static void __init ek_add_device_buttons(void)
{
at91_set_gpio_input(AT91_PIN_PA27, 1); /* btn0 */
at91_set_deglitch(AT91_PIN_PA27, 1);
at91_set_gpio_input(AT91_PIN_PA26, 1); /* btn1 */
at91_set_deglitch(AT91_PIN_PA26, 1);
at91_set_gpio_input(AT91_PIN_PA25, 1); /* btn2 */
at91_set_deglitch(AT91_PIN_PA25, 1);
at91_set_gpio_input(AT91_PIN_PA24, 1); /* btn3 */
at91_set_deglitch(AT91_PIN_PA24, 1);
platform_device_register(&ek_button_device);
}
#else
static void __init ek_add_device_buttons(void) {}
#endif
/*
* LEDs
*/
static struct gpio_led ek_leds[] = {
{ /* "bottom" led, green, userled1 to be defined */
.name = "ds7",
.gpio = AT91_PIN_PA14,
.active_low = 1,
.default_trigger = "none",
},
{ /* "top" led, green, userled2 to be defined */
.name = "ds8",
.gpio = AT91_PIN_PA13,
.active_low = 1,
.default_trigger = "none",
},
{ /* "power" led, yellow */
.name = "ds1",
.gpio = AT91_PIN_PA23,
.default_trigger = "heartbeat",
}
};
static void __init ek_board_init(void)
{
/* Serial */
at91_add_device_serial();
/* USB Host */
at91_add_device_usbh(&ek_usbh_data);
/* USB Device */
at91_add_device_udc(&ek_udc_data);
/* I2C */
at91_add_device_i2c(NULL, 0);
/* NAND */
ek_add_device_nand();
/* DM9000 ethernet */
ek_add_device_dm9000();
/* spi0 and mmc/sd share the same PIO pins */
#if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
/* SPI */
at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
/* Touchscreen */
ek_add_device_ts();
/* SSC (to AT73C213) */
at73c213_set_clk(&at73c213_data);
at91_add_device_ssc(AT91SAM9261_ID_SSC1, ATMEL_SSC_TX);
#else
/* MMC */
at91_add_device_mmc(0, &ek_mmc_data);
#endif
/* LCD Controller */
at91_add_device_lcdc(&ek_lcdc_data);
/* Push Buttons */
ek_add_device_buttons();
/* LEDs */
at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
}
#if defined(CONFIG_MACH_AT91SAM9261EK)
MACHINE_START(AT91SAM9261EK, "Atmel AT91SAM9261-EK")
#else
MACHINE_START(AT91SAM9G10EK, "Atmel AT91SAM9G10-EK")
#endif
/* Maintainer: Atmel */
.timer = &at91sam926x_timer,
.map_io = at91sam9261_map_io,
.init_early = ek_init_early,
.init_irq = ek_init_irq,
.init_machine = ek_board_init,
MACHINE_END
| [
"usuario@localhost.localdomain"
] | usuario@localhost.localdomain |
e6b2901185f3cc0011a0fa4b1cd514eb880223e2 | c65dc5e1e8b02335dbc83b5d93fbf340db9287e2 | /baek/ch/math2/11653.c | 993454845459c1d66c8eabeb953da7adc8c10e73 | [] | no_license | YeJunJi/C_Project | a432a9509cb3f566efd2bff826d1cf19dc7fc4bb | faab343ea31f1f3c32aaebacf0552b314c5e5a09 | refs/heads/master | 2023-03-27T20:30:47.987016 | 2021-03-24T14:59:10 | 2021-03-24T14:59:10 | 298,241,508 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 150 | c | #include <stdio.h>
int main(){
int n,p=2;
scanf("%d", &n);
while(n!=1){
if(n%p==0){
n/=p;
printf("%d\n", p);
}
else{
p++;
}
}
} | [
"yj201244@gmail.com"
] | yj201244@gmail.com |
ed736d9e1b11bd1c3d0f64ccee5c7ed1b280ebd1 | 33737aaaacc54925fab6bda2a01f92612f747990 | /c_files/mmult.c | ff18abadd3be4e44eaff2f6b16b605a2622649de | [] | no_license | cglagovich/cs1645_project | 5f15ca35527d06165216629c2ea952b5e181a87f | 72d041ee41322e3049fa78ebca30bd30590e233b | refs/heads/master | 2020-09-22T13:32:44.997484 | 2019-12-01T19:31:23 | 2019-12-01T19:31:23 | 225,217,185 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,720 | c | #include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include <omp.h>
#define NROW 1024
#define NCOL NROW
#define TEST_RESULTS
//Input Array A
int inputArrayA [NROW][NCOL];
//Input Array B
int inputArrayB [NROW][NCOL];
//Output Array C
long outputArrayC [NROW][NCOL];
struct timeval startTime;
struct timeval finishTime;
double timeIntervalLength;
int main(int argc, char* argv[])
{
int i,j,k;
double totalSum;
//INITIALIZE ARRAYS
for(i=0;i<NROW;i++)
{
for(j=0;j<NCOL;j++)
{
inputArrayA[i][j]= i*NCOL+j;
inputArrayB[i][j]= j*NCOL+i;
outputArrayC[i][j]= 0;
}
}
//Get the start time
gettimeofday(&startTime, NULL); /* START TIME */
#pragma omp parallel for default(none) \
shared(outputArrayC, inputArrayA, inputArrayB) \
private(i, j, k) schedule(dynamic)
for(i=0; i < NROW; i++)
{
for(j=0; j<NCOL; j++)
{
long temp = 0;
for(k=0;k<NROW;k++)
{
temp+=inputArrayA[i][k]*inputArrayB[k][j];
}
outputArrayC[i][j] = temp;
}
}
//Get the end time
gettimeofday(&finishTime, NULL); /* END TIME */
#ifdef TEST_RESULTS
//CALCULATE TOTAL SUM
//[Just for verification]
totalSum=0;
//
for(i=0;i<NROW;i++)
{
for(j=0;j<NCOL;j++)
{
totalSum+=(double)outputArrayC[i][j];
}
}
//printf("\nTotal Sum = %g\n",totalSum);
#endif
//Calculate the interval length
timeIntervalLength = (double)(finishTime.tv_sec-startTime.tv_sec) * 1000000
+ (double)(finishTime.tv_usec-startTime.tv_usec);
timeIntervalLength=timeIntervalLength/1000;
//Print the interval length
printf("%g", timeIntervalLength);
return 0;
}
| [
"cglagovich@gmail.com"
] | cglagovich@gmail.com |
f3fe26211f69da9ca338b8a050264a23e60ca8ef | d74ce539ac88be352aa6f76999391b76447385fb | /Temp/il2cppOutput/il2cppOutput/UnityEngine.InputLegacyModule_CodeGen.c | d292836455257a1c10668ed2b9ff117b588f3d03 | [] | no_license | MoNireu/Iceberg | 3df3cf4cf6782016f834859f5d437ae07e4b19b4 | d5b6f3086ed93c136255f64fbd90b4374ab0a254 | refs/heads/master | 2022-12-19T01:56:44.427608 | 2020-09-26T12:03:10 | 2020-09-26T12:03:10 | 293,477,758 | 0 | 0 | null | 2020-09-26T12:03:16 | 2020-09-07T09:09:30 | C# | UTF-8 | C | false | false | 11,734 | c | #include "pch-c.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include "codegen/il2cpp-codegen-metadata.h"
IL2CPP_EXTERN_C_BEGIN
IL2CPP_EXTERN_C_END
// 0x00000001 System.Int32 UnityEngine.Touch::get_fingerId()
extern void Touch_get_fingerId_mCED0E66949120E69BFE9294DC0A11A6F9FDBD129_AdjustorThunk ();
// 0x00000002 UnityEngine.Vector2 UnityEngine.Touch::get_position()
extern void Touch_get_position_mE32B04C6DA32A0965C403A31847ED7F1725EA1DE_AdjustorThunk ();
// 0x00000003 UnityEngine.TouchPhase UnityEngine.Touch::get_phase()
extern void Touch_get_phase_m576EA3F4FE1D12EB85510326AD8EC3C2EB267257_AdjustorThunk ();
// 0x00000004 UnityEngine.TouchType UnityEngine.Touch::get_type()
extern void Touch_get_type_m33FB24B6A53A307E8AC9881ED3B483DD4B44C050_AdjustorThunk ();
// 0x00000005 UnityEngine.GameObject UnityEngine.CameraRaycastHelper::RaycastTry(UnityEngine.Camera,UnityEngine.Ray,System.Single,System.Int32)
extern void CameraRaycastHelper_RaycastTry_m8AA2714ED46E79851C77B83A3916C515D7280FD1 ();
// 0x00000006 UnityEngine.GameObject UnityEngine.CameraRaycastHelper::RaycastTry2D(UnityEngine.Camera,UnityEngine.Ray,System.Single,System.Int32)
extern void CameraRaycastHelper_RaycastTry2D_mAA0B0BAC7BE8A2F640A236BB6655EB47E5408C9D ();
// 0x00000007 UnityEngine.GameObject UnityEngine.CameraRaycastHelper::RaycastTry_Injected(UnityEngine.Camera,UnityEngine.Ray&,System.Single,System.Int32)
extern void CameraRaycastHelper_RaycastTry_Injected_mFAED8F3DC204691A92849F36D8BC69CFE68F43E8 ();
// 0x00000008 UnityEngine.GameObject UnityEngine.CameraRaycastHelper::RaycastTry2D_Injected(UnityEngine.Camera,UnityEngine.Ray&,System.Single,System.Int32)
extern void CameraRaycastHelper_RaycastTry2D_Injected_m1AB3B5B899C17D5D6FC41D8F8CF2BE549F7D9F21 ();
// 0x00000009 System.Boolean UnityEngine.Input::GetKeyInt(UnityEngine.KeyCode)
extern void Input_GetKeyInt_mCBF4A2379EF913E589DFF4AE9C9407D0AC6B4E4D ();
// 0x0000000A System.Boolean UnityEngine.Input::GetKeyUpInt(UnityEngine.KeyCode)
extern void Input_GetKeyUpInt_mBF5453011D089E0D585F38D8BC72AB743CE243BE ();
// 0x0000000B System.Boolean UnityEngine.Input::GetKeyDownInt(UnityEngine.KeyCode)
extern void Input_GetKeyDownInt_mEAC027107792507CA7F0B1DFBEA4E6289CDCCCBA ();
// 0x0000000C System.Single UnityEngine.Input::GetAxis(System.String)
extern void Input_GetAxis_m939297DEB2ECF8D8D09AD66EB69979AAD2B62326 ();
// 0x0000000D System.Single UnityEngine.Input::GetAxisRaw(System.String)
extern void Input_GetAxisRaw_mC07AC23FD8D04A69CDB07C6399C93FFFAEB0FC5B ();
// 0x0000000E System.Boolean UnityEngine.Input::GetButton(System.String)
extern void Input_GetButton_m95EE8314087068F3AA9CEF3C3F6A246D55C4734C ();
// 0x0000000F System.Boolean UnityEngine.Input::GetButtonDown(System.String)
extern void Input_GetButtonDown_m2001112EBCA3D5C7B0344EF62C896667F7E67DDF ();
// 0x00000010 System.Boolean UnityEngine.Input::GetButtonUp(System.String)
extern void Input_GetButtonUp_m15AA6B42BD0DDCC7802346E49F30653D750260DD ();
// 0x00000011 System.Boolean UnityEngine.Input::GetMouseButton(System.Int32)
extern void Input_GetMouseButton_m27BF2DDBF38A38787B83A13D3E6F0F88F7C834C1 ();
// 0x00000012 System.Boolean UnityEngine.Input::GetMouseButtonDown(System.Int32)
extern void Input_GetMouseButtonDown_m466D81FDCC87C9CB07557B39DCB435EB691F1EF3 ();
// 0x00000013 System.Boolean UnityEngine.Input::GetMouseButtonUp(System.Int32)
extern void Input_GetMouseButtonUp_m2BA562F8C4FE8364EEC93970093E776371DF4022 ();
// 0x00000014 UnityEngine.Touch UnityEngine.Input::GetTouch(System.Int32)
extern void Input_GetTouch_m6A2A31482B1A7D018C3AAC188C02F5D14500C81F ();
// 0x00000015 System.Boolean UnityEngine.Input::GetKey(UnityEngine.KeyCode)
extern void Input_GetKey_mFDD450A4C61F2930928B12287FFBD1ACCB71E429 ();
// 0x00000016 System.Boolean UnityEngine.Input::GetKeyUp(UnityEngine.KeyCode)
extern void Input_GetKeyUp_mDE9D56FE11715566D4D54FD96F8E1EF9734D225F ();
// 0x00000017 System.Boolean UnityEngine.Input::GetKeyDown(UnityEngine.KeyCode)
extern void Input_GetKeyDown_m476116696E71771641BBECBAB1A4C55E69018220 ();
// 0x00000018 UnityEngine.Vector3 UnityEngine.Input::get_mousePosition()
extern void Input_get_mousePosition_m79528BC2F30C57054641F709C855130AE586AC0E ();
// 0x00000019 UnityEngine.Vector2 UnityEngine.Input::get_mouseScrollDelta()
extern void Input_get_mouseScrollDelta_m018B3C74FC710A166684FC8391CAC93D8EC0ADB7 ();
// 0x0000001A UnityEngine.IMECompositionMode UnityEngine.Input::get_imeCompositionMode()
extern void Input_get_imeCompositionMode_m04AD6A8C7FEE55E7C4F70885DB5AF222E9F904E5 ();
// 0x0000001B System.Void UnityEngine.Input::set_imeCompositionMode(UnityEngine.IMECompositionMode)
extern void Input_set_imeCompositionMode_m7D4AA771F1F616FE74A97CA186C4B55EF268E112 ();
// 0x0000001C System.String UnityEngine.Input::get_compositionString()
extern void Input_get_compositionString_mF957B324E35155878D307CE2AEE0AACC9BEC25BD ();
// 0x0000001D UnityEngine.Vector2 UnityEngine.Input::get_compositionCursorPos()
extern void Input_get_compositionCursorPos_m70946478FB2B607BC3BC5EC1280AA217323518B3 ();
// 0x0000001E System.Void UnityEngine.Input::set_compositionCursorPos(UnityEngine.Vector2)
extern void Input_set_compositionCursorPos_mA2A9D63F782E3C75F065F031C67C2A1363D47D9C ();
// 0x0000001F System.Boolean UnityEngine.Input::get_mousePresent()
extern void Input_get_mousePresent_mBCACCE1C97E146FF46C7AE7FFE693F7BAB4E4FE5 ();
// 0x00000020 System.Int32 UnityEngine.Input::get_touchCount()
extern void Input_get_touchCount_mE1A06AB1973E3456AE398B3CC5105F27CC7335D6 ();
// 0x00000021 System.Boolean UnityEngine.Input::get_touchSupported()
extern void Input_get_touchSupported_mE5B2F5199B4CC16D89AD2C3125B5CB38F4B4867B ();
// 0x00000022 System.Void UnityEngine.Input::GetTouch_Injected(System.Int32,UnityEngine.Touch&)
extern void Input_GetTouch_Injected_m19710838FFBDDC3E60536B0932D3B5A392BE539D ();
// 0x00000023 System.Void UnityEngine.Input::get_mousePosition_Injected(UnityEngine.Vector3&)
extern void Input_get_mousePosition_Injected_m4E5460D301ECE27CC322AB79C0914A4503ABC06E ();
// 0x00000024 System.Void UnityEngine.Input::get_mouseScrollDelta_Injected(UnityEngine.Vector2&)
extern void Input_get_mouseScrollDelta_Injected_m8B072340853637C9CF5A23CEA63ED51B14886EC9 ();
// 0x00000025 System.Void UnityEngine.Input::get_compositionCursorPos_Injected(UnityEngine.Vector2&)
extern void Input_get_compositionCursorPos_Injected_mE31464243AB1819574A268B942B5667B03F4822E ();
// 0x00000026 System.Void UnityEngine.Input::set_compositionCursorPos_Injected(UnityEngine.Vector2&)
extern void Input_set_compositionCursorPos_Injected_m4B961AC7900B41DDBFBA03BE2F65F49C030CCB4D ();
// 0x00000027 System.Void UnityEngine.SendMouseEvents::SetMouseMoved()
extern void SendMouseEvents_SetMouseMoved_mEC659144183FB490A2E1F12112C8F08569A511CD ();
// 0x00000028 System.Void UnityEngine.SendMouseEvents::DoSendMouseEvents(System.Int32)
extern void SendMouseEvents_DoSendMouseEvents_m21561D473C27F19BA9CDBC53B4A13D40DDFBE785 ();
// 0x00000029 System.Void UnityEngine.SendMouseEvents::SendEvents(System.Int32,UnityEngine.SendMouseEvents_HitInfo)
extern void SendMouseEvents_SendEvents_m7A59BBFBB15C1BF3E47D56CDD4921599A686F9C7 ();
// 0x0000002A System.Void UnityEngine.SendMouseEvents::.cctor()
extern void SendMouseEvents__cctor_m6B63654E024F338414361C995EAFEC615743A0E0 ();
// 0x0000002B System.Void UnityEngine.SendMouseEvents_HitInfo::SendMessage(System.String)
extern void HitInfo_SendMessage_m2D813691948EAB9CDA487A3B8668678EABFCFA62_AdjustorThunk ();
// 0x0000002C System.Boolean UnityEngine.SendMouseEvents_HitInfo::op_Implicit(UnityEngine.SendMouseEvents_HitInfo)
extern void HitInfo_op_Implicit_m8332A3930623A2248D797F3A8020FFF4E05A9420 ();
// 0x0000002D System.Boolean UnityEngine.SendMouseEvents_HitInfo::Compare(UnityEngine.SendMouseEvents_HitInfo,UnityEngine.SendMouseEvents_HitInfo)
extern void HitInfo_Compare_m3AD170E7A52826C73DEF8C3C8F6507C9EAB28363 ();
static Il2CppMethodPointer s_methodPointers[45] =
{
Touch_get_fingerId_mCED0E66949120E69BFE9294DC0A11A6F9FDBD129_AdjustorThunk,
Touch_get_position_mE32B04C6DA32A0965C403A31847ED7F1725EA1DE_AdjustorThunk,
Touch_get_phase_m576EA3F4FE1D12EB85510326AD8EC3C2EB267257_AdjustorThunk,
Touch_get_type_m33FB24B6A53A307E8AC9881ED3B483DD4B44C050_AdjustorThunk,
CameraRaycastHelper_RaycastTry_m8AA2714ED46E79851C77B83A3916C515D7280FD1,
CameraRaycastHelper_RaycastTry2D_mAA0B0BAC7BE8A2F640A236BB6655EB47E5408C9D,
CameraRaycastHelper_RaycastTry_Injected_mFAED8F3DC204691A92849F36D8BC69CFE68F43E8,
CameraRaycastHelper_RaycastTry2D_Injected_m1AB3B5B899C17D5D6FC41D8F8CF2BE549F7D9F21,
Input_GetKeyInt_mCBF4A2379EF913E589DFF4AE9C9407D0AC6B4E4D,
Input_GetKeyUpInt_mBF5453011D089E0D585F38D8BC72AB743CE243BE,
Input_GetKeyDownInt_mEAC027107792507CA7F0B1DFBEA4E6289CDCCCBA,
Input_GetAxis_m939297DEB2ECF8D8D09AD66EB69979AAD2B62326,
Input_GetAxisRaw_mC07AC23FD8D04A69CDB07C6399C93FFFAEB0FC5B,
Input_GetButton_m95EE8314087068F3AA9CEF3C3F6A246D55C4734C,
Input_GetButtonDown_m2001112EBCA3D5C7B0344EF62C896667F7E67DDF,
Input_GetButtonUp_m15AA6B42BD0DDCC7802346E49F30653D750260DD,
Input_GetMouseButton_m27BF2DDBF38A38787B83A13D3E6F0F88F7C834C1,
Input_GetMouseButtonDown_m466D81FDCC87C9CB07557B39DCB435EB691F1EF3,
Input_GetMouseButtonUp_m2BA562F8C4FE8364EEC93970093E776371DF4022,
Input_GetTouch_m6A2A31482B1A7D018C3AAC188C02F5D14500C81F,
Input_GetKey_mFDD450A4C61F2930928B12287FFBD1ACCB71E429,
Input_GetKeyUp_mDE9D56FE11715566D4D54FD96F8E1EF9734D225F,
Input_GetKeyDown_m476116696E71771641BBECBAB1A4C55E69018220,
Input_get_mousePosition_m79528BC2F30C57054641F709C855130AE586AC0E,
Input_get_mouseScrollDelta_m018B3C74FC710A166684FC8391CAC93D8EC0ADB7,
Input_get_imeCompositionMode_m04AD6A8C7FEE55E7C4F70885DB5AF222E9F904E5,
Input_set_imeCompositionMode_m7D4AA771F1F616FE74A97CA186C4B55EF268E112,
Input_get_compositionString_mF957B324E35155878D307CE2AEE0AACC9BEC25BD,
Input_get_compositionCursorPos_m70946478FB2B607BC3BC5EC1280AA217323518B3,
Input_set_compositionCursorPos_mA2A9D63F782E3C75F065F031C67C2A1363D47D9C,
Input_get_mousePresent_mBCACCE1C97E146FF46C7AE7FFE693F7BAB4E4FE5,
Input_get_touchCount_mE1A06AB1973E3456AE398B3CC5105F27CC7335D6,
Input_get_touchSupported_mE5B2F5199B4CC16D89AD2C3125B5CB38F4B4867B,
Input_GetTouch_Injected_m19710838FFBDDC3E60536B0932D3B5A392BE539D,
Input_get_mousePosition_Injected_m4E5460D301ECE27CC322AB79C0914A4503ABC06E,
Input_get_mouseScrollDelta_Injected_m8B072340853637C9CF5A23CEA63ED51B14886EC9,
Input_get_compositionCursorPos_Injected_mE31464243AB1819574A268B942B5667B03F4822E,
Input_set_compositionCursorPos_Injected_m4B961AC7900B41DDBFBA03BE2F65F49C030CCB4D,
SendMouseEvents_SetMouseMoved_mEC659144183FB490A2E1F12112C8F08569A511CD,
SendMouseEvents_DoSendMouseEvents_m21561D473C27F19BA9CDBC53B4A13D40DDFBE785,
SendMouseEvents_SendEvents_m7A59BBFBB15C1BF3E47D56CDD4921599A686F9C7,
SendMouseEvents__cctor_m6B63654E024F338414361C995EAFEC615743A0E0,
HitInfo_SendMessage_m2D813691948EAB9CDA487A3B8668678EABFCFA62_AdjustorThunk,
HitInfo_op_Implicit_m8332A3930623A2248D797F3A8020FFF4E05A9420,
HitInfo_Compare_m3AD170E7A52826C73DEF8C3C8F6507C9EAB28363,
};
static const int32_t s_InvokerIndices[45] =
{
10,
1022,
10,
10,
1295,
1295,
1296,
1296,
46,
46,
46,
1287,
1287,
109,
109,
109,
46,
46,
46,
1297,
46,
46,
46,
1115,
1143,
520,
121,
4,
1143,
1298,
49,
520,
49,
1198,
17,
17,
17,
17,
3,
121,
1299,
3,
26,
1300,
1301,
};
extern const Il2CppCodeGenModule g_UnityEngine_InputLegacyModuleCodeGenModule;
const Il2CppCodeGenModule g_UnityEngine_InputLegacyModuleCodeGenModule =
{
"UnityEngine.InputLegacyModule.dll",
45,
s_methodPointers,
s_InvokerIndices,
0,
NULL,
0,
NULL,
0,
NULL,
NULL,
};
| [
"monireu.dev@gmail.com"
] | monireu.dev@gmail.com |
50654c464ec20396eacf28a9be953711db43d5b3 | ef23e388061a637f82b815d32f7af8cb60c5bb1f | /src/mess/machine/mc6843.c | 0778813994c53a5fe9a99d4d3aacb3af1b3922ce | [] | no_license | marcellodash/psmame | 76fd877a210d50d34f23e50d338e65a17deff066 | 09f52313bd3b06311b910ed67a0e7c70c2dd2535 | refs/heads/master | 2021-05-29T23:57:23.333706 | 2011-06-23T20:11:22 | 2011-06-23T20:11:22 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 25,298 | c | /**********************************************************************
Copyright (C) Antoine Mine' 2007
Motorola 6843 Floppy Disk Controller emulation.
**********************************************************************/
/*
Main MC 6843 features are:
- single density floppies
- IBM 3740 compatible
- DMA-able
- high-level commands (including multi-sector read/write)
CLONES: HD 46503S seems to be a clone of MC 6843
BUGS
The driver was designed with Thomson computer emulation in mind
(CD 90-015 5"1/4 floppy controller) and works in this context.
It might work in other contexts but has currently shortcomings:
- DMA is not emulated
- Free-Format Read is not emulated
- Free-Format Write only supports track formatting, in a specific
format (FWF=1, Thomson-like sector formats)
- very rough timing: basically, there is a fixed delay between
a command request (CMR write) and its response (first byte
available, seek complete, etc.); there is no delay between
read / write
*/
#include "emu.h"
#include "mc6843.h"
#include "imagedev/flopdrv.h"
/******************* parameters ******************/
#define VERBOSE 0
/******************* internal chip data structure ******************/
typedef struct
{
/* interface */
const mc6843_interface* iface;
/* registers */
UINT8 CTAR; /* current track */
UINT8 CMR; /* command */
UINT8 ISR; /* interrupt status */
UINT8 SUR; /* set-up */
UINT8 STRA; /* status */
UINT8 STRB; /* status */
UINT8 SAR; /* sector address */
UINT8 GCR; /* general count */
UINT8 CCR; /* CRC control */
UINT8 LTAR; /* logical address track (=track destination) */
/* internal state */
UINT8 drive;
UINT8 side;
UINT8 data[128]; /* sector buffer */
UINT32 data_size; /* size of data */
UINT32 data_idx; /* current read/write position in data */
UINT32 data_id; /* chrd_id for sector write */
UINT8 index_pulse;
/* trigger delayed actions (bottom halves) */
emu_timer* timer_cont;
} mc6843_t;
/* macro-command numbers */
#define CMD_STZ 0x2 /* seek track zero */
#define CMD_SEK 0x3 /* seek */
#define CMD_SSR 0x4 /* single sector read */
#define CMD_SSW 0x5 /* single sector write */
#define CMD_RCR 0x6 /* read CRC */
#define CMD_SWD 0x7 /* single sector write with delete data mark */
#define CMD_MSW 0xd /* multiple sector write */
#define CMD_MSR 0xc /* multiple sector read */
#define CMD_FFW 0xb /* free format write */
#define CMD_FFR 0xa /* free format read */
/* coarse delays */
#define DELAY_SEEK attotime::from_usec( 100 ) /* track seek time */
#define DELAY_ADDR attotime::from_usec( 100 ) /* search-address time */
static const char *const mc6843_cmd[16] =
{
"---", "---", "STZ", "SEK", "SSR", "SSW", "RCR", "SWD",
"---", "---", "FFR", "FFW", "MSR", "MSW", "---", "---",
};
/******************* utility function and macros ********************/
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
INLINE mc6843_t* get_safe_token( device_t *device )
{
assert( device != NULL );
assert( device->type() == MC6843 );
return (mc6843_t*) downcast<legacy_device_base *>(device)->token();
}
/************************** floppy interface ****************************/
static device_t* mc6843_floppy_image ( device_t *device )
{
mc6843_t* mc6843 = get_safe_token( device );
return floppy_get_device( device->machine(), mc6843->drive );
}
void mc6843_set_drive( device_t *device, int drive )
{
mc6843_t* mc6843 = get_safe_token( device );
mc6843->drive = drive;
}
void mc6843_set_side( device_t *device, int side )
{
mc6843_t* mc6843 = get_safe_token( device );
mc6843->side = side;
}
/* called after ISR or STRB has changed */
static void mc6843_status_update( device_t *device )
{
mc6843_t* mc6843 = get_safe_token( device );
int irq = 0;
/* ISR3 */
if ( (mc6843->CMR & 0x40) || ! mc6843->STRB )
mc6843->ISR &= ~8;
else
mc6843->ISR |= 8;
/* interrupts */
if ( mc6843->ISR & 4 )
irq = 1; /* unmaskable */
if ( ! (mc6843->CMR & 0x80) )
{
/* maskable */
if ( mc6843->ISR & ~4 )
irq = 1;
}
if ( mc6843->iface->irq_func )
{
mc6843->iface->irq_func( device, irq );
LOG(( "mc6843_status_update: irq=%i (CMR=%02X, ISR=%02X)\n", irq, mc6843->CMR, mc6843->ISR ));
}
}
void mc6843_set_index_pulse ( device_t *device, int index_pulse )
{
mc6843_t* mc6843 = get_safe_token( device );
mc6843->index_pulse = index_pulse;
}
/* called at end of command */
static void mc6843_cmd_end( device_t *device )
{
mc6843_t* mc6843 = get_safe_token( device );
int cmd = mc6843->CMR & 0x0f;
if ( ( cmd == CMD_STZ ) || ( cmd == CMD_SEK ) )
{
mc6843->ISR |= 0x02; /* set Settling Time Complete */
}
else
{
mc6843->ISR |= 0x01; /* set Macro Command Complete */
}
mc6843->STRA &= ~0x80; /* clear Busy */
mc6843->CMR &= 0xf0; /* clear command */
mc6843_status_update( device );
}
/* Seek Track Zero bottom half */
static void mc6843_finish_STZ( device_t *device )
{
mc6843_t* mc6843 = get_safe_token( device );
device_t* img = mc6843_floppy_image( device );
int i;
/* seek to track zero */
for ( i=0; i<83; i++ )
{
if (floppy_tk00_r(img) == CLEAR_LINE)
break;
floppy_drive_seek( img, -1 );
}
LOG(( "%f mc6843_finish_STZ: actual=%i\n", device->machine().time().as_double(), floppy_drive_get_current_track( img ) ));
/* update state */
mc6843->CTAR = 0;
mc6843->GCR = 0;
mc6843->SAR = 0;
mc6843->STRB |= floppy_tk00_r(img) << 4;
mc6843_cmd_end( device );
}
/* Seek bottom half */
static void mc6843_finish_SEK( device_t *device )
{
mc6843_t* mc6843 = get_safe_token( device );
device_t* img = mc6843_floppy_image( device );
/* seek to track */
floppy_drive_seek( img, mc6843->GCR - mc6843->CTAR );
LOG(( "%f mc6843_finish_SEK: from %i to %i (actual=%i)\n", device->machine().time().as_double(), mc6843->CTAR, mc6843->GCR, floppy_drive_get_current_track( img ) ));
/* update state */
mc6843->CTAR = mc6843->GCR;
mc6843->SAR = 0;
mc6843_cmd_end( device );
}
/* preamble to all sector read / write commands, returns 1 if found */
static int mc6843_address_search( device_t *device, chrn_id* id )
{
mc6843_t* mc6843 = get_safe_token( device );
device_t* img = mc6843_floppy_image( device );
int r = 0;
while ( 1 )
{
if ( ( ! floppy_drive_get_next_id( img, mc6843->side, id ) ) || ( id->flags & ID_FLAG_CRC_ERROR_IN_ID_FIELD ) || ( id->N != 0 ) )
{
/* read address error */
LOG(( "%f mc6843_address_search: get_next_id failed\n", device->machine().time().as_double() ));
mc6843->STRB |= 0x0a; /* set CRC error & Sector Address Undetected */
mc6843_cmd_end( device );
return 0;
}
if ( id->C != mc6843->LTAR )
{
/* track mismatch */
LOG(( "%f mc6843_address_search: track mismatch: logical=%i real=%i\n", device->machine().time().as_double(), mc6843->LTAR, id->C ));
mc6843->data[0] = id->C; /* make the track number available to the CPU */
mc6843->STRA |= 0x20; /* set Track Not Equal */
mc6843_cmd_end( device );
return 0;
}
if ( id->R == mc6843->SAR )
{
/* found! */
LOG(( "%f mc6843_address_search: sector %i found on track %i\n", device->machine().time().as_double(), id->R, id->C ));
if ( ! (mc6843->CMR & 0x20) )
{
mc6843->ISR |= 0x04; /* if no DMA, set Status Sense */
}
return 1;
}
if ( floppy_drive_get_flag_state( img, FLOPPY_DRIVE_INDEX ) )
{
r++;
if ( r >= 4 )
{
/* time-out after 3 full revolutions */
LOG(( "%f mc6843_address_search: no sector %i found after 3 revolutions\n", device->machine().time().as_double(), mc6843->SAR ));
mc6843->STRB |= 0x08; /* set Sector Address Undetected */
mc6843_cmd_end( device );
return 0;
}
}
}
return 0; /* unreachable */
}
/* preamble specific to read commands (adds extra checks) */
static int mc6843_address_search_read( device_t *device, chrn_id* id )
{
mc6843_t* mc6843 = get_safe_token( device );
if ( ! mc6843_address_search( device, id ) )
return 0;
if ( id->flags & ID_FLAG_CRC_ERROR_IN_DATA_FIELD )
{
LOG(( "%f mc6843_address_search_read: data CRC error\n", device->machine().time().as_double() ));
mc6843->STRB |= 0x06; /* set CRC error & Data Mark Undetected */
mc6843_cmd_end( device );
return 0;
}
if ( id->flags & ID_FLAG_DELETED_DATA )
{
LOG(( "%f mc6843_address_search_read: deleted data\n", device->machine().time().as_double() ));
mc6843->STRA |= 0x02; /* set Delete Data Mark Detected */
}
return 1;
}
/* Read CRC bottom half */
static void mc6843_finish_RCR( device_t *device )
{
chrn_id id;
if ( ! mc6843_address_search_read( device, &id ) )
return;
mc6843_cmd_end( device );
}
/* Single / Multiple Sector Read bottom half */
static void mc6843_cont_SR( device_t *device )
{
mc6843_t* mc6843 = get_safe_token( device );
chrn_id id;
device_t* img = mc6843_floppy_image( device );
/* sector seek */
if ( ! mc6843_address_search_read( device, &id ) )
return;
/* sector read */
floppy_drive_read_sector_data( img, mc6843->side, id.data_id, mc6843->data, 128 );
mc6843->data_idx = 0;
mc6843->data_size = 128;
mc6843->STRA |= 0x01; /* set Data Transfer Request */
mc6843_status_update( device );
}
/* Single / Multiple Sector Write bottom half */
static void mc6843_cont_SW( device_t *device )
{
mc6843_t* mc6843 = get_safe_token( device );
chrn_id id;
/* sector seek */
if ( ! mc6843_address_search( device, &id ) )
return;
/* setup sector write buffer */
mc6843->data_idx = 0;
mc6843->data_size = 128;
mc6843->STRA |= 0x01; /* set Data Transfer Request */
mc6843->data_id = id.data_id; /* for subsequent write sector command */
mc6843_status_update( device );
}
/* bottom halves, called to continue / finish a command after some delay */
static TIMER_CALLBACK( mc6843_cont )
{
device_t* device = (device_t*) ptr;
mc6843_t* mc6843 = get_safe_token( device );
int cmd = mc6843->CMR & 0x0f;
LOG(( "%f mc6843_cont: timer called for cmd=%s(%i)\n", device->machine().time().as_double(), mc6843_cmd[cmd], cmd ));
mc6843->timer_cont->adjust( attotime::never );
switch ( cmd )
{
case CMD_STZ: mc6843_finish_STZ( device ); break;
case CMD_SEK: mc6843_finish_SEK( device ); break;
case CMD_SSR: mc6843_cont_SR( device ); break;
case CMD_SSW: mc6843_cont_SW( device ); break;
case CMD_RCR: mc6843_finish_RCR( device ); break;
case CMD_SWD: mc6843_cont_SW( device ); break;
case CMD_MSW: mc6843_cont_SW( device ); break;
case CMD_MSR: mc6843_cont_SR( device ); break;
}
}
/************************** CPU interface ****************************/
READ8_DEVICE_HANDLER ( mc6843_r )
{
mc6843_t* mc6843 = get_safe_token( device );
UINT8 data = 0;
switch ( offset ) {
case 0: /* Data Input Register (DIR) */
{
int cmd = mc6843->CMR & 0x0f;
LOG(( "%f $%04x mc6843_r: data input cmd=%s(%i), pos=%i/%i, GCR=%i, ",
device->machine().time().as_double(), cpu_get_previouspc( device->machine().firstcpu ),
mc6843_cmd[cmd], cmd, mc6843->data_idx,
mc6843->data_size, mc6843->GCR ));
if ( cmd == CMD_SSR || cmd == CMD_MSR )
{
/* sector read */
assert( mc6843->data_size > 0 );
assert( mc6843->data_idx < mc6843->data_size );
assert( mc6843->data_idx < sizeof(mc6843->data) );
data = mc6843->data[ mc6843->data_idx ];
mc6843->data_idx++;
if ( mc6843->data_idx >= mc6843->data_size )
{
/* end of sector read */
mc6843->STRA &= ~0x01; /* clear Data Transfer Request */
if ( cmd == CMD_MSR )
{
/* schedule next sector in multiple sector read */
mc6843->GCR--;
mc6843->SAR++;
if ( mc6843->GCR == 0xff )
{
mc6843_cmd_end( device );
}
else if ( mc6843->SAR > 26 )
{
mc6843->STRB |= 0x08; /* set Sector Address Undetected */
mc6843_cmd_end( device );
}
else
{
mc6843->timer_cont->adjust( DELAY_ADDR );
}
}
else
{
mc6843_cmd_end( device );
}
}
}
else if ( cmd == 0 )
{
data = mc6843->data[0];
}
else
{
/* XXX TODO: other read modes */
data = mc6843->data[0];
logerror( "$%04x mc6843 read in unsupported command mode %i\n", cpu_get_previouspc( device->machine().firstcpu ), cmd );
}
LOG(( "data=%02X\n", data ));
break;
}
case 1: /* Current-Track Address Register (CTAR) */
data = mc6843->CTAR;
LOG(( "%f $%04x mc6843_r: read CTAR %i (actual=%i)\n",
device->machine().time().as_double(), cpu_get_previouspc( device->machine().firstcpu ), data,
floppy_drive_get_current_track( mc6843_floppy_image( device ) ) ));
break;
case 2: /* Interrupt Status Register (ISR) */
data = mc6843->ISR;
LOG(( "%f $%04x mc6843_r: read ISR %02X: cmd=%scomplete settle=%scomplete sense-rq=%i STRB=%i\n",
device->machine().time().as_double(), cpu_get_previouspc( device->machine().firstcpu ), data,
(data & 1) ? "" : "not-" , (data & 2) ? "" : "not-",
(data >> 2) & 1, (data >> 3) & 1 ));
/* reset */
mc6843->ISR &= 8; /* keep STRB */
mc6843_status_update( device );
break;
case 3: /* Status Register A (STRA) */
{
/* update */
device_t* img = mc6843_floppy_image( device );
int flag = floppy_drive_get_flag_state( img, FLOPPY_DRIVE_READY);
mc6843->STRA &= 0xa3;
if ( flag & FLOPPY_DRIVE_READY )
mc6843->STRA |= 0x04;
mc6843->STRA |= !floppy_tk00_r(img) << 3;
mc6843->STRA |= !floppy_wpt_r(img) << 4;
if ( mc6843->index_pulse )
mc6843->STRA |= 0x40;
data = mc6843->STRA;
LOG(( "%f $%04x mc6843_r: read STRA %02X: data-rq=%i del-dta=%i ready=%i t0=%i wp=%i trk-dif=%i idx=%i busy=%i\n",
device->machine().time().as_double(), cpu_get_previouspc( device->machine().firstcpu ), data,
data & 1, (data >> 1) & 1, (data >> 2) & 1, (data >> 3) & 1,
(data >> 4) & 1, (data >> 5) & 1, (data >> 6) & 1, (data >> 7) & 1 ));
break;
}
case 4: /* Status Register B (STRB) */
data = mc6843->STRB;
LOG(( "%f $%04x mc6843_r: read STRB %02X: data-err=%i CRC-err=%i dta--mrk-err=%i sect-mrk-err=%i seek-err=%i fi=%i wr-err=%i hard-err=%i\n",
device->machine().time().as_double(), cpu_get_previouspc( device->machine().firstcpu ), data,
data & 1, (data >> 1) & 1, (data >> 2) & 1, (data >> 3) & 1,
(data >> 4) & 1, (data >> 5) & 1, (data >> 6) & 1, (data >> 7) & 1 ));
/* (partial) reset */
mc6843->STRB &= ~0xfb;
mc6843_status_update( device );
break;
case 7: /* Logical-Track Address Register (LTAR) */
data = mc6843->LTAR;
LOG(( "%f $%04x mc6843_r: read LTAR %i (actual=%i)\n",
device->machine().time().as_double(), cpu_get_previouspc( device->machine().firstcpu ), data,
floppy_drive_get_current_track( mc6843_floppy_image( device ) ) ));
break;
default:
logerror( "$%04x mc6843 invalid read offset %i\n", cpu_get_previouspc( device->machine().firstcpu ), offset );
}
return data;
}
WRITE8_DEVICE_HANDLER ( mc6843_w )
{
mc6843_t* mc6843 = get_safe_token( device );
switch ( offset ) {
case 0: /* Data Output Register (DOR) */
{
int cmd = mc6843->CMR & 0x0f;
int FWF = (mc6843->CMR >> 4) & 1;
LOG(( "%f $%04x mc6843_w: data output cmd=%s(%i), pos=%i/%i, GCR=%i, data=%02X\n",
device->machine().time().as_double(), cpu_get_previouspc( device->machine().firstcpu ),
mc6843_cmd[cmd], cmd, mc6843->data_idx,
mc6843->data_size, mc6843->GCR, data ));
if ( cmd == CMD_SSW || cmd == CMD_MSW || cmd == CMD_SWD )
{
/* sector write */
assert( mc6843->data_size > 0 );
assert( mc6843->data_idx < mc6843->data_size );
assert( mc6843->data_idx < sizeof(mc6843->data) );
mc6843->data[ mc6843->data_idx ] = data;
mc6843->data_idx++;
if ( mc6843->data_idx >= mc6843->data_size )
{
/* end of sector write */
device_t* img = mc6843_floppy_image( device );
LOG(( "%f $%04x mc6843_w: write sector %i\n", device->machine().time().as_double(), cpu_get_previouspc( device->machine().firstcpu ), mc6843->data_id ));
floppy_drive_write_sector_data(
img, mc6843->side, mc6843->data_id,
mc6843->data, mc6843->data_size,
(cmd == CMD_SWD) ? ID_FLAG_DELETED_DATA : 0 );
mc6843->STRA &= ~0x01; /* clear Data Transfer Request */
if ( cmd == CMD_MSW )
{
mc6843->GCR--;
mc6843->SAR++;
if ( mc6843->GCR == 0xff )
{
mc6843_cmd_end( device );
}
else if ( mc6843->SAR > 26 )
{
mc6843->STRB |= 0x08; /* set Sector Address Undetected */
mc6843_cmd_end( device );
}
else
{
mc6843->timer_cont->adjust( DELAY_ADDR );
}
}
else
{
mc6843_cmd_end( device );
}
}
}
else if ( (cmd == CMD_FFW) && FWF )
{
/* assume we are formatting */
UINT8 nibble;
nibble =
(data & 0x01) |
((data & 0x04) >> 1 )|
((data & 0x10) >> 2 )|
((data & 0x40) >> 3 );
assert( mc6843->data_idx < sizeof(mc6843->data) );
mc6843->data[mc6843->data_idx / 2] =
(mc6843->data[mc6843->data_idx / 2] << 4) | nibble;
if ( (mc6843->data_idx == 0) && (mc6843->data[0] == 0xfe ) )
{
/* address mark detected */
mc6843->data_idx = 2;
}
else if ( mc6843->data_idx == 9 )
{
/* address id field complete */
if ( (mc6843->data[2] == 0) && (mc6843->data[4] == 0) )
{
/* valid address id field */
device_t* img = mc6843_floppy_image( device );
UINT8 track = mc6843->data[1];
UINT8 sector = mc6843->data[3];
UINT8 filler = 0xe5; /* standard Thomson filler */
LOG(( "%f $%04x mc6843_w: address id detected track=%i sector=%i\n", device->machine().time().as_double(), cpu_get_previouspc( device->machine().firstcpu ), track, sector));
floppy_drive_format_sector( img, mc6843->side, sector, track, 0, sector, 0, filler );
}
else
{
/* abort */
mc6843->data_idx = 0;
}
}
else if ( mc6843->data_idx > 0 )
{
/* accumulate address id field */
mc6843->data_idx++;
}
}
else if ( cmd == 0 )
{
/* nothing */
}
else
{
/* XXX TODO: other write modes */
logerror( "$%04x mc6843 write %02X in unsupported command mode %i (FWF=%i)\n", cpu_get_previouspc( device->machine().firstcpu ), data, cmd, FWF );
}
break;
}
case 1: /* Current-Track Address Register (CTAR) */
mc6843->CTAR = data & 0x7f;
LOG(( "%f $%04x mc6843_w: set CTAR to %i %02X (actual=%i) \n",
device->machine().time().as_double(), cpu_get_previouspc( device->machine().firstcpu ), mc6843->CTAR, data,
floppy_drive_get_current_track( mc6843_floppy_image( device ) ) ));
break;
case 2: /* Command Register (CMR) */
{
int cmd = data & 15;
LOG(( "%f $%04x mc6843_w: set CMR to $%02X: cmd=%s(%i) FWF=%i DMA=%i ISR3-intr=%i fun-intr=%i\n",
device->machine().time().as_double(), cpu_get_previouspc( device->machine().firstcpu ),
data, mc6843_cmd[cmd], cmd, (data >> 4) & 1, (data >> 5) & 1,
(data >> 6) & 1, (data >> 7) & 1 ));
/* sanitize state */
mc6843->STRA &= ~0x81; /* clear Busy & Data Transfer Request */
mc6843->data_idx = 0;
mc6843->data_size = 0;
/* commands are initiated by updating some flags and scheduling
a bottom-half (mc6843_cont) after some delay */
switch (cmd)
{
case CMD_SSW:
case CMD_SSR:
case CMD_SWD:
case CMD_RCR:
case CMD_MSR:
case CMD_MSW:
mc6843->STRA |= 0x80; /* set Busy */
mc6843->STRA &= ~0x22; /* clear Track Not Equal & Delete Data Mark Detected */
mc6843->STRB &= ~0x04; /* clear Data Mark Undetected */
mc6843->timer_cont->adjust( DELAY_ADDR );
break;
case CMD_STZ:
case CMD_SEK:
mc6843->STRA |= 0x80; /* set Busy */
mc6843->timer_cont->adjust( DELAY_SEEK );
break;
case CMD_FFW:
case CMD_FFR:
mc6843->data_idx = 0;
mc6843->STRA |= 0x01; /* set Data Transfer Request */
break;
}
mc6843->CMR = data;
mc6843_status_update( device );
break;
}
case 3: /* Set-Up Register (SUR) */
mc6843->SUR = data;
/* assume CLK freq = 1MHz (IBM 3740 compatibility) */
LOG(( "%f $%04x mc6843_w: set SUR to $%02X: head settling time=%fms, track-to-track seek time=%f\n",
device->machine().time().as_double(), cpu_get_previouspc( device->machine().firstcpu ),
data, 4.096 * (data & 15), 1.024 * ((data >> 4) & 15) ));
break;
case 4: /* Sector Address Register (SAR) */
mc6843->SAR = data & 0x1f;
LOG(( "%f $%04x mc6843_w: set SAR to %i (%02X)\n", device->machine().time().as_double(), cpu_get_previouspc( device->machine().firstcpu ), mc6843->SAR, data ));
break;
case 5: /* General Count Register (GCR) */
mc6843->GCR = data & 0x7f;
LOG(( "%f $%04x mc6843_w: set GCR to %i (%02X)\n", device->machine().time().as_double(), cpu_get_previouspc( device->machine().firstcpu ), mc6843->GCR, data ));
break;
case 6: /* CRC Control Register (CCR) */
mc6843->CCR = data & 3;
LOG(( "%f $%04x mc6843_w: set CCR to %02X: CRC=%s shift=%i\n",
device->machine().time().as_double(), cpu_get_previouspc( device->machine().firstcpu ), data,
(data & 1) ? "enabled" : "disabled", (data >> 1) & 1 ));
break;
case 7: /* Logical-Track Address Register (LTAR) */
mc6843->LTAR = data & 0x7f;
LOG(( "%f $%04x mc6843_w: set LTAR to %i %02X (actual=%i)\n",
device->machine().time().as_double(), cpu_get_previouspc( device->machine().firstcpu ), mc6843->LTAR, data,
floppy_drive_get_current_track( mc6843_floppy_image( device ) ) ));
break;
default:
logerror( "$%04x mc6843 invalid write offset %i (data=$%02X)\n", cpu_get_previouspc( device->machine().firstcpu ), offset, data );
}
}
/************************ reset *****************************/
static DEVICE_RESET( mc6843 )
{
mc6843_t* mc6843 = get_safe_token( device );
int i;
LOG (( "mc6843 reset\n" ));
/* setup/reset floppy drive */
for ( i = 0; i < 4; i++ )
{
device_t * img = floppy_get_device( device->machine(), i );
floppy_mon_w(img, CLEAR_LINE);
floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 );
floppy_drive_set_rpm( img, 300. );
}
/* reset registers */
mc6843->CMR &= 0xf0; /* zero only command */
mc6843->ISR = 0;
mc6843->STRA &= 0x5c;
mc6843->SAR = 0;
mc6843->STRB &= 0x20;
mc6843_status_update( device );
mc6843->data_size = 0;
mc6843->data_idx = 0;
mc6843->timer_cont->adjust( attotime::never );
}
/************************ start *****************************/
static DEVICE_START( mc6843 )
{
mc6843_t* mc6843 = get_safe_token( device );
mc6843->iface = (const mc6843_interface*)device->baseconfig().static_config();
mc6843->timer_cont = device->machine().scheduler().timer_alloc(FUNC(mc6843_cont), (void*) device) ;
state_save_register_item( device->machine(),"mc6843", device->tag(), 0, mc6843->CTAR );
state_save_register_item( device->machine(),"mc6843", device->tag(), 0, mc6843->CMR );
state_save_register_item( device->machine(),"mc6843", device->tag(), 0, mc6843->ISR );
state_save_register_item( device->machine(),"mc6843", device->tag(), 0, mc6843->SUR );
state_save_register_item( device->machine(),"mc6843", device->tag(), 0, mc6843->STRA );
state_save_register_item( device->machine(),"mc6843", device->tag(), 0, mc6843->STRB );
state_save_register_item( device->machine(),"mc6843", device->tag(), 0, mc6843->SAR );
state_save_register_item( device->machine(),"mc6843", device->tag(), 0, mc6843->GCR );
state_save_register_item( device->machine(),"mc6843", device->tag(), 0, mc6843->CCR );
state_save_register_item( device->machine(),"mc6843", device->tag(), 0, mc6843->LTAR );
state_save_register_item( device->machine(),"mc6843", device->tag(), 0, mc6843->drive );
state_save_register_item( device->machine(),"mc6843", device->tag(), 0, mc6843->side );
state_save_register_item_array( device->machine(),"mc6843", device->tag(), 0, mc6843->data );
state_save_register_item( device->machine(),"mc6843", device->tag(), 0, mc6843->data_size );
state_save_register_item( device->machine(),"mc6843", device->tag(), 0, mc6843->data_idx );
state_save_register_item( device->machine(),"mc6843", device->tag(), 0, mc6843->data_id );
}
/************************** configuration ****************************/
DEVICE_GET_INFO( mc6843 ) {
switch ( state ) {
/* --- the following bits of info are returned as 64-bit signed integers --- */
case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(mc6843_t); break;
case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break;
/* --- the following bits of info are returned as pointers to data or functions --- */
case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(mc6843); break;
case DEVINFO_FCT_STOP: /* nothing */ break;
case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(mc6843); break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case DEVINFO_STR_NAME: strcpy(info->s, "Motorola MC6843 floppy controller"); break;
case DEVINFO_STR_FAMILY: strcpy(info->s, "MC6843"); break;
case DEVINFO_STR_VERSION: strcpy(info->s, "1.00"); break;
case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break;
case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MAME and MESS Teams"); break;
}
}
DEFINE_LEGACY_DEVICE(MC6843, mc6843);
| [
"Mike@localhost"
] | Mike@localhost |