text
stringlengths 5
99.8k
| meta
dict |
|---|---|
/*
* Copyright 2008, 2010-2014 Freescale Semiconductor, Inc.
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <hwconfig.h>
#include <fsl_ddr_sdram.h>
#include <fsl_ddr.h>
/*
* Use our own stack based buffer before relocation to allow accessing longer
* hwconfig strings that might be in the environment before we've relocated.
* This is pretty fragile on both the use of stack and if the buffer is big
* enough. However we will get a warning from getenv_f for the later.
*/
/* Board-specific functions defined in each board's ddr.c */
extern void fsl_ddr_board_options(memctl_options_t *popts,
dimm_params_t *pdimm,
unsigned int ctrl_num);
struct dynamic_odt {
unsigned int odt_rd_cfg;
unsigned int odt_wr_cfg;
unsigned int odt_rtt_norm;
unsigned int odt_rtt_wr;
};
#if defined(CONFIG_SYS_FSL_DDR3) || defined(CONFIG_SYS_FSL_DDR4)
static const struct dynamic_odt single_Q[4] = {
{ /* cs0 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_CS_AND_OTHER_DIMM,
DDR3_RTT_20_OHM,
DDR3_RTT_120_OHM
},
{ /* cs1 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_NEVER, /* tied high */
DDR3_RTT_OFF,
DDR3_RTT_120_OHM
},
{ /* cs2 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_CS_AND_OTHER_DIMM,
DDR3_RTT_20_OHM,
DDR3_RTT_120_OHM
},
{ /* cs3 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_NEVER, /* tied high */
DDR3_RTT_OFF,
DDR3_RTT_120_OHM
}
};
static const struct dynamic_odt single_D[4] = {
{ /* cs0 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_ALL,
DDR3_RTT_40_OHM,
DDR3_RTT_OFF
},
{ /* cs1 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_NEVER,
DDR3_RTT_OFF,
DDR3_RTT_OFF
},
{0, 0, 0, 0},
{0, 0, 0, 0}
};
static const struct dynamic_odt single_S[4] = {
{ /* cs0 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_ALL,
DDR3_RTT_40_OHM,
DDR3_RTT_OFF
},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
};
static const struct dynamic_odt dual_DD[4] = {
{ /* cs0 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_SAME_DIMM,
DDR3_RTT_120_OHM,
DDR3_RTT_OFF
},
{ /* cs1 */
FSL_DDR_ODT_OTHER_DIMM,
FSL_DDR_ODT_OTHER_DIMM,
DDR3_RTT_30_OHM,
DDR3_RTT_OFF
},
{ /* cs2 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_SAME_DIMM,
DDR3_RTT_120_OHM,
DDR3_RTT_OFF
},
{ /* cs3 */
FSL_DDR_ODT_OTHER_DIMM,
FSL_DDR_ODT_OTHER_DIMM,
DDR3_RTT_30_OHM,
DDR3_RTT_OFF
}
};
static const struct dynamic_odt dual_DS[4] = {
{ /* cs0 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_SAME_DIMM,
DDR3_RTT_120_OHM,
DDR3_RTT_OFF
},
{ /* cs1 */
FSL_DDR_ODT_OTHER_DIMM,
FSL_DDR_ODT_OTHER_DIMM,
DDR3_RTT_30_OHM,
DDR3_RTT_OFF
},
{ /* cs2 */
FSL_DDR_ODT_OTHER_DIMM,
FSL_DDR_ODT_ALL,
DDR3_RTT_20_OHM,
DDR3_RTT_120_OHM
},
{0, 0, 0, 0}
};
static const struct dynamic_odt dual_SD[4] = {
{ /* cs0 */
FSL_DDR_ODT_OTHER_DIMM,
FSL_DDR_ODT_ALL,
DDR3_RTT_20_OHM,
DDR3_RTT_120_OHM
},
{0, 0, 0, 0},
{ /* cs2 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_SAME_DIMM,
DDR3_RTT_120_OHM,
DDR3_RTT_OFF
},
{ /* cs3 */
FSL_DDR_ODT_OTHER_DIMM,
FSL_DDR_ODT_OTHER_DIMM,
DDR3_RTT_20_OHM,
DDR3_RTT_OFF
}
};
static const struct dynamic_odt dual_SS[4] = {
{ /* cs0 */
FSL_DDR_ODT_OTHER_DIMM,
FSL_DDR_ODT_ALL,
DDR3_RTT_30_OHM,
DDR3_RTT_120_OHM
},
{0, 0, 0, 0},
{ /* cs2 */
FSL_DDR_ODT_OTHER_DIMM,
FSL_DDR_ODT_ALL,
DDR3_RTT_30_OHM,
DDR3_RTT_120_OHM
},
{0, 0, 0, 0}
};
static const struct dynamic_odt dual_D0[4] = {
{ /* cs0 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_SAME_DIMM,
DDR3_RTT_40_OHM,
DDR3_RTT_OFF
},
{ /* cs1 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_NEVER,
DDR3_RTT_OFF,
DDR3_RTT_OFF
},
{0, 0, 0, 0},
{0, 0, 0, 0}
};
static const struct dynamic_odt dual_0D[4] = {
{0, 0, 0, 0},
{0, 0, 0, 0},
{ /* cs2 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_SAME_DIMM,
DDR3_RTT_40_OHM,
DDR3_RTT_OFF
},
{ /* cs3 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_NEVER,
DDR3_RTT_OFF,
DDR3_RTT_OFF
}
};
static const struct dynamic_odt dual_S0[4] = {
{ /* cs0 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_CS,
DDR3_RTT_40_OHM,
DDR3_RTT_OFF
},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0}
};
static const struct dynamic_odt dual_0S[4] = {
{0, 0, 0, 0},
{0, 0, 0, 0},
{ /* cs2 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_CS,
DDR3_RTT_40_OHM,
DDR3_RTT_OFF
},
{0, 0, 0, 0}
};
static const struct dynamic_odt odt_unknown[4] = {
{ /* cs0 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_CS,
DDR3_RTT_120_OHM,
DDR3_RTT_OFF
},
{ /* cs1 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_CS,
DDR3_RTT_120_OHM,
DDR3_RTT_OFF
},
{ /* cs2 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_CS,
DDR3_RTT_120_OHM,
DDR3_RTT_OFF
},
{ /* cs3 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_CS,
DDR3_RTT_120_OHM,
DDR3_RTT_OFF
}
};
#else /* CONFIG_SYS_FSL_DDR3 || CONFIG_SYS_FSL_DDR4 */
static const struct dynamic_odt single_Q[4] = {
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0}
};
static const struct dynamic_odt single_D[4] = {
{ /* cs0 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_ALL,
DDR2_RTT_150_OHM,
DDR2_RTT_OFF
},
{ /* cs1 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_NEVER,
DDR2_RTT_OFF,
DDR2_RTT_OFF
},
{0, 0, 0, 0},
{0, 0, 0, 0}
};
static const struct dynamic_odt single_S[4] = {
{ /* cs0 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_ALL,
DDR2_RTT_150_OHM,
DDR2_RTT_OFF
},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
};
static const struct dynamic_odt dual_DD[4] = {
{ /* cs0 */
FSL_DDR_ODT_OTHER_DIMM,
FSL_DDR_ODT_OTHER_DIMM,
DDR2_RTT_75_OHM,
DDR2_RTT_OFF
},
{ /* cs1 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_NEVER,
DDR2_RTT_OFF,
DDR2_RTT_OFF
},
{ /* cs2 */
FSL_DDR_ODT_OTHER_DIMM,
FSL_DDR_ODT_OTHER_DIMM,
DDR2_RTT_75_OHM,
DDR2_RTT_OFF
},
{ /* cs3 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_NEVER,
DDR2_RTT_OFF,
DDR2_RTT_OFF
}
};
static const struct dynamic_odt dual_DS[4] = {
{ /* cs0 */
FSL_DDR_ODT_OTHER_DIMM,
FSL_DDR_ODT_OTHER_DIMM,
DDR2_RTT_75_OHM,
DDR2_RTT_OFF
},
{ /* cs1 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_NEVER,
DDR2_RTT_OFF,
DDR2_RTT_OFF
},
{ /* cs2 */
FSL_DDR_ODT_OTHER_DIMM,
FSL_DDR_ODT_OTHER_DIMM,
DDR2_RTT_75_OHM,
DDR2_RTT_OFF
},
{0, 0, 0, 0}
};
static const struct dynamic_odt dual_SD[4] = {
{ /* cs0 */
FSL_DDR_ODT_OTHER_DIMM,
FSL_DDR_ODT_OTHER_DIMM,
DDR2_RTT_75_OHM,
DDR2_RTT_OFF
},
{0, 0, 0, 0},
{ /* cs2 */
FSL_DDR_ODT_OTHER_DIMM,
FSL_DDR_ODT_OTHER_DIMM,
DDR2_RTT_75_OHM,
DDR2_RTT_OFF
},
{ /* cs3 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_NEVER,
DDR2_RTT_OFF,
DDR2_RTT_OFF
}
};
static const struct dynamic_odt dual_SS[4] = {
{ /* cs0 */
FSL_DDR_ODT_OTHER_DIMM,
FSL_DDR_ODT_OTHER_DIMM,
DDR2_RTT_75_OHM,
DDR2_RTT_OFF
},
{0, 0, 0, 0},
{ /* cs2 */
FSL_DDR_ODT_OTHER_DIMM,
FSL_DDR_ODT_OTHER_DIMM,
DDR2_RTT_75_OHM,
DDR2_RTT_OFF
},
{0, 0, 0, 0}
};
static const struct dynamic_odt dual_D0[4] = {
{ /* cs0 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_ALL,
DDR2_RTT_150_OHM,
DDR2_RTT_OFF
},
{ /* cs1 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_NEVER,
DDR2_RTT_OFF,
DDR2_RTT_OFF
},
{0, 0, 0, 0},
{0, 0, 0, 0}
};
static const struct dynamic_odt dual_0D[4] = {
{0, 0, 0, 0},
{0, 0, 0, 0},
{ /* cs2 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_ALL,
DDR2_RTT_150_OHM,
DDR2_RTT_OFF
},
{ /* cs3 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_NEVER,
DDR2_RTT_OFF,
DDR2_RTT_OFF
}
};
static const struct dynamic_odt dual_S0[4] = {
{ /* cs0 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_CS,
DDR2_RTT_150_OHM,
DDR2_RTT_OFF
},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0}
};
static const struct dynamic_odt dual_0S[4] = {
{0, 0, 0, 0},
{0, 0, 0, 0},
{ /* cs2 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_CS,
DDR2_RTT_150_OHM,
DDR2_RTT_OFF
},
{0, 0, 0, 0}
};
static const struct dynamic_odt odt_unknown[4] = {
{ /* cs0 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_CS,
DDR2_RTT_75_OHM,
DDR2_RTT_OFF
},
{ /* cs1 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_NEVER,
DDR2_RTT_OFF,
DDR2_RTT_OFF
},
{ /* cs2 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_CS,
DDR2_RTT_75_OHM,
DDR2_RTT_OFF
},
{ /* cs3 */
FSL_DDR_ODT_NEVER,
FSL_DDR_ODT_NEVER,
DDR2_RTT_OFF,
DDR2_RTT_OFF
}
};
#endif
/*
* Automatically seleect bank interleaving mode based on DIMMs
* in this order: cs0_cs1_cs2_cs3, cs0_cs1, null.
* This function only deal with one or two slots per controller.
*/
static inline unsigned int auto_bank_intlv(dimm_params_t *pdimm)
{
#if (CONFIG_DIMM_SLOTS_PER_CTLR == 1)
if (pdimm[0].n_ranks == 4)
return FSL_DDR_CS0_CS1_CS2_CS3;
else if (pdimm[0].n_ranks == 2)
return FSL_DDR_CS0_CS1;
#elif (CONFIG_DIMM_SLOTS_PER_CTLR == 2)
#ifdef CONFIG_FSL_DDR_FIRST_SLOT_QUAD_CAPABLE
if (pdimm[0].n_ranks == 4)
return FSL_DDR_CS0_CS1_CS2_CS3;
#endif
if (pdimm[0].n_ranks == 2) {
if (pdimm[1].n_ranks == 2)
return FSL_DDR_CS0_CS1_CS2_CS3;
else
return FSL_DDR_CS0_CS1;
}
#endif
return 0;
}
unsigned int populate_memctl_options(int all_dimms_registered,
memctl_options_t *popts,
dimm_params_t *pdimm,
unsigned int ctrl_num)
{
unsigned int i;
char buffer[HWCONFIG_BUFFER_SIZE];
char *buf = NULL;
#if defined(CONFIG_SYS_FSL_DDR3) || \
defined(CONFIG_SYS_FSL_DDR2) || \
defined(CONFIG_SYS_FSL_DDR4)
const struct dynamic_odt *pdodt = odt_unknown;
#endif
ulong ddr_freq;
/*
* Extract hwconfig from environment since we have not properly setup
* the environment but need it for ddr config params
*/
if (getenv_f("hwconfig", buffer, sizeof(buffer)) > 0)
buf = buffer;
#if defined(CONFIG_SYS_FSL_DDR3) || \
defined(CONFIG_SYS_FSL_DDR2) || \
defined(CONFIG_SYS_FSL_DDR4)
/* Chip select options. */
#if (CONFIG_DIMM_SLOTS_PER_CTLR == 1)
switch (pdimm[0].n_ranks) {
case 1:
pdodt = single_S;
break;
case 2:
pdodt = single_D;
break;
case 4:
pdodt = single_Q;
break;
}
#elif (CONFIG_DIMM_SLOTS_PER_CTLR == 2)
switch (pdimm[0].n_ranks) {
#ifdef CONFIG_FSL_DDR_FIRST_SLOT_QUAD_CAPABLE
case 4:
pdodt = single_Q;
if (pdimm[1].n_ranks)
printf("Error: Quad- and Dual-rank DIMMs cannot be used together\n");
break;
#endif
case 2:
switch (pdimm[1].n_ranks) {
case 2:
pdodt = dual_DD;
break;
case 1:
pdodt = dual_DS;
break;
case 0:
pdodt = dual_D0;
break;
}
break;
case 1:
switch (pdimm[1].n_ranks) {
case 2:
pdodt = dual_SD;
break;
case 1:
pdodt = dual_SS;
break;
case 0:
pdodt = dual_S0;
break;
}
break;
case 0:
switch (pdimm[1].n_ranks) {
case 2:
pdodt = dual_0D;
break;
case 1:
pdodt = dual_0S;
break;
}
break;
}
#endif /* CONFIG_DIMM_SLOTS_PER_CTLR */
#endif /* CONFIG_SYS_FSL_DDR2, 3, 4 */
/* Pick chip-select local options. */
for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) {
#if defined(CONFIG_SYS_FSL_DDR3) || \
defined(CONFIG_SYS_FSL_DDR2) || \
defined(CONFIG_SYS_FSL_DDR4)
popts->cs_local_opts[i].odt_rd_cfg = pdodt[i].odt_rd_cfg;
popts->cs_local_opts[i].odt_wr_cfg = pdodt[i].odt_wr_cfg;
popts->cs_local_opts[i].odt_rtt_norm = pdodt[i].odt_rtt_norm;
popts->cs_local_opts[i].odt_rtt_wr = pdodt[i].odt_rtt_wr;
#else
popts->cs_local_opts[i].odt_rd_cfg = FSL_DDR_ODT_NEVER;
popts->cs_local_opts[i].odt_wr_cfg = FSL_DDR_ODT_CS;
#endif
popts->cs_local_opts[i].auto_precharge = 0;
}
/* Pick interleaving mode. */
/*
* 0 = no interleaving
* 1 = interleaving between 2 controllers
*/
popts->memctl_interleaving = 0;
/*
* 0 = cacheline
* 1 = page
* 2 = (logical) bank
* 3 = superbank (only if CS interleaving is enabled)
*/
popts->memctl_interleaving_mode = 0;
/*
* 0: cacheline: bit 30 of the 36-bit physical addr selects the memctl
* 1: page: bit to the left of the column bits selects the memctl
* 2: bank: bit to the left of the bank bits selects the memctl
* 3: superbank: bit to the left of the chip select selects the memctl
*
* NOTE: ba_intlv (rank interleaving) is independent of memory
* controller interleaving; it is only within a memory controller.
* Must use superbank interleaving if rank interleaving is used and
* memory controller interleaving is enabled.
*/
/*
* 0 = no
* 0x40 = CS0,CS1
* 0x20 = CS2,CS3
* 0x60 = CS0,CS1 + CS2,CS3
* 0x04 = CS0,CS1,CS2,CS3
*/
popts->ba_intlv_ctl = 0;
/* Memory Organization Parameters */
popts->registered_dimm_en = all_dimms_registered;
/* Operational Mode Paramters */
/* Pick ECC modes */
popts->ecc_mode = 0; /* 0 = disabled, 1 = enabled */
#ifdef CONFIG_DDR_ECC
if (hwconfig_sub_f("fsl_ddr", "ecc", buf)) {
if (hwconfig_subarg_cmp_f("fsl_ddr", "ecc", "on", buf))
popts->ecc_mode = 1;
} else
popts->ecc_mode = 1;
#endif
popts->ecc_init_using_memctl = 1; /* 0 = use DMA, 1 = use memctl */
/*
* Choose DQS config
* 0 for DDR1
* 1 for DDR2
*/
#if defined(CONFIG_SYS_FSL_DDR1)
popts->dqs_config = 0;
#elif defined(CONFIG_SYS_FSL_DDR2) || defined(CONFIG_SYS_FSL_DDR3)
popts->dqs_config = 1;
#endif
/* Choose self-refresh during sleep. */
popts->self_refresh_in_sleep = 1;
/* Choose dynamic power management mode. */
popts->dynamic_power = 0;
/*
* check first dimm for primary sdram width
* presuming all dimms are similar
* 0 = 64-bit, 1 = 32-bit, 2 = 16-bit
*/
#if defined(CONFIG_SYS_FSL_DDR1) || defined(CONFIG_SYS_FSL_DDR2)
if (pdimm[0].n_ranks != 0) {
if ((pdimm[0].data_width >= 64) && \
(pdimm[0].data_width <= 72))
popts->data_bus_width = 0;
else if ((pdimm[0].data_width >= 32) || \
(pdimm[0].data_width <= 40))
popts->data_bus_width = 1;
else {
panic("Error: data width %u is invalid!\n",
pdimm[0].data_width);
}
}
#else
if (pdimm[0].n_ranks != 0) {
if (pdimm[0].primary_sdram_width == 64)
popts->data_bus_width = 0;
else if (pdimm[0].primary_sdram_width == 32)
popts->data_bus_width = 1;
else if (pdimm[0].primary_sdram_width == 16)
popts->data_bus_width = 2;
else {
panic("Error: primary sdram width %u is invalid!\n",
pdimm[0].primary_sdram_width);
}
}
#endif
popts->x4_en = (pdimm[0].device_width == 4) ? 1 : 0;
/* Choose burst length. */
#if defined(CONFIG_SYS_FSL_DDR3) || defined(CONFIG_SYS_FSL_DDR4)
#if defined(CONFIG_E500MC)
popts->otf_burst_chop_en = 0; /* on-the-fly burst chop disable */
popts->burst_length = DDR_BL8; /* Fixed 8-beat burst len */
#else
if ((popts->data_bus_width == 1) || (popts->data_bus_width == 2)) {
/* 32-bit or 16-bit bus */
popts->otf_burst_chop_en = 0;
popts->burst_length = DDR_BL8;
} else {
popts->otf_burst_chop_en = 1; /* on-the-fly burst chop */
popts->burst_length = DDR_OTF; /* on-the-fly BC4 and BL8 */
}
#endif
#else
popts->burst_length = DDR_BL4; /* has to be 4 for DDR2 */
#endif
/* Choose ddr controller address mirror mode */
#if defined(CONFIG_SYS_FSL_DDR3) || defined(CONFIG_SYS_FSL_DDR4)
popts->mirrored_dimm = pdimm[0].mirrored_dimm;
#endif
/* Global Timing Parameters. */
debug("mclk_ps = %u ps\n", get_memory_clk_period_ps());
/* Pick a caslat override. */
popts->cas_latency_override = 0;
popts->cas_latency_override_value = 3;
if (popts->cas_latency_override) {
debug("using caslat override value = %u\n",
popts->cas_latency_override_value);
}
/* Decide whether to use the computed derated latency */
popts->use_derated_caslat = 0;
/* Choose an additive latency. */
popts->additive_latency_override = 0;
popts->additive_latency_override_value = 3;
if (popts->additive_latency_override) {
debug("using additive latency override value = %u\n",
popts->additive_latency_override_value);
}
/*
* 2T_EN setting
*
* Factors to consider for 2T_EN:
* - number of DIMMs installed
* - number of components, number of active ranks
* - how much time you want to spend playing around
*/
popts->twot_en = 0;
popts->threet_en = 0;
/* for RDIMM, address parity enable */
popts->ap_en = 1;
/*
* BSTTOPRE precharge interval
*
* Set this to 0 for global auto precharge
* The value of 0x100 has been used for DDR1, DDR2, DDR3.
* It is not wrong. Any value should be OK. The performance depends on
* applications. There is no one good value for all.
*/
popts->bstopre = 0x100;
/*
* Window for four activates -- tFAW
*
* FIXME: UM: applies only to DDR2/DDR3 with eight logical banks only
* FIXME: varies depending upon number of column addresses or data
* FIXME: width, was considering looking at pdimm->primary_sdram_width
*/
#if defined(CONFIG_SYS_FSL_DDR1)
popts->tfaw_window_four_activates_ps = mclk_to_picos(1);
#elif defined(CONFIG_SYS_FSL_DDR2)
/*
* x4/x8; some datasheets have 35000
* x16 wide columns only? Use 50000?
*/
popts->tfaw_window_four_activates_ps = 37500;
#else
popts->tfaw_window_four_activates_ps = pdimm[0].tfaw_ps;
#endif
popts->zq_en = 0;
popts->wrlvl_en = 0;
#if defined(CONFIG_SYS_FSL_DDR3) || defined(CONFIG_SYS_FSL_DDR4)
/*
* due to ddr3 dimm is fly-by topology
* we suggest to enable write leveling to
* meet the tQDSS under different loading.
*/
popts->wrlvl_en = 1;
popts->zq_en = 1;
popts->wrlvl_override = 0;
#endif
/*
* Check interleaving configuration from environment.
* Please refer to doc/README.fsl-ddr for the detail.
*
* If memory controller interleaving is enabled, then the data
* bus widths must be programmed identically for all memory controllers.
*
* Attempt to set all controllers to the same chip select
* interleaving mode. It will do a best effort to get the
* requested ranks interleaved together such that the result
* should be a subset of the requested configuration.
*
* if CONFIG_SYS_FSL_DDR_INTLV_256B is defined, mandatory interleaving
* with 256 Byte is enabled.
*/
#if (CONFIG_NUM_DDR_CONTROLLERS > 1)
if (!hwconfig_sub_f("fsl_ddr", "ctlr_intlv", buf))
#ifdef CONFIG_SYS_FSL_DDR_INTLV_256B
;
#else
goto done;
#endif
if (pdimm[0].n_ranks == 0) {
printf("There is no rank on CS0 for controller %d.\n", ctrl_num);
popts->memctl_interleaving = 0;
goto done;
}
popts->memctl_interleaving = 1;
#ifdef CONFIG_SYS_FSL_DDR_INTLV_256B
popts->memctl_interleaving_mode = FSL_DDR_256B_INTERLEAVING;
popts->memctl_interleaving = 1;
debug("256 Byte interleaving\n");
#else
/*
* test null first. if CONFIG_HWCONFIG is not defined
* hwconfig_arg_cmp returns non-zero
*/
if (hwconfig_subarg_cmp_f("fsl_ddr", "ctlr_intlv",
"null", buf)) {
popts->memctl_interleaving = 0;
debug("memory controller interleaving disabled.\n");
} else if (hwconfig_subarg_cmp_f("fsl_ddr",
"ctlr_intlv",
"cacheline", buf)) {
popts->memctl_interleaving_mode =
((CONFIG_NUM_DDR_CONTROLLERS == 3) && ctrl_num == 2) ?
0 : FSL_DDR_CACHE_LINE_INTERLEAVING;
popts->memctl_interleaving =
((CONFIG_NUM_DDR_CONTROLLERS == 3) && ctrl_num == 2) ?
0 : 1;
} else if (hwconfig_subarg_cmp_f("fsl_ddr",
"ctlr_intlv",
"page", buf)) {
popts->memctl_interleaving_mode =
((CONFIG_NUM_DDR_CONTROLLERS == 3) && ctrl_num == 2) ?
0 : FSL_DDR_PAGE_INTERLEAVING;
popts->memctl_interleaving =
((CONFIG_NUM_DDR_CONTROLLERS == 3) && ctrl_num == 2) ?
0 : 1;
} else if (hwconfig_subarg_cmp_f("fsl_ddr",
"ctlr_intlv",
"bank", buf)) {
popts->memctl_interleaving_mode =
((CONFIG_NUM_DDR_CONTROLLERS == 3) && ctrl_num == 2) ?
0 : FSL_DDR_BANK_INTERLEAVING;
popts->memctl_interleaving =
((CONFIG_NUM_DDR_CONTROLLERS == 3) && ctrl_num == 2) ?
0 : 1;
} else if (hwconfig_subarg_cmp_f("fsl_ddr",
"ctlr_intlv",
"superbank", buf)) {
popts->memctl_interleaving_mode =
((CONFIG_NUM_DDR_CONTROLLERS == 3) && ctrl_num == 2) ?
0 : FSL_DDR_SUPERBANK_INTERLEAVING;
popts->memctl_interleaving =
((CONFIG_NUM_DDR_CONTROLLERS == 3) && ctrl_num == 2) ?
0 : 1;
#if (CONFIG_NUM_DDR_CONTROLLERS == 3)
} else if (hwconfig_subarg_cmp_f("fsl_ddr",
"ctlr_intlv",
"3way_1KB", buf)) {
popts->memctl_interleaving_mode =
FSL_DDR_3WAY_1KB_INTERLEAVING;
} else if (hwconfig_subarg_cmp_f("fsl_ddr",
"ctlr_intlv",
"3way_4KB", buf)) {
popts->memctl_interleaving_mode =
FSL_DDR_3WAY_4KB_INTERLEAVING;
} else if (hwconfig_subarg_cmp_f("fsl_ddr",
"ctlr_intlv",
"3way_8KB", buf)) {
popts->memctl_interleaving_mode =
FSL_DDR_3WAY_8KB_INTERLEAVING;
#elif (CONFIG_NUM_DDR_CONTROLLERS == 4)
} else if (hwconfig_subarg_cmp_f("fsl_ddr",
"ctlr_intlv",
"4way_1KB", buf)) {
popts->memctl_interleaving_mode =
FSL_DDR_4WAY_1KB_INTERLEAVING;
} else if (hwconfig_subarg_cmp_f("fsl_ddr",
"ctlr_intlv",
"4way_4KB", buf)) {
popts->memctl_interleaving_mode =
FSL_DDR_4WAY_4KB_INTERLEAVING;
} else if (hwconfig_subarg_cmp_f("fsl_ddr",
"ctlr_intlv",
"4way_8KB", buf)) {
popts->memctl_interleaving_mode =
FSL_DDR_4WAY_8KB_INTERLEAVING;
#endif
} else {
popts->memctl_interleaving = 0;
printf("hwconfig has unrecognized parameter for ctlr_intlv.\n");
}
#endif /* CONFIG_SYS_FSL_DDR_INTLV_256B */
done:
#endif /* CONFIG_NUM_DDR_CONTROLLERS > 1 */
if ((hwconfig_sub_f("fsl_ddr", "bank_intlv", buf)) &&
(CONFIG_CHIP_SELECTS_PER_CTRL > 1)) {
/* test null first. if CONFIG_HWCONFIG is not defined,
* hwconfig_subarg_cmp_f returns non-zero */
if (hwconfig_subarg_cmp_f("fsl_ddr", "bank_intlv",
"null", buf))
debug("bank interleaving disabled.\n");
else if (hwconfig_subarg_cmp_f("fsl_ddr", "bank_intlv",
"cs0_cs1", buf))
popts->ba_intlv_ctl = FSL_DDR_CS0_CS1;
else if (hwconfig_subarg_cmp_f("fsl_ddr", "bank_intlv",
"cs2_cs3", buf))
popts->ba_intlv_ctl = FSL_DDR_CS2_CS3;
else if (hwconfig_subarg_cmp_f("fsl_ddr", "bank_intlv",
"cs0_cs1_and_cs2_cs3", buf))
popts->ba_intlv_ctl = FSL_DDR_CS0_CS1_AND_CS2_CS3;
else if (hwconfig_subarg_cmp_f("fsl_ddr", "bank_intlv",
"cs0_cs1_cs2_cs3", buf))
popts->ba_intlv_ctl = FSL_DDR_CS0_CS1_CS2_CS3;
else if (hwconfig_subarg_cmp_f("fsl_ddr", "bank_intlv",
"auto", buf))
popts->ba_intlv_ctl = auto_bank_intlv(pdimm);
else
printf("hwconfig has unrecognized parameter for bank_intlv.\n");
switch (popts->ba_intlv_ctl & FSL_DDR_CS0_CS1_CS2_CS3) {
case FSL_DDR_CS0_CS1_CS2_CS3:
#if (CONFIG_DIMM_SLOTS_PER_CTLR == 1)
if (pdimm[0].n_ranks < 4) {
popts->ba_intlv_ctl = 0;
printf("Not enough bank(chip-select) for "
"CS0+CS1+CS2+CS3 on controller %d, "
"interleaving disabled!\n", ctrl_num);
}
#elif (CONFIG_DIMM_SLOTS_PER_CTLR == 2)
#ifdef CONFIG_FSL_DDR_FIRST_SLOT_QUAD_CAPABLE
if (pdimm[0].n_ranks == 4)
break;
#endif
if ((pdimm[0].n_ranks < 2) && (pdimm[1].n_ranks < 2)) {
popts->ba_intlv_ctl = 0;
printf("Not enough bank(chip-select) for "
"CS0+CS1+CS2+CS3 on controller %d, "
"interleaving disabled!\n", ctrl_num);
}
if (pdimm[0].capacity != pdimm[1].capacity) {
popts->ba_intlv_ctl = 0;
printf("Not identical DIMM size for "
"CS0+CS1+CS2+CS3 on controller %d, "
"interleaving disabled!\n", ctrl_num);
}
#endif
break;
case FSL_DDR_CS0_CS1:
if (pdimm[0].n_ranks < 2) {
popts->ba_intlv_ctl = 0;
printf("Not enough bank(chip-select) for "
"CS0+CS1 on controller %d, "
"interleaving disabled!\n", ctrl_num);
}
break;
case FSL_DDR_CS2_CS3:
#if (CONFIG_DIMM_SLOTS_PER_CTLR == 1)
if (pdimm[0].n_ranks < 4) {
popts->ba_intlv_ctl = 0;
printf("Not enough bank(chip-select) for CS2+CS3 "
"on controller %d, interleaving disabled!\n", ctrl_num);
}
#elif (CONFIG_DIMM_SLOTS_PER_CTLR == 2)
if (pdimm[1].n_ranks < 2) {
popts->ba_intlv_ctl = 0;
printf("Not enough bank(chip-select) for CS2+CS3 "
"on controller %d, interleaving disabled!\n", ctrl_num);
}
#endif
break;
case FSL_DDR_CS0_CS1_AND_CS2_CS3:
#if (CONFIG_DIMM_SLOTS_PER_CTLR == 1)
if (pdimm[0].n_ranks < 4) {
popts->ba_intlv_ctl = 0;
printf("Not enough bank(CS) for CS0+CS1 and "
"CS2+CS3 on controller %d, "
"interleaving disabled!\n", ctrl_num);
}
#elif (CONFIG_DIMM_SLOTS_PER_CTLR == 2)
if ((pdimm[0].n_ranks < 2) || (pdimm[1].n_ranks < 2)) {
popts->ba_intlv_ctl = 0;
printf("Not enough bank(CS) for CS0+CS1 and "
"CS2+CS3 on controller %d, "
"interleaving disabled!\n", ctrl_num);
}
#endif
break;
default:
popts->ba_intlv_ctl = 0;
break;
}
}
if (hwconfig_sub_f("fsl_ddr", "addr_hash", buf)) {
if (hwconfig_subarg_cmp_f("fsl_ddr", "addr_hash", "null", buf))
popts->addr_hash = 0;
else if (hwconfig_subarg_cmp_f("fsl_ddr", "addr_hash",
"true", buf))
popts->addr_hash = 1;
}
if (pdimm[0].n_ranks == 4)
popts->quad_rank_present = 1;
ddr_freq = get_ddr_freq(0) / 1000000;
if (popts->registered_dimm_en) {
popts->rcw_override = 1;
popts->rcw_1 = 0x000a5a00;
if (ddr_freq <= 800)
popts->rcw_2 = 0x00000000;
else if (ddr_freq <= 1066)
popts->rcw_2 = 0x00100000;
else if (ddr_freq <= 1333)
popts->rcw_2 = 0x00200000;
else
popts->rcw_2 = 0x00300000;
}
fsl_ddr_board_options(popts, pdimm, ctrl_num);
return 0;
}
void check_interleaving_options(fsl_ddr_info_t *pinfo)
{
int i, j, k, check_n_ranks, intlv_invalid = 0;
unsigned int check_intlv, check_n_row_addr, check_n_col_addr;
unsigned long long check_rank_density;
struct dimm_params_s *dimm;
int first_ctrl = pinfo->first_ctrl;
int last_ctrl = first_ctrl + pinfo->num_ctrls - 1;
/*
* Check if all controllers are configured for memory
* controller interleaving. Identical dimms are recommended. At least
* the size, row and col address should be checked.
*/
j = 0;
check_n_ranks = pinfo->dimm_params[first_ctrl][0].n_ranks;
check_rank_density = pinfo->dimm_params[first_ctrl][0].rank_density;
check_n_row_addr = pinfo->dimm_params[first_ctrl][0].n_row_addr;
check_n_col_addr = pinfo->dimm_params[first_ctrl][0].n_col_addr;
check_intlv = pinfo->memctl_opts[first_ctrl].memctl_interleaving_mode;
for (i = first_ctrl; i <= last_ctrl; i++) {
dimm = &pinfo->dimm_params[i][0];
if (!pinfo->memctl_opts[i].memctl_interleaving) {
continue;
} else if (((check_rank_density != dimm->rank_density) ||
(check_n_ranks != dimm->n_ranks) ||
(check_n_row_addr != dimm->n_row_addr) ||
(check_n_col_addr != dimm->n_col_addr) ||
(check_intlv !=
pinfo->memctl_opts[i].memctl_interleaving_mode))){
intlv_invalid = 1;
break;
} else {
j++;
}
}
if (intlv_invalid) {
for (i = first_ctrl; i <= last_ctrl; i++)
pinfo->memctl_opts[i].memctl_interleaving = 0;
printf("Not all DIMMs are identical. "
"Memory controller interleaving disabled.\n");
} else {
switch (check_intlv) {
case FSL_DDR_256B_INTERLEAVING:
case FSL_DDR_CACHE_LINE_INTERLEAVING:
case FSL_DDR_PAGE_INTERLEAVING:
case FSL_DDR_BANK_INTERLEAVING:
case FSL_DDR_SUPERBANK_INTERLEAVING:
#if (3 == CONFIG_NUM_DDR_CONTROLLERS)
k = 2;
#else
k = CONFIG_NUM_DDR_CONTROLLERS;
#endif
break;
case FSL_DDR_3WAY_1KB_INTERLEAVING:
case FSL_DDR_3WAY_4KB_INTERLEAVING:
case FSL_DDR_3WAY_8KB_INTERLEAVING:
case FSL_DDR_4WAY_1KB_INTERLEAVING:
case FSL_DDR_4WAY_4KB_INTERLEAVING:
case FSL_DDR_4WAY_8KB_INTERLEAVING:
default:
k = CONFIG_NUM_DDR_CONTROLLERS;
break;
}
debug("%d of %d controllers are interleaving.\n", j, k);
if (j && (j != k)) {
for (i = first_ctrl; i <= last_ctrl; i++)
pinfo->memctl_opts[i].memctl_interleaving = 0;
if ((last_ctrl - first_ctrl) > 1)
puts("Not all controllers have compatible interleaving mode. All disabled.\n");
}
}
debug("Checking interleaving options completed\n");
}
int fsl_use_spd(void)
{
int use_spd = 0;
#ifdef CONFIG_DDR_SPD
char buffer[HWCONFIG_BUFFER_SIZE];
char *buf = NULL;
/*
* Extract hwconfig from environment since we have not properly setup
* the environment but need it for ddr config params
*/
if (getenv_f("hwconfig", buffer, sizeof(buffer)) > 0)
buf = buffer;
/* if hwconfig is not enabled, or "sdram" is not defined, use spd */
if (hwconfig_sub_f("fsl_ddr", "sdram", buf)) {
if (hwconfig_subarg_cmp_f("fsl_ddr", "sdram", "spd", buf))
use_spd = 1;
else if (hwconfig_subarg_cmp_f("fsl_ddr", "sdram",
"fixed", buf))
use_spd = 0;
else
use_spd = 1;
} else
use_spd = 1;
#endif
return use_spd;
}
|
{
"pile_set_name": "Github"
}
|
%%%%
scimitar of Flaming Death
Smokin'!
%%%%
scythe "Finisher"
Uzun ve keskin tırpan. Savaşlar için özel olarak modifiye edilmiş
%%%%
sling "Punk"
Garip mavi deriden yapılmış sapan.
%%%%
crossbow "Hellfire"
Cehennem ateşinde dövülmüş ateşten bir arbelat; adı gibi güçlü ateşten oklar
fırlatır
%%%%
robe of Augmentation
En iyi ipekten yapılmış cübbe
%%%%
cloak of Flash
Titreyen bir pelerin
%%%%
skin of Zhor
Garip bir hayvanın kokan derisi
%%%%
salamander hide armour
Salamander derisinden yapılma zırh
%%%%
shield of Resistance
Bronz bir kalkan
%%%%
Maxwell's patent armour
Garip görünüşlü zırh
%%%%
ring of Robustness
Sade çelik bir yüzük
%%%%
|
{
"pile_set_name": "Github"
}
|
# Copyright 2011-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://github.com/systemd/systemd.git"
inherit git-r3
else
if [[ ${PV} == *.* ]]; then
MY_PN=systemd-stable
else
MY_PN=systemd
fi
MY_PV=${PV/_/-}
MY_P=${MY_PN}-${MY_PV}
S=${WORKDIR}/${MY_P}
SRC_URI="https://github.com/systemd/${MY_PN}/archive/v${MY_PV}/${MY_P}.tar.gz"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
fi
PYTHON_COMPAT=( python3_{6,7,8} )
inherit bash-completion-r1 linux-info meson multilib-minimal ninja-utils pam python-any-r1 systemd toolchain-funcs udev usr-ldscript
DESCRIPTION="System and service manager for Linux"
HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd"
LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
SLOT="0/2"
IUSE="acl apparmor audit build cgroup-hybrid cryptsetup curl dns-over-tls elfutils +gcrypt gnuefi homed http +hwdb idn importd +kmod +lz4 lzma nat pam pcre pkcs11 policykit pwquality qrcode repart +resolvconf +seccomp selinux split-usr static-libs +sysv-utils test vanilla xkb"
REQUIRED_USE="
homed? ( cryptsetup )
importd? ( curl gcrypt lzma )
"
RESTRICT="!test? ( test )"
MINKV="3.11"
OPENSSL_DEP=">=dev-libs/openssl-1.1.0:0="
COMMON_DEPEND=">=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}]
sys-libs/libcap:0=[${MULTILIB_USEDEP}]
acl? ( sys-apps/acl:0= )
apparmor? ( sys-libs/libapparmor:0= )
audit? ( >=sys-process/audit-2:0= )
cryptsetup? ( >=sys-fs/cryptsetup-2.0.1:0= )
curl? ( net-misc/curl:0= )
dns-over-tls? ( >=net-libs/gnutls-3.6.0:0= )
elfutils? ( >=dev-libs/elfutils-0.158:0= )
gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
homed? ( ${OPENSSL_DEP} )
http? (
>=net-libs/libmicrohttpd-0.9.33:0=[epoll(+)]
>=net-libs/gnutls-3.1.4:0=
)
idn? ( net-dns/libidn2:= )
importd? (
app-arch/bzip2:0=
sys-libs/zlib:0=
)
kmod? ( >=sys-apps/kmod-15:0= )
lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] )
lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
nat? ( net-firewall/iptables:0= )
pam? ( sys-libs/pam:=[${MULTILIB_USEDEP}] )
pkcs11? ( app-crypt/p11-kit:0= )
pcre? ( dev-libs/libpcre2 )
pwquality? ( dev-libs/libpwquality:0= )
qrcode? ( media-gfx/qrencode:0= )
repart? ( ${OPENSSL_DEP} )
seccomp? ( >=sys-libs/libseccomp-2.3.3:0= )
selinux? ( sys-libs/libselinux:0= )
xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )"
# Newer linux-headers needed by ia64, bug #480218
DEPEND="${COMMON_DEPEND}
>=sys-kernel/linux-headers-${MINKV}
gnuefi? ( >=sys-boot/gnu-efi-3.0.2 )
"
# baselayout-2.2 has /run
RDEPEND="${COMMON_DEPEND}
acct-group/adm
acct-group/wheel
acct-group/kmem
acct-group/tty
acct-group/utmp
acct-group/audio
acct-group/cdrom
acct-group/dialout
acct-group/disk
acct-group/input
acct-group/kvm
acct-group/render
acct-group/tape
acct-group/video
acct-group/systemd-journal
acct-user/systemd-journal-remote
acct-user/systemd-coredump
acct-user/systemd-network
acct-user/systemd-resolve
acct-user/systemd-timesync
>=sys-apps/baselayout-2.2
selinux? ( sec-policy/selinux-base-policy[systemd] )
sysv-utils? ( !sys-apps/sysvinit )
!sysv-utils? ( sys-apps/sysvinit )
resolvconf? ( !net-dns/openresolv )
!build? ( || (
sys-apps/util-linux[kill(-)]
sys-process/procps[kill(+)]
sys-apps/coreutils[kill(-)]
) )
!sys-auth/nss-myhostname
!sys-fs/eudev
!sys-fs/udev
"
# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
PDEPEND=">=sys-apps/dbus-1.9.8[systemd]
hwdb? ( >=sys-apps/hwids-20150417[udev] )
>=sys-fs/udev-init-scripts-34
policykit? ( sys-auth/polkit )
!vanilla? ( sys-apps/gentoo-systemd-integration )"
BDEPEND="
app-arch/xz-utils:0
dev-util/gperf
>=dev-util/meson-0.46
>=dev-util/intltool-0.50
>=sys-apps/coreutils-8.16
sys-devel/m4
virtual/pkgconfig
test? ( sys-apps/dbus )
app-text/docbook-xml-dtd:4.2
app-text/docbook-xml-dtd:4.5
app-text/docbook-xsl-stylesheets
dev-libs/libxslt:0
$(python_gen_any_dep 'dev-python/lxml[${PYTHON_USEDEP}]')
"
python_check_deps() {
has_version -b "dev-python/lxml[${PYTHON_USEDEP}]"
}
pkg_pretend() {
if [[ ${MERGE_TYPE} != buildonly ]]; then
if use test && has pid-sandbox ${FEATURES}; then
ewarn "Tests are known to fail with PID sandboxing enabled."
ewarn "See https://bugs.gentoo.org/674458."
fi
local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS
~CHECKPOINT_RESTORE ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE
~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS
~TIMERFD ~TMPFS_XATTR ~UNIX ~USER_NS
~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH
~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
~!SYSFS_DEPRECATED_V2"
use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER"
kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG"
kernel_is -lt 4 7 && CONFIG_CHECK+=" ~DEVPTS_MULTIPLE_INSTANCES"
kernel_is -ge 4 10 && CONFIG_CHECK+=" ~CGROUP_BPF"
if linux_config_exists; then
local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
if [[ -n ${uevent_helper_path} ]] && [[ ${uevent_helper_path} != '""' ]]; then
ewarn "It's recommended to set an empty value to the following kernel config option:"
ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
fi
if linux_chkconfig_present X86; then
CONFIG_CHECK+=" ~DMIID"
fi
fi
if kernel_is -lt ${MINKV//./ }; then
ewarn "Kernel version at least ${MINKV} required"
fi
check_extra_config
fi
}
pkg_setup() {
:
}
src_unpack() {
default
[[ ${PV} != 9999 ]] || git-r3_src_unpack
}
src_prepare() {
# Do NOT add patches here
local PATCHES=()
[[ -d "${WORKDIR}"/patches ]] && PATCHES+=( "${WORKDIR}"/patches )
# Add local patches here
PATCHES+=(
)
if ! use vanilla; then
PATCHES+=(
"${FILESDIR}/gentoo-generator-path-r2.patch"
"${FILESDIR}/gentoo-systemctl-disable-sysv-sync.patch"
"${FILESDIR}/gentoo-journald-audit.patch"
)
fi
default
}
src_configure() {
# Prevent conflicts with i686 cross toolchain, bug 559726
tc-export AR CC NM OBJCOPY RANLIB
python_setup
multilib-minimal_src_configure
}
meson_use() {
usex "$1" true false
}
meson_multilib() {
if multilib_is_native_abi; then
echo true
else
echo false
fi
}
meson_multilib_native_use() {
if multilib_is_native_abi && use "$1"; then
echo true
else
echo false
fi
}
multilib_src_configure() {
local myconf=(
--localstatedir="${EPREFIX}/var"
-Dsupport-url="https://gentoo.org/support/"
-Dpamlibdir="$(getpam_mod_dir)"
# avoid bash-completion dep
-Dbashcompletiondir="$(get_bashcompdir)"
# make sure we get /bin:/sbin in PATH
-Dsplit-usr=$(usex split-usr true false)
-Dsplit-bin=true
-Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")"
-Drootlibdir="${EPREFIX}/usr/$(get_libdir)"
# Avoid infinite exec recursion, bug 642724
-Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit"
# no deps
-Dima=true
-Ddefault-hierarchy=$(usex cgroup-hybrid hybrid unified)
# Optional components/dependencies
-Dacl=$(meson_multilib_native_use acl)
-Dapparmor=$(meson_multilib_native_use apparmor)
-Daudit=$(meson_multilib_native_use audit)
-Dlibcryptsetup=$(meson_multilib_native_use cryptsetup)
-Dlibcurl=$(meson_multilib_native_use curl)
-Ddns-over-tls=$(meson_multilib_native_use dns-over-tls)
-Delfutils=$(meson_multilib_native_use elfutils)
-Dgcrypt=$(meson_use gcrypt)
-Dgnu-efi=$(meson_multilib_native_use gnuefi)
-Defi-libdir="${ESYSROOT}/usr/$(get_libdir)"
-Dhomed=$(meson_multilib_native_use homed)
-Dhwdb=$(meson_multilib_native_use hwdb)
-Dmicrohttpd=$(meson_multilib_native_use http)
-Didn=$(meson_multilib_native_use idn)
-Dimportd=$(meson_multilib_native_use importd)
-Dbzip2=$(meson_multilib_native_use importd)
-Dzlib=$(meson_multilib_native_use importd)
-Dkmod=$(meson_multilib_native_use kmod)
-Dlz4=$(meson_use lz4)
-Dxz=$(meson_use lzma)
-Dlibiptc=$(meson_multilib_native_use nat)
-Dpam=$(meson_use pam)
-Dp11kit=$(meson_multilib_native_use pkcs11)
-Dpcre2=$(meson_multilib_native_use pcre)
-Dpolkit=$(meson_multilib_native_use policykit)
-Dpwquality=$(meson_multilib_native_use pwquality)
-Dqrencode=$(meson_multilib_native_use qrcode)
-Drepart=$(meson_multilib_native_use repart)
-Dseccomp=$(meson_multilib_native_use seccomp)
-Dselinux=$(meson_multilib_native_use selinux)
-Ddbus=$(meson_multilib_native_use test)
-Dxkbcommon=$(meson_multilib_native_use xkb)
-Dntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
# Breaks screen, tmux, etc.
-Ddefault-kill-user-processes=false
-Dcreate-log-dirs=false
# multilib options
-Dbacklight=$(meson_multilib)
-Dbinfmt=$(meson_multilib)
-Dcoredump=$(meson_multilib)
-Denvironment-d=$(meson_multilib)
-Dfirstboot=$(meson_multilib)
-Dhibernate=$(meson_multilib)
-Dhostnamed=$(meson_multilib)
-Dldconfig=$(meson_multilib)
-Dlocaled=$(meson_multilib)
-Dman=$(meson_multilib)
-Dnetworkd=$(meson_multilib)
-Dquotacheck=$(meson_multilib)
-Drandomseed=$(meson_multilib)
-Drfkill=$(meson_multilib)
-Dsysusers=$(meson_multilib)
-Dtimedated=$(meson_multilib)
-Dtimesyncd=$(meson_multilib)
-Dtmpfiles=$(meson_multilib)
-Dvconsole=$(meson_multilib)
# static-libs
-Dstatic-libsystemd=$(usex static-libs true false)
-Dstatic-libudev=$(usex static-libs true false)
)
meson_src_configure "${myconf[@]}"
}
multilib_src_compile() {
eninja
}
multilib_src_test() {
unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR
meson_src_test
}
multilib_src_install() {
DESTDIR="${D}" eninja install
}
multilib_src_install_all() {
local rootprefix=$(usex split-usr '' /usr)
# meson doesn't know about docdir
mv "${ED}"/usr/share/doc/{systemd,${PF}} || die
einstalldocs
dodoc "${FILESDIR}"/nsswitch.conf
if ! use resolvconf; then
rm -f "${ED}${rootprefix}"/sbin/resolvconf || die
fi
rm "${ED}"/etc/init.d/README || die
rm "${ED}${rootprefix}"/lib/systemd/system-generators/systemd-sysv-generator || die
if ! use sysv-utils; then
rm "${ED}${rootprefix}"/sbin/{halt,init,poweroff,reboot,runlevel,shutdown,telinit} || die
rm "${ED}"/usr/share/man/man1/init.1 || die
rm "${ED}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 || die
fi
if ! use resolvconf && ! use sysv-utils; then
rmdir "${ED}${rootprefix}"/sbin || die
fi
# Preserve empty dirs in /etc & /var, bug #437008
keepdir /etc/{binfmt.d,modules-load.d,tmpfiles.d}
keepdir /etc/kernel/install.d
keepdir /etc/systemd/{network,system,user}
keepdir /etc/udev/rules.d
if use hwdb; then
keepdir /etc/udev/hwdb.d
fi
keepdir "${rootprefix}"/lib/systemd/{system-sleep,system-shutdown}
keepdir /usr/lib/{binfmt.d,modules-load.d}
keepdir /usr/lib/systemd/user-generators
keepdir /var/lib/systemd
keepdir /var/log/journal
# Symlink /etc/sysctl.conf for easy migration.
dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf
if use hwdb; then
rm -r "${ED}${rootprefix}"/lib/udev/hwdb.d || die
fi
if use split-usr; then
# Avoid breaking boot/reboot
dosym ../../../lib/systemd/systemd /usr/lib/systemd/systemd
dosym ../../../lib/systemd/systemd-shutdown /usr/lib/systemd/systemd-shutdown
fi
gen_usr_ldscript -a systemd udev
}
migrate_locale() {
local envd_locale_def="${EROOT}/etc/env.d/02locale"
local envd_locale=( "${EROOT}"/etc/env.d/??locale )
local locale_conf="${EROOT}/etc/locale.conf"
if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
# If locale.conf does not exist...
if [[ -e ${envd_locale} ]]; then
# ...either copy env.d/??locale if there's one
ebegin "Moving ${envd_locale} to ${locale_conf}"
mv "${envd_locale}" "${locale_conf}"
eend ${?} || FAIL=1
else
# ...or create a dummy default
ebegin "Creating ${locale_conf}"
cat > "${locale_conf}" <<-EOF
# This file has been created by the sys-apps/systemd ebuild.
# See locale.conf(5) and localectl(1).
# LANG=${LANG}
EOF
eend ${?} || FAIL=1
fi
fi
if [[ ! -L ${envd_locale} ]]; then
# now, if env.d/??locale is not a symlink (to locale.conf)...
if [[ -e ${envd_locale} ]]; then
# ...warn the user that he has duplicate locale settings
ewarn
ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
ewarn "and create the symlink with the following command:"
ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
ewarn
else
# ...or just create the symlink if there's nothing here
ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
ln -n -s ../locale.conf "${envd_locale_def}"
eend ${?} || FAIL=1
fi
fi
}
save_enabled_units() {
ENABLED_UNITS=()
type systemctl &>/dev/null || return
for x; do
if systemctl --quiet --root="${ROOT:-/}" is-enabled "${x}"; then
ENABLED_UNITS+=( "${x}" )
fi
done
}
pkg_preinst() {
save_enabled_units {machines,remote-{cryptsetup,fs}}.target getty@tty1.service
if ! use split-usr; then
local dir
for dir in bin sbin lib; do
if [[ ! ${EROOT}/${dir} -ef ${EROOT}/usr/${dir} ]]; then
eerror "\"${EROOT}/${dir}\" and \"${EROOT}/usr/${dir}\" are not merged."
eerror "One of them should be a symbolic link to the other one."
FAIL=1
fi
done
if [[ ${FAIL} ]]; then
eerror "Migration to system layout with merged directories must be performed before"
eerror "rebuilding ${CATEGORY}/${PN} with USE=\"-split-usr\" to avoid run-time breakage."
die "System layout with split directories still used"
fi
fi
}
pkg_postinst() {
systemd_update_catalog
# Keep this here in case the database format changes so it gets updated
# when required. Despite that this file is owned by sys-apps/hwids.
if has_version "sys-apps/hwids[udev]"; then
udevadm hwdb --update --root="${EROOT}"
fi
udev_reload || FAIL=1
# Bug 465468, make sure locales are respect, and ensure consistency
# between OpenRC & systemd
migrate_locale
systemd_reenable systemd-networkd.service systemd-resolved.service
if [[ ${ENABLED_UNITS[@]} ]]; then
systemctl --root="${ROOT:-/}" enable "${ENABLED_UNITS[@]}"
fi
if [[ -z ${REPLACING_VERSIONS} ]]; then
if type systemctl &>/dev/null; then
systemctl --root="${ROOT:-/}" enable getty@.service remote-fs.target || FAIL=1
fi
elog "To enable a useful set of services, run the following:"
elog " systemctl preset-all --preset-mode=enable-only"
fi
if [[ -L ${EROOT}/var/lib/systemd/timesync ]]; then
rm "${EROOT}/var/lib/systemd/timesync"
fi
if [[ -z ${ROOT} && -d /run/systemd/system ]]; then
ebegin "Reexecuting system manager"
systemctl daemon-reexec
eend $?
fi
if [[ ${FAIL} ]]; then
eerror "One of the postinst commands failed. Please check the postinst output"
eerror "for errors. You may need to clean up your system and/or try installing"
eerror "systemd again."
eerror
fi
}
pkg_prerm() {
# If removing systemd completely, remove the catalog database.
if [[ ! ${REPLACED_BY_VERSION} ]]; then
rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
fi
}
|
{
"pile_set_name": "Github"
}
|
\documentclass{beamer}
\usepackage{color,amsmath}
\usepackage{subfigure}
\usepackage{booktabs}
\usepackage{framed}
\usepackage{comment}
\def\vf{\vfill}
%%%%%%%%%%%%%%%%%%%%%%%%%%
\title[]{Welcome and logistics}
\author[]{Matthew J. Salganik\\Department of Sociology\\Princeton University}
\date[]{Summer Institute in Computational Social Science\\June 19, 2017
\vfill
\begin{flushright}
\vspace{0.6in}
\includegraphics[width=0.1\textwidth]{figures/cc-by.png}
\end{flushright}
}
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%
\frame{\titlepage}
%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\begin{center}
\Large{Welcome}
\end{center}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
Logistics:
\pause
\begin{itemize}
\item How do I get on the internet?: \texttt{puvisitor}
\pause
\item Consent form for livestream
\pause
\item Collect information for Qualtrics accounts
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
A typical day:
\begin{itemize}
\item 9am: start
\item morning: mix of lecture and activities, mostly lecture
\item lunch
\item afternoon: mix of lecture and activities, mostly activties
\item 4pm: visiting speaker
\item dinner
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
|
{
"pile_set_name": "Github"
}
|
/* $NetBSD: if_ieee1394.h,v 1.6 2005/12/10 23:21:38 elad Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Atsushi Onoe.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _NET_IF_IEEE1394_H_
#define _NET_IF_IEEE1394_H_
/* hardware address information for arp / nd */
struct ieee1394_hwaddr {
u_int8_t iha_uid[8]; /* node unique ID */
u_int8_t iha_maxrec; /* max_rec in the config ROM */
u_int8_t iha_speed; /* min of link/PHY speed */
u_int8_t iha_offset[6]; /* unicast FIFO address */
};
/*
* BPF wants to see one of these.
*/
struct ieee1394_bpfhdr {
uint8_t ibh_dhost[8];
uint8_t ibh_shost[8];
uint16_t ibh_type;
};
#ifdef _KERNEL
/* pseudo header */
struct ieee1394_header {
u_int8_t ih_uid[8]; /* dst/src uid */
u_int8_t ih_maxrec; /* dst maxrec for tx */
u_int8_t ih_speed; /* speed */
u_int8_t ih_offset[6]; /* dst offset */
};
/* unfragment encapsulation header */
struct ieee1394_unfraghdr {
u_int16_t iuh_ft; /* fragment type == 0 */
u_int16_t iuh_etype; /* ether_type */
};
/* fragmented encapsulation header */
struct ieee1394_fraghdr {
u_int16_t ifh_ft_size; /* fragment type, data size-1 */
u_int16_t ifh_etype_off; /* etype for first fragment */
/* offset for subseq frag */
u_int16_t ifh_dgl; /* datagram label */
u_int16_t ifh_reserved;
};
#define IEEE1394_FT_SUBSEQ 0x8000
#define IEEE1394_FT_MORE 0x4000
#define IEEE1394MTU 1500
#define IEEE1394_GASP_LEN 8 /* GASP header for Stream */
#define IEEE1394_ADDR_LEN 8
#define IEEE1394_CRC_LEN 4
struct ieee1394_reass_pkt {
LIST_ENTRY(ieee1394_reass_pkt) rp_next;
struct mbuf *rp_m;
u_int16_t rp_size;
u_int16_t rp_etype;
u_int16_t rp_off;
u_int16_t rp_dgl;
u_int16_t rp_len;
u_int16_t rp_ttl;
};
struct ieee1394_reassq {
LIST_ENTRY(ieee1394_reassq) rq_node;
LIST_HEAD(, ieee1394_reass_pkt) rq_pkt;
u_int32_t fr_id;
};
struct ieee1394com {
struct ifnet fc_if;
struct ieee1394_hwaddr ic_hwaddr;
u_int16_t ic_dgl;
LIST_HEAD(, ieee1394_reassq) ic_reassq;
};
const char *ieee1394_sprintf(const u_int8_t *);
void ieee1394_input(struct ifnet *, struct mbuf *, u_int16_t);
void ieee1394_ifattach(struct ifnet *, const struct ieee1394_hwaddr *);
void ieee1394_ifdetach(struct ifnet *);
int ieee1394_ioctl(struct ifnet *, u_long, caddr_t);
struct mbuf * ieee1394_fragment(struct ifnet *, struct mbuf *, int, u_int16_t);
void ieee1394_drain(struct ifnet *);
void ieee1394_watchdog(struct ifnet *);
#endif /* _KERNEL */
#endif /* !_NET_IF_IEEE1394_H_ */
|
{
"pile_set_name": "Github"
}
|
0
0
1
11
3
7
9
9
1
5
2
1
1
2
9
0
2
3
3
2
5
1
3
11
0
1
9
2
11
0
0
4
0
0
9
2
7
0
2
2
7
0
2
9
0
0
9
2
7
3
1
2
9
0
1
0
5
3
7
0
7
9
7
3
7
7
7
3
1
7
99
5
2
9
2
0
9
1
2
3
3
5
2
9
11
3
1
7
4
7
7
7
1
0
0
3
7
11
0
3
2
0
0
0
0
3
9
4
5
1
21
13
7
3
2
0
2
7
3
9
2
11
3
9
9
3
1
5
1
7
1
1
0
2
2
11
0
1
1
2
1
9
3
0
0
0
0
5
2
11
0
2
7
5
9
0
2
7
1
0
0
7
0
0
9
1
1
1
0
0
11
11
0
0
0
1
7
1
1
0
0
0
7
0
2
0
1
7
7
1
0
0
3
7
0
0
0
2
0
9
1
5
0
0
2
9
1
1
7
3
0
7
1
11
0
1
1
9
13
4
3
0
1
7
1
0
1
7
1
0
9
1
3
5
1
3
9
3
1
1
3
7
1
1
1
3
11
1
1
3
0
1
5
5
2
1
13
1
9
9
1
3
3
1
9
1
11
0
0
9
0
0
0
1
7
1
5
9
7
11
9
0
0
1
2
5
7
1
|
{
"pile_set_name": "Github"
}
|
%%
%% This is file `ucmtt.fd',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% cmfonts.fdd (with options: `Ucmtt')
%%
%% This is a generated file.
%%
%% The source is maintained by the LaTeX Project team and bug
%% reports for it can be opened at https://latex-project.org/bugs.html
%% (but please observe conditions on bug reports sent to that address!)
%%
%%
%% Copyright (C) 1993-2019
%% The LaTeX3 Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file was generated from file(s) of the LaTeX base system.
%% --------------------------------------------------------------
%%
%% It may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% https://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2008 or later.
%%
%% This file may only be distributed together with a copy of the LaTeX
%% base system. You may however distribute the LaTeX base system without
%% such generated files.
%%
%% The list of all files belonging to the LaTeX base distribution is
%% given in the file `manifest.txt'. See also `legal.txt' for additional
%% information.
%%
%% In particular, permission is granted to customize the declarations in
%% this file to serve the needs of your installation.
%%
%% However, a modified version of this file under its original name
%% should not be distributed as part of a standard LaTeX distribution, as
%% the modification will be nontransparent for the user of that
%% distribution (and thus violating clause 6a of the LPPL license),
%% making successful document exchange impossible.
%%
\ProvidesFile{ucmtt.fd}
[2014/09/29 v2.5h Standard LaTeX font definitions]
\DeclareFontFamily{U}{cmtt}{\hyphenchar \font\m@ne}
\DeclareFontShape{U}{cmtt}{m}{n}%
{%
<5><6><7><8>cmtt8<9>cmtt9%
<10><10.95>cmtt10%
<12><14.4><17.28><20.74><24.88>cmtt12%
}{}
%%%%%% make sure subst shapes are available
\DeclareFontShape{U}{cmtt}{m}{it}%
{%
<5><6><7><8><9>%
<10><10.95><12><14.4><17.28><20.74><24.88>cmitt10%
}{}
\DeclareFontShape{U}{cmtt}{m}{sl}%
{%
<5><6><7><8><9>%
<10><10.95><12><14.4><17.28><20.74><24.88>cmsltt10%
}{}
\DeclareFontShape{U}{cmtt}{m}{sc}%
{%
<5><6><7><8><9>%
<10><10.95><12><14.4><17.28><20.74><24.88>cmtcsc10%
}{}
\DeclareFontShape{U}{cmtt}{m}{ui}%
{<->sub*cmtt/m/it}{}
\DeclareFontShape{U}{cmtt}{bx}{n}%
{<->sub*cmtt/m/n}{}
\DeclareFontShape{U}{cmtt}{bx}{it}%
{<->sub*cmtt/m/it}{}
\DeclareFontShape{U}{cmtt}{bx}{ui}%
{<->sub*cmtt/m/it}{}
\endinput
%%
%% End of file `ucmtt.fd'.
|
{
"pile_set_name": "Github"
}
|
# $NetBSD: Makefile,v 1.19 2020/08/31 23:07:07 wiz Exp $
DISTNAME= kitty-0.16.0
PKGREVISION= 3
CATEGORIES= x11
MASTER_SITES= ${MASTER_SITE_GITHUB:=kovidgoyal/}
GITHUB_PROJECT= kitty
GITHUB_RELEASE= v${PKGVERSION_NOREV}
EXTRACT_SUFX= .tar.xz
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= https://sw.kovidgoyal.net/kitty/index.html
COMMENT= GPU based terminal emulator
LICENSE= gnu-gpl-v3
USE_LANGUAGES= c99
EXTRACT_USING= bsdtar
USE_TOOLS+= gmake pkg-config
# don't force LTO
BUILDLINK_TRANSFORM+= rm:-flto
# kitty's homegrown packaging expects the functionality of tic(1) that
# comes with ncurses.
USE_NCURSES= yes
PYTHON_VERSIONED_DEPENDENCIES+= setuptools:tool
SUBST_CLASSES+= python
SUBST_STAGE.python= pre-build
SUBST_MESSAGE.python= Replacing path to Sphinx.
SUBST_FILES.python= docs/Makefile
SUBST_SED.python+= -e "s,sphinx-build,sphinx-build-${PYVERSSUFFIX},g"
INSTALLATION_DIRS+= ${PKGMANDIR}/man1
PYTHON_VERSIONS_INCOMPATIBLE= 27
PYTHON_VERSIONED_DEPENDENCIES+= sphinx:tool
do-build:
cd ${WRKSRC} && ${MAKE_ENV} ${PYTHONBIN} setup.py linux-package
cd ${WRKSRC} && ${MAKE_ENV} ${GMAKE} man
do-install:
cd ${WRKSRC} && ${MAKE_ENV} ${PYTHONBIN} setup.py linux-package \
--prefix ${DESTDIR}${PREFIX}
${FIND} ${DESTDIR} -type d -name __pycache__ -print0 | ${XARGS} -0 ${RM} -rf
${MV} ${DESTDIR}${PREFIX}/share/man/man1/kitty.1 \
${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/kitty.1 || ${FALSE}
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} != "Darwin"
.include "../../graphics/freetype2/buildlink3.mk"
.include "../../fonts/fontconfig/buildlink3.mk"
.endif
.include "options.mk"
.include "../../graphics/hicolor-icon-theme/buildlink3.mk"
.include "../../devel/ncurses/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../fonts/harfbuzz/buildlink3.mk"
.include "../../graphics/MesaLib/buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
.include "../../sysutils/dbus/buildlink3.mk"
.include "../../x11/libXcursor/buildlink3.mk"
.include "../../x11/libXi/buildlink3.mk"
.include "../../x11/libXinerama/buildlink3.mk"
.include "../../x11/libXrandr/buildlink3.mk"
.include "../../x11/libxkbcommon/buildlink3.mk"
.include "../../lang/python/application.mk"
.include "../../lang/python/extension.mk"
.include "../../lang/python/tool.mk"
.include "../../lang/python/versioned_dependencies.mk"
.include "../../mk/pthread.buildlink3.mk"
.include "../../mk/dlopen.buildlink3.mk"
BUILDLINK_TRANSFORM+= opt:-ldl:${BUILDLINK_LDADD.dl:Q}
.include "../../lang/python/versioned_dependencies.mk"
.include "../../mk/bsd.pkg.mk"
|
{
"pile_set_name": "Github"
}
|
\chapter{File formats}
\label{app:formats}
All file formats are binary, and all data fields are stored in
little-endian byte order, unless otherwise specified. All indices are
zero-based, and all sizes and offsets are in bytes unless otherwise
specified. To describe a file format, we use the conventions shown in
the following example of a table:
\begin{protocol}
\pline{Bytes in field}{Description of field}
\\
\pline{4 bytes}{number of \nonterminal{entry}s (= $n$)}
\pline{4$n$ bytes}{\nonterminal{entry}s}
\\
\newnonterminal{entry}
\pline{4 bytes}{per-entry information}
\\
\pline{\nonterminal{entry}$*$}{zero or more instances of \nonterminal{entry}}
\end{protocol}
The file is described in sequential order. A token within angle
brackets ({\tt <>}) is a nonterminal symbol that is defined elsewhere
in the specification.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Sound and music files}
The client supports music in standard MIDI files. Sounds can be in
any of the usual WAV file formats: sampling rates of 11kHz, 22 kHz,
44 kHz, mono or stereo, and 8 bit or 16 bit samples.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Object code {\tt .bof}}
A \bof file contains the object code generated by compiling a \kod
file with the Blakston compiler. All offsets in the file are relative
to the beginning of the file, which is offset 0.
\begin{protocol}
\pline{4 bytes}{magic number = 42 4F 46 FF (hexadecimal)}
\pline{4 bytes}{version of bof file = 5}
\\
\pline{4 bytes}{offset of source filename}
\pline{4 bytes}{offset of beginning of \nonterminal{string table}}
\pline{4 bytes}{offset of beginning of \nonterminal{debugging info} (0 if none)}
\\
\pline{4 bytes}{number of classes (= $n$)}
8$n$ bytes \\
\plineindent{4 bytes}{class id}
\plineindent{4 bytes}{offset of class in file}
\\
\nonterminal{class}$*$ \\
\nonterminal{string table} \\
\nonterminal{debugging info} \\
\pline{\nonterminal{string}}{source filename}
\\
\newnonterminal{class}
\pline{4 bytes}{class id of superclass}
\pline{4 bytes}{offset of \nonterminal{property section}}
\pline{4 bytes}{offset of \nonterminal{message section}}
\pline{4 bytes}{number of class variables for this class and all superclasses}
\pline{4 bytes}{number of default class variable values (= $n$)}
\pline{8$n$ bytes}{class variable default values}
\plineindent{4 bytes}{index number of class variable}
\plineindent{4 bytes}{class variable default \nonterminal{value}}
\\
\newnonterminal{property section}
\pline{4 bytes}{number of properties for this class and all superclasses}
\pline{4 bytes}{number of default property values (= $n$)}
\pline{8$n$ bytes}{property default values}
\plineindent{4 bytes}{index number of property}
\plineindent{4 bytes}{property default \nonterminal{value}}
\\
\newnonterminal{message section}
\pline{4 bytes}{number of \nonterminal{message handler}s (= $n$)}
\pline{12$n$ bytes}{message handler headers}
\plineindent{4 bytes}{message id}
\plineindent{4 bytes}{offset of message handler}
\plineindent{4 bytes}{index of handler's comment string in \nonterminal{string table} (-1 if none)}
\nonterminal{message handler}$*$ \\
\\
\newnonterminal{message handler}
\pline{1 byte}{number of local variables}
\pline{1 byte}{number of parameters (= $n$)}
\pline{8$n$ bytes}{parameters}
\plineindent{4 bytes}{id of parameter}
\plineindent{4 bytes}{default value of parameter}
These parameters must appear in increasing id number order. \\
\pline{\nonterminal{bkod statement}$*$}{Message handler code}
\\
\newnonterminal{string table}
\pline{4 bytes}{number of strings (= $n$)}
\pline{4$n$ bytes}{offset of beginning of each \nonterminal{string}}
\\
\newnonterminal{string}
\pline{$n$ bytes}{ASCII string characters, null terminated}
\\
\newnonterminal{debugging info}
\pline{4 bytes}{number of \nonterminal{line entry}s}
\nonterminal{line entry}$*$ \\
\\
\newnonterminal{line entry}
\pline{4 bytes}{offset in file}
\pline{4 bytes}{corresponding source file line number}
\\
\newnonterminal{value}
4 bytes \\
\pushtabs
First 4 bits \= Type \hspace{1in} \= 28 data bits \\
0000 \> NIL \> all 0 \\
0001 \> integer \> integer value \\
0010 \> object \> object id \\
0011 \> list \> list id \\
0100 \> string \> string id \\
1100 \> debugging string \> string index into \nonterminal{debugging info} \\
\poptabs
\\
\newnonterminal{bkod statement}
\pline{1 byte}{\nonterminal{opcode}}
\pline{$n$ bytes}{data}
\\
\newnonterminal{opcode}
\pline{{\it xxxwyyzz}}{8 bit opcode value}
\\
{\it xxx} or {\it xxxw} specifies the command \\
\pline{000}{\nonterminal{unary assignment}}
\pline{001}{\nonterminal{binary assignment}}
\pline{010}{\nonterminal{goto}}
\pline{011}{\nonterminal{call}}
\pline{1001}{\nonterminal{propagate}}
\pline{1000}{\nonterminal{return}}
\\
\newnonterminal{destination}
\pline{0}{local variable}
\pline{1}{property}
\\
\newnonterminal{source}
\pline{00}{local variable}
\pline{01}{property}
\pline{10}{constant}
\pline{11}{class variable}
\\
\newnonterminal{unary assignment}
\pline{1 byte}{opcode}
\plineindent{{\it w}}{\nonterminal{destination}}
\plineindent{{\it yy}}{\nonterminal{source}}
\plineindent{{\it zz}}{always 00}
\pline{1 byte}{operation}
\plineindent{0}{logical NOT}
\plineindent{1}{unary minus}
\plineindent{2}{no operation}
\plineindent{3}{bitwise NOT}
\pline{4 bytes}{destination index (property or local variable)}
\pline{4 bytes}{source index (property, local variable, constant, or class variable)}
\\
\newnonterminal{binary assignment}
\pline{1 byte}{opcode}
\plineindent{{\it w}}{\nonterminal{destination}}
\plineindent{{\it yy}}{\nonterminal{source \#1}}
\plineindent{{\it zz}}{\nonterminal{source \#2}}
\pline{1 byte}{C-like operation}
\plineindent{0}{$+$}
\plineindent{1}{$-$}
\plineindent{2}{$*$}
\plineindent{3}{$/$}
\plineindent{4}{$\%$}
\plineindent{5}{$\&\&$}
\plineindent{6}{$\mid\mid$}
\plineindent{7}{$=$}
\plineindent{8}{$!=$}
\plineindent{9}{$<$}
\plineindent{10}{$>$}
\plineindent{11}{$<=$}
\plineindent{12}{$>=$}
\plineindent{13}{$\&$}
\plineindent{14}{$\mid$}
\pline{4 bytes}{destination index (property or local variable)}
\pline{4 bytes}{source \#1 index (property, local variable, constant, or class variable)}
\pline{4 bytes}{source \#2 index (property, local variable, constant, or class variable)}
\\
\newnonterminal{goto}
\pline{1 byte}{opcode}
\plineindent{{\it w}}{\nonterminal{condition}}
\plineindent{{\it yy}}{\nonterminal{source}}
\plineindent{{\it zz}}{conditional/unconditional jump \nonterminal{indicator}}
\pline{4 bytes}{destination address, relative to the beginning of this
instruction}
\pline{4 bytes}{source index (not present for unconditional goto)}
\\
\newnonterminal{condition}
\pline{0}{jump if source != 0}
\pline{1}{jump if source = 0}
\\
\newnonterminal{indicator}
\pline{0}{conditional jump}
\pline{1}{unconditional jump (\nonterminal{condition} must be 00)}
\\
\newnonterminal{call}
\pline{1 byte}{opcode}
\pline{{\it wyy}}{location to store return value}
\plineindent{000}{local variable}
\plineindent{001}{property}
\plineindent{010}{nowhere}
\pline{1 byte}{built-in function to call}
\pline{4 bytes}{destination index for return value}
\pline{}{(not present if return value not stored)}
\pline{1 byte}{number of \nonterminal{parameter}s to the function (=
$n$)}
\pline{9$n$ bytes}{\nonterminal{parameter}*}
\\
\newnonterminal{parameter}
\pline{4 bytes}{resource identifier of parameter name}
\pline{1 byte}{parameter type}
\plineindent{0}{local variable}
\plineindent{1}{property}
\plineindent{2}{constant}
\plineindent{3}{class variable}
\pline{4 bytes}{\nonterminal{value} of parameter}
\\
\newnonterminal{propagate}
\pline{1 byte}{opcode}
\pline{yy}{\nonterminal{destination} for return value}
\pline{4 bytes}{destination index for return value}
\\
\newnonterminal{return}
\pline{1 byte}{opcode}
\end{protocol}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{String resource {\tt .rsc}}
Compiling a \kod file also generates a \rsc file, which contains a
mapping of resource identifier numbers to strings. These files are
sent to clients, where they are used to decode resource numbers sent
in protocol messages. The files are encrypted with the Crusher
library to keep users from reading their contents.
\begin{protocol}
\pline{4 bytes}{magic number = 52 53 43 01 (hexadecimal)}
\pline{4 bytes}{version = 2}
\pline{4 bytes}{number of resources}
\pline{4 bytes}{length of \nonterminal{encrypted section}}
\pline{4 bytes}{response to challenge of version number (used in decryption)}
\nonterminal{encrypted section} \\
\\
\newnonterminal{encrypted section}
This section is encrypted with the hexadecimal key
xF1x71xC6xBBx19x6Ex2Ex71x6F. \\
\nonterminal{resource}$*$ \\
\\
\newnonterminal{resource}
\pline{4 bytes}{resource identifier}
\pline{$n$ bytes}{null-terminated string}
\end{protocol}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Room file {\tt .roo}}
A room file contains the BSP tree for a single room. The file can be
encrypted to prevent tampering; the client can load both encrypted and
unencrypted versions.
Building the BSP tree splits walls into smaller pieces. However,
these splits should not appear when the room is later loaded back into
the editor. Thus, we store the original walls (before the creation of
the BSP tree) in the file separately. The editor loads the original
walls and ignores the BSP tree, while the client loads the BSP tree
but ignores the original walls.
The editor builds the ``server section'' of the file so that the
server can have some basic knowledge of the room's geometry. Neither
the client nor the editor loads this section.
\begin{protocol}
\pline{4 bytes}{magic number = 52 4F 4F B1 (hexadecimal)}
\pline{4 bytes}{version = 11}
\pline{4 bytes}{\nonterminal{security}}
\pline{4 bytes}{offset of \nonterminal{main info}}
\pline{4 bytes}{offset of \nonterminal{server info}}
\nonterminal{main info} \\
\nonterminal{server info} \\
\\
\newnonterminal{main info}
\nonterminal{size} \\
\nonterminal{data} \\
\\
\newnonterminal{size}
\pline{4 bytes}{width of room (in client units)}
\pline{4 bytes}{height of room (in client units)}
If the width of the room is -1, then the \nonterminal{data} section is
encrypted. \\
In this case, these bytes appear here: \\
\pline{4 bytes}{length of \nonterminal{data}}
\pline{4 bytes}{response to challenge of room security check (used in
decryption)}
and the \nonterminal{data} section is encrypted by the hexadecimal
password x15x20x53x01xFCxAAx64. \\
\\
\newnonterminal{data}
\pline{4 bytes}{offset of \nonterminal{node subsection}}
\pline{4 bytes}{offset of \nonterminal{client wall subsection}}
\pline{4 bytes}{offset of \nonterminal{roomedit wall subsection}}
\pline{4 bytes}{offset of \nonterminal{sidedef subsection}}
\pline{4 bytes}{offset of \nonterminal{sector subsection}}
\pline{4 bytes}{offset of \nonterminal{thing subsection}}
\\
\newnonterminal{node subsection}
\pline{2 bytes}{number of \nonterminal{BSPnode}s}
\pline{\nonterminal{BSP node}$*$}{nodes of BSP tree; root must appear
first}
\\
\newnonterminal{client wall subsection}
\pline{2 bytes}{number of \nonterminal{client wall}s}
\nonterminal{client wall}$*$ \\
\\
\newnonterminal{roomedit wall subsection}
\pline{2 bytes}{number of \nonterminal{roomedit wall}s}
\nonterminal{roomedit wall}$*$ \\
\\
\newnonterminal{sidedef subsection}
\pline{2 bytes}{number of \nonterminal{sidedef}s}
\nonterminal{sidedef}$*$ \\
\\
\newnonterminal{sector subsection}
\pline{2 bytes}{number of \nonterminal{sector}s}
\nonterminal{sector}$*$ \\
\\
\newnonterminal{thing subsection}
\pline{2 bytes}{number of \nonterminal{thing}s}
\nonterminal{thing}$*$ \\
\\
\newnonterminal{BSP node}
\pline{1 byte}{node type}
\plineindent{1}{internal node}
\plineindent{2}{leaf node}
\pline{\nonterminal{box}}{bounding box of node}
\pline{\nonterminal{internal node} or \nonterminal{leaf node}}
\\
\newnonterminal{internal node}
\pline{\nonterminal{line}}{equation of a line that splits the BSP tree}
\pline{\nonterminal{node id}}{BSP node number of + subtree (0 if none, 1 = first wall in file)}
\pline{\nonterminal{node id}}{BSP node number of - right subtree (0 if none, 1 = first wall in file)}
\pline{2 bytes}{wall number of first wall in this plane (starts at 1 =
first wall in file; 0 if none)}
\\
\newnonterminal{leaf node}
\pline{2 bytes}{sector number corresponding to this node (1 = first sector in file)}
\pline{2 bytes}{number of points in polygon defining leaf node}
\pline{\nonterminal{point}$*$}{points of polygon defining leaf node (clockwise order as seen from above)}
\\
\newnonterminal{client wall}
\pline{2 bytes}{next wall in list of walls in plane (0 if none)}
\pline{2 bytes}{sidedef on + side of wall (0 = none, 1 = first sidedef in file)}
\pline{2 bytes}{sidedef on - side of wall (0 = none, 1 = first sidedef in file)}
\pline{\nonterminal{point}}{coordinates of start of wall}
\pline{\nonterminal{point}}{coordinates of end of wall (positive side
is on right going start to end)}
\pline{2 bytes}{length of wall (units: 1 server coordinate unit = length 64)}
\pline{2 bytes}{texture x offset on positive side (in pixels)}
\pline{2 bytes}{texture x offset on negative side (in pixels)}
\pline{2 bytes}{texture y offset on positive side (in pixels)}
\pline{2 bytes}{texture y offset on negative side (in pixels)}
\pline{2 bytes}{sector number on + side of wall (0 = none, 1 = first sector in file)}
\pline{2 bytes}{sector number on - side of wall (0 = none, 1 = first sector in file)}
\\
\newnonterminal{line}
\pline{4 bytes}{$A$ in line equation $Ax + By + C = 0$}
\pline{4 bytes}{$B$ in line equation $Ax + By + C = 0$}
\pline{4 bytes}{$C$ in line equation $Ax + By + C = 0$}
\\
\newnonterminal{box}
\pline{point}{coordinates of NW corner of bounding box}
\pline{point}{coordinates of SE corner of bounding box}
\\
\newnonterminal{point}
\pline{4 bytes}{x coordinate}
\pline{4 bytes}{y coordinate}
\\
\newnonterminal{node id}
\pline{2 bytes}{}
\\
\newnonterminal{sidedef}
\pline{2 bytes}{user-defined id (used for referencing from server)}
\pline{2 bytes}{bitmap number of normal bitmap}
\pline{2 bytes}{bitmap number of above bitmap}
\pline{2 bytes}{bitmap number of below bitmap}
\pline{\nonterminal{wall flags}}{various characteristics of the wall}
\pline{1 byte}{animation speed of bitmap on wall, in tenths of a frame per second}
\\
\newnonterminal{sector}
\pline{2 bytes}{user-defined id (used for referencing from sector)}
\pline{2 bytes}{bitmap number of floor bitmap}
\pline{2 bytes}{bitmap number of ceiling bitmap}
\pline{2 bytes}{x coordinate of origin of floor and ceiling textures
(in pixels)}
\pline{2 bytes}{y coordinate of origin of floor and ceiling textures
(in pixels)}
\pline{2 bytes}{floor height (units: size of one server coordinate = 64)}
\pline{2 bytes}{ceiling height (units: size of one server coordinate = 64)}
\pline{\nonterminal{light level}}{light level in sector}
\pline{\nonterminal{sector flags}}{various characteristics of the sector}
\pline{1 byte}{animation speed of bitmaps in sector, in tenths of a frame per second}
if \nonterminal{sector flags} indicates a sloped floor, then \\
\pline{\nonterminal{slope info}}{info on sloped floor}
if \nonterminal{sector flags} indicates a sloped ceiling, then \\
\pline{\nonterminal{slope info}}{info on sloped ceiling}
\\
\newnonterminal{light level}
\pline{1 byte}{}
\plineindent{0-127}{sector not affected by ambient light; 0 = darkest, 127 = brightest}
\plineindent{128-255}{sector affected by ambient light; 128 = darkest,
255 = brightest, 192 = neutral}
\\
\newnonterminal{roomedit wall}
\pline{2 bytes}{sidedef on + side of wall (0 = none, 1 = first sidedef in file)}
\pline{2 bytes}{sidedef on - side of wall (0 = none, 1 = first sidedef in file)}
\pline{2 bytes}{texture x offset on positive side (in pixels)}
\pline{2 bytes}{texture x offset on negative side (in pixels)}
\pline{2 bytes}{texture y offset on positive side (in pixels)}
\pline{2 bytes}{texture y offset on negative side (in pixels)}
\pline{2 bytes}{sector number on + side of wall}
\pline{2 bytes}{sector number on - side of wall}
\pline{\nonterminal{point}}{coordinates of start of wall}
\pline{\nonterminal{point}}{coordinates of end of wall (positive side is on right
going start to end)}
\\
\newnonterminal{thing}
\pline{\nonterminal{point}}{location of thing}
\\
\newnonterminal{wall flags}
\pline{4 bytes}{}
\plineindent{bit 0}{1 if bitmaps on wall should be drawn backwards (left-right reversed)}
\plineindent{bit 1}{1 if normal wall has some transparency}
\plineindent{bit 2}{1 if objects can pass through wall}
\plineindent{bit 3}{1 if wall should never be shown on map}
\plineindent{bit 4}{1 if wall should always be shown on map}
\plineindent{bit 5}{1 if wall is transparent, but there's nothing behind it}
\plineindent{bit 6}{1 if upper wall should be drawn bottom up (default is top down)}
\plineindent{bit 7}{1 if lower wall should be drawn top down (default is bottom up)}
\plineindent{bit 8}{1 if normal wall should be drawn top down (default is bottom up)}
\plineindent{bit 9}{1 if wall shouldn't tile vertically (must also be transparent)}
\plineindent{bits 10-11}{texture scrolling speed, 0 = none, ... 3 = fast}
\plineindent{bits 12-14}{texture scrolling direction (used only if
scroll speed nonzero)}
\pline{}{0 = N, 1 = NE, ... 7 = NW}
\\
\newnonterminal{sector flags}
\pline{4 bytes}{}
\plineindent{bits 0 and 1}{``depth'' of sector (for wading effects)}
\pline{}{0 = no depth, 1 = shallow, 2 = deep, 3 = very deep}
\plineindent{bits 2-3}{texture scrolling speed, 0 = none, ... 3 = fast}
\plineindent{bits 4-6}{texture scrolling direction (used only if
scroll speed nonzero)}
\pline{}{0 = N, 1 = NE, ... 7 = NW}
\plineindent{bit 7}{1 if floor texture should be scrolled}
\plineindent{bit 8}{1 if ceiling texture should be scrolled}
\plineindent{bit 9}{1 if light in sector should flicker}
\plineindent{bit 10}{1 if sector has a sloped floor}
\plineindent{bit 11}{1 if sector has a sloped ceiling}
\\
\newnonterminal{slope info}
\pline{4 bytes}{$a$ coefficient in plane equation $ax+by+cz+d = 0$}
\pline{4 bytes}{$b$ coefficient in plane equation $ax+by+cz+d = 0$}
\pline{4 bytes}{$c$ coefficient in plane equation $ax+by+cz+d = 0$}
\pline{4 bytes}{$d$ coefficient in plane equation $ax+by+cz+d = 0$}
\pline{\nonterminal{point}}{texture origin}
\pline{\nonterminal{angle}}{direction of positive u axis (for texture orientation)}
\pline{2 bytes}{vertex number of user-specified sector vertex \#1 (used in editor)}
\pline{2 bytes}{z coordinate of vertex \#1 (in room editor units)}
\pline{2 bytes}{vertex number of user-specified sector vertex \#2 (used in editor)}
\pline{2 bytes}{z coordinate of vertex \#2 (in room editor units)}
\pline{2 bytes}{vertex number of user-specified sector vertex \#3 (used in editor)}
\pline{2 bytes}{z coordinate of vertex \#3 (in room editor units)}
\\
\newnonterminal{server info}
\pline{4 bytes}{number of grid rows (= $r$)}
\pline{4 bytes}{number of grid cols (= $c$)}
\pline{\nonterminal{move grid}}{inter-square movement grid}
\pline{\nonterminal{flag grid}}{server square flags}
\\
\newnonterminal{move grid}
\pline{$r * c$ bytes}{one byte for each square in the room, row major order:}
\plineindent{bit 0}{1 if possible to move to adjacent square to N}
\plineindent{bit 1}{1 if possible to move to adjacent square to NE}
\plineindent{bit 2}{1 if possible to move to adjacent square to E}
\plineindent{bit 3}{1 if possible to move to adjacent square to SE}
\plineindent{bit 4}{1 if possible to move to adjacent square to S}
\plineindent{bit 5}{1 if possible to move to adjacent square to SW}
\plineindent{bit 6}{1 if possible to move to adjacent square to W}
\plineindent{bit 7}{1 if possible to move to adjacent square to NW}
\\
\newnonterminal{flag grid}
\pline{$r * c$ bytes}{one byte for each square in the room, row major order:}
\plineindent{bit 0}{1 if square is entirely within playable region (i.e. a real floor covers square)}
\end{protocol}
\begin{tabbing}
The \nonterminal{security} value is calculated as follows: \\
\\
1) Calculate the 32 bit signed sum of the following things in the
file: \\
\\
file version number \\
for \= each internal node in main section: \\
\>$a, b, c$ coefficients of line \\
\>wall number of first wall in plane \\
for each leaf node in main section: \\
\>x and y coordinates of each point \\
for each client wall in client section: \\
\>+ and - sidedef numbers \\
\>x and y coordinates of start and end of wall \\
\>+ and - sector numbers \\
for each sidedef in main section: \\
\>user-defined id \\
\>bitmap numbers of normal, above, and below walls \\
\>wall flags value \\
for each sector in client section: \\
\>user-defined id \\
\>bitmap numbers of floor and ceiling \\
\>floor and ceiling heights \\
\>light level \\
\>sector flags value \\
\\
2) exclusive or with 0x89ab786c \\
\end{tabbing}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Graphics {\tt .bgf}}
A \bgf file contains one or more Windows bitmaps that describe an
object, along with information that makes displaying and animating the
object easier.
The rows in a bitmap appear in order top to bottom. Each row contains
1 byte per column, left to right. This byte's value is an index into
the game's palette.
\begin{protocol}
\pline{4 bytes}{magic number = 42 47 46 11 (hexadecimal)}
\pline{4 bytes}{version = 9}
\pline{32 bytes}{bitmap name, null terminated}
\pline{4 bytes}{number of \nonterminal{bitmap}s}
\pline{4 bytes}{number of \nonterminal{bitmap group}s}
\pline{4 bytes}{largest number of bitmaps in any single bitmap group}
\pline{4 bytes}{shrink factor of all bitmaps; divide by this to get size to draw bitmap on screen}
\nonterminal{bitmap}$*$ \\
\nonterminal{bitmap group}$*$ \\
\\
\newnonterminal{bitmap group}
\pline{4 bytes}{number of \nonterminal{bitmap index}s}
\nonterminal{bitmap index}$*$ \\
\\
\newnonterminal{bitmap index}
\pline{4 bytes}{index into bitmaps in file (starts counting from 0)}
\\
\newnonterminal{bitmap}
\pline{4 bytes}{width in pixels (= $w$)}
\pline{4 bytes}{height in pixels (= $h$)}
\pline{4 bytes}{x offset in pixels}
\pline{4 bytes}{y offset in pixels}
\pline{1 byte}{number of hotspots}
\pline{\nonterminal{hotspot}$*$}{hotspot locations}
\pline{1 byte}{format of image, 0 = raw, 1 = compressed}
\\
if format = 0 \\
\pline{4 bytes}{unused (must be 0)}
\pline{$w * h$ bytes}{raw bytes of image}
\\
if format = 1 \\
\pline{4 bytes}{size of compressed image}
\pline{$w * h$ bytes}{raw bytes of image, compressed by Crusher}
\\
\newnonterminal{hotspot}
\pline{1 byte}{hotspot number (unique to this object and all its overlays)}
\pline{4 bytes}{x coordinate}
\pline{4 bytes}{y coordinate}
\end{protocol}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Map file {\tt .map}}
A map file indicates which walls of each room the player has viewed,
for use in drawing the map. It also stores map annotations, which are
text strings that are associated with locations on a map. These files
are kept on client machines.
\begin{protocol}
\pline{4 bytes}{magic number = 4D 41 50 0F (hexadecimal)}
\pline{4 bytes}{version = 1}
\nonterminal{header table} \\
\nonterminal{offset table}$*$ \\
\nonterminal{map info}$*$ \\
\\
\newnonterminal{header table}
\pline{\nonterminal{offset}}{offset of first \nonterminal{offset
table} for \nonterminal{digits} 00; 0 if none}
... \\
\pline{\nonterminal{offset}}{offset of first \nonterminal{offset table} for \nonterminal{digits} 99; 0 if none}
\\
More \nonterminal{offset table}s and \nonterminal{map info}s occur
interspersed in the file. \\
\newnonterminal{offset table}
\pline{\nonterminal{offset}}{offset of next \nonterminal{offset table} in file with same last 2 digits; 0 if none}
\pline{\nonterminal{offset table entry}$*$}{100 table entries}
\\
\newnonterminal{offset table entry}
\pline{\nonterminal{security}}{room security value of a room, 0 if entry is invalid}
\pline{\nonterminal{offset}}{offset of \nonterminal{map info} for this room}
\\
\newnonterminal{map info}
\pline{4 bytes}{number of bits in \nonterminal{bit table} = number of walls in room}
\pline{\nonterminal{bit table}}{which walls in room are saved as visible}
\pline{\nonterminal{offset}}{offset in file of \nonterminal{annotations}, 0 if none}
\\
\newnonterminal{bit table}
An array of bits, 1 bit per wall in the room file, with the first bit \\
corresponding to the first wall. If the bit is 1, the corresponding \\
wall should be shown on the map. The bit table is rounded up in size \\
to the nearest byte. \\
\\
\newnonterminal{annotations}
\pline{4 bytes}{number of \nonterminal{map annotation}s}
\nonterminal{map annotation}$*$ \\
\\
\newnonterminal{map annotation}
\pline{4 bytes}{x position of annotation (client units)}
\pline{4 bytes}{y position of annotation (client units)}
\pline{100 bytes}{text of annotation, null-terminated}
\\
\newnonterminal{offset}
\pline{4 bytes}{offset in bytes from the beginning of the file}
\\
\newnonterminal{security}
\pline{4 bytes}{room security value}
\\
\newnonterminal{digits}
\pline{4 bytes}{A \nonterminal{security} value modulo 100}
\end{protocol}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Server account file}
The account file stores username, password, and administrative
information for each account. This is a text file format, one account
per line, with fields deilimited by colons.
ACCOUNT \nonterminal{number}:\nonterminal{name}:\nonterminal{password}:\nonterminal{type}:\nonterminal{login
time}:\nonterminal{credits}
\begin{protocol}
\newnonterminal{number}
Account number; first account is 1. \\
\\
\newnonterminal{name}
String name of account. \\
\\
\newnonterminal{password}
Account password, represented as a sequence of hexadecimal digits, \\
run through the MD5 one-way hash algorithm. \\
\\
\newnonterminal{type}
Type of account. \\
\plineindent{0}{User account}
\plineindent{1}{Administrator account}
\plineindent{2}{DM account}
\plineindent{3}{Guest account}
\\
\newnonterminal{login time}
Last time the player logged in, in units of seconds since January 1,
1970. \\
\\
\newnonterminal{credits}
Floating point number equal to the number of seconds the player has
spent in game mode, \\
divided by 100. \\
\end{protocol}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Saved game format}
The server saves its object database in a binary format. When the
server next starts, it reads in its last saved game file and
initializes its database with these values.
\begin{protocol}
\pline{\nonterminal{class}$*$}{description of all classes}
\pline{\nonterminal{resource}$*$}{description of all resources}
\pline{\nonterminal{system}}{identifies unique system object}
\pline{\nonterminal{object}$*$}{description of all objects}
\pline{\nonterminal{list nodes}}{description of all list nodes}
\pline{\nonterminal{timer}$*$}{description of all timers}
\pline{\nonterminal{user}$*$}{description of all users}
\\
\newnonterminal{class}
\pline{1 byte}{01 hexadecimal}
\pline{4 bytes}{class identifier}
\pline{\nonterminal{string}}{class name}
\pline{4 bytes}{number of properties in class (= $n$)}
\pline{\nonterminal{string}*}{property names}
\\
\newnonterminal{resource}
\pline{1 byte}{02 hexadecimal}
\pline{4 bytes}{resource identifier}
\pline{\nonterminal{string}}{resource name}
\\
\newnonterminal{system}
\pline{1 byte}{03 hexadecimal}
\pline{4 bytes}{object identifier}
\pline{4 bytes}{class identifier for this object}
\pline{4 bytes}{number of properties}
\pline{\nonterminal{value}$*$}{value of each property}
\\
\newnonterminal{object}
\pline{1 byte}{04 hexadecimal}
\pline{4 bytes}{resource identifier}
\pline{\nonterminal{string}}{resource name}
\\
\newnonterminal{list nodes}
\pline{1 byte}{05 hexadecimal}
\pline{4 bytes}{number of list nodes}
\pline{\nonterminal{list node}$*$}{values of list nodes}
\\
\newnonterminal{list node}
\pline{\nonterminal{value}}{value of first part of list node}
\pline{\nonterminal{value}}{value of second part of list node}
\\
\newnonterminal{timer}
\pline{1 byte}{06 hexadecimal}
\pline{4 bytes}{timer identifier}
\pline{4 bytes}{object that timer will call when it goes off}
\pline{\nonterminal{string}}{name of timer}
\pline{4 bytes}{number of milliseconds until timer goes off}
\\
\newnonterminal{user}
\pline{1 byte}{07 hexadecimal}
\pline{4 bytes}{user account number}
\pline{4 bytes}{user object identifier}
\\
\newnonterminal{string}
\pline{$n$ bytes}{null-terminated ASCII string}
\\
\newnonterminal{value}
\pline{4 bytes}{tagged Blakod value (4 bits type, 28 bits value)}
\end{protocol}
|
{
"pile_set_name": "Github"
}
|
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* logicore_dp_tx_regif.h
*
* Register interface definition for XILINX LogiCore DisplayPort v6.1 TX
* (Source) based on Xilinx dp_v3_1 driver sources
*
* (C) Copyright 2016
* Dirk Eibach, Guntermann & Drunck GmbH, dirk.eibach@gdsys.cc
*/
#ifndef __GDSYS_LOGICORE_DP_TX_REGIF_H__
#define __GDSYS_LOGICORE_DP_TX_REGIF_H__
enum {
/* link configuration field */
REG_LINK_BW_SET = 0x000,
REG_LANE_COUNT_SET = 0x004,
REG_ENHANCED_FRAME_EN = 0x008,
REG_TRAINING_PATTERN_SET = 0x00C,
REG_LINK_QUAL_PATTERN_SET = 0x010,
REG_SCRAMBLING_DISABLE = 0x014,
REG_DOWNSPREAD_CTRL = 0x018,
REG_SOFT_RESET = 0x01C,
};
enum {
/* core enables */
REG_ENABLE = 0x080,
REG_ENABLE_MAIN_STREAM = 0x084,
REG_ENABLE_SEC_STREAM = 0x088,
REG_FORCE_SCRAMBLER_RESET = 0x0C0,
REG_MST_CONFIG = 0x0D0,
REG_LINE_RESET_DISABLE = 0x0F0,
};
enum {
/* core ID */
REG_VERSION = 0x0F8,
REG_CORE_ID = 0x0FC,
};
enum {
/* AUX channel interface */
REG_AUX_CMD = 0x100,
REG_AUX_WRITE_FIFO = 0x104,
REG_AUX_ADDRESS = 0x108,
REG_AUX_CLK_DIVIDER = 0x10C,
REG_USER_FIFO_OVERFLOW = 0x110,
REG_INTERRUPT_SIG_STATE = 0x130,
REG_AUX_REPLY_DATA = 0x134,
REG_AUX_REPLY_CODE = 0x138,
REG_AUX_REPLY_COUNT = 0x13C,
REG_INTERRUPT_STATUS = 0x140,
REG_INTERRUPT_MASK = 0x144,
REG_REPLY_DATA_COUNT = 0x148,
REG_REPLY_STATUS = 0x14C,
REG_HPD_DURATION = 0x150,
};
enum {
/* main stream attributes for SST / MST STREAM1 */
REG_STREAM1_MSA_START = 0x180,
REG_MAIN_STREAM_HTOTAL = 0x180,
REG_MAIN_STREAM_VTOTAL = 0x184,
REG_MAIN_STREAM_POLARITY = 0x188,
REG_MAIN_STREAM_HSWIDTH = 0x18C,
REG_MAIN_STREAM_VSWIDTH = 0x190,
REG_MAIN_STREAM_HRES = 0x194,
REG_MAIN_STREAM_VRES = 0x198,
REG_MAIN_STREAM_HSTART = 0x19C,
REG_MAIN_STREAM_VSTART = 0x1A0,
REG_MAIN_STREAM_MISC0 = 0x1A4,
REG_MAIN_STREAM_MISC1 = 0x1A8,
REG_M_VID = 0x1AC,
REG_TU_SIZE = 0x1B0,
REG_N_VID = 0x1B4,
REG_USER_PIXEL_WIDTH = 0x1B8,
REG_USER_DATA_COUNT_PER_LANE = 0x1BC,
REG_MAIN_STREAM_INTERLACED = 0x1C0,
REG_MIN_BYTES_PER_TU = 0x1C4,
REG_FRAC_BYTES_PER_TU = 0x1C8,
REG_INIT_WAIT = 0x1CC,
REG_STREAM1 = 0x1D0,
REG_STREAM2 = 0x1D4,
REG_STREAM3 = 0x1D8,
REG_STREAM4 = 0x1DC,
};
enum {
/* PHY configuration status */
REG_PHY_CONFIG = 0x200,
REG_PHY_VOLTAGE_DIFF_LANE_0 = 0x220,
REG_PHY_VOLTAGE_DIFF_LANE_1 = 0x224,
REG_PHY_VOLTAGE_DIFF_LANE_2 = 0x228,
REG_PHY_VOLTAGE_DIFF_LANE_3 = 0x22C,
REG_PHY_TRANSMIT_PRBS7 = 0x230,
REG_PHY_CLOCK_SELECT = 0x234,
REG_PHY_POWER_DOWN = 0x238,
REG_PHY_PRECURSOR_LANE_0 = 0x23C,
REG_PHY_PRECURSOR_LANE_1 = 0x240,
REG_PHY_PRECURSOR_LANE_2 = 0x244,
REG_PHY_PRECURSOR_LANE_3 = 0x248,
REG_PHY_POSTCURSOR_LANE_0 = 0x24C,
REG_PHY_POSTCURSOR_LANE_1 = 0x250,
REG_PHY_POSTCURSOR_LANE_2 = 0x254,
REG_PHY_POSTCURSOR_LANE_3 = 0x258,
REG_PHY_STATUS = 0x280,
REG_GT_DRP_COMMAND = 0x2A0,
REG_GT_DRP_READ_DATA = 0x2A4,
REG_GT_DRP_CHANNEL_STATUS = 0x2A8,
};
enum {
/* DisplayPort audio */
REG_AUDIO_CONTROL = 0x300,
REG_AUDIO_CHANNELS = 0x304,
REG_AUDIO_INFO_DATA = 0x308,
REG_AUDIO_MAUD = 0x328,
REG_AUDIO_NAUD = 0x32C,
REG_AUDIO_EXT_DATA = 0x330,
};
enum {
/* HDCP */
REG_HDCP_ENABLE = 0x400,
};
enum {
/* main stream attributes for MST STREAM2, 3, and 4 */
REG_STREAM2_MSA_START = 0x500,
REG_STREAM3_MSA_START = 0x550,
REG_STREAM4_MSA_START = 0x5A0,
REG_VC_PAYLOAD_BUFFER_ADDR = 0x800,
};
enum {
LINK_BW_SET_162GBPS = 0x06,
LINK_BW_SET_270GBPS = 0x0A,
LINK_BW_SET_540GBPS = 0x14,
};
enum {
LANE_COUNT_SET_1 = 0x1,
LANE_COUNT_SET_2 = 0x2,
LANE_COUNT_SET_4 = 0x4,
};
enum {
TRAINING_PATTERN_SET_OFF = 0x0,
/* training pattern 1 used for clock recovery */
TRAINING_PATTERN_SET_TP1 = 0x1,
/* training pattern 2 used for channel equalization */
TRAINING_PATTERN_SET_TP2 = 0x2,
/*
* training pattern 3 used for channel equalization for cores with DP
* v1.2
*/
TRAINING_PATTERN_SET_TP3 = 0x3,
};
enum {
LINK_QUAL_PATTERN_SET_OFF = 0x0,
/* D10.2 unscrambled test pattern transmitted */
LINK_QUAL_PATTERN_SET_D102_TEST = 0x1,
/* symbol error rate measurement pattern transmitted */
LINK_QUAL_PATTERN_SET_SER_MES = 0x2,
/* pseudo random bit sequence 7 transmitted */
LINK_QUAL_PATTERN_SET_PRBS7 = 0x3,
};
enum {
SOFT_RESET_VIDEO_STREAM1_MASK = 0x00000001,
SOFT_RESET_VIDEO_STREAM2_MASK = 0x00000002,
SOFT_RESET_VIDEO_STREAM3_MASK = 0x00000004,
SOFT_RESET_VIDEO_STREAM4_MASK = 0x00000008,
SOFT_RESET_AUX_MASK = 0x00000080,
SOFT_RESET_VIDEO_STREAM_ALL_MASK = 0x0000000F,
};
enum {
MST_CONFIG_MST_EN_MASK = 0x00000001,
};
enum {
LINE_RESET_DISABLE_MASK = 0x1,
};
#define AUX_CMD_NBYTES_TRANSFER_MASK 0x0000000F
#define AUX_CMD_SHIFT 8
#define AUX_CMD_MASK 0x00000F00
enum {
AUX_CMD_I2C_WRITE = 0x0,
AUX_CMD_I2C_READ = 0x1,
AUX_CMD_I2C_WRITE_STATUS = 0x2,
AUX_CMD_I2C_WRITE_MOT = 0x4,
AUX_CMD_I2C_READ_MOT = 0x5,
AUX_CMD_I2C_WRITE_STATUS_MOT = 0x6,
AUX_CMD_WRITE = 0x8,
AUX_CMD_READ = 0x9,
};
#define AUX_CLK_DIVIDER_VAL_MASK 0x00FF
#define AUX_CLK_DIVIDER_AUX_SIG_WIDTH_FILT_SHIFT 8
#define AUX_CLK_DIVIDER_AUX_SIG_WIDTH_FILT_MASK 0xFF00
enum {
INTERRUPT_SIG_STATE_HPD_STATE_MASK = 0x00000001,
INTERRUPT_SIG_STATE_REQUEST_STATE_MASK = 0x00000002,
INTERRUPT_SIG_STATE_REPLY_STATE_MASK = 0x00000004,
INTERRUPT_SIG_STATE_REPLY_TIMEOUT_MASK = 0x00000008,
};
enum {
AUX_REPLY_CODE_ACK = 0x0,
AUX_REPLY_CODE_I2C_ACK = 0x0,
AUX_REPLY_CODE_NACK = 0x1,
AUX_REPLY_CODE_DEFER = 0x2,
AUX_REPLY_CODE_I2C_NACK = 0x4,
AUX_REPLY_CODE_I2C_DEFER = 0x8,
};
enum {
INTERRUPT_STATUS_HPD_IRQ_MASK = 0x00000001,
INTERRUPT_STATUS_HPD_EVENT_MASK = 0x00000002,
INTERRUPT_STATUS_REPLY_RECEIVED_MASK = 0x00000004,
INTERRUPT_STATUS_REPLY_TIMEOUT_MASK = 0x00000008,
INTERRUPT_STATUS_HPD_PULSE_DETECTED_MASK = 0x00000010,
INTERRUPT_STATUS_EXT_PKT_TXD_MASK = 0x00000020,
};
enum {
INTERRUPT_MASK_HPD_IRQ_MASK = 0x00000001,
INTERRUPT_MASK_HPD_EVENT_MASK = 0x00000002,
INTERRUPT_MASK_REPLY_RECEIVED_MASK = 0x00000004,
INTERRUPT_MASK_REPLY_TIMEOUT_MASK = 0x00000008,
INTERRUPT_MASK_HPD_PULSE_DETECTED_MASK = 0x00000010,
INTERRUPT_MASK_EXT_PKT_TXD_MASK = 0x00000020,
};
#define REPLY_STATUS_REPLY_STATUS_STATE_SHIFT 4
#define REPLY_STATUS_REPLY_STATUS_STATE_MASK 0x00000FF0
enum {
REPLY_STATUS_REPLY_RECEIVED_MASK = 0x00000001,
REPLY_STATUS_REPLY_IN_PROGRESS_MASK = 0x00000002,
REPLY_STATUS_REQUEST_IN_PROGRESS_MASK = 0x00000004,
REPLY_STATUS_REPLY_ERROR_MASK = 0x00000008,
};
#define MAIN_STREAMX_POLARITY_VSYNC_POL_SHIFT 1
enum {
MAIN_STREAMX_POLARITY_HSYNC_POL_MASK = 0x00000001,
MAIN_STREAMX_POLARITY_VSYNC_POL_MASK = 0x00000002,
};
enum {
MAIN_STREAMX_MISC0_SYNC_CLK_MASK = 0x00000001,
};
#define MAIN_STREAMX_MISC0_COMPONENT_FORMAT_SHIFT 1
#define MAIN_STREAMX_MISC0_COMPONENT_FORMAT_MASK 0x00000006
enum {
MAIN_STREAMX_MISC0_COMPONENT_FORMAT_RGB = 0x0,
MAIN_STREAMX_MISC0_COMPONENT_FORMAT_YCBCR422 = 0x1,
MAIN_STREAMX_MISC0_COMPONENT_FORMAT_YCBCR444 = 0x2,
};
#define MAIN_STREAMX_MISC0_DYNAMIC_RANGE_SHIFT 3
#define MAIN_STREAMX_MISC0_DYNAMIC_RANGE_MASK 0x00000008
#define MAIN_STREAMX_MISC0_YCBCR_COLORIMETRY_SHIFT 4
#define MAIN_STREAMX_MISC0_YCBCR_COLORIMETRY_MASK 0x00000010
#define MAIN_STREAMX_MISC0_BDC_SHIFT 5
#define MAIN_STREAMX_MISC0_BDC_MASK 0x000000E0
enum {
MAIN_STREAMX_MISC0_BDC_6BPC = 0x0,
MAIN_STREAMX_MISC0_BDC_8BPC = 0x1,
MAIN_STREAMX_MISC0_BDC_10BPC = 0x2,
MAIN_STREAMX_MISC0_BDC_12BPC = 0x3,
MAIN_STREAMX_MISC0_BDC_16BPC = 0x4,
};
enum {
PHY_CONFIG_PHY_RESET_ENABLE_MASK = 0x0000000,
PHY_CONFIG_PHY_RESET_MASK = 0x0000001,
PHY_CONFIG_GTTX_RESET_MASK = 0x0000002,
PHY_CONFIG_GT_ALL_RESET_MASK = 0x0000003,
PHY_CONFIG_TX_PHY_PMA_RESET_MASK = 0x0000100,
PHY_CONFIG_TX_PHY_PCS_RESET_MASK = 0x0000200,
PHY_CONFIG_TX_PHY_POLARITY_MASK = 0x0000800,
PHY_CONFIG_TX_PHY_PRBSFORCEERR_MASK = 0x0001000,
PHY_CONFIG_TX_PHY_POLARITY_IND_LANE_MASK = 0x0010000,
PHY_CONFIG_TX_PHY_POLARITY_LANE0_MASK = 0x0020000,
PHY_CONFIG_TX_PHY_POLARITY_LANE1_MASK = 0x0040000,
PHY_CONFIG_TX_PHY_POLARITY_LANE2_MASK = 0x0080000,
PHY_CONFIG_TX_PHY_POLARITY_LANE3_MASK = 0x0100000,
PHY_CONFIG_TX_PHY_8B10BEN_MASK = 0x0200000,
};
#define PHY_CONFIG_TX_PHY_LOOPBACK_SHIFT 13
#define PHY_CONFIG_TX_PHY_LOOPBACK_MASK 0x000E000
enum {
PHY_CLOCK_SELECT_162GBPS = 0x1,
PHY_CLOCK_SELECT_270GBPS = 0x3,
PHY_CLOCK_SELECT_540GBPS = 0x5,
};
enum {
VS_LEVEL_0 = 0x2,
VS_LEVEL_1 = 0x5,
VS_LEVEL_2 = 0x8,
VS_LEVEL_3 = 0xF,
VS_LEVEL_OFFSET = 0x4,
};
enum {
PE_LEVEL_0 = 0x00,
PE_LEVEL_1 = 0x0E,
PE_LEVEL_2 = 0x14,
PE_LEVEL_3 = 0x1B,
};
enum {
PHY_STATUS_RESET_LANE_2_3_DONE_SHIFT = 2,
PHY_STATUS_TX_ERROR_LANE_0_SHIFT = 18,
PHY_STATUS_TX_BUFFER_STATUS_LANE_1_SHIFT = 20,
PHY_STATUS_TX_ERROR_LANE_1_SHIFT = 22,
PHY_STATUS_TX_BUFFER_STATUS_LANE_0_SHIFT = 16,
PHY_STATUS_TX_BUFFER_STATUS_LANE_2_SHIFT = 24,
PHY_STATUS_TX_ERROR_LANE_2_SHIFT = 26,
PHY_STATUS_TX_BUFFER_STATUS_LANE_3_SHIFT = 28,
PHY_STATUS_TX_ERROR_LANE_3_SHIFT = 30,
};
enum {
PHY_STATUS_RESET_LANE_0_DONE_MASK = 0x00000001,
PHY_STATUS_RESET_LANE_1_DONE_MASK = 0x00000002,
PHY_STATUS_RESET_LANE_2_3_DONE_MASK = 0x0000000C,
PHY_STATUS_PLL_LANE0_1_LOCK_MASK = 0x00000010,
PHY_STATUS_PLL_LANE2_3_LOCK_MASK = 0x00000020,
PHY_STATUS_PLL_FABRIC_LOCK_MASK = 0x00000040,
PHY_STATUS_TX_BUFFER_STATUS_LANE_0_MASK = 0x00030000,
PHY_STATUS_TX_ERROR_LANE_0_MASK = 0x000C0000,
PHY_STATUS_TX_BUFFER_STATUS_LANE_1_MASK = 0x00300000,
PHY_STATUS_TX_ERROR_LANE_1_MASK = 0x00C00000,
PHY_STATUS_TX_BUFFER_STATUS_LANE_2_MASK = 0x03000000,
PHY_STATUS_TX_ERROR_LANE_2_MASK = 0x0C000000,
PHY_STATUS_TX_BUFFER_STATUS_LANE_3_MASK = 0x30000000,
PHY_STATUS_TX_ERROR_LANE_3_MASK = 0xC0000000,
};
#define PHY_STATUS_LANE_0_READY_MASK \
(PHY_STATUS_RESET_LANE_0_DONE_MASK | \
PHY_STATUS_PLL_LANE0_1_LOCK_MASK)
#define PHY_STATUS_LANES_0_1_READY_MASK \
(PHY_STATUS_LANE_0_READY_MASK | \
PHY_STATUS_RESET_LANE_1_DONE_MASK)
/*
* PHY_STATUS_ALL_LANES_READY_MASK seems to be missing lanes 0 and 1 in
* Xilinx dp_v3_0 implementation
*/
#define PHY_STATUS_ALL_LANES_READY_MASK \
(PHY_STATUS_LANES_0_1_READY_MASK | \
PHY_STATUS_RESET_LANE_2_3_DONE_MASK | \
PHY_STATUS_PLL_LANE2_3_LOCK_MASK)
/**
* phy_status_lanes_ready_mask() - Generate phy status ready mask
* @lane_count: Number of lanes for which to generate a mask
*
* Return: The generated phy status ready mask
*/
static inline u32 phy_status_lanes_ready_mask(u8 lane_count)
{
if (lane_count > 2)
return PHY_STATUS_ALL_LANES_READY_MASK;
if (lane_count == 2)
return PHY_STATUS_LANES_0_1_READY_MASK;
return PHY_STATUS_LANE_0_READY_MASK;
}
#define GT_DRP_COMMAND_DRP_ADDR_MASK 0x000F
#define GT_DRP_COMMAND_DRP_RW_CMD_MASK 0x0080
#define GT_DRP_COMMAND_DRP_W_DATA_SHIFT 16
#define GT_DRP_COMMAND_DRP_W_DATA_MASK 0xFF00
#define HDCP_ENABLE_BYPASS_DISABLE_MASK 0x0001
#endif /* __GDSYS_LOGICORE_DP_TX_REGIF_H__ */
|
{
"pile_set_name": "Github"
}
|
&HEAD CHID='Steckler_540', TITLE='Steckler Compartment, Test 540'/
&MESH IJK=72,56,44, XB=0.00,3.60,-1.40,1.40,0.00,2.13 /
&TIME T_END=1800.0, TIME_SHRINK_FACTOR=10. /
&DUMP NFRAMES=100, DT_DEVC=10., DT_DEVC_LINE=10., DT_HRR=10., SIG_FIGS=4, SIG_FIGS_EXP=2 /
&MISC TMPA=13. /
SURF ID='BURNER',HRRPUA= 526.7,TMP_FRONT=100.,COLOR='ORANGE' / 31.6 kW
&SURF ID='BURNER',HRRPUA=1048.3,TMP_FRONT=100.,COLOR='ORANGE' / 62.9 kW
SURF ID='BURNER',HRRPUA=1755.0,TMP_FRONT=100.,COLOR='ORANGE' / 105.3 kW
SURF ID='BURNER',HRRPUA=2633.3,TMP_FRONT=100.,COLOR='ORANGE' / 158.0 kW
HOLE XB=2.75,2.95,-0.12,0.12,0.00,1.83 / 2/6 Door
HOLE XB=2.75,2.95,-0.18,0.18,0.00,1.83 / 3/6 Door
HOLE XB=2.75,2.95,-0.25,0.25,0.00,1.83 / 4/6 Door
HOLE XB=2.75,2.95,-0.31,0.31,0.00,1.83 / 5/6 Door
HOLE XB=2.75,2.95,-0.37,0.37,0.00,1.83 / 6/6 Door
&HOLE XB=2.75,2.95,-0.43,0.43,0.00,1.83 / 7/6 Door
HOLE XB=2.75,2.95,-0.50,0.50,0.00,1.83 / 8/6 Door
HOLE XB=2.75,2.95,-0.37,0.37,1.37,1.83 / 1/3 Window
HOLE XB=2.75,2.95,-0.37,0.37,0.91,1.83 / 2/3 Window
HOLE XB=2.75,2.95,-0.37,0.37,0.45,1.83 / 3/3 Window
VENT XB=1.30,1.50,-0.10,0.10,0.00,0.00, SURF_ID='BURNER' / Position A
VENT XB=1.25,1.30,-0.05,0.05,0.00,0.00, SURF_ID='BURNER' /
VENT XB=1.50,1.55,-0.05,0.05,0.00,0.00, SURF_ID='BURNER' /
VENT XB=1.35,1.45,-0.15,-.10,0.00,0.00, SURF_ID='BURNER' /
VENT XB=1.35,1.45, 0.10,0.15,0.00,0.00, SURF_ID='BURNER' /
VENT XB=0.15,0.35,-1.30,-1.10,0.00,0.00, SURF_ID='BURNER' / Position B
VENT XB=0.10,0.15,-1.25,-1.15,0.00,0.00, SURF_ID='BURNER' /
VENT XB=0.35,0.40,-1.25,-1.15,0.00,0.00, SURF_ID='BURNER' /
VENT XB=0.20,0.30,-1.35,-1.30,0.00,0.00, SURF_ID='BURNER' /
VENT XB=0.20,0.30,-1.10,-1.05,0.00,0.00, SURF_ID='BURNER' /
&VENT XB=0.15,0.35,-0.10,0.10,0.00,0.00, SURF_ID='BURNER' / Position C
&VENT XB=0.10,0.15,-0.05,0.05,0.00,0.00, SURF_ID='BURNER' /
&VENT XB=0.35,0.40,-0.05,0.05,0.00,0.00, SURF_ID='BURNER' /
&VENT XB=0.20,0.30,-0.15,-.10,0.00,0.00, SURF_ID='BURNER' /
&VENT XB=0.20,0.30, 0.10,0.15,0.00,0.00, SURF_ID='BURNER' /
OBST XB=1.15,1.65,-0.20,0.20,0.00,0.30, SURF_ID='FIBER BOARD' / Position AR
VENT XB=1.30,1.50,-0.10,0.10,0.30,0.30, SURF_ID='BURNER' /
VENT XB=1.25,1.30,-0.05,0.05,0.30,0.30, SURF_ID='BURNER' /
VENT XB=1.50,1.55,-0.05,0.05,0.30,0.30, SURF_ID='BURNER' /
VENT XB=1.35,1.45,-0.15,-.10,0.30,0.30, SURF_ID='BURNER' /
VENT XB=1.35,1.45, 0.10,0.15,0.30,0.30, SURF_ID='BURNER' /
OBST XB=0.00,0.50,-1.40,-1.00,0.00,0.30, SURF_ID='FIBER BOARD' / Position BR
VENT XB=0.15,0.35,-1.30,-1.10,0.30,0.30, SURF_ID='BURNER' /
VENT XB=0.10,0.15,-1.25,-1.15,0.30,0.30, SURF_ID='BURNER' /
VENT XB=0.35,0.40,-1.25,-1.15,0.30,0.30, SURF_ID='BURNER' /
VENT XB=0.20,0.30,-1.35,-1.30,0.30,0.30, SURF_ID='BURNER' /
VENT XB=0.20,0.30,-1.10,-1.05,0.30,0.30, SURF_ID='BURNER' /
OBST XB=0.00,0.50,-0.20,0.20,0.00,0.30, SURF_ID='FIBER BOARD' / Position CR
VENT XB=0.15,0.35,-0.10,0.10,0.30,0.30, SURF_ID='BURNER' /
VENT XB=0.10,0.15,-0.05,0.05,0.30,0.30, SURF_ID='BURNER' /
VENT XB=0.35,0.40,-0.05,0.05,0.30,0.30, SURF_ID='BURNER' /
VENT XB=0.20,0.30,-0.15,-.10,0.30,0.30, SURF_ID='BURNER' /
VENT XB=0.20,0.30, 0.10,0.15,0.30,0.30, SURF_ID='BURNER' /
OBST XB=1.15,1.65,-1.40,-1.00,0.00,0.30, SURF_ID='FIBER BOARD' / Position DR
VENT XB=1.30,1.50,-1.30,-1.10,0.30,0.30, SURF_ID='BURNER' /
VENT XB=1.25,1.30,-1.25,-1.15,0.30,0.30, SURF_ID='BURNER' /
VENT XB=1.50,1.55,-1.25,-1.15,0.30,0.30, SURF_ID='BURNER' /
VENT XB=1.35,1.45,-1.35,-1.30,0.30,0.30, SURF_ID='BURNER' /
VENT XB=1.35,1.45,-1.10,-1.05,0.30,0.30, SURF_ID='BURNER' /
OBST XB=1.15,1.65, 1.00, 1.40,0.00,0.30, SURF_ID='FIBER BOARD' / Position ER
VENT XB=1.30,1.50, 1.10, 1.30,0.30,0.30, SURF_ID='BURNER' /
VENT XB=1.25,1.30, 1.15, 1.25,0.30,0.30, SURF_ID='BURNER' /
VENT XB=1.50,1.55, 1.15, 1.25,0.30,0.30, SURF_ID='BURNER' /
VENT XB=1.35,1.45, 1.30, 1.35,0.30,0.30, SURF_ID='BURNER' /
VENT XB=1.35,1.45, 1.05, 1.10,0.30,0.30, SURF_ID='BURNER' /
OBST XB=1.75,2.25,-0.20,0.20,0.00,0.30, SURF_ID='FIBER BOARD' / Position FR
VENT XB=1.90,2.10,-0.10,0.10,0.30,0.30, SURF_ID='BURNER' /
VENT XB=1.85,1.90,-0.05,0.05,0.30,0.30, SURF_ID='BURNER' /
VENT XB=2.10,2.15,-0.05,0.05,0.30,0.30, SURF_ID='BURNER' /
VENT XB=1.95,2.05,-0.15,-.10,0.30,0.30, SURF_ID='BURNER' /
VENT XB=1.95,2.05, 0.10,0.15,0.30,0.30, SURF_ID='BURNER' /
OBST XB=2.30,2.80,-0.20,0.20,0.00,0.30, SURF_ID='FIBER BOARD' / Position GR
VENT XB=2.45,2.65,-0.10,0.10,0.30,0.30, SURF_ID='BURNER' /
VENT XB=2.40,2.45,-0.05,0.05,0.30,0.30, SURF_ID='BURNER' /
VENT XB=2.65,2.70,-0.05,0.05,0.30,0.30, SURF_ID='BURNER' /
VENT XB=2.50,2.60,-0.15,-.10,0.30,0.30, SURF_ID='BURNER' /
VENT XB=2.50,2.60, 0.10,0.15,0.30,0.30, SURF_ID='BURNER' /
OBST XB=2.10,2.60,-1.15,-0.75,0.00,0.30, SURF_ID='FIBER BOARD' / Position HR
VENT XB=2.25,2.45,-1.05,-0.85,0.30,0.30, SURF_ID='BURNER' /
VENT XB=2.20,2.25,-1.00,-0.90,0.30,0.30, SURF_ID='BURNER' /
VENT XB=2.45,2.50,-1.00,-0.90,0.30,0.30, SURF_ID='BURNER' /
VENT XB=2.30,2.40,-1.10,-1.05,0.30,0.30, SURF_ID='BURNER' /
VENT XB=2.30,2.40,-0.85,-0.80,0.30,0.30, SURF_ID='BURNER' /
&SURF ID='FIBER BOARD', DEFAULT=.TRUE., MATL_ID='INSULATION', THICKNESS=0.013, COLOR='BEIGE' /
&REAC FUEL='METHANE',SOOT_YIELD=0. /
&OBST XB=2.80,2.90,-1.40,1.40,0.00,2.13 / Wall with door or window
&VENT MB='XMAX',SURF_ID='OPEN'/
&VENT XB= 2.90,3.60,-1.40,-1.40,0.00,2.13, SURF_ID='OPEN'/
&VENT XB= 2.90,3.60, 1.40, 1.40,0.00,2.13, SURF_ID='OPEN'/
&VENT XB= 2.90,3.60,-1.40, 1.40,2.13,2.13, SURF_ID='OPEN'/
&MATL ID = 'INSULATION'
DENSITY = 200.
CONDUCTIVITY = 0.1
SPECIFIC_HEAT = 1. /
&SLCF PBY=0.0,QUANTITY='TEMPERATURE',VECTOR=.TRUE./
&DEVC ID='TC_Room', POINTS=44, XB=2.50,2.50,1.10,1.10,0.02,2.11, QUANTITY='TEMPERATURE', Z_ID='Room_z' /
&DEVC ID='TC_Door', POINTS=38, XB=2.85,2.85,0.00,0.00,0.02,1.82, QUANTITY='TEMPERATURE', Z_ID='Door_z' /
&DEVC ID='BP_Door', POINTS=38, XB=2.85,2.85,0.00,0.00,0.02,1.82, QUANTITY='VELOCITY', VELO_INDEX=1, HIDE_COORDINATES=.TRUE. /
&DEVC ID='HGL Temp', XB=2.50,2.50,1.10,1.10,0.00,2.13, QUANTITY='UPPER TEMPERATURE' /
&DEVC ID='HGL Height', XB=2.50,2.50,1.10,1.10,0.00,2.13, QUANTITY='LAYER HEIGHT' /
&TAIL /
|
{
"pile_set_name": "Github"
}
|
/*
* RFC 1186/1320 compliant MD4 implementation
*
* Based on XySSL: Copyright (C) 2006-2008 Christophe Devine
*
* Copyright (C) 2009 Paul Bakker <polarssl_maintainer at polarssl dot org>
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the names of PolarSSL or XySSL nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* The MD4 algorithm was designed by Ron Rivest in 1990.
*
* http://www.ietf.org/rfc/rfc1186.txt
* http://www.ietf.org/rfc/rfc1320.txt
*/
#include "netif/ppp/ppp_opts.h"
#if PPP_SUPPORT && LWIP_INCLUDED_POLARSSL_MD4
#include "netif/ppp/polarssl/md4.h"
#include <string.h>
/*
* 32-bit integer manipulation macros (little endian)
*/
#ifndef GET_ULONG_LE
#define GET_ULONG_LE(n,b,i) \
{ \
(n) = ( (unsigned long) (b)[(i) ] ) \
| ( (unsigned long) (b)[(i) + 1] << 8 ) \
| ( (unsigned long) (b)[(i) + 2] << 16 ) \
| ( (unsigned long) (b)[(i) + 3] << 24 ); \
}
#endif
#ifndef PUT_ULONG_LE
#define PUT_ULONG_LE(n,b,i) \
{ \
(b)[(i) ] = (unsigned char) ( (n) ); \
(b)[(i) + 1] = (unsigned char) ( (n) >> 8 ); \
(b)[(i) + 2] = (unsigned char) ( (n) >> 16 ); \
(b)[(i) + 3] = (unsigned char) ( (n) >> 24 ); \
}
#endif
/*
* MD4 context setup
*/
void md4_starts( md4_context *ctx )
{
ctx->total[0] = 0;
ctx->total[1] = 0;
ctx->state[0] = 0x67452301;
ctx->state[1] = 0xEFCDAB89;
ctx->state[2] = 0x98BADCFE;
ctx->state[3] = 0x10325476;
}
static void md4_process( md4_context *ctx, const unsigned char data[64] )
{
unsigned long X[16], A, B, C, D;
GET_ULONG_LE( X[ 0], data, 0 );
GET_ULONG_LE( X[ 1], data, 4 );
GET_ULONG_LE( X[ 2], data, 8 );
GET_ULONG_LE( X[ 3], data, 12 );
GET_ULONG_LE( X[ 4], data, 16 );
GET_ULONG_LE( X[ 5], data, 20 );
GET_ULONG_LE( X[ 6], data, 24 );
GET_ULONG_LE( X[ 7], data, 28 );
GET_ULONG_LE( X[ 8], data, 32 );
GET_ULONG_LE( X[ 9], data, 36 );
GET_ULONG_LE( X[10], data, 40 );
GET_ULONG_LE( X[11], data, 44 );
GET_ULONG_LE( X[12], data, 48 );
GET_ULONG_LE( X[13], data, 52 );
GET_ULONG_LE( X[14], data, 56 );
GET_ULONG_LE( X[15], data, 60 );
#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n)))
A = ctx->state[0];
B = ctx->state[1];
C = ctx->state[2];
D = ctx->state[3];
#define F(x, y, z) ((x & y) | ((~x) & z))
#define P(a,b,c,d,x,s) { a += F(b,c,d) + x; a = S(a,s); }
P( A, B, C, D, X[ 0], 3 );
P( D, A, B, C, X[ 1], 7 );
P( C, D, A, B, X[ 2], 11 );
P( B, C, D, A, X[ 3], 19 );
P( A, B, C, D, X[ 4], 3 );
P( D, A, B, C, X[ 5], 7 );
P( C, D, A, B, X[ 6], 11 );
P( B, C, D, A, X[ 7], 19 );
P( A, B, C, D, X[ 8], 3 );
P( D, A, B, C, X[ 9], 7 );
P( C, D, A, B, X[10], 11 );
P( B, C, D, A, X[11], 19 );
P( A, B, C, D, X[12], 3 );
P( D, A, B, C, X[13], 7 );
P( C, D, A, B, X[14], 11 );
P( B, C, D, A, X[15], 19 );
#undef P
#undef F
#define F(x,y,z) ((x & y) | (x & z) | (y & z))
#define P(a,b,c,d,x,s) { a += F(b,c,d) + x + 0x5A827999; a = S(a,s); }
P( A, B, C, D, X[ 0], 3 );
P( D, A, B, C, X[ 4], 5 );
P( C, D, A, B, X[ 8], 9 );
P( B, C, D, A, X[12], 13 );
P( A, B, C, D, X[ 1], 3 );
P( D, A, B, C, X[ 5], 5 );
P( C, D, A, B, X[ 9], 9 );
P( B, C, D, A, X[13], 13 );
P( A, B, C, D, X[ 2], 3 );
P( D, A, B, C, X[ 6], 5 );
P( C, D, A, B, X[10], 9 );
P( B, C, D, A, X[14], 13 );
P( A, B, C, D, X[ 3], 3 );
P( D, A, B, C, X[ 7], 5 );
P( C, D, A, B, X[11], 9 );
P( B, C, D, A, X[15], 13 );
#undef P
#undef F
#define F(x,y,z) (x ^ y ^ z)
#define P(a,b,c,d,x,s) { a += F(b,c,d) + x + 0x6ED9EBA1; a = S(a,s); }
P( A, B, C, D, X[ 0], 3 );
P( D, A, B, C, X[ 8], 9 );
P( C, D, A, B, X[ 4], 11 );
P( B, C, D, A, X[12], 15 );
P( A, B, C, D, X[ 2], 3 );
P( D, A, B, C, X[10], 9 );
P( C, D, A, B, X[ 6], 11 );
P( B, C, D, A, X[14], 15 );
P( A, B, C, D, X[ 1], 3 );
P( D, A, B, C, X[ 9], 9 );
P( C, D, A, B, X[ 5], 11 );
P( B, C, D, A, X[13], 15 );
P( A, B, C, D, X[ 3], 3 );
P( D, A, B, C, X[11], 9 );
P( C, D, A, B, X[ 7], 11 );
P( B, C, D, A, X[15], 15 );
#undef F
#undef P
ctx->state[0] += A;
ctx->state[1] += B;
ctx->state[2] += C;
ctx->state[3] += D;
}
/*
* MD4 process buffer
*/
void md4_update( md4_context *ctx, const unsigned char *input, int ilen )
{
int fill;
unsigned long left;
if( ilen <= 0 )
return;
left = ctx->total[0] & 0x3F;
fill = 64 - left;
ctx->total[0] += ilen;
ctx->total[0] &= 0xFFFFFFFF;
if( ctx->total[0] < (unsigned long) ilen )
ctx->total[1]++;
if( left && ilen >= fill )
{
MEMCPY( (void *) (ctx->buffer + left),
input, fill );
md4_process( ctx, ctx->buffer );
input += fill;
ilen -= fill;
left = 0;
}
while( ilen >= 64 )
{
md4_process( ctx, input );
input += 64;
ilen -= 64;
}
if( ilen > 0 )
{
MEMCPY( (void *) (ctx->buffer + left),
input, ilen );
}
}
static const unsigned char md4_padding[64] =
{
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
/*
* MD4 final digest
*/
void md4_finish( md4_context *ctx, unsigned char output[16] )
{
unsigned long last, padn;
unsigned long high, low;
unsigned char msglen[8];
high = ( ctx->total[0] >> 29 )
| ( ctx->total[1] << 3 );
low = ( ctx->total[0] << 3 );
PUT_ULONG_LE( low, msglen, 0 );
PUT_ULONG_LE( high, msglen, 4 );
last = ctx->total[0] & 0x3F;
padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
md4_update( ctx, md4_padding, padn );
md4_update( ctx, msglen, 8 );
PUT_ULONG_LE( ctx->state[0], output, 0 );
PUT_ULONG_LE( ctx->state[1], output, 4 );
PUT_ULONG_LE( ctx->state[2], output, 8 );
PUT_ULONG_LE( ctx->state[3], output, 12 );
}
/*
* output = MD4( input buffer )
*/
void md4( unsigned char *input, int ilen, unsigned char output[16] )
{
md4_context ctx;
md4_starts( &ctx );
md4_update( &ctx, input, ilen );
md4_finish( &ctx, output );
}
#endif /* PPP_SUPPORT && LWIP_INCLUDED_POLARSSL_MD4 */
|
{
"pile_set_name": "Github"
}
|
/*
* LoggerIPConnection.h
*
* BSD license follows (http://www.opensource.org/licenses/bsd-license.php)
*
* Copyright (c) 2010-2011 Florent Pillet <fpillet@gmail.com> All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. Redistributions in
* binary form must reproduce the above copyright notice, this list of
* conditions and the following disclaimer in the documentation and/or other
* materials provided with the distribution. Neither the name of Florent
* Pillet nor the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
* NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#import "LoggerConnection.h"
@interface LoggerIPConnection : LoggerConnection
{
}
@end
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2010-2011 Atheros Communications Inc.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "htc.h"
/******************/
/* BTCOEX */
/******************/
#define ATH_HTC_BTCOEX_PRODUCT_ID "wb193"
#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
/*
* Detects if there is any priority bt traffic
*/
static void ath_detect_bt_priority(struct ath9k_htc_priv *priv)
{
struct ath_btcoex *btcoex = &priv->btcoex;
struct ath_hw *ah = priv->ah;
if (ath9k_hw_gpio_get(ah, ah->btcoex_hw.btpriority_gpio))
btcoex->bt_priority_cnt++;
if (time_after(jiffies, btcoex->bt_priority_time +
msecs_to_jiffies(ATH_BT_PRIORITY_TIME_THRESHOLD))) {
priv->op_flags &= ~(OP_BT_PRIORITY_DETECTED | OP_BT_SCAN);
/* Detect if colocated bt started scanning */
if (btcoex->bt_priority_cnt >= ATH_BT_CNT_SCAN_THRESHOLD) {
ath_dbg(ath9k_hw_common(ah), BTCOEX,
"BT scan detected\n");
priv->op_flags |= (OP_BT_SCAN |
OP_BT_PRIORITY_DETECTED);
} else if (btcoex->bt_priority_cnt >= ATH_BT_CNT_THRESHOLD) {
ath_dbg(ath9k_hw_common(ah), BTCOEX,
"BT priority traffic detected\n");
priv->op_flags |= OP_BT_PRIORITY_DETECTED;
}
btcoex->bt_priority_cnt = 0;
btcoex->bt_priority_time = jiffies;
}
}
/*
* This is the master bt coex work which runs for every
* 45ms, bt traffic will be given priority during 55% of this
* period while wlan gets remaining 45%
*/
static void ath_btcoex_period_work(struct work_struct *work)
{
struct ath9k_htc_priv *priv = container_of(work, struct ath9k_htc_priv,
coex_period_work.work);
struct ath_btcoex *btcoex = &priv->btcoex;
struct ath_common *common = ath9k_hw_common(priv->ah);
u32 timer_period;
bool is_btscan;
int ret;
ath_detect_bt_priority(priv);
is_btscan = !!(priv->op_flags & OP_BT_SCAN);
ret = ath9k_htc_update_cap_target(priv,
!!(priv->op_flags & OP_BT_PRIORITY_DETECTED));
if (ret) {
ath_err(common, "Unable to set BTCOEX parameters\n");
return;
}
ath9k_hw_btcoex_bt_stomp(priv->ah, is_btscan ? ATH_BTCOEX_STOMP_ALL :
btcoex->bt_stomp_type);
ath9k_hw_btcoex_enable(priv->ah);
timer_period = is_btscan ? btcoex->btscan_no_stomp :
btcoex->btcoex_no_stomp;
ieee80211_queue_delayed_work(priv->hw, &priv->duty_cycle_work,
msecs_to_jiffies(timer_period));
ieee80211_queue_delayed_work(priv->hw, &priv->coex_period_work,
msecs_to_jiffies(btcoex->btcoex_period));
}
/*
* Work to time slice between wlan and bt traffic and
* configure weight registers
*/
static void ath_btcoex_duty_cycle_work(struct work_struct *work)
{
struct ath9k_htc_priv *priv = container_of(work, struct ath9k_htc_priv,
duty_cycle_work.work);
struct ath_hw *ah = priv->ah;
struct ath_btcoex *btcoex = &priv->btcoex;
struct ath_common *common = ath9k_hw_common(ah);
bool is_btscan = priv->op_flags & OP_BT_SCAN;
ath_dbg(common, BTCOEX, "time slice work for bt and wlan\n");
if (btcoex->bt_stomp_type == ATH_BTCOEX_STOMP_LOW || is_btscan)
ath9k_hw_btcoex_bt_stomp(ah, ATH_BTCOEX_STOMP_NONE);
else if (btcoex->bt_stomp_type == ATH_BTCOEX_STOMP_ALL)
ath9k_hw_btcoex_bt_stomp(ah, ATH_BTCOEX_STOMP_LOW);
ath9k_hw_btcoex_enable(priv->ah);
}
static void ath_htc_init_btcoex_work(struct ath9k_htc_priv *priv)
{
struct ath_btcoex *btcoex = &priv->btcoex;
btcoex->btcoex_period = ATH_BTCOEX_DEF_BT_PERIOD;
btcoex->btcoex_no_stomp = (100 - ATH_BTCOEX_DEF_DUTY_CYCLE) *
btcoex->btcoex_period / 100;
btcoex->btscan_no_stomp = (100 - ATH_BTCOEX_BTSCAN_DUTY_CYCLE) *
btcoex->btcoex_period / 100;
INIT_DELAYED_WORK(&priv->coex_period_work, ath_btcoex_period_work);
INIT_DELAYED_WORK(&priv->duty_cycle_work, ath_btcoex_duty_cycle_work);
}
/*
* (Re)start btcoex work
*/
static void ath_htc_resume_btcoex_work(struct ath9k_htc_priv *priv)
{
struct ath_btcoex *btcoex = &priv->btcoex;
struct ath_hw *ah = priv->ah;
ath_dbg(ath9k_hw_common(ah), BTCOEX, "Starting btcoex work\n");
btcoex->bt_priority_cnt = 0;
btcoex->bt_priority_time = jiffies;
priv->op_flags &= ~(OP_BT_PRIORITY_DETECTED | OP_BT_SCAN);
ieee80211_queue_delayed_work(priv->hw, &priv->coex_period_work, 0);
}
/*
* Cancel btcoex and bt duty cycle work.
*/
static void ath_htc_cancel_btcoex_work(struct ath9k_htc_priv *priv)
{
cancel_delayed_work_sync(&priv->coex_period_work);
cancel_delayed_work_sync(&priv->duty_cycle_work);
}
void ath9k_htc_start_btcoex(struct ath9k_htc_priv *priv)
{
struct ath_hw *ah = priv->ah;
if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_3WIRE) {
ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT,
AR_STOMP_LOW_WLAN_WGHT);
ath9k_hw_btcoex_enable(ah);
ath_htc_resume_btcoex_work(priv);
}
}
void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv)
{
struct ath_hw *ah = priv->ah;
if (ah->btcoex_hw.enabled &&
ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) {
ath9k_hw_btcoex_disable(ah);
if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE)
ath_htc_cancel_btcoex_work(priv);
}
}
void ath9k_htc_init_btcoex(struct ath9k_htc_priv *priv, char *product)
{
struct ath_hw *ah = priv->ah;
int qnum;
if (product && strncmp(product, ATH_HTC_BTCOEX_PRODUCT_ID, 5) == 0) {
ah->btcoex_hw.scheme = ATH_BTCOEX_CFG_3WIRE;
}
switch (ath9k_hw_get_btcoex_scheme(priv->ah)) {
case ATH_BTCOEX_CFG_NONE:
break;
case ATH_BTCOEX_CFG_3WIRE:
priv->ah->btcoex_hw.btactive_gpio = 7;
priv->ah->btcoex_hw.btpriority_gpio = 6;
priv->ah->btcoex_hw.wlanactive_gpio = 8;
priv->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW;
ath9k_hw_btcoex_init_3wire(priv->ah);
ath_htc_init_btcoex_work(priv);
qnum = priv->hwq_map[WME_AC_BE];
ath9k_hw_init_btcoex_hw(priv->ah, qnum);
break;
default:
WARN_ON(1);
break;
}
}
#endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */
/*******/
/* LED */
/*******/
#ifdef CONFIG_MAC80211_LEDS
void ath9k_led_work(struct work_struct *work)
{
struct ath9k_htc_priv *priv = container_of(work,
struct ath9k_htc_priv,
led_work);
ath9k_hw_set_gpio(priv->ah, priv->ah->led_pin,
(priv->brightness == LED_OFF));
}
static void ath9k_led_brightness(struct led_classdev *led_cdev,
enum led_brightness brightness)
{
struct ath9k_htc_priv *priv = container_of(led_cdev,
struct ath9k_htc_priv,
led_cdev);
/* Not locked, but it's just a tiny green light..*/
priv->brightness = brightness;
ieee80211_queue_work(priv->hw, &priv->led_work);
}
void ath9k_deinit_leds(struct ath9k_htc_priv *priv)
{
if (!priv->led_registered)
return;
ath9k_led_brightness(&priv->led_cdev, LED_OFF);
led_classdev_unregister(&priv->led_cdev);
cancel_work_sync(&priv->led_work);
}
void ath9k_init_leds(struct ath9k_htc_priv *priv)
{
int ret;
if (AR_SREV_9287(priv->ah))
priv->ah->led_pin = ATH_LED_PIN_9287;
else if (AR_SREV_9271(priv->ah))
priv->ah->led_pin = ATH_LED_PIN_9271;
else if (AR_DEVID_7010(priv->ah))
priv->ah->led_pin = ATH_LED_PIN_7010;
else
priv->ah->led_pin = ATH_LED_PIN_DEF;
/* Configure gpio 1 for output */
ath9k_hw_cfg_output(priv->ah, priv->ah->led_pin,
AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
/* LED off, active low */
ath9k_hw_set_gpio(priv->ah, priv->ah->led_pin, 1);
snprintf(priv->led_name, sizeof(priv->led_name),
"ath9k_htc-%s", wiphy_name(priv->hw->wiphy));
priv->led_cdev.name = priv->led_name;
priv->led_cdev.brightness_set = ath9k_led_brightness;
ret = led_classdev_register(wiphy_dev(priv->hw->wiphy), &priv->led_cdev);
if (ret < 0)
return;
INIT_WORK(&priv->led_work, ath9k_led_work);
priv->led_registered = true;
return;
}
#endif
/*******************/
/* Rfkill */
/*******************/
static bool ath_is_rfkill_set(struct ath9k_htc_priv *priv)
{
bool is_blocked;
ath9k_htc_ps_wakeup(priv);
is_blocked = ath9k_hw_gpio_get(priv->ah, priv->ah->rfkill_gpio) ==
priv->ah->rfkill_polarity;
ath9k_htc_ps_restore(priv);
return is_blocked;
}
void ath9k_htc_rfkill_poll_state(struct ieee80211_hw *hw)
{
struct ath9k_htc_priv *priv = hw->priv;
bool blocked = !!ath_is_rfkill_set(priv);
wiphy_rfkill_set_hw_state(hw->wiphy, blocked);
}
void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv)
{
if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_RFSILENT)
wiphy_rfkill_start_polling(priv->hw->wiphy);
}
void ath9k_htc_radio_enable(struct ieee80211_hw *hw)
{
struct ath9k_htc_priv *priv = hw->priv;
struct ath_hw *ah = priv->ah;
struct ath_common *common = ath9k_hw_common(ah);
int ret;
u8 cmd_rsp;
if (!ah->curchan)
ah->curchan = ath9k_cmn_get_curchannel(hw, ah);
/* Reset the HW */
ret = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false);
if (ret) {
ath_err(common,
"Unable to reset hardware; reset status %d (freq %u MHz)\n",
ret, ah->curchan->channel);
}
ath9k_cmn_update_txpow(ah, priv->curtxpow, priv->txpowlimit,
&priv->curtxpow);
/* Start RX */
WMI_CMD(WMI_START_RECV_CMDID);
ath9k_host_rx_init(priv);
/* Start TX */
htc_start(priv->htc);
spin_lock_bh(&priv->tx.tx_lock);
priv->tx.flags &= ~ATH9K_HTC_OP_TX_QUEUES_STOP;
spin_unlock_bh(&priv->tx.tx_lock);
ieee80211_wake_queues(hw);
WMI_CMD(WMI_ENABLE_INTR_CMDID);
/* Enable LED */
ath9k_hw_cfg_output(ah, ah->led_pin,
AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
ath9k_hw_set_gpio(ah, ah->led_pin, 0);
}
void ath9k_htc_radio_disable(struct ieee80211_hw *hw)
{
struct ath9k_htc_priv *priv = hw->priv;
struct ath_hw *ah = priv->ah;
struct ath_common *common = ath9k_hw_common(ah);
int ret;
u8 cmd_rsp;
ath9k_htc_ps_wakeup(priv);
/* Disable LED */
ath9k_hw_set_gpio(ah, ah->led_pin, 1);
ath9k_hw_cfg_gpio_input(ah, ah->led_pin);
WMI_CMD(WMI_DISABLE_INTR_CMDID);
/* Stop TX */
ieee80211_stop_queues(hw);
ath9k_htc_tx_drain(priv);
WMI_CMD(WMI_DRAIN_TXQ_ALL_CMDID);
/* Stop RX */
WMI_CMD(WMI_STOP_RECV_CMDID);
/* Clear the WMI event queue */
ath9k_wmi_event_drain(priv);
/*
* The MIB counters have to be disabled here,
* since the target doesn't do it.
*/
ath9k_hw_disable_mib_counters(ah);
if (!ah->curchan)
ah->curchan = ath9k_cmn_get_curchannel(hw, ah);
/* Reset the HW */
ret = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false);
if (ret) {
ath_err(common,
"Unable to reset hardware; reset status %d (freq %u MHz)\n",
ret, ah->curchan->channel);
}
/* Disable the PHY */
ath9k_hw_phy_disable(ah);
ath9k_htc_ps_restore(priv);
ath9k_htc_setpower(priv, ATH9K_PM_FULL_SLEEP);
}
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Destroyable unit test</title>
<script src="boilerplate.js"></script>
<script type="text/javascript">
require([
"doh/runner",
"dojo/aspect", "dojo/_base/declare", "dojo/Deferred", "dojo/dom", "dojo/dom-construct",
"dojo/_base/lang", "dojo/on", "dojo/Stateful",
"dijit/Destroyable", "dojo/domReady!"
], function(doh, aspect, declare, Deferred, dom, domConstruct, lang, on, Stateful, Destroyable){
doh.register("Destroyable", [
function general(){
var SupportingWidget = declare([], {
destroyCalls: 0,
constructor: function(name){
this.name = name;
},
destroy: function(){
this.destroyCalls++;
}
});
var watchMe = new Stateful({
name: "watchMe",
x: 0
});
var DestroyableSubClass = declare(Destroyable, {
// number of times my button was clicked
clicks: 0,
// number of times watchMe changed value of x
watches: 0,
constructor: function(){
var self = this;
this.domNode = domConstruct.create("button");
this.own(
// setup an event handler (to be destroyed when I'm destroyed)
on(this.domNode, "click", function(){ self.clicks++; }),
// watch external watchMe class (to be unwatch()'d when I'm destroyed)
watchMe.watch("x", function(name, oVal, nVal){ self.watches++; })
);
// Setup two supporting widgets, to be destroyed when I'm destroyed
this.own(this.sw1 = new SupportingWidget("sw1"));
this.own(this.sw2 = new SupportingWidget("sw2"));
}
});
var destroyable1 = new DestroyableSubClass();
dom.byId("container").appendChild(destroyable1.domNode);
// make sure event handler was setup
destroyable1.domNode.click();
doh.is(1, destroyable1.clicks, "one click");
// make sure watch handler was setup
watchMe.set("x", 1);
doh.is(1, destroyable1.watches, "one watch notification");
// manually destroy one of the supporting widgets
destroyable1.sw1.destroy();
doh.is(1, destroyable1.sw1.destroyCalls);
// Destroy the Destroyable instance itself. destroyable1 should:
// - destroy the sw2 supporting widget, but not try to re-destroy sw1
// - disconnect the watch() listener on watchMe
// - disconnect the click event handler on destroyable1.domNode
destroyable1.destroy();
doh.is(1, destroyable1.sw1.destroyCalls, "sw1 wasn't redestroyed");
doh.is(1, destroyable1.sw2.destroyCalls, "sw2 was destroyed");
destroyable1.domNode.click();
doh.is(1, destroyable1.clicks, "no new click notification");
watchMe.set("x", 2);
doh.is(1, destroyable1.watches, "no new watch notification");
},
function multipleDestroyFunctions(){
var destroyRecursiveCount = 0;
var destroyCount = 0;
var W1 = declare([Destroyable], {
destroyRecursive: function() {
destroyRecursiveCount++;
this.destroy();
this.inherited(arguments);
},
destroy: function() {
destroyCount++;
this.inherited(arguments);
}
});
var W2 = declare([Destroyable], {
test: function() {
var w1 = new W1();
this.own(w1);
w1.destroy();
},
destroy: function() {
this.inherited(arguments);
}
});
var W3 = declare([Destroyable], {
test: function() {
var w1 = new W1();
this.own(w1);
w1.destroyRecursive();
},
destroy: function() {
this.inherited(arguments);
}
});
var w2 = new W2();
w2.test();
w2.destroy();
doh.is(0, destroyRecursiveCount, "destroyRecursive was not called as expected");
doh.is(1, destroyCount, "destroy was not called as expected");
destroyRecursiveCount = 0;
destroyCount = 0;
var w3 = new W3();
w3.test();
w3.destroy();
doh.is(1, destroyRecursiveCount, "destroyRecursive was not called as expected");
doh.is(1, destroyCount, "destroy was not called as expected");
},
function owningPromises(){
var cancels = 0;
var W1 = declare(Destroyable, {
constructor: function(){
this.p1 = new Deferred(function(){ console.log("cancel p1"); cancels++; });
this.p2 = new Deferred(function(){ console.log("cancel p2"); cancels++; });
this.p3 = new Deferred(function(){ console.log("cancel p3"); cancels++; });
this.p4 = new Deferred(function(){ console.log("cancel p4"); cancels++; });
this.own(this.p1, this.p2, this.p3, this.p4);
}
});
var w1 = new W1();
w1.p1.resolve(true);
aspect.after(w1.p1, "cancel", function(){
throw new Error("p1 shouldn't have been canceled");
}, true);
w1.p2.reject(new Error("I was rejected"));
aspect.after(w1.p2, "cancel", function(){
throw new Error("p2 shouldn't have been canceled");
}, true);
w1.p3.cancel();
doh.is(1, cancels, "one promise canceled manually before destroy");
// Destroying the widget should only cancel p4; it's the only Promise that hasn't been dealt with already.
// OTOH if Destroyable is broken, one of the asserts above may go off during the destroy() call.
w1.destroy();
doh.is(2, cancels, "only p4 canceled on widget destroy");
}
]); // doh.register()
doh.run();
}); // require()
</script>
</head>
<body>
<h1>dijit/Destroyable Unit Test</h1>
<div id="container"></div>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2017 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#ifndef DM_PP_SMU_IF__H
#define DM_PP_SMU_IF__H
/*
* interface to PPLIB/SMU to setup clocks and pstate requirements on SoC
*/
typedef bool BOOLEAN;
enum pp_smu_ver {
/*
* PP_SMU_INTERFACE_X should be interpreted as the interface defined
* starting from X, where X is some family of ASICs. This is as
* opposed to interfaces used only for X. There will be some degree
* of interface sharing between families of ASIcs.
*/
PP_SMU_UNSUPPORTED,
PP_SMU_VER_RV,
PP_SMU_VER_NV,
PP_SMU_VER_RN,
PP_SMU_VER_MAX
};
struct pp_smu {
enum pp_smu_ver ver;
const void *pp;
/*
* interim extra handle for backwards compatibility
* as some existing functionality not yet implemented
* by ppsmu
*/
const void *dm;
};
enum pp_smu_status {
PP_SMU_RESULT_UNDEFINED = 0,
PP_SMU_RESULT_OK = 1,
PP_SMU_RESULT_FAIL,
PP_SMU_RESULT_UNSUPPORTED
};
#define PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MIN 0x0
#define PP_SMU_WM_SET_RANGE_CLK_UNCONSTRAINED_MAX 0xFFFF
enum wm_type {
WM_TYPE_PSTATE_CHG = 0,
WM_TYPE_RETRAINING = 1,
};
/* This structure is a copy of WatermarkRowGeneric_t defined by smuxx_driver_if.h*/
struct pp_smu_wm_set_range {
uint16_t min_fill_clk_mhz;
uint16_t max_fill_clk_mhz;
uint16_t min_drain_clk_mhz;
uint16_t max_drain_clk_mhz;
uint8_t wm_inst;
uint8_t wm_type;
};
#define MAX_WATERMARK_SETS 4
struct pp_smu_wm_range_sets {
unsigned int num_reader_wm_sets;
struct pp_smu_wm_set_range reader_wm_sets[MAX_WATERMARK_SETS];
unsigned int num_writer_wm_sets;
struct pp_smu_wm_set_range writer_wm_sets[MAX_WATERMARK_SETS];
};
struct pp_smu_funcs_rv {
struct pp_smu pp_smu;
/* PPSMC_MSG_SetDisplayCount
* 0 triggers S0i2 optimization
*/
void (*set_display_count)(struct pp_smu *pp, int count);
/* reader and writer WM's are sent together as part of one table*/
/*
* PPSMC_MSG_SetDriverDramAddrHigh
* PPSMC_MSG_SetDriverDramAddrLow
* PPSMC_MSG_TransferTableDram2Smu
*
* */
void (*set_wm_ranges)(struct pp_smu *pp,
struct pp_smu_wm_range_sets *ranges);
/* PPSMC_MSG_SetHardMinDcfclkByFreq
* fixed clock at requested freq, either from FCH bypass or DFS
*/
void (*set_hard_min_dcfclk_by_freq)(struct pp_smu *pp, int mhz);
/* PPSMC_MSG_SetMinDeepSleepDcfclk
* when DF is in cstate, dcf clock is further divided down
* to just above given frequency
*/
void (*set_min_deep_sleep_dcfclk)(struct pp_smu *pp, int mhz);
/* PPSMC_MSG_SetHardMinFclkByFreq
* FCLK will vary with DPM, but never below requested hard min
*/
void (*set_hard_min_fclk_by_freq)(struct pp_smu *pp, int mhz);
/* PPSMC_MSG_SetHardMinSocclkByFreq
* Needed for DWB support
*/
void (*set_hard_min_socclk_by_freq)(struct pp_smu *pp, int mhz);
/* PME w/a */
void (*set_pme_wa_enable)(struct pp_smu *pp);
};
/* Used by pp_smu_funcs_nv.set_voltage_by_freq
*
*/
enum pp_smu_nv_clock_id {
PP_SMU_NV_DISPCLK,
PP_SMU_NV_PHYCLK,
PP_SMU_NV_PIXELCLK
};
/*
* Used by pp_smu_funcs_nv.get_maximum_sustainable_clocks
*/
struct pp_smu_nv_clock_table {
// voltage managed SMU, freq set by driver
unsigned int displayClockInKhz;
unsigned int dppClockInKhz;
unsigned int phyClockInKhz;
unsigned int pixelClockInKhz;
unsigned int dscClockInKhz;
// freq/voltage managed by SMU
unsigned int fabricClockInKhz;
unsigned int socClockInKhz;
unsigned int dcfClockInKhz;
unsigned int uClockInKhz;
};
struct pp_smu_funcs_nv {
struct pp_smu pp_smu;
/* PPSMC_MSG_SetDisplayCount
* 0 triggers S0i2 optimization
*/
enum pp_smu_status (*set_display_count)(struct pp_smu *pp, int count);
/* PPSMC_MSG_SetHardMinDcfclkByFreq
* fixed clock at requested freq, either from FCH bypass or DFS
*/
enum pp_smu_status (*set_hard_min_dcfclk_by_freq)(struct pp_smu *pp, int Mhz);
/* PPSMC_MSG_SetMinDeepSleepDcfclk
* when DF is in cstate, dcf clock is further divided down
* to just above given frequency
*/
enum pp_smu_status (*set_min_deep_sleep_dcfclk)(struct pp_smu *pp, int Mhz);
/* PPSMC_MSG_SetHardMinUclkByFreq
* UCLK will vary with DPM, but never below requested hard min
*/
enum pp_smu_status (*set_hard_min_uclk_by_freq)(struct pp_smu *pp, int Mhz);
/* PPSMC_MSG_SetHardMinSocclkByFreq
* Needed for DWB support
*/
enum pp_smu_status (*set_hard_min_socclk_by_freq)(struct pp_smu *pp, int Mhz);
/* PME w/a */
enum pp_smu_status (*set_pme_wa_enable)(struct pp_smu *pp);
/* PPSMC_MSG_SetHardMinByFreq
* Needed to set ASIC voltages for clocks programmed by DAL
*/
enum pp_smu_status (*set_voltage_by_freq)(struct pp_smu *pp,
enum pp_smu_nv_clock_id clock_id, int Mhz);
/* reader and writer WM's are sent together as part of one table*/
/*
* PPSMC_MSG_SetDriverDramAddrHigh
* PPSMC_MSG_SetDriverDramAddrLow
* PPSMC_MSG_TransferTableDram2Smu
*
* on DCN20:
* reader fill clk = uclk
* reader drain clk = dcfclk
* writer fill clk = socclk
* writer drain clk = uclk
* */
enum pp_smu_status (*set_wm_ranges)(struct pp_smu *pp,
struct pp_smu_wm_range_sets *ranges);
/* Not a single SMU message. This call should return maximum sustainable limit for all
* clocks that DC depends on. These will be used as basis for mode enumeration.
*/
enum pp_smu_status (*get_maximum_sustainable_clocks)(struct pp_smu *pp,
struct pp_smu_nv_clock_table *max_clocks);
/* This call should return the discrete uclk DPM states available
*/
enum pp_smu_status (*get_uclk_dpm_states)(struct pp_smu *pp,
unsigned int *clock_values_in_khz, unsigned int *num_states);
/* Not a single SMU message. This call informs PPLIB that display will not be able
* to perform pstate handshaking in its current state. Typically this handshake
* is used to perform uCLK switching, so disabling pstate disables uCLK switching.
*
* Note that when setting handshake to unsupported, the call is pre-emptive. That means
* DC will make the call BEFORE setting up the display state which would cause pstate
* request to go un-acked. Only when the call completes should such a state be applied to
* DC hardware
*/
enum pp_smu_status (*set_pstate_handshake_support)(struct pp_smu *pp,
BOOLEAN pstate_handshake_supported);
};
#define PP_SMU_NUM_SOCCLK_DPM_LEVELS 8
#define PP_SMU_NUM_DCFCLK_DPM_LEVELS 8
#define PP_SMU_NUM_FCLK_DPM_LEVELS 4
#define PP_SMU_NUM_MEMCLK_DPM_LEVELS 4
struct dpm_clock {
uint32_t Freq; // In MHz
uint32_t Vol; // Millivolts with 2 fractional bits
};
/* this is a copy of the structure defined in smuxx_driver_if.h*/
struct dpm_clocks {
struct dpm_clock DcfClocks[PP_SMU_NUM_DCFCLK_DPM_LEVELS];
struct dpm_clock SocClocks[PP_SMU_NUM_SOCCLK_DPM_LEVELS];
struct dpm_clock FClocks[PP_SMU_NUM_FCLK_DPM_LEVELS];
struct dpm_clock MemClocks[PP_SMU_NUM_MEMCLK_DPM_LEVELS];
};
struct pp_smu_funcs_rn {
struct pp_smu pp_smu;
/*
* reader and writer WM's are sent together as part of one table
*
* PPSMC_MSG_SetDriverDramAddrHigh
* PPSMC_MSG_SetDriverDramAddrLow
* PPSMC_MSG_TransferTableDram2Smu
*
*/
enum pp_smu_status (*set_wm_ranges)(struct pp_smu *pp,
struct pp_smu_wm_range_sets *ranges);
enum pp_smu_status (*get_dpm_clock_table) (struct pp_smu *pp,
struct dpm_clocks *clock_table);
};
struct pp_smu_funcs {
struct pp_smu ctx;
union {
struct pp_smu_funcs_rv rv_funcs;
struct pp_smu_funcs_nv nv_funcs;
struct pp_smu_funcs_rn rn_funcs;
};
};
#endif /* DM_PP_SMU_IF__H */
|
{
"pile_set_name": "Github"
}
|
$!
$! OpenVMS configure procedure for libtiff
$! (c) Alexey Chupahin 22-NOV-2007
$! elvis_75@mail.ru
$!
$! Permission to use, copy, modify, distribute, and sell this software and
$! its documentation for any purpose is hereby granted without fee, provided
$! that (i) the above copyright notices and this permission notice appear in
$! all copies of the software and related documentation, and (ii) the names of
$! Sam Leffler and Silicon Graphics may not be used in any advertising or
$! publicity relating to the software without the specific, prior written
$! permission of Sam Leffler and Silicon Graphics.
$!
$! THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
$! EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
$! WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
$!
$! IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
$! ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
$! OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
$! WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
$! LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
$! OF THIS SOFTWARE.
$!
$!
$ SET NOON
$WRITE SYS$OUTPUT " "
$WRITE SYS$OUTPUT "Configuring libTIFF library"
$WRITE SYS$OUTPUT " "
$! Checking architecture
$DECC = F$SEARCH("SYS$SYSTEM:DECC$COMPILER.EXE") .NES. ""
$IF (.NOT. DECC) THEN $WRITE SYS$OUTPUT "BAD compiler" GOTO EXIT
$ IF F$GETSYI("ARCH_TYPE").EQ.1 THEN CPU = "VAX"
$ IF F$GETSYI("ARCH_TYPE").EQ.2 THEN CPU = "Alpha"
$ IF F$GETSYI("ARCH_TYPE").EQ.3 THEN CPU = "I64"
$ OS = F$GETSYI("VERSION")
$WRITE SYS$OUTPUT "Checking architecture ... ", CPU
$WRITE SYS$OUTPUT "Checking OS ... OpenVMS ",OS
$SHARED=0
$IF ( (CPU.EQS."Alpha").OR.(CPU.EQS."I64") )
$ THEN
$ SHARED=64
$ ELSE
$ SHARED=32
$ENDIF
$MMS = F$SEARCH("SYS$SYSTEM:MMS.EXE") .NES. ""
$MMK = F$TYPE(MMK)
$IF (MMS .OR. MMK.NES."") THEN GOTO TEST_LIBRARIES
$! I cant find any make tool
$GOTO EXIT
$!
$!
$TEST_LIBRARIES:
$! Setting as MAKE utility one of MMS or MMK. I prefer MMS.
$IF (MMK.NES."") THEN MAKE="MMK"
$IF (MMS) THEN MAKE="MMS"
$WRITE SYS$OUTPUT "Checking build utility ... ''MAKE'"
$WRITE SYS$OUTPUT " "
$!
$!
$IF (P1.EQS."STATIC").OR.(P1.EQS."static") THEN SHARED=0
$!
$!
$!"Checking for strcasecmp "
$ DEFINE SYS$ERROR _NLA0:
$ DEFINE SYS$OUTPUT _NLA0:
$ CC/OBJECT=TEST.OBJ/INCLUDE=(ZLIB) SYS$INPUT
#include <strings.h>
#include <stdlib.h>
int main()
{
if (strcasecmp("bla", "Bla")==0) exit(0);
else exit(2);
}
$!
$TMP = $STATUS
$DEASS SYS$ERROR
$DEAS SYS$OUTPUT
$IF (TMP .NE. %X10B90001)
$ THEN
$ HAVE_STRCASECMP=0
$ GOTO NEXT1
$ENDIF
$DEFINE SYS$ERROR _NLA0:
$DEFINE SYS$OUTPUT _NLA0:
$LINK/EXE=TEST TEST
$TMP = $STATUS
$DEAS SYS$ERROR
$DEAS SYS$OUTPUT
$!WRITE SYS$OUTPUT TMP
$IF (TMP .NE. %X10000001)
$ THEN
$ HAVE_STRCASECMP=0
$ GOTO NEXT1
$ENDIF
$!
$DEFINE SYS$ERROR _NLA0:
$DEFINE SYS$OUTPUT _NLA0:
$RUN TEST
$IF ($STATUS .NE. %X00000001)
$ THEN
$ HAVE_STRCASECMP=0
$ ELSE
$ HAVE_STRCASECMP=1
$ENDIF
$DEAS SYS$ERROR
$DEAS SYS$OUTPUT
$NEXT1:
$IF (HAVE_STRCASECMP.EQ.1)
$ THEN
$ WRITE SYS$OUTPUT "Checking for strcasecmp ... Yes"
$ ELSE
$ WRITE SYS$OUTPUT "Checking for strcasecmp ... No"
$ENDIF
$!
$!
$!"Checking for lfind "
$ DEFINE SYS$ERROR _NLA0:
$ DEFINE SYS$OUTPUT _NLA0:
$ CC/OBJECT=TEST.OBJ/INCLUDE=(ZLIB) SYS$INPUT
#include <search.h>
int main()
{
lfind((const void *)key, (const void *)NULL, (size_t *)NULL,
(size_t) 0, NULL);
}
$!
$TMP = $STATUS
$DEASS SYS$ERROR
$DEAS SYS$OUTPUT
$IF (TMP .NE. %X10B90001)
$ THEN
$ HAVE_LFIND=0
$ GOTO NEXT2
$ENDIF
$DEFINE SYS$ERROR _NLA0:
$DEFINE SYS$OUTPUT _NLA0:
$LINK/EXE=TEST TEST
$TMP = $STATUS
$DEAS SYS$ERROR
$DEAS SYS$OUTPUT
$!WRITE SYS$OUTPUT TMP
$IF (TMP .NE. %X10000001)
$ THEN
$ HAVE_LFIND=0
$ GOTO NEXT2
$ ELSE
$ HAVE_LFIND=1
$ENDIF
$!
$NEXT2:
$IF (HAVE_LFIND.EQ.1)
$ THEN
$ WRITE SYS$OUTPUT "Checking for lfind ... Yes"
$ ELSE
$ WRITE SYS$OUTPUT "Checking for lfind ... No"
$ENDIF
$!
$!
$!"Checking for correct zlib library "
$ DEFINE SYS$ERROR _NLA0:
$ DEFINE SYS$OUTPUT _NLA0:
$ CC/OBJECT=TEST.OBJ/INCLUDE=(ZLIB) SYS$INPUT
#include <stdlib.h>
#include <stdio.h>
#include <zlib.h>
int main()
{
printf("checking version zlib: %s\n",zlibVersion());
}
$TMP = $STATUS
$DEASS SYS$ERROR
$DEAS SYS$OUTPUT
$!WRITE SYS$OUTPUT TMP
$IF (TMP .NE. %X10B90001)
$ THEN
$ HAVE_ZLIB=0
$ GOTO EXIT
$ENDIF
$DEFINE SYS$ERROR _NLA0:
$DEFINE SYS$OUTPUT _NLA0:
$LINK/EXE=TEST TEST,ZLIB:LIBZ/LIB
$TMP = $STATUS
$DEAS SYS$ERROR
$DEAS SYS$OUTPUT
$!WRITE SYS$OUTPUT TMP
$IF (TMP .NE. %X10000001)
$ THEN
$ HAVE_ZLIB=0
$ GOTO EXIT
$ ELSE
$ HAVE_ZLIB=1
$ENDIF
$IF (HAVE_ZLIB.EQ.1)
$ THEN
$ WRITE SYS$OUTPUT "Checking for correct zlib library ... Yes"
$ ELSE
$ WRITE SYS$OUTPUT "Checking for correct zlib library ... No"
$ WRITE SYS$OUTPUT "This is fatal. Please download and install good library from fafner.dyndns.org/~alexey/libsdl/public.html"
$ENDIF
$RUN TEST
$!
$DEL TEST.OBJ;*
$! Checking for JPEG ...
$ DEFINE SYS$ERROR _NLA0:
$ DEFINE SYS$OUTPUT _NLA0:
$ CC/OBJECT=TEST.OBJ/INCLUDE=(JPEG) SYS$INPUT
#include <stdlib.h>
#include <stdio.h>
#include <jpeglib.h>
#include <jversion.h>
int main()
{
printf("checking version jpeg: %s\n",JVERSION);
jpeg_quality_scaling(0);
return 0;
}
$TMP = $STATUS
$DEASS SYS$ERROR
$DEAS SYS$OUTPUT
$!WRITE SYS$OUTPUT TMP
$IF (TMP .NE. %X10B90001)
$ THEN
$ WRITE SYS$OUTPUT "Checking for static jpeg library ... No"
$ HAVE_JPEG=0
$ENDIF
$DEFINE SYS$ERROR _NLA0:
$DEFINE SYS$OUTPUT _NLA0:
$LINK/EXE=TEST TEST,JPEG:LIBJPEG/LIB
$TMP = $STATUS
$DEAS SYS$ERROR
$DEAS SYS$OUTPUT
$!WRITE SYS$OUTPUT TMP
$IF (TMP .NE. %X10000001)
$ THEN
$ HAVE_JPEG=0
$ ELSE
$ HAVE_JPEG=1
$ENDIF
$IF (HAVE_JPEG.EQ.1)
$ THEN
$ WRITE SYS$OUTPUT "Checking for static jpeg library ... Yes"
$ JPEG_LIBRARY_PATH="JPEG:LIBJPEG/LIB"
$ RUN TEST
$ ELSE
$ WRITE SYS$OUTPUT "Checking for static jpeg library ... No"
$ENDIF
$!
$!"Checking for SHARED JPEG library "
$OPEN/WRITE OUT TEST.OPT
$WRITE OUT "SYS$SHARE:LIBJPEG$SHR/SHARE"
$WRITE OUT "ZLIB:LIBZ/LIB"
$CLOSE OUT
$DEFINE SYS$ERROR _NLA0:
$DEFINE SYS$OUTPUT _NLA0:
$LINK/EXE=TEST TEST,TEST/OPT
$TMP = $STATUS
$DEAS SYS$ERROR
$DEAS SYS$OUTPUT
$!WRITE SYS$OUTPUT TMP
$IF (TMP .NE. %X10000001)
$ THEN
$ HAVE_JPEG_SHARED=0
$ ELSE
$ HAVE_JPEG_SHARED=1
$ENDIF
$IF (HAVE_JPEG_SHARED.EQ.1)
$ THEN
$ WRITE SYS$OUTPUT "Checking for shared jpeg library ... Yes"
$ JPEG_LIBRARY_PATH="SYS$SHARE:LIBJPEG$SHR/SHARE"
$ ELSE
$ WRITE SYS$OUTPUT "Checking for shared jpeg library ... No"
$ENDIF
$!
$ IF ( (HAVE_JPEG_SHARED.EQ.0).AND.(HAVE_JPEG.EQ.0) )
$ THEN
$ WRITE SYS$OUTPUT "No JPEG library installed. This is fatal. Please download and install good library from fafner.dyndns.org/~alexey/libsdl/public.html"
$ GOTO EXIT
$ ENDIF
$!
$!
$!
$! Checking for X11 ...
$IF F$TRNLNM("DECW$INCLUDE") .NES. ""
$ THEN
$ WRITE SYS$OUTPUT "Checking for X11 ... Yes"
$ ELSE
$ WRITE SYS$OUTPUT "Checking for X11 ... No"
$ WRITE SYS$OUTPUT "This is fatal. Please install X11 software"
$ GOTO EXIT
$ENDIF
$!
$!WRITING BUILD FILES
$OPEN/WRITE OUT BUILD.COM
$ WRITE OUT "$set def [.port]"
$ WRITE OUT "$",MAKE
$ WRITE OUT "$set def [-.libtiff]"
$ WRITE OUT "$",MAKE
$ WRITE OUT "$set def [-.tools]"
$ WRITE OUT "$",MAKE
$ WRITE OUT "$set def [-]"
$ WRITE OUT "$cop [.PORT]LIBPORT.OLB [.LIBTIFF]LIBPORT.OLB"
$ WRITE OUT "$ CURRENT = F$ENVIRONMENT (""DEFAULT"") "
$ WRITE OUT "$TIFF=CURRENT"
$ WRITE OUT "$OPEN/WRITE OUTT LIBTIFF$STARTUP.COM"
$ WRITE OUT "$TIFF[F$LOCATE(""]"",TIFF),9]:="".LIBTIFF]"""
$ WRITE OUT "$WRITE OUTT ""DEFINE TIFF ","'","'","TIFF'"" "
$ WRITE OUT "$TIFF=CURRENT"
$ WRITE OUT "$TIFF[F$LOCATE(""]"",TIFF),7]:="".TOOLS]"""
$ WRITE OUT "$WRITE OUTT ""BMP2TIFF:==$", "'","'","TIFF'BMP2TIFF"""
$ WRITE OUT "$WRITE OUTT ""FAX2PS:==$", "'","'","TIFF'FAX2PS"""
$ WRITE OUT "$WRITE OUTT ""FAX2TIFF:==$", "'","'","TIFF'FAX2TIFF"""
$ WRITE OUT "$WRITE OUTT ""GIF2TIFF:==$", "'","'","TIFF'GIF2TIFF"""
$ WRITE OUT "$WRITE OUTT ""PAL2RGB:==$", "'","'","TIFF'PAL2RGB"""
$ WRITE OUT "$WRITE OUTT ""PPM2TIFF:==$", "'","'","TIFF'PPM2TIFF"""
$ WRITE OUT "$WRITE OUTT ""RAS2TIFF:==$", "'","'","TIFF'RAS2TIFF"""
$ WRITE OUT "$WRITE OUTT ""RAW2TIFF:==$", "'","'","TIFF'RAW2TIFF"""
$ WRITE OUT "$WRITE OUTT ""RGB2YCBCR:==$", "'","'","TIFF'RGB2YCBCR"""
$ WRITE OUT "$WRITE OUTT ""THUMBNAIL:==$", "'","'","TIFF'THUMBNAIL"""
$ WRITE OUT "$WRITE OUTT ""TIFF2BW:==$", "'","'","TIFF'TIFF2BW"""
$ WRITE OUT "$WRITE OUTT ""TIFF2PDF:==$", "'","'","TIFF'TIFF2PDF"""
$ WRITE OUT "$WRITE OUTT ""TIFF2PS:==$", "'","'","TIFF'TIFF2PS"""
$ WRITE OUT "$WRITE OUTT ""TIFF2RGBA:==$", "'","'","TIFF'TIFF2RGBA"""
$ WRITE OUT "$WRITE OUTT ""TIFFCMP:==$", "'","'","TIFF'TIFFCMP"""
$ WRITE OUT "$WRITE OUTT ""TIFFCP:==$", "'","'","TIFF'TIFFCP"""
$ WRITE OUT "$WRITE OUTT ""TIFFDITHER:==$", "'","'","TIFF'TIFFDITHER"""
$ WRITE OUT "$WRITE OUTT ""TIFFDUMP:==$", "'","'","TIFF'TIFFDUMP"""
$ WRITE OUT "$WRITE OUTT ""TIFFINFO:==$", "'","'","TIFF'TIFFINFO"""
$ WRITE OUT "$WRITE OUTT ""TIFFMEDIAN:==$", "'","'","TIFF'TIFFMEDIAN"""
$ WRITE OUT "$WRITE OUTT ""TIFFCROP:==$", "'","'","TIFF'TIFFCROP"""
$ WRITE OUT "$WRITE OUTT ""TIFFSET:==$", "'","'","TIFF'TIFFSET"""
$ WRITE OUT "$CLOSE OUTT"
$ WRITE OUT "$OPEN/WRITE OUTT [.LIBTIFF]LIBTIFF.OPT"
$ WRITE OUT "$WRITE OUTT ""TIFF:TIFF/LIB""
$ WRITE OUT "$WRITE OUTT ""TIFF:LIBPORT/LIB""
$ WRITE OUT "$WRITE OUTT ""JPEG:LIBJPEG/LIB""
$ WRITE OUT "$WRITE OUTT ""ZLIB:LIBZ/LIB""
$ WRITE OUT "$CLOSE OUTT"
$!
$ WRITE OUT "$WRITE SYS$OUTPUT "" "" "
$ WRITE OUT "$WRITE SYS$OUTPUT ""***************************************************************************** "" "
$ WRITE OUT "$WRITE SYS$OUTPUT ""LIBTIFF$STARTUP.COM has been created. "" "
$ WRITE OUT "$WRITE SYS$OUTPUT ""This file setups all logicals needed. It should be execute before using LibTIFF "" "
$ WRITE OUT "$WRITE SYS$OUTPUT ""Nice place to call it - LOGIN.COM "" "
$ WRITE OUT "$WRITE SYS$OUTPUT """" "
$ WRITE OUT "$WRITE SYS$OUTPUT ""Using the library:"" "
$ WRITE OUT "$WRITE SYS$OUTPUT ""CC/INC=TIFF ASCII_TAG.C"" "
$ WRITE OUT "$WRITE SYS$OUTPUT ""LINK ASCII_TAG,TIFF:LIBTIFF/OPT"" "
$ WRITE OUT "$WRITE SYS$OUTPUT ""***************************************************************************** "" "
$CLOSE OUT
$!
$! DESCRIP.MMS in [.PORT]
$OBJ="dummy.obj"
$IF HAVE_STRCASECMP.NE.1
$ THEN
$ OBJ=OBJ+",strcasecmp.obj"
$ENDIF
$IF HAVE_LFIND.NE.1
$ THEN
$ OBJ=OBJ+",lfind.obj"
$ENDIF
$OPEN/WRITE OUT [.PORT]DESCRIP.MMS
$WRITE OUT "OBJ=",OBJ
$WRITE OUT ""
$WRITE OUT "LIBPORT.OLB : $(OBJ)"
$WRITE OUT " LIB/CREA LIBPORT $(OBJ)"
$WRITE OUT ""
$WRITE OUT ""
$WRITE OUT "dummy.obj : dummy.c"
$WRITE OUT " $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)"
$WRITE OUT ""
$WRITE OUT ""
$WRITE OUT "strcasecmp.obj : strcasecmp.c"
$WRITE OUT " $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)"
$WRITE OUT ""
$WRITE OUT ""
$WRITE OUT "lfind.obj : lfind.c"
$WRITE OUT " $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)"
$WRITE OUT ""
$WRITE OUT ""
$CLOSE OUT
$!
$!
$WRITE SYS$OUTPUT "Creating LIBTIFF$DEF.OPT"
$IF (SHARED.EQ.64)
$ THEN
$ COPY SYS$INPUT TIFF$DEF.OPT
SYMBOL_VECTOR= (-
TIFFOpen=PROCEDURE,-
TIFFGetVersion=PROCEDURE,-
TIFFCleanup=PROCEDURE,-
TIFFClose=PROCEDURE,-
TIFFFlush=PROCEDURE,-
TIFFFlushData=PROCEDURE,-
TIFFGetField=PROCEDURE,-
TIFFVGetField=PROCEDURE,-
TIFFGetFieldDefaulted=PROCEDURE,-
TIFFVGetFieldDefaulted=PROCEDURE,-
TIFFGetTagListEntry=PROCEDURE,-
TIFFGetTagListCount=PROCEDURE,-
TIFFReadDirectory=PROCEDURE,-
TIFFScanlineSize=PROCEDURE,-
TIFFStripSize=PROCEDURE,-
TIFFVStripSize=PROCEDURE,-
TIFFRawStripSize=PROCEDURE,-
TIFFTileRowSize=PROCEDURE,-
TIFFTileSize=PROCEDURE,-
TIFFVTileSize=PROCEDURE,-
TIFFFileno=PROCEDURE,-
TIFFSetFileno=PROCEDURE,-
TIFFGetMode=PROCEDURE,-
TIFFIsTiled=PROCEDURE,-
TIFFIsByteSwapped=PROCEDURE,-
TIFFIsBigEndian=PROCEDURE,-
TIFFIsMSB2LSB=PROCEDURE,-
TIFFIsUpSampled=PROCEDURE,-
TIFFCIELabToRGBInit=PROCEDURE,-
TIFFCIELabToXYZ=PROCEDURE,-
TIFFXYZToRGB=PROCEDURE,-
TIFFYCbCrToRGBInit=PROCEDURE,-
TIFFYCbCrtoRGB=PROCEDURE,-
TIFFCurrentRow=PROCEDURE,-
TIFFCurrentDirectory=PROCEDURE,-
TIFFCurrentStrip=PROCEDURE,-
TIFFCurrentTile=PROCEDURE,-
TIFFDataWidth=PROCEDURE,-
TIFFReadBufferSetup=PROCEDURE,-
TIFFWriteBufferSetup=PROCEDURE,-
TIFFSetupStrips=PROCEDURE,-
TIFFLastDirectory=PROCEDURE,-
TIFFSetDirectory=PROCEDURE,-
TIFFSetSubDirectory=PROCEDURE,-
TIFFUnlinkDirectory=PROCEDURE,-
TIFFSetField=PROCEDURE,-
TIFFVSetField=PROCEDURE,-
TIFFCheckpointDirectory=PROCEDURE,-
TIFFWriteDirectory=PROCEDURE,-
TIFFRewriteDirectory=PROCEDURE,-
TIFFPrintDirectory=PROCEDURE,-
TIFFReadScanline=PROCEDURE,-
TIFFWriteScanline=PROCEDURE,-
TIFFReadRGBAImage=PROCEDURE,-
TIFFReadRGBAImageOriented=PROCEDURE,-
TIFFFdOpen=PROCEDURE,-
TIFFClientOpen=PROCEDURE,-
TIFFFileName=PROCEDURE,-
TIFFError=PROCEDURE,-
TIFFErrorExt=PROCEDURE,-
TIFFWarning=PROCEDURE,-
TIFFWarningExt=PROCEDURE,-
TIFFSetErrorHandler=PROCEDURE,-
TIFFSetErrorHandlerExt=PROCEDURE,-
TIFFSetWarningHandler=PROCEDURE,-
TIFFSetWarningHandlerExt=PROCEDURE,-
TIFFComputeTile=PROCEDURE,-
TIFFCheckTile=PROCEDURE,-
TIFFNumberOfTiles=PROCEDURE,-
TIFFReadTile=PROCEDURE,-
TIFFWriteTile=PROCEDURE,-
TIFFComputeStrip=PROCEDURE,-
TIFFNumberOfStrips=PROCEDURE,-
TIFFRGBAImageBegin=PROCEDURE,-
TIFFRGBAImageGet=PROCEDURE,-
TIFFRGBAImageEnd=PROCEDURE,-
TIFFReadEncodedStrip=PROCEDURE,-
TIFFReadRawStrip=PROCEDURE,-
TIFFReadEncodedTile=PROCEDURE,-
TIFFReadRawTile=PROCEDURE,-
TIFFReadRGBATile=PROCEDURE,-
TIFFReadRGBAStrip=PROCEDURE,-
TIFFWriteEncodedStrip=PROCEDURE,-
TIFFWriteRawStrip=PROCEDURE,-
TIFFWriteEncodedTile=PROCEDURE,-
TIFFWriteRawTile=PROCEDURE,-
TIFFSetWriteOffset=PROCEDURE,-
TIFFSwabDouble=PROCEDURE,-
TIFFSwabShort=PROCEDURE,-
TIFFSwabLong=PROCEDURE,-
TIFFSwabArrayOfShort=PROCEDURE,-
TIFFSwabArrayOfLong=PROCEDURE,-
TIFFSwabArrayOfDouble=PROCEDURE,-
TIFFSwabArrayOfTriples=PROCEDURE,-
TIFFReverseBits=PROCEDURE,-
TIFFGetBitRevTable=PROCEDURE,-
TIFFDefaultStripSize=PROCEDURE,-
TIFFDefaultTileSize=PROCEDURE,-
TIFFRasterScanlineSize=PROCEDURE,-
_TIFFmalloc=PROCEDURE,-
_TIFFrealloc=PROCEDURE,-
_TIFFfree=PROCEDURE,-
_TIFFmemset=PROCEDURE,-
_TIFFmemcpy=PROCEDURE,-
_TIFFmemcmp=PROCEDURE,-
TIFFCreateDirectory=PROCEDURE,-
TIFFSetTagExtender=PROCEDURE,-
TIFFMergeFieldInfo=PROCEDURE,-
TIFFFindFieldInfo=PROCEDURE,-
TIFFFindFieldInfoByName=PROCEDURE,-
TIFFFieldWithName=PROCEDURE,-
TIFFFieldWithTag=PROCEDURE,-
TIFFFieldTag=PROCEDURE,-
TIFFFieldName=PROCEDURE,-
TIFFFieldDataType=PROCEDURE,-
TIFFFieldPassCount=PROCEDURE,-
TIFFFieldReadCount=PROCEDURE,-
TIFFFieldWriteCount=PROCEDURE,-
TIFFCurrentDirOffset=PROCEDURE,-
TIFFWriteCheck=PROCEDURE,-
TIFFRGBAImageOK=PROCEDURE,-
TIFFNumberOfDirectories=PROCEDURE,-
TIFFSetFileName=PROCEDURE,-
TIFFSetClientdata=PROCEDURE,-
TIFFSetMode=PROCEDURE,-
TIFFClientdata=PROCEDURE,-
TIFFGetReadProc=PROCEDURE,-
TIFFGetWriteProc=PROCEDURE,-
TIFFGetSeekProc=PROCEDURE,-
TIFFGetCloseProc=PROCEDURE,-
TIFFGetSizeProc=PROCEDURE,-
TIFFGetMapFileProc=PROCEDURE,-
TIFFGetUnmapFileProc=PROCEDURE,-
TIFFIsCODECConfigured=PROCEDURE,-
TIFFGetConfiguredCODECs=PROCEDURE,-
TIFFFindCODEC=PROCEDURE,-
TIFFRegisterCODEC=PROCEDURE,-
TIFFUnRegisterCODEC=PROCEDURE,-
TIFFFreeDirectory=PROCEDURE,-
TIFFReadCustomDirectory=PROCEDURE,-
TIFFReadEXIFDirectory=PROCEDURE,-
TIFFAccessTagMethods=PROCEDURE,-
TIFFGetClientInfo=PROCEDURE,-
TIFFSetClientInfo=PROCEDURE,-
TIFFReassignTagToIgnore=PROCEDURE-
)
$ENDIF
$IF (SHARED.EQ.32)
$ THEN
$ COPY SYS$INPUT TIFF$DEF.OPT
UNIVERSAL=TIFFOpen
UNIVERSAL=TIFFGetVersion
UNIVERSAL=TIFFCleanup
UNIVERSAL=TIFFClose
UNIVERSAL=TIFFFlush
UNIVERSAL=TIFFFlushData
UNIVERSAL=TIFFGetField
UNIVERSAL=TIFFVGetField
UNIVERSAL=TIFFGetFieldDefaulted
UNIVERSAL=TIFFVGetFieldDefaulted
UNIVERSAL=TIFFGetTagListEntry
UNIVERSAL=TIFFGetTagListCount
UNIVERSAL=TIFFReadDirectory
UNIVERSAL=TIFFScanlineSize
UNIVERSAL=TIFFStripSize
UNIVERSAL=TIFFVStripSize
UNIVERSAL=TIFFRawStripSize
UNIVERSAL=TIFFTileRowSize
UNIVERSAL=TIFFTileSize
UNIVERSAL=TIFFVTileSize
UNIVERSAL=TIFFFileno
UNIVERSAL=TIFFSetFileno
UNIVERSAL=TIFFGetMode
UNIVERSAL=TIFFIsTiled
UNIVERSAL=TIFFIsByteSwapped
UNIVERSAL=TIFFIsBigEndian
UNIVERSAL=TIFFIsMSB2LSB
UNIVERSAL=TIFFIsUpSampled
UNIVERSAL=TIFFCIELabToRGBInit
UNIVERSAL=TIFFCIELabToXYZ
UNIVERSAL=TIFFXYZToRGB
UNIVERSAL=TIFFYCbCrToRGBInit
UNIVERSAL=TIFFYCbCrtoRGB
UNIVERSAL=TIFFCurrentRow
UNIVERSAL=TIFFCurrentDirectory
UNIVERSAL=TIFFCurrentStrip
UNIVERSAL=TIFFCurrentTile
UNIVERSAL=TIFFDataWidth
UNIVERSAL=TIFFReadBufferSetup
UNIVERSAL=TIFFWriteBufferSetup
UNIVERSAL=TIFFSetupStrips
UNIVERSAL=TIFFLastDirectory
UNIVERSAL=TIFFSetDirectory
UNIVERSAL=TIFFSetSubDirectory
UNIVERSAL=TIFFUnlinkDirectory
UNIVERSAL=TIFFSetField
UNIVERSAL=TIFFVSetField
UNIVERSAL=TIFFCheckpointDirectory
UNIVERSAL=TIFFWriteDirectory
UNIVERSAL=TIFFRewriteDirectory
UNIVERSAL=TIFFPrintDirectory
UNIVERSAL=TIFFReadScanline
UNIVERSAL=TIFFWriteScanline
UNIVERSAL=TIFFReadRGBAImage
UNIVERSAL=TIFFReadRGBAImageOriented
UNIVERSAL=TIFFFdOpen
UNIVERSAL=TIFFClientOpen
UNIVERSAL=TIFFFileName
UNIVERSAL=TIFFError
UNIVERSAL=TIFFErrorExt
UNIVERSAL=TIFFWarning
UNIVERSAL=TIFFWarningExt
UNIVERSAL=TIFFSetErrorHandler
UNIVERSAL=TIFFSetErrorHandlerExt
UNIVERSAL=TIFFSetWarningHandler
UNIVERSAL=TIFFSetWarningHandlerExt
UNIVERSAL=TIFFComputeTile
UNIVERSAL=TIFFCheckTile
UNIVERSAL=TIFFNumberOfTiles
UNIVERSAL=TIFFReadTile
UNIVERSAL=TIFFWriteTile
UNIVERSAL=TIFFComputeStrip
UNIVERSAL=TIFFNumberOfStrips
UNIVERSAL=TIFFRGBAImageBegin
UNIVERSAL=TIFFRGBAImageGet
UNIVERSAL=TIFFRGBAImageEnd
UNIVERSAL=TIFFReadEncodedStrip
UNIVERSAL=TIFFReadRawStrip
UNIVERSAL=TIFFReadEncodedTile
UNIVERSAL=TIFFReadRawTile
UNIVERSAL=TIFFReadRGBATile
UNIVERSAL=TIFFReadRGBAStrip
UNIVERSAL=TIFFWriteEncodedStrip
UNIVERSAL=TIFFWriteRawStrip
UNIVERSAL=TIFFWriteEncodedTile
UNIVERSAL=TIFFWriteRawTile
UNIVERSAL=TIFFSetWriteOffset
UNIVERSAL=TIFFSwabDouble
UNIVERSAL=TIFFSwabShort
UNIVERSAL=TIFFSwabLong
UNIVERSAL=TIFFSwabArrayOfShort
UNIVERSAL=TIFFSwabArrayOfLong
UNIVERSAL=TIFFSwabArrayOfDouble
UNIVERSAL=TIFFSwabArrayOfTriples
UNIVERSAL=TIFFReverseBits
UNIVERSAL=TIFFGetBitRevTable
UNIVERSAL=TIFFDefaultStripSize
UNIVERSAL=TIFFDefaultTileSize
UNIVERSAL=TIFFRasterScanlineSize
UNIVERSAL=_TIFFmalloc
UNIVERSAL=_TIFFrealloc
UNIVERSAL=_TIFFfree
UNIVERSAL=_TIFFmemset
UNIVERSAL=_TIFFmemcpy
UNIVERSAL=_TIFFmemcmp
UNIVERSAL=TIFFCreateDirectory
UNIVERSAL=TIFFSetTagExtender
UNIVERSAL=TIFFMergeFieldInfo
UNIVERSAL=TIFFFindFieldInfo
UNIVERSAL=TIFFFindFieldInfoByName
UNIVERSAL=TIFFFieldWithName
UNIVERSAL=TIFFFieldWithTag
UNIVERSAL=TIFFFieldTag
UNIVERSAL=TIFFFieldName
UNIVERSAL=TIFFFieldDataType
UNIVERSAL=TIFFFieldPassCount
UNIVERSAL=TIFFFieldReadCount
UNIVERSAL=TIFFFieldWriteCount
UNIVERSAL=TIFFCurrentDirOffset
UNIVERSAL=TIFFWriteCheck
UNIVERSAL=TIFFRGBAImageOK
UNIVERSAL=TIFFNumberOfDirectories
UNIVERSAL=TIFFSetFileName
UNIVERSAL=TIFFSetClientdata
UNIVERSAL=TIFFSetMode
UNIVERSAL=TIFFClientdata
UNIVERSAL=TIFFGetReadProc
UNIVERSAL=TIFFGetWriteProc
UNIVERSAL=TIFFGetSeekProc
UNIVERSAL=TIFFGetCloseProc
UNIVERSAL=TIFFGetSizeProc
UNIVERSAL=TIFFGetMapFileProc
UNIVERSAL=TIFFGetUnmapFileProc
UNIVERSAL=TIFFIsCODECConfigured
UNIVERSAL=TIFFGetConfiguredCODECs
UNIVERSAL=TIFFFindCODEC
UNIVERSAL=TIFFRegisterCODEC
UNIVERSAL=TIFFUnRegisterCODEC
UNIVERSAL=TIFFFreeDirectory
UNIVERSAL=TIFFReadCustomDirectory
UNIVERSAL=TIFFReadEXIFDirectory
UNIVERSAL=TIFFAccessTagMethods
UNIVERSAL=TIFFGetClientInfo
UNIVERSAL=TIFFSetClientInfo
UNIVERSAL=TIFFReassignTagToIgnore
$ENDIF
$!
$!
$! Writing TIFF$SHR.OPT file to build TOOLS
$ IF (SHARED.GT.0)
$ THEN
$ OPEN/WRITE OUT TIFF$SHR.OPT
$ WRITE OUT "[]TIFF/LIB"
$ WRITE OUT "[-.PORT]LIBPORT/LIB"
$ WRITE OUT JPEG_LIBRARY_PATH
$ WRITE OUT "ZLIB:LIBZ/LIB"
$ CLOSE OUT
$ ENDIF
$!
$!
$! Writing OPT.OPT file to build TOOLS
$OPEN/WRITE OUT OPT.OPT
$ IF (SHARED.GT.0)
$ THEN
$ WRITE OUT "[-.LIBTIFF]TIFF$SHR/SHARE"
$ WRITE OUT JPEG_LIBRARY_PATH
$ ELSE
$ WRITE OUT "[-.LIBTIFF]TIFF/LIB"
$ WRITE OUT "[-.PORT]LIBPORT/LIB"
$ WRITE OUT JPEG_LIBRARY_PATH
$ ENDIF
$ WRITE OUT "ZLIB:LIBZ/LIB"
$CLOSE OUT
$!
$!
$COPY SYS$INPUT [.LIBTIFF]DESCRIP.MMS
# (c) Alexey Chupahin 22-NOV-2007
# OpenVMS 7.3-1, DEC 2000 mod.300
# OpenVMS 8.3, HP rx1620
# Makefile for DEC C compilers.
#
INCL = /INCLUDE=(JPEG,ZLIB,[])
CFLAGS = $(INCL)
OBJ_SYSDEP_MODULE = tif_vms.obj
OBJ = \
tif_aux.obj,\
tif_close.obj,\
tif_codec.obj,\
tif_color.obj,\
tif_compress.obj,\
tif_dir.obj,\
tif_dirinfo.obj,\
tif_dirread.obj,\
tif_dirwrite.obj,\
tif_dumpmode.obj,\
tif_error.obj,\
tif_extension.obj,\
tif_fax3.obj,\
tif_fax3sm.obj,\
tif_flush.obj,\
tif_getimage.obj,\
tif_jbig.obj,\
tif_jpeg.obj,\
tif_luv.obj,\
tif_lzw.obj,\
tif_next.obj,\
tif_ojpeg.obj,\
tif_open.obj,\
tif_packbits.obj,\
tif_pixarlog.obj,\
tif_predict.obj,\
tif_print.obj,\
tif_read.obj,\
tif_strip.obj,\
tif_swab.obj,\
tif_thunder.obj,\
tif_tile.obj,\
tif_version.obj,\
tif_warning.obj,\
tif_write.obj,\
tif_zip.obj, $(OBJ_SYSDEP_MODULE)
$IF (SHARED.GT.0)
$ THEN
$ APP SYS$INPUT [.LIBTIFF]DESCRIP.MMS
ALL : tiff.olb, tiff$shr.exe
$WRITE SYS$OUTPUT "Done"
tiff$shr.exe : tiff.olb
LINK/SHARE=TIFF$SHR.EXE TIF_AUX,[-]TIFF$DEF/OPT, [-]TIFF$SHR/OPT
COPY TIFF$SHR.EXE SYS$SHARE
PURGE SYS$SHARE:TIFF$SHR.EXE
$ ELSE
$ APP SYS$INPUT [.LIBTIFF]DESCRIP.MMS
ALL : tiff.olb
$WRITE SYS$OUTPUT "Done"
$ENDIF
$!
$!
$ APP SYS$INPUT [.LIBTIFF]DESCRIP.MMS
tiff.olb : $(OBJ)
lib/crea tiff.olb $(OBJ)
#tif_config.h : tif_config.h-vms
# copy tif_config.h-vms tif_config.h
#
#tiffconf.h : tiffconf.h-vms
# copy tiffconf.h-vms tiffconf.h
tif_aux.obj : tif_aux.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_close.obj : tif_close.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_codec.obj : tif_codec.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_color.obj : tif_color.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_compress.obj : tif_compress.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_dir.obj : tif_dir.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_dirinfo.obj : tif_dirinfo.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_dirread.obj : tif_dirread.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_dirwrite.obj : tif_dirwrite.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_dumpmode.obj : tif_dumpmode.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_error.obj : tif_error.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_extension.obj : tif_extension.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_fax3.obj : tif_fax3.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_fax3sm.obj : tif_fax3sm.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_flush.obj : tif_flush.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_getimage.obj : tif_getimage.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_jbig.obj : tif_jbig.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_jpeg.obj : tif_jpeg.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_luv.obj : tif_luv.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_lzw.obj : tif_lzw.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_next.obj : tif_next.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_ojpeg.obj : tif_ojpeg.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_open.obj : tif_open.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_packbits.obj : tif_packbits.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_pixarlog.obj : tif_pixarlog.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_predict.obj : tif_predict.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_print.obj : tif_print.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_read.obj : tif_read.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_strip.obj : tif_strip.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_swab.obj : tif_swab.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_thunder.obj : tif_thunder.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_tile.obj : tif_tile.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_unix.obj : tif_unix.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_version.obj : tif_version.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_warning.obj : tif_warning.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_write.obj : tif_write.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tif_zip.obj : tif_zip.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
clean :
del *.obj;*
del *.olb;*
$!
$!
$!
$COPY SYS$INPUT [.TOOLS]DESCRIP.MMS
# (c) Alexey Chupahin 22-NOV-2007
# OpenVMS 7.3-1, DEC 2000 mod.300
# OpenVMS 8.3, HP rx1620
INCL = /INCL=([],[-.LIBTIFF])
CFLAGS = $(INCL)
LIBS = [-]OPT/OPT
OBJ=\
bmp2tiff.exe,\
fax2ps.exe,\
fax2tiff.exe,\
gif2tiff.exe,\
pal2rgb.exe,\
ppm2tiff.exe,\
ras2tiff.exe,\
raw2tiff.exe,\
rgb2ycbcr.exe,\
thumbnail.exe,\
tiff2bw.exe,\
tiff2pdf.exe,\
tiff2ps.exe,\
tiff2rgba.exe,\
tiffcmp.exe,\
tiffcp.exe,\
tiffcrop.exe,\
tiffdither.exe,\
tiffdump.exe,\
tiffinfo.exe,\
tiffmedian.exe,\
tiffset.exe,\
tiffsplit.exe,\
ycbcr.exe
all : $(OBJ)
$!
bmp2tiff.obj : bmp2tiff.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
bmp2tiff.exe : bmp2tiff.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
fax2ps.obj : fax2ps.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
fax2ps.exe : fax2ps.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
fax2tiff.obj : fax2tiff.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
fax2tiff.exe : fax2tiff.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
gif2tiff.obj : gif2tiff.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
gif2tiff.exe : gif2tiff.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
pal2rgb.obj : pal2rgb.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
pal2rgb.exe : pal2rgb.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
ppm2tiff.obj : ppm2tiff.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
ppm2tiff.exe : ppm2tiff.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
ras2tiff.obj : ras2tiff.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
ras2tiff.exe : ras2tiff.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
raw2tiff.obj : raw2tiff.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
raw2tiff.exe : raw2tiff.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
rgb2ycbcr.obj : rgb2ycbcr.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
rgb2ycbcr.exe : rgb2ycbcr.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
sgi2tiff.obj : sgi2tiff.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
sgi2tiff.exe : sgi2tiff.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
sgisv.obj : sgisv.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
sgisv.exe : sgisv.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
thumbnail.obj : thumbnail.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
thumbnail.exe : thumbnail.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
tiff2bw.obj : tiff2bw.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tiff2bw.exe : tiff2bw.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
tiff2pdf.obj : tiff2pdf.c
$(CC) $(CFLAGS) /NOWARN $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tiff2pdf.exe : tiff2pdf.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
tiff2ps.obj : tiff2ps.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tiff2ps.exe : tiff2ps.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
tiff2rgba.obj : tiff2rgba.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tiff2rgba.exe : tiff2rgba.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
tiffcmp.obj : tiffcmp.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tiffcmp.exe : tiffcmp.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
tiffcp.obj : tiffcp.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tiffcp.exe : tiffcp.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
tiffcrop.obj : tiffcrop.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tiffcrop.exe : tiffcrop.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
tiffdither.obj : tiffdither.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tiffdither.exe : tiffdither.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
tiffdump.obj : tiffdump.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tiffdump.exe : tiffdump.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
tiffgt.obj : tiffgt.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tiffgt.exe : tiffgt.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
tiffinfo.obj : tiffinfo.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tiffinfo.exe : tiffinfo.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
tiffmedian.obj : tiffmedian.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tiffmedian.exe : tiffmedian.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
tiffset.obj : tiffset.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tiffset.exe : tiffset.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
tiffsplit.obj : tiffsplit.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
tiffsplit.exe : tiffsplit.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
ycbcr.obj : ycbcr.c
$(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
ycbcr.exe : ycbcr.obj
LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
CLEAN :
DEL ALL.;*
DEL *.OBJ;*
DEL *.EXE;*
$!
$!
$!
$!copiing and patching TIFF_CONF.H, TIF_CONFIG.H
$!
$CURRENT = F$ENVIRONMENT (""DEFAULT"")
$CURRENT[F$LOCATE("]",CURRENT),9]:=".LIBTIFF]"
$WRITE SYS$OUTPUT "Creating TIFFCONF.H and TIF_CONFIG.H"
$COPY SYS$INPUT 'CURRENT'TIFFCONF.H
/*
Configuration defines for installed libtiff.
This file maintained for backward compatibility. Do not use definitions
from this file in your programs.
*/
#ifndef _TIFFCONF_
#define _TIFFCONF_
/* Define to 1 if the system has the type `int16'. */
//#define HAVE_INT16
/* Define to 1 if the system has the type `int32'. */
//#define HAVE_INT32
/* Define to 1 if the system has the type `int8'. */
//#define HAVE_INT8
/* The size of a `int', as computed by sizeof. */
#define SIZEOF_INT 4
/* The size of a `long', as computed by sizeof. */
#define SIZEOF_LONG 4
/* Compatibility stuff. */
/* Define as 0 or 1 according to the floating point format suported by the
machine */
#ifdef __IEEE_FLOAT
#define HAVE_IEEEFP 1
#endif
#define HAVE_GETOPT 1
/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */
#define HOST_FILLORDER FILLORDER_LSB2MSB
/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian
(Intel) */
#define HOST_BIGENDIAN 0
/* Support CCITT Group 3 & 4 algorithms */
#define CCITT_SUPPORT 1
/* Support LogLuv high dynamic range encoding */
#define LOGLUV_SUPPORT 1
/* Support LZW algorithm */
#define LZW_SUPPORT 1
/* Support NeXT 2-bit RLE algorithm */
#define NEXT_SUPPORT 1
/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation
fails with unpatched IJG JPEG library) */
/* Support Macintosh PackBits algorithm */
#define PACKBITS_SUPPORT 1
/* Support Pixar log-format algorithm (requires Zlib) */
#define PIXARLOG_SUPPORT 1
/* Support ThunderScan 4-bit RLE algorithm */
#define THUNDER_SUPPORT 1
/* Support Deflate compression */
/* #undef ZIP_SUPPORT */
/* Support strip chopping (whether or not to convert single-strip uncompressed
images to mutiple strips of ~8Kb to reduce memory usage) */
#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP
/* Enable SubIFD tag (330) support */
#define SUBIFD_SUPPORT 1
/* Treat extra sample as alpha (default enabled). The RGBA interface will
treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many
packages produce RGBA files but don't mark the alpha properly. */
#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1
/* Pick up YCbCr subsampling info from the JPEG data stream to support files
lacking the tag (default enabled). */
#define CHECK_JPEG_YCBCR_SUBSAMPLING 1
/*
* Feature support definitions.
* XXX: These macros are obsoleted. Don't use them in your apps!
* Macros stays here for backward compatibility and should be always defined.
*/
#define COLORIMETRY_SUPPORT
#define YCBCR_SUPPORT
#define CMYK_SUPPORT
#define ICC_SUPPORT
#define PHOTOSHOP_SUPPORT
#define IPTC_SUPPORT
#endif /* _TIFFCONF_ */
$COPY SYS$INPUT 'CURRENT'TIF_CONFIG.H
/* Define to 1 if you have the <assert.h> header file. */
#ifndef HAVE_GETOPT
# define HAVE_GETOPT 1
#endif
#define HAVE_ASSERT_H 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define as 0 or 1 according to the floating point format suported by the
machine */
#ifdef __IEEE_FLOAT
#define HAVE_IEEEFP 1
#endif
#define HAVE_UNISTD_H 1
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <io.h> header file. */
//#define HAVE_IO_H 1
/* Define to 1 if you have the <search.h> header file. */
//#define HAVE_SEARCH_H 1
/* The size of a `int', as computed by sizeof. */
#define SIZEOF_INT 4
/* The size of a `long', as computed by sizeof. */
#define SIZEOF_LONG 4
/* Set the native cpu bit order */
#define HOST_FILLORDER FILLORDER_LSB2MSB
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef WORDS_BIGENDIAN */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
/*
#ifndef __cplusplus
# ifndef inline
# define inline __inline
# endif
#endif
*/
/* Support CCITT Group 3 & 4 algorithms */
#define CCITT_SUPPORT 1
/* Pick up YCbCr subsampling info from the JPEG data stream to support files
lacking the tag (default enabled). */
#define CHECK_JPEG_YCBCR_SUBSAMPLING 1
/* Support C++ stream API (requires C++ compiler) */
#define CXX_SUPPORT 1
/* Treat extra sample as alpha (default enabled). The RGBA interface will
treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many
packages produce RGBA files but don't mark the alpha properly. */
#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1
/* little Endian */
#define HOST_BIGENDIAN 0
#define JPEG_SUPPORT 1
#define LOGLUV_SUPPORT 1
/* Support LZW algorithm */
#define LZW_SUPPORT 1
/* Support Microsoft Document Imaging format */
#define MDI_SUPPORT 1
/* Support NeXT 2-bit RLE algorithm */
#define NEXT_SUPPORT 1
#define OJPEG_SUPPORT 1
/* Name of package */
#define PACKAGE "tiff"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "tiff@lists.maptools.org"
/* Define to the full name of this package. */
#define PACKAGE_NAME "LibTIFF Software"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "LibTIFF Software 3.9.0beta for VMS"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "tiff"
$PURGE 'CURRENT'TIFFCONF.H
$PURGE 'CURRENT'TIF_CONFIG.H
$OPEN/APPEND OUT 'CURRENT'TIF_CONFIG.H
$IF HAVE_LFIND.EQ.1
$ THEN
$ WRITE OUT "#define HAVE_SEARCH_H 1"
$ ELSE
$ WRITE OUT "#undef HAVE_SEARCH_H"
$ENDIF
$CLOSE OUT
$!
$!
$WRITE SYS$OUTPUT " "
$WRITE SYS$OUTPUT " "
$WRITE SYS$OUTPUT "Now you can type @BUILD "
$!
$EXIT:
$DEFINE SYS$ERROR _NLA0:
$DEFINE SYS$OUTPUT _NLA0:
$DEL TEST.OBJ;*
$DEL TEST.C;*
$DEL TEST.EXE;*
$DEAS SYS$ERROR
$DEAS SYS$OUTPUT
|
{
"pile_set_name": "Github"
}
|
/******************************************************************************
*
* Copyright(c) 2009-2014 Realtek Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* The full GNU General Public License is included in this distribution in the
* file called LICENSE.
*
* Contact Information:
* wlanfae <wlanfae@realtek.com>
* Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
* Hsinchu 300, Taiwan.
*
* Larry Finger <Larry.Finger@lwfinger.net>
*
*****************************************************************************/
#include "../wifi.h"
#include "../pci.h"
#include "reg.h"
#include "led.h"
static void _rtl92ee_init_led(struct ieee80211_hw *hw,
struct rtl_led *pled, enum rtl_led_pin ledpin)
{
pled->hw = hw;
pled->ledpin = ledpin;
pled->ledon = false;
}
void rtl92ee_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
{
u32 ledcfg;
struct rtl_priv *rtlpriv = rtl_priv(hw);
RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD,
"LedAddr:%X ledpin=%d\n", REG_LEDCFG2, pled->ledpin);
switch (pled->ledpin) {
case LED_PIN_GPIO0:
break;
case LED_PIN_LED0:
ledcfg = rtl_read_dword(rtlpriv , REG_GPIO_PIN_CTRL);
ledcfg &= ~BIT(13);
ledcfg |= BIT(21);
ledcfg &= ~BIT(29);
rtl_write_dword(rtlpriv, REG_GPIO_PIN_CTRL, ledcfg);
break;
case LED_PIN_LED1:
break;
default:
RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
"switch case not process\n");
break;
}
pled->ledon = true;
}
void rtl92ee_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
u32 ledcfg;
RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD,
"LedAddr:%X ledpin=%d\n", REG_LEDCFG2, pled->ledpin);
switch (pled->ledpin) {
case LED_PIN_GPIO0:
break;
case LED_PIN_LED0:
ledcfg = rtl_read_dword(rtlpriv , REG_GPIO_PIN_CTRL);
ledcfg |= ~BIT(21);
ledcfg &= ~BIT(29);
rtl_write_dword(rtlpriv, REG_GPIO_PIN_CTRL, ledcfg);
break;
case LED_PIN_LED1:
break;
default:
RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
"switch case not process\n");
break;
}
pled->ledon = false;
}
void rtl92ee_init_sw_leds(struct ieee80211_hw *hw)
{
struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw);
_rtl92ee_init_led(hw, &pcipriv->ledctl.sw_led0, LED_PIN_LED0);
_rtl92ee_init_led(hw, &pcipriv->ledctl.sw_led1, LED_PIN_LED1);
}
static void _rtl92ee_sw_led_control(struct ieee80211_hw *hw,
enum led_ctl_mode ledaction)
{
struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw);
struct rtl_led *pLed0 = &pcipriv->ledctl.sw_led0;
switch (ledaction) {
case LED_CTL_POWER_ON:
case LED_CTL_LINK:
case LED_CTL_NO_LINK:
rtl92ee_sw_led_on(hw, pLed0);
break;
case LED_CTL_POWER_OFF:
rtl92ee_sw_led_off(hw, pLed0);
break;
default:
break;
}
}
void rtl92ee_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
if ((ppsc->rfoff_reason > RF_CHANGE_BY_PS) &&
(ledaction == LED_CTL_TX ||
ledaction == LED_CTL_RX ||
ledaction == LED_CTL_SITE_SURVEY ||
ledaction == LED_CTL_LINK ||
ledaction == LED_CTL_NO_LINK ||
ledaction == LED_CTL_START_TO_LINK ||
ledaction == LED_CTL_POWER_ON)) {
return;
}
RT_TRACE(rtlpriv, COMP_LED, DBG_TRACE, "ledaction %d,\n", ledaction);
_rtl92ee_sw_led_control(hw, ledaction);
}
|
{
"pile_set_name": "Github"
}
|
\documentstyle[fullpage,12pt]{article}
\title{GSS-API Extensions to Sun RPC}
\date{Draft---\today}
\author{Barry Jaspan}
\setlength{\parskip}{.7\baselineskip}
\setlength{\parindent}{0pt}
\makeatletter
\newcount\savecnt\savecnt=0
\def\saveenum#1{\global\savecnt=\csname c@enum#1\endcsname}
\def\restoreenum#1{\csname c@enum#1\endcsname=\savecnt}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Make _ actually generate an _, and allow line-breaking after it.
\let\underscore=\_
\catcode`_=13
\def_{\underscore\penalty75\relax}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
{\setlength{\parskip}{0pt}\maketitle\tableofcontents}
\section{Introduction}
This document describes the integration of GSS-API authentication and
security with Sun RPC.
\section{Requirements}
The requirements of the GSS-API authentication system for Sun RPC are:
\begin{enumerate}
\item It must provide mutual authentication between RPC clients and
servers.
\item It must provide for integrity checking and encryption of all
procedure arguments and results passed over the network.
\saveenum{i}
\end{enumerate}
The following features are desired, but not mandatory:
\begin{enumerate}
\restoreenum{i}
\item It should provide for integrity checking and encryption of all
``header information'' that specifies the program and procedure being
called.
\item It should obey the Sun RPC protocol so that clients using
it can interoperate with existing servers. In this case,
``interoperate'' means that existing servers will return an error code
indicating that they do not understand the authentication flavor, but
not that they do not understand the request at all.
\item It should require minimal or no changes to the standard Sun RPC
programming paradigm for either clients or servers so that existing
code can use it with little or no effort.
\item It should operate correctly with all the standard Sun RPC
transport mechansims (e.g. UDP and TCP).
\saveenum{i}
\end{enumerate}
\section{Functional Specification}
This section describes the programmer's interface to the GSS-API
authentication flavor. Knowledge of standard Sun RPC programming is
assumed.
\subsection{Client Side}
A RPC client can select the GSS-API authentication flavor in the same
way it can select any other authentication flavor, by setting the
cl_auth field of the CLIENT structure to the appropriate value:
\begin{verbatim}
clnt = clnt_create(server_host, PROG_NUM, PROG_VERS, protocol);
clnt->cl_auth = auth_gssapi_create(clnt, ...);
\end{verbatim}
There are two functions that create GSS-API authentication flavor
structures for the cl_auth field, auth_gssapi_create and
auth_gssapi_create_default.
\begin{verbatim}
AUTH *auth_gssapi_create(CLIENT *clnt,
OM_uint32 *major_status,
OM_uint32 *minor_status,
gss_cred_id_t claimant_cred_handle,
gss_name_t target_name,
gss_OID mech_type,
int req_flags,
int time_req,
gss_OID *actual_mech_type,
int *ret_flags,
OM_uint32 *time_rec);
\end{verbatim}
auth_gssapi_create creates a GSS-API authentication structure and
provides most of the flexibility of gss_init_sec_context. The
arguments have the same interpretation as those of
gss_init_sec_context with the same name, except:
\begin{description}
\item[clnt] The CLIENT structure returned by client_create or one of
its relatives. It is not modified.
\end{description}
auth_gssapi_create calls gss_init_sec_context as needed, passing each
generated token to and processing each token returned from the RPC
server specified by the RPC handle clnt. On return, if major_status
is GSS_S_COMPLETE, the context has been established, the returned AUTH
structure is valid, and all of the arguments filled in by
gss_init_sec_context have the correct values. If major_status is not
GSS_S_COMPLETE then it and minor_status contain error codes that can
be passed to gss_display_status and the returned value is NULL.
\begin{verbatim}
AUTH *auth_gssapi_create_default(CLIENT *clnt, char *service_name);
\end{verbatim}
auth_gssapi_create_default is a shorthand for auth_gssapi_create that
attempts to create a context that provides procedure call and result
integrity, using the default credentials and GSS-API mechanism.
service_name is parsed as a GSS-API ``service'' name and used as the
target name. The other arguments to auth_gssapi_create are as follows:
\begin{verbatim}
auth_gssapi_create(clnt,
&dummy,
&dummy,
GSS_C_NO_CREDENTIAL,
target_name,
GSS_C_NULL_OID,
GSS_C_MUTUAL_FLAG | GSS_C_REPLAY_FLAG,
0,
NULL,
NULL,
NULL);
\end{verbatim}
Note that if the underlying default mechanism does not support data
integrity (e.g. the trust mechanism), this function will fail.
The GSS-API major and minor status codes can be interpreted with
auth_gssapi_display_status:
\begin{verbatim}
void auth_gssapi_display_status(char *msg, OM_uint32 major,
OM_uint32 minor);
\end{verbatim}
All of the error messages associated with the major and minor status
are displated on the standard error output, preceeded by the message
``GSS-API authentication error $<$msg$>$:''.
\subsection{Server Side}
\subsubsection{Service Name Registration}
An application server must register the service name(s) that it will
use for GSS-API connections before any AUTH_GSSAPI requests will
succeed.
\begin{verbatim}
typedef struct _auth_gssapi_name {
char *name;
gss_OID type;
} auth_gssapi_name;
bool_t _svcauth_gssapi_set_names(auth_gssapi_name *names, int num);
\end{verbatim}
names is an array of name specifications, each of which consists of a
null-terminated ASCII representation of a name and the GSS-API name
type that should be used to import it with gss_import_name. The
name type ``gss_nt_service_name'' is recommended.
\subsubsection{Calling Client and Service Identification}
Each application server's dispatch function is passed two arguments,
the transport mechanism (transp) and the RPC service request (rqstp).
If the service request's credential flavor (rq_cred.oa_flavor) is
AUTH_GSSAPI (300001)\footnote{The value 4 was originally used, but
300001 has been officially assigned by the IETF.}, then the call has
been authenticated. The rq_clntcred field of transp contains the
gss_name_t of the authenticated caller and can be passed to
gss_display_name to obtain a string represtation or gss_compare_name
to compare it with other names. The rq_svccred field of transp
contains the GSS-API context established with the caller and can be
passed to gss_inquire_context.
\subsubsection{Error Logging}
An application server can register a function to be called when a
failure occurs during GSS-API context establishment with
_svcauth_set_log_badauth_func.
\begin{verbatim}
typedef void (*auth_gssapi_log_badauth_func)(OM_uint32 major,
OM_uint32 minor,
struct sockaddr_in *raddr,
caddr_t data);
void _svcauth_set_log_badauth_func(auth_gssapi_log_badauth_func func,
caddr_t data);
\end{verbatim}
The function func is called each time gss_accept_sec_context fails.
The major and minor arguments indicate the GSS-API major and minor
status codes returned. The raddr field contains the INET socket that
the request came from, and the data field contains the data argument
of _svcauth_gssapi_set_log_badauth_func.
An application server can register a function to be called when an RPC
request with an invalid verifier arrives with
_svcauth_set_log_badverf_func.
\begin{verbatim}
typedef void (*auth_gssapi_log_badverf_func)(gss_name_t client,
gss_name_t server,
struct svc_req *rqst,
struct rpc_msg *msg,
caddr_t data);
void _svcauth_set_log_badverf_func(auth_gssapi_log_badverf_func func,
caddr_t data);
\end{verbatim}
The function specified in func is called each time an invalid verifier
is received. The client and server fields identify the (falsely
claimed) originating client and the server it originally authenticated
to. The raddr and addrlen fields contain the INET socket that the
request (claims to have) come from, and data contains the data
argument of _svcauth_set_log_badverf_func.
\section{Modifications to Sun RPC}
The Sun RPC extensible authentication mechanism is designed to allow
different authentication systems to be integrated into Sun RPC easily.
Unfortunately, it has two drawbacks. First, the existing system has a
number of non-general design properties that are intended specifically
for Sun's Secure RPC, and second, the existing system has no concept
of or ability to perform authentication-flavor-specific operations on
function arguments and results passed over the wire. The first
problem merely makes the system confusing, since a number of features
touted as ``general'' do not make any sense for arbitrary
authentication systems. The second problem is more substantial, and
can only be corrected by modifications to Sun RPC internals.
The following sections describe the necessary modifications to Sun
RPC.
\subsection{Client Side Authentication, AUTH Structure}
The AUTH structure (figure \ref{fig:auth}) encapsulates the data and
function pointers for an authentication flavor instance. It has been
changed in two ways.
\begin{figure}[htbp]
\begin{verbatim}
typedef struct {
struct opaque_auth ah_cred;
struct opaque_auth ah_verf;
union des_block ah_key;
struct auth_ops {
void (*ah_nextverf)();
int (*ah_marshal)(); /* nextverf & serialize */
int (*ah_validate)(); /* validate varifier */
int (*ah_refresh)(); /* refresh credentials */
int (*ah_wrap)(); /* encode data for wire */
int (*ah_unwrap)(); /* decode data from wire */
void (*ah_destroy)(); /* destroy this structure */
} *ah_ops;
caddr_t ah_private;
} AUTH;
\end{verbatim}
\caption{The AUTH structure, with the new function pointers ah_wrap
and ah_unwrap.}
\label{fig:auth}
\end{figure}
First, the new functions ah_wrap and ah_unwrap prepare function
arguments and results for transmission over the wire. The
authentication mechanism can use them to sign, encrypt, or perform any
other operation on the data. Their prototype is:
\begin{verbatim}
bool_t ah_wrap(AUTH *auth, XDR *out_xdrs, xdrproc_t func, caddr_t ptr);
bool_t ah_unwrap(AUTH *auth, XDR *in_xdrs, xdrproc_t func, caddr_t ptr);
\end{verbatim}
ah_wrap encodes function arguments for transmission. func and ptr are
the XDR procedure and pointer that serialize the arguments, and
out_xdrs is the xdr stream that the encoded arguments should be
written to. ah_unwrap decodes function arguments received from the
network. Its arguments are the converse of those to ah_wrap.
It is the responsibility of RPC transport mechanisms to call an
authorization flavor's ah_wrap and ah_unwrap functions when function
arguments or results would normally be written to or read from the
wire. Authorization flavors that do not need to perform any encoding
or decoding can use the provided function authany_wrap for ah_wrap
and ah_unwrap; it consists of the single statement ``return
(*func)(out_xdrs, ptr)'' (or in_xdrs, as appropriate).
Second, the function ah_refresh has been changed to take the RPC error
message that resulted in its being called as an argument. This is
necessary since the contents of the error message may dictate how
ah_refresh should go about correcting the authentication failure.
\subsection{Client Side Transport Mechanisms}
Each client side transport mechanism must be modified to call the
ah_wrap and ah_unwrap functions from the cl_auth field of the CLIENT
structure during the call and reply process. The modification is
fairly simple. For example, the UDP transport mechanism used to
encode procedure calls like this:
\begin{verbatim}
if ((! XDR_PUTLONG(xdrs, (long *)&proc)) ||
(! AUTH_MARSHALL(cl->cl_auth, xdrs)) ||
(! (*xargs)(xdrs, argsp)))
return (cu->cu_error.re_status = RPC_CANTENCODEARGS);
\end{verbatim}
The last function call in the conditional serializes the arguments
onto the xdr stream. This must be replaced with a call to the
appropriate ah_wrap function:
\begin{verbatim}
if ((! XDR_PUTLONG(xdrs, (long *)&proc)) ||
(! AUTH_MARSHALL(cl->cl_auth, xdrs)) ||
(! AUTH_WRAP(cl->cl_auth, xdrs, xargs, argsp)))
return (cu->cu_error.re_status = RPC_CANTENCODEARGS);
\end{verbatim}
AUTH_WRAP is a macro that takes the four arguments for an ah_wrap
function and extracts and calls the function pointer from the cl_auth
structure with the specified arguments.
Similarly, the transport mechanism must unwrap procedure results.
Again, the UDP mechanism will be instructive. It used to deserialize
function results like this:
\begin{verbatim}
reply_msg.acpted_rply.ar_results.where = resultsp;
reply_msg.acpted_rply.ar_results.proc = xresults;
ok = xdr_replymsg(&reply_xdrs, &reply_msg);
\end{verbatim}
The problem here is that xdr_replymsg deserializes an entire reply
message, including the results. Since xresults and resultsp are the
function and pointer to decode the results, they will be automatically
deserialized {\it without} ah_unwrap being invoked. The simplest
solution (which is also the normal method used by the TCP mechanism)
is to arrange to deserialize the function results explicitly:
\begin{verbatim}
reply_msg.acpted_rply.ar_results.where = NULL;
reply_msg.acpted_rply.ar_results.proc = xdr_void;
if ((! xdr_replymsg(&reply_xdrs, &reply_msg)) ||
(! AUTH_UNWRAP(cl->cl_auth, reply_xdrs, xresults,
resultsp))) {
return (cu->cu_error.re_status = RPC_CANTENCODEARGS);
}
\end{verbatim}
Since xdr_void does not read any data from the XDR stream, the
function results are still available when AUTH_UNWRAP is called. Note
that AUTH_UNWRAP should only be called on {\it successful} calls; if
the reply message status is not RPC_SUCCESS there are no arguments to
read.
Currently, the UDP and TCP transport mechanisms has been
converted.\footnote{The ``raw'' mechanism, for direct connections, has
not been.}
\subsection{Service Side Authentication, SVCAUTH and XPRT}
Standard Sun RPC service-side authentication consists of a single
function per authentication flavor; there is no concept of an AUTH
structure containing function pointers and private data as with the
client side. Previously, nothing else was necessary, because each
flavor only did a single thing (authenticated individual calls in a
stateless manner). More functions and state are now required,
however; they are stored in the SVCAUTH structure, see figure
\ref{fig:svcauth}.
\begin{figure}[htbp]
\begin{verbatim}
typedef struct {
struct svc_auth_ops {
int (*svc_ah_wrap)();
int (*svc_ah_unwrap)();
} *svc_ah_ops;
caddr_t svc_ah_private;
} SVCAUTH;
\end{verbatim}
\caption{The new SVCAUTH structure.}
\label{fig:svcauth}
\end{figure}
There is one SVCAUTH structure per authentication flavor (there is a
default, svc_auth_any, for existing authentication flavors that do not
need the extra functionality). The svc_ah_wrap and svc_ah_unwrap
perform the same logical function as their client-side counterparts.
Just as with the client side, it is the responsibility of the
transport mechanism to call the svc_ah_wrap and svc_ah_unwrap
functions associated with the authentication flavor associated with
each RPC call at the appropriate time. Unfortunately, the transport
mechanism code does not have access to the RPC call structure
containing the authenticator flavor because the RPC call structure
itself is not passed as an argument to the necessary functions. The
present solution is to add another argument to the transport mechanism
structure, xp_auth, that stores the SVCAUTH of the {\it current} call
on that mechanism; see figure \ref{fig:xprt}. xp_auth is initialized
to svc_auth_any so that existing authentication mechanisms that do not
set the field will still operate correctly. \footnote{This is not an
great solution, because it forces each transport mechanism to be
single threaded. The correct solution is to store the SVCAUTH
associated with each RPC call in the RPC call structure; however,
doing so would require changing a lot of code to pass around the RPC
call structure that currently does not do so. Since other parts of
Sun RPC use the XPRT structure in a non-reentrant way, the present
solution does not make the situation any
worse.}$^{\mbox{,}}$\footnote{A somewhat irrelevant side effect of
adding SVCAUTH to XPRT is that the standard include file
$<$rpc/rpc.h$>$ had to be changed to include $<$rpc/svc_auth$>$ before
$<$rpc/svc.h$>$, whereas they used to be in the opposite order.}
\begin{figure}[htbp]
\begin{verbatim}
typedef struct {
int xp_sock;
u_short xp_port; /* associated port number */
struct xp_ops {
bool_t (*xp_recv)(); /* receive incomming requests */
enum xprt_stat (*xp_stat)(); /* get transport status */
bool_t (*xp_getargs)(); /* get arguments */
bool_t (*xp_reply)(); /* send reply */
bool_t (*xp_freeargs)();/* free mem allocated for args */
void (*xp_destroy)(); /* destroy this struct */
} *xp_ops;
int xp_addrlen; /* length of remote address */
struct sockaddr_in xp_raddr; /* remote address */
struct opaque_auth xp_verf; /* raw response verifier */
SVCAUTH *xp_auth; /* auth flavor of current req */
caddr_t xp_p1; /* private */
caddr_t xp_p2; /* private */
} SVCXPRT;
\end{verbatim}
\caption{The modified XPRT structure, with the xp_auth field.}
\label{fig:xprt}
\end{figure}
Finally, with the modified XPRT structure carrying around the
authentication flavor structure, the functions that serialize and
deserialize function arguments and results must be modified to use the
svc_ah_wrap and svc_ah_unwrap functions. Each service-side transport
mechanism has getargs and reply functions that must be modified to use
the SVCAUTH_UNWRAP and SVCAUTH_WRAP macros, respectively, in a manner
completely parallel to the client side.
\subsection{Authenticated Service Identification, svc_req}
Sun RPC provides the authenticated credentials of a client to the
application server via rq_clntcred (``cooked credentials'') field of
the service request (svc_req) structure. In many authentication
systems, services are also named entities, and there is no reason that
an RPC should be restricted to accepting connections as a single
authenticated service name. However, access control decisions may be
based on the service name a client authenticated to, so that
information must be available to the application server.
Figure \ref{fig:svc-req} shows the modified service request structure
that contains a single new field, rq_svccred. Like rq_clntcred, the
authentication flavor is responsible for setting rq_svccred to the
``cooked'' service credentials associated with a given RPC call.
Authentication flavors that do not have the concept of service names
can of course leave this field blank.
\begin{figure}[htbp]
\begin{verbatim}
struct svc_req {
u_long rq_prog; /* service program number */
u_long rq_vers; /* service protocol version */
u_long rq_proc; /* the desired procedure */
struct opaque_auth rq_cred; /* raw creds from the wire */
caddr_t rq_clntcred; /* read only cooked client cred */
caddr_t rq_svccred; /* read only cooked svc cred */
SVCXPRT *rq_xprt; /* associated transport */
};
\end{verbatim}
\caption{The modified svc_req structure, with the rq_svccred field.}
\label{fig:svc-req}
\end{figure}
\subsection{Authentication Negotiation, no_dispatch}
In order to avoid having to transmit a full set of authentication
information with every call, the service-side authentication mechanism
must save state between calls. Establishing that state may require
multiple messages between the client-side and service-side
authentication mechanisms. The client-side authentication mechanism
can make arbitrary RPC calls to the server simply by requiring the
programmer to specify the CLIENT structure to the authentication
flavor initialization routine. The service side, however, is more
complex. In the normal course of events, an RPC call comes in, is
authenticated, and is then dispatched to the appropriate procedure.
For client- and service-side authentication flavors to communicate
independent of the server implemented above the RPC layer, the
service-side flavor must be able to send a reply to the client
directly and {\it prevent} the call from being dispatched.
This is implemented by a simple modification to the _authenticate
routine, which dispatches each RPC call to the appropriate
authentication flavor; see figure \ref{fig:authenticate}. It takes an
additional argument, no_dispatch, that instructs the mechanism not to
dispatch the RPC call to the specified procedure.
\begin{figure}[htbp]
\begin{verbatim}
why=_authenticate(&r, &msg, &no_dispatch);
if (why != AUTH_OK) {
svcerr_auth(xprt, why);
goto call_done;
} else if (no_dispatch) {
goto call_done;
}
\end{verbatim}
\caption{A call to the modified _authenticate.}
\label{fig:authenticate}
\end{figure}
If _authenticate sets no_dispatch to true, the call is considered
finished and no procedure dispatch takes place. Presumably, an
authentication flavor that sets no_dispatch to true also replies to
the RPC call with svc_sendreply. Authentication flavors that do not
modify no_dispatch implicitly leave it set to false, so the normal
dispatch takes place.
\subsection{Affected Files}
Table \ref{tab:modfiles} lists the files that were
affected for each of the modifications described in previous sections.
\begin{table}[htbp]
\centering
\caption{Files modified for each change to Sun RPC.}
\label{tab:modfiles}
\begin{tabular}{ll}
AUTH structure & auth.h \\
& auth_none.c \\
& auth_exit.c \\
& auth_any.c \\
Client Transport Mechanisms & clnt_udp.c \\
& clnt_tcp.c \\
SVCAUTH and XPRT structures & rpc.h \\
& svc.h \\
& svc_auth.h \\
& svc.c \\
& svc_auth.c \\
& svc_auth_any.c \\
& svc_auth_unix.c \\
Server Transport Mechanisms & svc_udp.c \\
& svc_tcp.c
\end{tabular}
\end{table}
\section{GSS-API Authentication Flavor}
The following sections describe the implementation of the GSS-API
authentication flavor for Sun RPC.
\subsection{Authentication Algorithms}
\label{sec:algorithms}
\subsubsection{Context Initiation}
The client creates a GSS-API context with the server each time it
calls auth_gssapi_create. The context is created using the standard
gss_init_sec_context and gss_accept_sec_context function calls. The
generated tokens are passed between the client and server as arguments
and results of normal RPC calls.
The client side, in auth_gssapi_create, performs the following steps
to initiate a context:
\begin{enumerate}
\item\label{item:process-token} The client calls gss_init_sec_context.
On the first such call, no input token is provided; on subsequent
calls, the token received from the server is provided.
\item If gss_init_sec_context produces an output token:
\begin{enumerate}
\item The client transmits the token to the server, identifying itself
with client_handle if it has already been received (see next step).
The return value from the server will contain a client_handle and one
or both of a token and a signed initial sequence number.
\item If this is the first response from the server, the client_handle
is stored for subsequent calls. Otherwise, the client_handle should be
the same as returned on the previous call.
\item If the response contains a signed initian sequence number but
the context is not yet established, then the response also contains a
token that will established the context. The signed initial sequence
number is stored.
\item If the response contains a token, step \ref{item:process-token}
repeated.
\end{enumerate}
\item The signed initial sequence number is verified using the
established context.
\end{enumerate}
The server side, in _svcauth_gssapi, performs the following steps to
initiate a context:
\begin{enumerate}
\item If a call arrives with no client_handle, a new client_handle is
allocated and stored in the database. Otherwise, the client's
previous state is is looked up in the database.
\item The received token is passed to gss_accept_sec_context. If an
output token is generated, it is returned to the client. Note that
since the application server may have registered multiple service
names and there is no way to determine {\it a priori} which service a
token is for, _svcauth_gssapi calls gss_accept_sec_context once for
each registered credential until one of them succeeds. The code
assumes that GSS_S_FAILURE is the only error that can result from a
credential mismatch, so any other error terminates the loop
immediately.
\item If the context is established, the server signs an initial
sequence number and returns it to the client.
\end{enumerate}
Note that these algorithms require context establishment to be
synchronous. If gss_init_sec_context returns GSS_S_COMPLETE upon
processing a token, it will either produce a token or not. If it
does, then gss_accept_sec_context will return GSS_S_COMPLETE when that
token is processed; if it does not, then gss_accept_sec_context
already returned GSS_S_COMPLETE (and presumably returned the token
that caused gss_init_sec_context to return GSS_S_COMPLETE when
processed). The reverse is also true.
\subsubsection{RPC Calls}
After the GSS-API context is established, both the server and the
client possess a client handle and a corresponding sequence number.
Each call from the client contains the client handle as the
``credential'' so that the server can identify which context to apply
to the call.
Each client call and server response includes a ``verifier'' that
contains the sealed current sequence number.\footnote{In a future
version, the verifier will also contain a signature block for the call
header, including the procedure number called.} The sequence number
prevents replay attacks\footnote{Although some GSS-API mechanisms
provide replay detection themselves, not all of them do; explicitly
including the sequence number in the RPC therefore provides better
end-to-end security}, but by itself it does not prevent splicing
attacks.
Each procedure argument and result block consists of the current
sequence number and the actual serialized argument string, all sealed
with gss_seal. Combining the sequence number with the argument/result
data prevents splicing attacks.
The sequence number is incremented by one for each RPC call and by one
for each response. The client and server will both reject messages
that do not contain the expected sequence number. Packets
retransmitted by the client should use the {\it same} sequence number
as the original packet, since even if the server receives multiple
copies only one will be honored.
\subsection{RPC Call Credential Structure}
Every message transmitted from the client to the server has a
credentials (cb_cred) field of the type auth_gssapi_creds:
\begin{verbatim}
typedef struct _auth_gssapi_creds {
bool_t auth_msg;
gss_buffer_desc client_handle;
};
\end{verbatim}
The auth_msg field indicates whether the message is intended for the
authentication mechanism for the actual server. Any message whose
auth_msg field is true is processed by the authentication mechanism;
any message whose auth_msg is false is passed to the application
server's dispatch function if authentication succeeds. All messages
must have an auth_msg of true until the context is established, since
authentication cannot succeed until it is.
The client_handle field contains the client handle obtained from the
first call to the server. On the first call, this field is empty.
\subsection{GSS-API Authentication Flavor Procedures}
The GSS-API authentication flavor uses standard RPC calls over the
client handle it is provided for the interactions described in
\ref{sec:algorithms}. All of the following procedures require the
auth_msg field in the credentials to be true; otherwise, the
server-side authentication flavor will simply attempt to authenticate
the caller and pass the call to the application server. The
server-side authentication flavor uses the no_dispatch variable to
indicate that it has handled the call.
\subsubsection{AUTH_GSSAPI_INIT, AUTH_GSSAPI_CONTINUE_INIT}
Context initiation is performed via AUTH_GSSAPI_INIT and
AUTH_GSSAPI_CONTINUE_INIT. The former is used to transfer the first
token generated by gss_init_sec_context, when no client handle is
included in the credentials; the latter is used on subsequent calls,
when a client handle is included.
Both procedures take an argument of type auth_gssapi_init_arg and
return results of the type auth_gssapi_init_res.
\begin{verbatim}
typedef struct _auth_gssapi_init_arg {
u_long version;
gss_buffer_desc token;
} auth_gssapi_init_arg;
\end{verbatim}
\begin{description}
\item[version] Three versions are presently defined.
\begin{description}
\item[1] The original version, as described in this document
\item[2] In earlier versions of Secure there was a bug in the GSS-API
library that affected the contents of accept_sec_context output
tokens. A client specifies version 2 to indicate that it expects the
correct (fixed) behavior. If the server indicates AUTH_BADCRED or
AUTH_FAILED it does not understand this version, so the client should
fall back to version 1.
\item[3] Version three indicates that channel bindings are in use.
The client must specify channel bindings with the version, and the
server will as well. If the server indicates AUTH_BADCRED or
AUTH_FAILED it does not understand this version, so the client should
fall back to version 2 (and cease specifying channel bindings).
\item[4] The previous versions all used the old GSS-API krb5 mechanism
oid; this version uses the new one specified in the RFC.
\end{description}
\item[token] The token field contains the token generated by
gss_init_sec_context.
\end{description}
\begin{verbatim}
typedef struct _auth_gssapi_init_res {
u_long version;
gss_buffer_desc client_handle;
gss_buffer_desc token;
OM_uint32 gss_major, gss_minor;
gss_buffer_desc signed_isn;
} auth_gssapi_init_res;
\end{verbatim}
\begin{description}
\item[version] There are two versions currently defined.
\begin{description}
\item[1] The original version, as described in this document. This is
the response version for {\it both} versions 1 and 2. The Secure 1.1
server will always return this version.
\item[3] Version three indicates that the server specified channel
bindings in response to a call arg version number of three. The
server must not specify this version unless the client does.
\end{description}
\item[client_handle] The client_handle field contains the client
handle that the client must use in the credentials field in all
subsequent RPC calls. In response to AUTH_GSSAPI_CONTINUE_INIT, it is
the same client handle that arrived in the credentials.
\item[gss_major, gss_minor] The GSS-API error codes that resulted from
processing the auth_gssapi_init_arg. If gss_major is GSS_S_COMPLETE,
the argument token was processed successfully. Otherwise, gss_major
and gss_minor contain the relevant major and minor status codes, and
the context currently being negotiated is no longer valid.
\item[token] In any response that the client is expecting another
token (i.e.: gss_init_sec_context last returned GSS_S_CONTINUE), the
token field contains the output token from gss_accept_sec_context. If
the client is not expecting a token and this field is not empty, an
error has occurred.
\item[signed_isn] If the client is not expecting another token (i.e.:
the previous call to gss_init_sec_context yielded a token and returned
GSS_S_COMPLETE) or the supplied token completes the context, the
signed_isn field contains the signed initial sequence number. The
server expects the first RPC call to have a sequence number one
greater than the initial sequence number (so that the signed_isn block
cannot be replayed). If the client is expecting another token and the
signed_isn field is not empty, an error has occurred.
\end{description}
\subsubsection{AUTH_GSSAPI_DESTROY}
Context tear-down is performed via AUTH_GSSAPI_DESTROY. This
procedure takes no arguments and returns no results; it merely informs
the server that the client wishes to destroy the established context.
When a client wishes to tear down an established context between
itself and a server, auth_gssapi_destroy first calls the
AUTH_GSSAPI_DESTROY procedure. The server authenticates the message
and immediately sends a ``success'' response with no results. The
client and server then both independently call gss_delete_sec_context
and discard the context-destruction token that is generated.
No RPC error checking is performed by either the client or the server.
The client waits a brief time for a success response from the server,
but if none arrives it destroys the context anyway since presumably
the user is waiting for the application to exit. The server similar
ignores any RPC errors since it knows that the client will ignore any
errors that are reported.
\subsection{RPC Call Authentication Implementation}
Once the context has been established, all subsequent RPC calls are
authenticated via the verifier described in section
\ref{sec:algorithms}.
auth_gssapi_marshall, invoked via AUTH_MARSHALL while the RPC call is
being created on the client side, serializes the client_handle
obtained during context initiation {\it in plaintext} as the
credentials and serializes the current sequence number, sealed with
gss_seal, as the verifier.
auth_gssapi_wrap, invoked next via AUTH_WRAP, serializes a sealed
token containing both the sequence number of the current call and the
serialized arguments.
_svcauth_gssapi, invoked on the server side by _authenticate, uses the
client_handle contained in the credentials to look up the correct
context and verifies the sequence number provided in the verifier; if
the sequence number is not correct, it declares a potential replay
attack.\footnote{Retransmitted packets will appear as replay attacks,
of course.} The response verifier is set to the serialized sealed
incremented sequence number.
svc_auth_gssapi_unwrap, invoked when either the application server or
_svcauth_gssapi (in response to an AUTH_GSSAPI authentication flavor
message) attempts to read its arguments, deserialzes and unseals the
block containing the current sequence number and serialized arguments.
If the sequence number is incorrect, it declares a splicing attack;
otherwise, it unserializes the arguments into the original structure.
svc_auth_gssapi_wrap, invoked when either the application server or
_svcauth_gssapi attempts to write its response, performs the same
operation as auth_gssapi_wrap.
auth_gssapi_validate, invoked by the client-side RPC mechanism when
an RPC_SUCCESS response is received, verifies that the returned sequence
number is one greater than the previous value sent by
auth_gssapi_marshall.
Finally, auth_gssapi_unwrap, invoked by the client-side RPC mechanism
after auth_gssapi_validate succeeds, performs the same operation as
svc_auth_gssapi_unwrap.
If an RPC request generates an error message (a status of other than
RPC_SUCCESS), auth_gssapi_refresh is called. If the error status is
AUTH_REJECTEDVERF, then the server rejected the sequence number as
invalid or replayed. The client guesses that, on some previous call,
the server received a message but the server's response did not make
it back to the client; this could happen if the packet got lost or if
the server was being debugged and the client timed out waiting for it.
As a result, the server is expected a higher sequence number than the
client sent. auth_gssapi_refresh increments the sequence number and
returns true so that the call will be tried again. The transport
mechanism will only call auth_gssapi_refresh twice for each RPC
request, so if some other error occurred an infinite loop will not
result; however, it is unlikely the the client and server will be able
to resynchronize after such an event.
\subsection{Client State Information}
The client-side GSS-API authentication flavor maintains an
auth_gssapi_data structure for each authentication instance:
\begin{verbatim}
struct auth_gssapi_data {
bool_t established;
CLIENT *clnt;
gss_ctx_id_t context;
gss_buffer_desc client_handle;
u_long seq_num;
int def_cred;
/* pre-serialized ah_cred */
u_char cred_buf[MAX_AUTH_BYTES];
u_long cred_len;
};
\end{verbatim}
The established field indicates whether the authentication context
between the client and server has been established. It is set to true
when gss_init_sec_context returns GSS_S_COM\-PLETE. When this field is
false, the auth_gssapi functions marshall, validate, wrap, and unwrap
mimic the ``no authentication'' flavor since there is no context with
which to perform authentication functions.\footnote{This field is
necessary because, when auth_gssapi_create calls clnt_call to make an
RPC call, it has to have set the client's authentication flavor to
AUTH_GSSAPI; otherwise, the service-side RPC mechanism will not know
to dispatch the call to _svcauth_gssapi. However, with the client's
authentication flavor set, all of the authentication flavor's
functions will be automatically invoked, even though they are not
ready to operate.}
The clnt field contains the RPC client structure that can be used to
communicate with the GSS-API authentication flavor on the server.
The context field contains the context structure created by
gss_init_sec_context.
The client_handle field contains the client handle used on all RPC
calls except the first one; the handle is obtained as the result of
the first call.
The sequence_number field contains the sequence number that will be
used when transmitting RPC calls to the server and verifying the
server's responses after the context is initialized.
The def_cred field is true if gss_init_sec_context created a default
credential, in which case the authentication mechanism is responsible
for releasing the default credential that gets automatically
allocated.
The cred_buf and cred_len fields contain the pre-serialized
credentials structure used in each call. This provides a small
performance enhancement since the credentials structure does not
change very often; the same pre-serialized version can be used on
virtually every call.
\subsection{Server State Information}
\label{sec:server-state}
The server-side GSS-API authentication flavor maintains an
svcauth_gssapi_data structure for each established or partially
established context:
\begin{verbatim}
typedef struct _svc_auth_gssapi_data {
bool_t established;
gss_ctx_id_t context;
gss_name_t client_name, server_name;
gss_cred_id_t server_creds;
u_long expiration;
u_long seq_num;
u_long key;
SVCAUTH svcauth;
} svc_auth_gssapi_data;
\end{verbatim}
The established field indicates whether the context is fully
established.
The context field contains the context created by
gss_accept_sec_context.
The client_name field contains the client's authenticated name, as
returned by gss_accept_sec_context. _svcauth_gssapi sets the ``cooked
credentials'' field of the RPC call structure to this value after the
call is authenticated; the application server can use it to perform
authorization.
The server_name field contains the service name that the client
established a context with. This is useful if the application server
registered more than one service name with the library; it allows the
server to determine which service the client chose.
The server_creds field contains the service credentials that the
client established a context with. It is used to avoid having to scan
through the server_creds_list multiple times in the case that context
establishment requires more than one round-trip to the server.
The expiration field contains the expiration time of the context, as a
Unix timestamp. If a context has no expiration (time_rec is
GSS_C_INDEFINITE), the expiration time is set to 24 hours in the
future. When the structure is created, before the context is
established, the expiration time is initialized to small duration
(currently 5 minutes) so that partially created and abandoned contexts
will be expired quickly.
The seq_num field is the current sequence number for the client.
The key field is the client's key into the hash table (see below).
The client_handle field sent to the client is the key treated as an
arbitrary four-byte string.
The svcauth field is a kludge that allows the svc_auth_gssapi
functions to access the per-client data structure while processing a
call. One SVCAUTH structure is allocated for each client structure,
and the svc_ah_private field is set to the corresponding client. The
client's svcauth field is then set to the new SVCAUTH structure, so
that client_data->svcauth->svc_ah_private == client_data. As each
request is processed, the transport mechanism's xp_auth field is set
to the client's svcauth field; thus, the server-side functions that
dispatch to server-side authentication flavors can access an
appropriate SVCAUTH structure, and the server-side authentication
function that is called can determine the appropriate per-client
structure from the SVCAUTH structure.
The per-client structures are all stored both in a BSD 4.4 db library
hash table and b-tree. The hash table maps client handles (key
fields) the client structures, and is used to look up client
structures based on the client_handle field of a call's credentials
structure. The b-tree stores the client structures as keys, sorted by
their expiration time. Each time _svcauth_gssapi is activated, it
traverses the tree and destroys all client structures that have
expired.
\end{document}
|
{
"pile_set_name": "Github"
}
|
:020000023000CC
:10FC000001C0F3C0112484B790E890936100109272
:10FC10006100882369F0982F9A70923049F081FF33
:10FC200002C097EF94BF282E80E002D10C94000010
:10FC300085E08093810082E08093D00088E180930A
:10FC4000D10080E18093D40086E08093D2008EE0E2
:10FC5000EFD0279A84E020E33CEF91E030938500D9
:10FC60002093840096BBB09BFECF1F9AA89540912D
:10FC7000D00047FD02C0815089F7CED0813479F49D
:10FC8000CBD0C82FDBD0C23811F480E004C088E0AC
:10FC9000C13809F083E0B9D080E1B7D0EECF82342B
:10FCA00019F484E1D3D0F8CF853411F485E0FACF8C
:10FCB000853581F4B1D0E82EAFD0F82E87FF07C08C
:10FCC0008BB781608BBFEE0CFF1CB8D0E5CF8BB734
:10FCD0008E7FF8CF863579F49FD08D3451F49CD047
:10FCE000CBB79AD0C170880F8C2B8BBF81E0AED080
:10FCF000CCCF83E0FCCF843609F046C08DD0C82F2E
:10FD0000D0E0DC2FCC2788D0C82B86D0D82E5E013F
:10FD10008EEFB81A00E012E04801EFEF8E1A9E0A4B
:10FD20007BD0F801808384018A149B04A9F786D0D4
:10FD3000F5E410E000E0DF1609F150E040E063E098
:10FD4000C70153D08701C12C92E0D92EF601419111
:10FD500051916F0161E0C80148D00E5F1F4F22979B
:10FD6000A9F750E040E065E0C7013FD095CF608142
:10FD7000C8018E0D9F1D79D00F5F1F4FF801FE5FE8
:10FD8000C017D107A1F788CF843701F545D0C82F18
:10FD9000D0E0DC2FCC2740D0C82B3ED0D82E4ED080
:10FDA0008701F5E4DF120BC0CE0DDF1DC80155D071
:10FDB0002CD00F5F1F4FC017D107C1F76DCFF801CF
:10FDC00087918F0122D02197D1F766CF853739F4FB
:10FDD00035D08EE11AD088E918D081E05CCF81352A
:10FDE00009F073CF88E024D070CFFC010A0167BF0F
:10FDF000E895112407B600FCFDCF667029F0452B6D
:10FE000019F481E187BFE89508959091D00095FF9E
:10FE1000FCCF8093D60008958091D00087FFFCCF5F
:10FE20008091D00084FD01C0A8958091D6000895EE
:10FE3000E0E6F0E098E1908380830895EDDF803282
:10FE400019F088E0F5DFFFCF84E1DFCFCF93C82F33
:10FE5000E3DFC150E9F7CF91F1CFF999FECF92BD21
:10FE600081BDF89A992780B50895262FF999FECF7C
:10FE70001FBA92BD81BD20BD0FB6F894FA9AF99AC7
:06FE80000FBE019608957B
:02FFFE000008F9
:040000033000FC00CD
:00000001FF
|
{
"pile_set_name": "Github"
}
|
#include <string>
//#include <tr1/unordered_map>
#include <limits>
#include <map>
#include <vector>
#include <iostream>
#include <stdexcept>
using std::vector;
using std::string;
using std::map;
using std::make_pair;
using std::cout;
using std::endl;
using std::out_of_range;
using std::ostream;
//typedef tr1::unordered_map map;
// TODO: upgrade it to process trace. Rule: char-->elem string-->elem_list
class SuffixTree
{
public:
// active point is initialized as (root, None, 0), remainder initialized as 1
SuffixTree(string str):test_str(str), root(test_str), active_point(&root, 0, 0), remainder(0), pos(0), active_e(0), ls() {}
int construct(void);
// return -1 if no such sub exist, return the beginning position of this substring in thr original string if it exist
int search(string sub);
// return the length of the longest prefix of sub which can be matched in suffix tree
template <class Iterator>
Iterator inc_search(Iterator sub)
{
Iterator result = sub;
Node* node = &root;
Edge* edge = NULL;
int pos = 0; // the iter's pos at edge
int edge_len = -1;
bool flag = true;
while (flag) {
if (edge == NULL) {
edge = node->find_edge(*result);
if (edge == NULL) {
flag = false;
}
else {
result++;
pos = 1; // the second element of the edge
edge_len = edge->length();
}
}
else {
if (pos >= edge_len) {
node = edge->endpoint;
edge = NULL;
edge_len = 0;
}
else {
if (*result == (*edge)[pos]) {
result++;
pos++;
}
else
flag = false;
}
}
}
return result;
}
struct Node;
struct Edge{
// the begin and end pos of this edge, note that INT_MAX stands for #(the changing end pos of this entire string)
unsigned int begin, end;
// Is there a better way to find test_str?
string& test_node_str;
Node * endpoint;
Edge(unsigned int b, unsigned int e, string& str):
test_node_str(str)
{
begin = b;
end = e;
endpoint = NULL;
std::cout << "Edge initialized" << std::endl;
}
void change_edge(unsigned int b, unsigned int e)
{
begin = b;
end = e;
}
int length(void)
{
if (end > test_node_str.size())
return test_node_str.size() - begin;
else
return end - begin + 1;
}
// needed by map
friend bool operator<(const Edge& me, const Edge& other)
{
return me.begin < other.begin;
}
char operator[](unsigned int i)
{
i += begin;
if (i > end)
throw out_of_range("Edge [] out of range.");
return test_node_str[i];
}
friend ostream& operator<<(ostream& os, Edge& edge)
{
unsigned int end = edge.test_node_str.size()-1;
if (end >= edge.end)
end = edge.end;
char c;
for (unsigned int i=edge.begin; i<=end; i++) {
c = edge.test_node_str[i];
os << c;
}
if (end != edge.end)
os << '#';
return os;
}
bool is_none(void) { return begin == 0 && end == 0; }
};
struct Node{
string& test_node_str;
map<int, int> testmap;
map<Edge*, bool> edges;
// find the edge quicky by storing the leading char of this edge
map<char, Edge*> findedges;
Node* suffix_link;
friend class LinkState;
Node(string& str) :
test_node_str(str), suffix_link(NULL) { edges.clear(); findedges.clear(); }
void add_edge(Edge* edge) {
if (edge->endpoint == NULL)
edge->endpoint = new Node(test_node_str);
make_pair(edge, true);
edges.insert(make_pair(edge, true));
findedges.insert(make_pair(test_node_str[edge->begin], edge));
cout << "edge added. Now we have " << edges.size() << "edges." << endl;
}
void del_edge(Edge* edge) {
map<Edge*, bool>::iterator iter = edges.find(edge);
if (iter == edges.end())
throw out_of_range("edge don't exit");
else {
// note we should erase the findedges too
edges.erase(edge);
cout << "delete" << (*edge)[0] << endl;
findedges.erase((*edge)[0]);
cout << "edge deleted. Now we have " << edges.size() << "edges." << endl;
}
}
// find edge by the first char
Edge* find_edge(char c)
{
cout << "finding edge char " << c;
map<char, Edge*>::iterator iter = findedges.find(c);
cout << " founded? ";
if (iter != findedges.end()) {
cout << "yes." << endl;
return iter->second;
}
else {
cout << "no." << endl;
return NULL;
}
}
bool isleaf() { return edges.empty(); }
bool operator==(Node& other)
{
return (this) == (&other);
}
friend ostream& operator<<(ostream& os, Node& node)
{
map<Edge*, bool>::iterator iter;
map<char, Edge*>::iterator iter_f;
for (iter=node.edges.begin(); iter!=node.edges.end(); ++iter)
os << iter->first << '\t';
os << endl;
for (iter_f=node.findedges.begin(); iter_f!=node.findedges.end(); ++iter_f)
os << iter_f->first << "-->" << iter_f->second << endl;
return os;
}
};
int print_tree(void);
private:
string test_str;
class ActivePoint{
public:
Node* active_node;
char active_edge;
int active_length;
ActivePoint(Node* node, char edge, int length):
active_node(node), active_edge(edge), active_length(length) { std::cout << "ActivePoint initialized" << std::endl; }
};
Node root;
ActivePoint active_point;
Node* get_active_node(void) { return active_point.active_node; }
void set_active_node(Node* node) { active_point.active_node = node; cout << "Active node set as " << node << endl; }
char get_active_edge(void)
{
return test_str[active_e];
}
int get_active_length(void) { return active_point.active_length; }
void set_active_length(int len) { active_point.active_length = len; }
void inc_active_len() { active_point.active_length++; }
void dec_active_len() { active_point.active_length--; }
// how many suffixes is to be inserted?
int remainder;
// how many characters inserted?
unsigned int pos;
unsigned int active_e; // the beginning position of suffixes need to be inserted
char get_ele(int i) { return test_str[i]; }
// insert a char from pos to suffix tree
int insert();
int insert_rule1();
int insert_rule3();
int print_node(Node* node, int level);
Node* separate_edge(Node * node, Edge* edge);
// check if we can change active node
bool check_active_node(void)
{
Node* node = get_active_node();
char a_char = get_active_edge();
Edge* edge = node->find_edge(a_char);
if (edge == NULL)
return false;
unsigned int edge_size = edge->end - edge->begin + 1;
unsigned int length = get_active_length();
// update
if (length >= edge_size) {
set_active_node(edge->endpoint);
set_active_length(length-edge_size);
active_e += edge_size;
return true;
}
return false;
}
// this class indicate when shall we insert a suffix link
// ls should be a singleton
class LinkState
{
bool first;
Node* prev, *curr;
public:
LinkState() : first(true), prev(NULL), curr(NULL) {}
void ins_link(Node* node)
{
prev = curr;
curr = node;
if (first == false) {
prev->suffix_link = curr;
cout << "Suffix link added from prev " << prev << " to curr " << curr << endl;
}
first = false;
}
void clear(void)
{
first = true;
prev = curr = NULL;
}
};
LinkState ls;
};
|
{
"pile_set_name": "Github"
}
|
/* $FreeBSD: src/sys/netinet6/in6_prefix.h,v 1.5 2001/06/11 12:39:05 ume Exp $ */
/* $KAME: in6_prefix.h,v 1.10 2001/02/08 16:30:30 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, 1998 and 1999 WIDE Project.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the project nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/callout.h>
struct rr_prefix {
struct ifprefix rp_ifpr;
LIST_ENTRY(rr_prefix) rp_entry;
LIST_HEAD(rp_addrhead, rp_addr) rp_addrhead;
struct sockaddr_in6 rp_prefix; /* prefix */
u_int32_t rp_vltime; /* advertised valid lifetime */
u_int32_t rp_pltime; /* advertised preferred lifetime */
time_t rp_expire; /* expiration time of the prefix */
time_t rp_preferred; /* preferred time of the prefix */
struct in6_prflags rp_flags;
u_char rp_origin; /* from where this prefix info is obtained */
struct rp_stateflags {
/* if some prefix should be added to this prefix */
u_char addmark : 1;
u_char delmark : 1; /* if this prefix will be deleted */
} rp_stateflags;
};
#define rp_type rp_ifpr.ifpr_type
#define rp_ifp rp_ifpr.ifpr_ifp
#define rp_plen rp_ifpr.ifpr_plen
#define rp_raf rp_flags.prf_ra
#define rp_raf_onlink rp_flags.prf_ra.onlink
#define rp_raf_auto rp_flags.prf_ra.autonomous
#define rp_statef_addmark rp_stateflags.addmark
#define rp_statef_delmark rp_stateflags.delmark
#define rp_rrf rp_flags.prf_rr
#define rp_rrf_decrvalid rp_flags.prf_rr.decrvalid
#define rp_rrf_decrprefd rp_flags.prf_rr.decrprefd
struct rp_addr {
LIST_ENTRY(rp_addr) ra_entry;
struct in6_addr ra_ifid;
struct in6_ifaddr *ra_addr;
struct ra_flags {
u_char anycast : 1;
} ra_flags;
};
#define ifpr2rp(ifpr) ((struct rr_prefix *)(ifpr))
#define rp2ifpr(rp) ((struct ifprefix *)(rp))
#define RP_IN6(rp) (&(rp)->rp_prefix.sin6_addr)
#define RR_INFINITE_LIFETIME 0xffffffff
LIST_HEAD(rr_prhead, rr_prefix);
extern struct rr_prhead rr_prefix;
void in6_rr_timer __P((void *));
extern struct callout in6_rr_timer_ch;
int delete_each_prefix __P((struct rr_prefix *rpp, u_char origin));
|
{
"pile_set_name": "Github"
}
|
StartChar: numbersign
Encoding: 35 35 93
Width: 1060
VWidth: 6
Flags: W
HStem: -19 21G<94 262 430 610.5> 385 158<79.4172 206 421 550 753 900> 795 160<166.791 334 546 679 881 985> 1312 20G<578 606.5 827 1010>
VStem: 485 162<1157.32 1331>
LayerCount: 2
Fore
SplineSet
497 795 m 1
475 715 446 623 421 541 c 1
462 543 494 543 528 543 c 2
602 543 l 1
629 627 655 720 679 798 c 1
608 798 565 796 497 795 c 1
262 -19 m 1
94 -18 l 1
123 95 155 208 206 375 c 1
153 374 108 365 78 356 c 1
57 503 l 1
117 523 190 529 257 534 c 1
289 614 310 711 334 790 c 1
320 790 l 1
254 786 203 781 165 768 c 1
141 915 l 1
211 940 302 944 387 949 c 1
445 1133 450 1191 485 1331 c 1
514 1331 559 1332 597 1332 c 0
616 1332 633 1332 647 1331 c 1
616 1210 589 1099 546 955 c 1
728 955 l 1
779 1118 806 1207 848 1326 c 1
1010 1324 l 1
961 1203 931 1114 881 956 c 1
1016 956 l 1
985 795 l 1
957 796 924 799 832 799 c 1
809 720 780 629 753 544 c 1
932 544 l 1
900 383 l 1
873 384 824 386 710 386 c 1
650 189 627 99 594 -22 c 1
430 -21 l 1
463 91 496 209 550 385 c 1
526 385 l 2
472 385 422 383 371 380 c 1
327 230 262 -19 262 -19 c 1
EndSplineSet
Validated: 1
EndChar
|
{
"pile_set_name": "Github"
}
|
/*
Copyright (C) 2008 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^\"\\]|\\.)*"|'(?:[^\'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\r\n]*|\/\*[\s\S]*?(?:\*\/|$))/],["kwd",/^(?:ADD|ALL|ALTER|AND|ANY|APPLY|AS|ASC|AUTHORIZATION|BACKUP|BEGIN|BETWEEN|BREAK|BROWSE|BULK|BY|CASCADE|CASE|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMN|COMMIT|COMPUTE|CONNECT|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|DATABASE|DBCC|DEALLOCATE|DECLARE|DEFAULT|DELETE|DENY|DESC|DISK|DISTINCT|DISTRIBUTED|DOUBLE|DROP|DUMMY|DUMP|ELSE|END|ERRLVL|ESCAPE|EXCEPT|EXEC|EXECUTE|EXISTS|EXIT|FETCH|FILE|FILLFACTOR|FOLLOWING|FOR|FOREIGN|FREETEXT|FREETEXTTABLE|FROM|FULL|FUNCTION|GOTO|GRANT|GROUP|HAVING|HOLDLOCK|IDENTITY|IDENTITYCOL|IDENTITY_INSERT|IF|IN|INDEX|INNER|INSERT|INTERSECT|INTO|IS|JOIN|KEY|KILL|LEFT|LIKE|LINENO|LOAD|MATCH|MATCHED|MERGE|NATURAL|NATIONAL|NOCHECK|NONCLUSTERED|NOCYCLE|NOT|NULL|NULLIF|OF|OFF|OFFSETS|ON|OPEN|OPENDATASOURCE|OPENQUERY|OPENROWSET|OPENXML|OPTION|OR|ORDER|OUTER|OVER|PARTITION|PERCENT|PIVOT|PLAN|PRECEDING|PRECISION|PRIMARY|PRINT|PROC|PROCEDURE|PUBLIC|RAISERROR|READ|READTEXT|RECONFIGURE|REFERENCES|REPLICATION|RESTORE|RESTRICT|RETURN|REVOKE|RIGHT|ROLLBACK|ROWCOUNT|ROWGUIDCOL|ROWS?|RULE|SAVE|SCHEMA|SELECT|SESSION_USER|SET|SETUSER|SHUTDOWN|SOME|START|STATISTICS|SYSTEM_USER|TABLE|TEXTSIZE|THEN|TO|TOP|TRAN|TRANSACTION|TRIGGER|TRUNCATE|TSEQUAL|UNBOUNDED|UNION|UNIQUE|UNPIVOT|UPDATE|UPDATETEXT|USE|USER|USING|VALUES|VARYING|VIEW|WAITFOR|WHEN|WHERE|WHILE|WITH|WITHIN|WRITETEXT|XML)(?=[^\w-]|$)/i,
null],["lit",/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^[a-z_][\w-]*/i],["pun",/^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0+\-\"\']*/]]),["sql"]);
|
{
"pile_set_name": "Github"
}
|
:020000021000EC
:10FC000001C0F2C0112484B790E890936100109273
:10FC10006100882369F0982F9A70923049F081FF33
:10FC200002C097EF94BF282E80E001D10C94000011
:10FC300085E08093810082E08093C00088E180931A
:10FC4000C1008CE08093C40086E08093C2008EE007
:10FC5000EED0279A84E026E83FEF91E030938500CC
:10FC60002093840096BBB09BFECF1F9AA89540912D
:10FC7000C00047FD02C0815089F7CDD0813479F4AE
:10FC8000CAD0C82FDAD0C23811F480E004C088E0AE
:10FC9000C13809F083E0B8D080E1B6D0EECF82342D
:10FCA00019F484E1D2D0F8CF853411F485E0FACF8D
:10FCB000853581F4B0D0E82EAED0F82E87FF07C08E
:10FCC0008BB781608BBFEE0CFF1CB7D0E5CF8BB735
:10FCD0008E7FF8CF863579F49ED08D3451F49BD049
:10FCE000CBB799D0C170880F8C2B8BBF81E0ADD082
:10FCF000CCCF83E0FCCF843609F046C08CD0C82F2F
:10FD0000D0E0DC2FCC2787D0C82B85D0D82E5E0141
:10FD10008EEFB81A00E012E04801EFEF8E1A9E0A4B
:10FD20007AD0F801808384018A149B04A9F785D0D6
:10FD3000F5E410E000E0DF1609F150E040E063E098
:10FD4000C70152D08701C12C92E0D92EF601419112
:10FD500051916F0161E0C80147D00E5F1F4F22979C
:10FD6000A9F750E040E065E0C7013ED095CF608143
:10FD7000C8018E0D9F1D78D00F5F1F4FF801FE5FE9
:10FD8000C017D107A1F788CF843701F544D0C82F19
:10FD9000D0E0DC2FCC273FD0C82B3DD0D82E4DD083
:10FDA0008701F5E4DF120BC0CE0DDF1DC80154D072
:10FDB0002BD00F5F1F4FC017D107C1F76DCFF801D0
:10FDC00087918F0121D02197D1F766CF853731F404
:10FDD00034D08EE119D087E917D05CCF813509F096
:10FDE00074CF88E024D071CFFC010A0167BFE89589
:10FDF000112407B600FCFDCF667029F0452B19F4DD
:10FE000081E187BFE89508959091C00095FFFCCFF0
:10FE10008093C60008958091C00087FFFCCF809139
:10FE2000C00084FD01C0A8958091C6000895E0E659
:10FE3000F0E098E1908380830895EDDF803219F03F
:10FE400088E0F5DFFFCF84E1DFCFCF93C82FE3DF7A
:10FE5000C150E9F7CF91F1CFF999FECF92BD81BDA5
:10FE6000F89A992780B50895262FF999FECF1FBAE1
:10FE700092BD81BD20BD0FB6F894FA9AF99A0FBED3
:04FE8000019608954A
:02FFFE000008F9
:040000031000FC00ED
:00000001FF
|
{
"pile_set_name": "Github"
}
|
:020000021000EC
:10FC000001C0F2C0112484B790E890936100109273
:10FC10006100882369F0982F9A70923049F081FF33
:10FC200002C097EF94BF282E80E001D10C94000011
:10FC300085E08093810082E08093300188E18093A9
:10FC4000310181E08093340186E0809332018EE0BF
:10FC5000EED0279A84E020E93FEF91E030938500D1
:10FC60002093840096BBB09BFECF1F9AA89540912D
:10FC7000300147FD02C0815089F7CDD0813479F43D
:10FC8000CAD0C82FDAD0C23811F480E004C088E0AE
:10FC9000C13809F083E0B8D080E1B6D0EECF82342D
:10FCA00019F484E1D2D0F8CF853411F485E0FACF8D
:10FCB000853581F4B0D0E82EAED0F82E87FF07C08E
:10FCC0008BB781608BBFEE0CFF1CB7D0E5CF8BB735
:10FCD0008E7FF8CF863579F49ED08D3451F49BD049
:10FCE000CBB799D0C170880F8C2B8BBF81E0ADD082
:10FCF000CCCF83E0FCCF843609F046C08CD0C82F2F
:10FD0000D0E0DC2FCC2787D0C82B85D0D82E5E0141
:10FD10008EEFB81A00E012E04801EFEF8E1A9E0A4B
:10FD20007AD0F801808384018A149B04A9F785D0D6
:10FD3000F5E410E000E0DF1609F150E040E063E098
:10FD4000C70152D08701C12C92E0D92EF601419112
:10FD500051916F0161E0C80147D00E5F1F4F22979C
:10FD6000A9F750E040E065E0C7013ED095CF608143
:10FD7000C8018E0D9F1D78D00F5F1F4FF801FE5FE9
:10FD8000C017D107A1F788CF843701F544D0C82F19
:10FD9000D0E0DC2FCC273FD0C82B3DD0D82E4DD083
:10FDA0008701F5E4DF120BC0CE0DDF1DC80154D072
:10FDB0002BD00F5F1F4FC017D107C1F76DCFF801D0
:10FDC00087918F0121D02197D1F766CF853731F404
:10FDD00034D08EE119D087E917D05CCF813509F096
:10FDE00074CF88E024D071CFFC010A0167BFE89589
:10FDF000112407B600FCFDCF667029F0452B19F4DD
:10FE000081E187BFE89508959091300195FFFCCF7F
:10FE10008093360108958091300187FFFCCF809157
:10FE2000300184FD01C0A895809136010895E0E677
:10FE3000F0E098E1908380830895EDDF803219F03F
:10FE400088E0F5DFFFCF84E1DFCFCF93C82FE3DF7A
:10FE5000C150E9F7CF91F1CFF999FECF92BD81BDA5
:10FE6000F89A992780B50895262FF999FECF1FBAE1
:10FE700092BD81BD20BD0FB6F894FA9AF99A0FBED3
:04FE8000019608954A
:02FFFE000008F9
:040000031000FC00ED
:00000001FF
|
{
"pile_set_name": "Github"
}
|
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
*
* LibTomCrypt is a library that provides various cryptographic
* algorithms in a highly modular and flexible manner.
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
*/
#include "tomcrypt.h"
/**
@file ctr_test.c
CTR implementation, Tests again RFC 3686, Tom St Denis
*/
#ifdef LTC_CTR_MODE
int ctr_test(void)
{
#ifdef LTC_NO_TEST
return CRYPT_NOP;
#else
static const struct {
int keylen, msglen;
unsigned char key[32], IV[16], pt[64], ct[64];
} tests[] = {
/* 128-bit key, 16-byte pt */
{
16, 16,
{0xAE,0x68,0x52,0xF8,0x12,0x10,0x67,0xCC,0x4B,0xF7,0xA5,0x76,0x55,0x77,0xF3,0x9E },
{0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
{0x53,0x69,0x6E,0x67,0x6C,0x65,0x20,0x62,0x6C,0x6F,0x63,0x6B,0x20,0x6D,0x73,0x67 },
{0xE4,0x09,0x5D,0x4F,0xB7,0xA7,0xB3,0x79,0x2D,0x61,0x75,0xA3,0x26,0x13,0x11,0xB8 },
},
/* 128-bit key, 36-byte pt */
{
16, 36,
{0x76,0x91,0xBE,0x03,0x5E,0x50,0x20,0xA8,0xAC,0x6E,0x61,0x85,0x29,0xF9,0xA0,0xDC },
{0x00,0xE0,0x01,0x7B,0x27,0x77,0x7F,0x3F,0x4A,0x17,0x86,0xF0,0x00,0x00,0x00,0x00 },
{0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
0x20,0x21,0x22,0x23},
{0xC1,0xCF,0x48,0xA8,0x9F,0x2F,0xFD,0xD9,0xCF,0x46,0x52,0xE9,0xEF,0xDB,0x72,0xD7,
0x45,0x40,0xA4,0x2B,0xDE,0x6D,0x78,0x36,0xD5,0x9A,0x5C,0xEA,0xAE,0xF3,0x10,0x53,
0x25,0xB2,0x07,0x2F },
},
};
int idx, err, x;
unsigned char buf[64];
symmetric_CTR ctr;
/* AES can be under rijndael or aes... try to find it */
if ((idx = find_cipher("aes")) == -1) {
if ((idx = find_cipher("rijndael")) == -1) {
return CRYPT_NOP;
}
}
for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) {
if ((err = ctr_start(idx, tests[x].IV, tests[x].key, tests[x].keylen, 0, CTR_COUNTER_BIG_ENDIAN|LTC_CTR_RFC3686, &ctr)) != CRYPT_OK) {
return err;
}
if ((err = ctr_encrypt(tests[x].pt, buf, tests[x].msglen, &ctr)) != CRYPT_OK) {
return err;
}
ctr_done(&ctr);
if (XMEMCMP(buf, tests[x].ct, tests[x].msglen)) {
return CRYPT_FAIL_TESTVECTOR;
}
}
return CRYPT_OK;
#endif
}
#endif
/* $Source: /cvs/libtom/libtomcrypt/src/modes/ctr/ctr_test.c,v $ */
/* $Revision: 1.3 $ */
/* $Date: 2006/11/05 02:06:49 $ */
|
{
"pile_set_name": "Github"
}
|
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Thomas <matt@3am-software.com>.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Based on NetBSD: rb.h,v 1.13 2009/08/16 10:57:01 yamt Exp
*/
#ifndef ARCHIVE_RB_H_INCLUDED
#define ARCHIVE_RB_H_INCLUDED
struct archive_rb_node {
struct archive_rb_node *rb_nodes[2];
/*
* rb_info contains the two flags and the parent back pointer.
* We put the two flags in the low two bits since we know that
* rb_node will have an alignment of 4 or 8 bytes.
*/
uintptr_t rb_info;
};
#define ARCHIVE_RB_DIR_LEFT 0
#define ARCHIVE_RB_DIR_RIGHT 1
#define ARCHIVE_RB_TREE_MIN(T) \
__archive_rb_tree_iterate((T), NULL, ARCHIVE_RB_DIR_LEFT)
#define ARCHIVE_RB_TREE_MAX(T) \
__archive_rb_tree_iterate((T), NULL, ARCHIVE_RB_DIR_RIGHT)
#define ARCHIVE_RB_TREE_NEXT(T, N) \
__archive_rb_tree_iterate((T), (N), ARCHIVE_RB_DIR_RIGHT)
#define ARCHIVE_RB_TREE_PREV(T, N) \
__archive_rb_tree_iterate((T), (N), ARCHIVE_RB_DIR_LEFT)
#define ARCHIVE_RB_TREE_FOREACH(N, T) \
for ((N) = ARCHIVE_RB_TREE_MIN(T); (N); \
(N) = ARCHIVE_RB_TREE_NEXT((T), (N)))
#define ARCHIVE_RB_TREE_FOREACH_REVERSE(N, T) \
for ((N) = ARCHIVE_RB_TREE_MAX(T); (N); \
(N) = ARCHIVE_RB_TREE_PREV((T), (N)))
#define ARCHIVE_RB_TREE_FOREACH_SAFE(N, T, S) \
for ((N) = ARCHIVE_RB_TREE_MIN(T); \
(N) && ((S) = ARCHIVE_RB_TREE_NEXT((T), (N)), 1); \
(N) = (S))
#define ARCHIVE_RB_TREE_FOREACH_REVERSE_SAFE(N, T, S) \
for ((N) = ARCHIVE_RB_TREE_MAX(T); \
(N) && ((S) = ARCHIVE_RB_TREE_PREV((T), (N)), 1); \
(N) = (S))
/*
* archive_rbto_compare_nodes_fn:
* return a positive value if the first node < the second node.
* return a negative value if the first node > the second node.
* return 0 if they are considered same.
*
* archive_rbto_compare_key_fn:
* return a positive value if the node < the key.
* return a negative value if the node > the key.
* return 0 if they are considered same.
*/
typedef signed int (*const archive_rbto_compare_nodes_fn)(const struct archive_rb_node *,
const struct archive_rb_node *);
typedef signed int (*const archive_rbto_compare_key_fn)(const struct archive_rb_node *,
const void *);
struct archive_rb_tree_ops {
archive_rbto_compare_nodes_fn rbto_compare_nodes;
archive_rbto_compare_key_fn rbto_compare_key;
};
struct archive_rb_tree {
struct archive_rb_node *rbt_root;
const struct archive_rb_tree_ops *rbt_ops;
};
void __archive_rb_tree_init(struct archive_rb_tree *,
const struct archive_rb_tree_ops *);
int __archive_rb_tree_insert_node(struct archive_rb_tree *,
struct archive_rb_node *);
struct archive_rb_node *
__archive_rb_tree_find_node(struct archive_rb_tree *, const void *);
struct archive_rb_node *
__archive_rb_tree_find_node_geq(struct archive_rb_tree *, const void *);
struct archive_rb_node *
__archive_rb_tree_find_node_leq(struct archive_rb_tree *, const void *);
void __archive_rb_tree_remove_node(struct archive_rb_tree *, struct archive_rb_node *);
struct archive_rb_node *
__archive_rb_tree_iterate(struct archive_rb_tree *,
struct archive_rb_node *, const unsigned int);
#endif /* ARCHIVE_RB_H_*/
|
{
"pile_set_name": "Github"
}
|
% seemovie() - see an EEG movie produced by eegmovie()
%
% Usage: >> seemovie(Movie,ntimes,Colormap)
%
% Inputs:
% Movie = Movie matrix returned by eegmovie()
% ntimes = Number of times to display {0 -> -10}
% If ntimes < 0, movie will play forward|backward
% Colormap = Color map returned by eegmovie() {0 -> default}
%
% Author: Scott Makeig & Colin Humphries, CNL / Salk Institute, 6/3/97
%
% See also: eegmovie()
% Copyright (C) 6/3/97 Scott Makeig & Colin Humphries, CNL / Salk Institute, La Jolla CA
%
% 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
% 10-31-97 changed test for user-defined colormap -ch & sm
% 1-8-98 added '\n' at end, improved help msg -sm
% 01-25-02 reformated help, added link -ad
function seemovie(Movie,ntimes,Colormap)
fps = 10; % projetion speed (requested frames per second)
if nargin<1
help seemovie
return
end
if nargin<3
Colormap = 0;
end
if nargin<2
ntimes = -10; % default to playing foward|backward endlessly
end
if ntimes == 0
ntimes = -10;
end
clf
axes('Position',[0 0 1 1]);
if size(Colormap,2) == 3 % if colormap user-defined
colormap(Colormap)
else
colormap([jet(64);0 0 0]); % set up the default topoplot color map
end
if ntimes > 0,
fprintf('Movie will play slowly once, then %d times faster.\n',ntimes);
else
fprintf('Movie will play slowly once, then %d times faster forwards and backwards.\n',-ntimes);
end
if abs(ntimes) > 7
fprintf(' Close figure to abort: ');
end
%%%%%%%%%%%%%%%%%%%%%%%% Show the movie %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
movie(Movie,ntimes,fps);
%%%%%%%%%%%%%%%%%%%%%%%% The End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if abs(ntimes) > 7
fprintf('\n');
end
|
{
"pile_set_name": "Github"
}
|
/*----------------------------------------------------------------------------
* RL-ARM - RTX
*----------------------------------------------------------------------------
* Name: RT_HAL_CM.H
* Purpose: Hardware Abstraction Layer for Cortex-M definitions
* Rev.: V4.60
*----------------------------------------------------------------------------
*
* Copyright (c) 1999-2009 KEIL, 2009-2012 ARM Germany GmbH
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of ARM nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*---------------------------------------------------------------------------*/
/* Definitions */
#define INITIAL_xPSR 0x01000000
#define DEMCR_TRCENA 0x01000000
#define ITM_ITMENA 0x00000001
#define MAGIC_WORD 0xE25A2EA5
#if defined (__CC_ARM) /* ARM Compiler */
#if ((__TARGET_ARCH_7_M || __TARGET_ARCH_7E_M) && !NO_EXCLUSIVE_ACCESS)
#define __USE_EXCLUSIVE_ACCESS
#else
#undef __USE_EXCLUSIVE_ACCESS
#endif
#elif defined (__GNUC__) /* GNU Compiler */
#undef __USE_EXCLUSIVE_ACCESS
#if defined (__CORTEX_M0) || defined (__CORTEX_M0PLUS)
#define __TARGET_ARCH_6S_M 1
#else
#define __TARGET_ARCH_6S_M 0
#endif
#if defined (__VFP_FP__) && !defined(__SOFTFP__)
#define __TARGET_FPU_VFP 1
#else
#define __TARGET_FPU_VFP 0
#endif
#define __inline inline
#define __weak __attribute__((weak))
#ifndef __CMSIS_GENERIC
__attribute__((always_inline)) static inline void __enable_irq(void)
{
__asm volatile ("cpsie i");
}
__attribute__((always_inline)) static inline U32 __disable_irq(void)
{
U32 result;
__asm volatile ("mrs %0, primask" : "=r" (result));
__asm volatile ("cpsid i");
return(result & 1);
}
#endif
__attribute__(( always_inline)) static inline U8 __clz(U32 value)
{
U8 result;
__asm volatile ("clz %0, %1" : "=r" (result) : "r" (value));
return(result);
}
#elif defined (__ICCARM__) /* IAR Compiler */
#undef __USE_EXCLUSIVE_ACCESS
#if (__CORE__ == __ARM6M__)
#define __TARGET_ARCH_6S_M 1
#else
#define __TARGET_ARCH_6S_M 0
#endif
#if defined __ARMVFP__
#define __TARGET_FPU_VFP 1
#else
#define __TARGET_FPU_VFP 0
#endif
#define __inline inline
#ifndef __CMSIS_GENERIC
static inline void __enable_irq(void)
{
__asm volatile ("cpsie i");
}
static inline U32 __disable_irq(void)
{
U32 result;
__asm volatile ("mrs %0, primask" : "=r" (result));
__asm volatile ("cpsid i");
return(result & 1);
}
#endif
static inline U8 __clz(U32 value)
{
U8 result;
__asm volatile ("clz %0, %1" : "=r" (result) : "r" (value));
return(result);
}
#endif
/* NVIC registers */
#define NVIC_ST_CTRL (*((volatile U32 *)0xE000E010))
#define NVIC_ST_RELOAD (*((volatile U32 *)0xE000E014))
#define NVIC_ST_CURRENT (*((volatile U32 *)0xE000E018))
#define NVIC_ISER ((volatile U32 *)0xE000E100)
#define NVIC_ICER ((volatile U32 *)0xE000E180)
#if (__TARGET_ARCH_6S_M)
#define NVIC_IP ((volatile U32 *)0xE000E400)
#else
#define NVIC_IP ((volatile U8 *)0xE000E400)
#endif
#define NVIC_INT_CTRL (*((volatile U32 *)0xE000ED04))
#define NVIC_AIR_CTRL (*((volatile U32 *)0xE000ED0C))
#define NVIC_SYS_PRI2 (*((volatile U32 *)0xE000ED1C))
#define NVIC_SYS_PRI3 (*((volatile U32 *)0xE000ED20))
#define OS_PEND_IRQ() NVIC_INT_CTRL = (1<<28)
#define OS_PENDING ((NVIC_INT_CTRL >> 26) & (1<<2 | 1))
#define OS_UNPEND(fl) NVIC_INT_CTRL = (*fl = OS_PENDING) << 25
#define OS_PEND(fl,p) NVIC_INT_CTRL = (fl | p<<2) << 26
#define OS_LOCK() NVIC_ST_CTRL = 0x0005
#define OS_UNLOCK() NVIC_ST_CTRL = 0x0007
#define OS_X_PENDING ((NVIC_INT_CTRL >> 28) & 1)
#define OS_X_UNPEND(fl) NVIC_INT_CTRL = (*fl = OS_X_PENDING) << 27
#define OS_X_PEND(fl,p) NVIC_INT_CTRL = (fl | p) << 28
#if (__TARGET_ARCH_6S_M)
#define OS_X_INIT(n) NVIC_IP[n>>2] |= 0xFF << (8*(n & 0x03)); \
NVIC_ISER[n>>5] = 1 << (n & 0x1F)
#else
#define OS_X_INIT(n) NVIC_IP[n] = 0xFF; \
NVIC_ISER[n>>5] = 1 << (n & 0x1F)
#endif
#define OS_X_LOCK(n) NVIC_ICER[n>>5] = 1 << (n & 0x1F)
#define OS_X_UNLOCK(n) NVIC_ISER[n>>5] = 1 << (n & 0x1F)
/* Core Debug registers */
#define DEMCR (*((volatile U32 *)0xE000EDFC))
/* ITM registers */
#define ITM_CONTROL (*((volatile U32 *)0xE0000E80))
#define ITM_ENABLE (*((volatile U32 *)0xE0000E00))
#define ITM_PORT30_U32 (*((volatile U32 *)0xE0000078))
#define ITM_PORT31_U32 (*((volatile U32 *)0xE000007C))
#define ITM_PORT31_U16 (*((volatile U16 *)0xE000007C))
#define ITM_PORT31_U8 (*((volatile U8 *)0xE000007C))
/* Variables */
extern BIT dbg_msg;
/* Functions */
#ifdef __USE_EXCLUSIVE_ACCESS
#define rt_inc(p) while(__strex((__ldrex(p)+1),p))
#define rt_dec(p) while(__strex((__ldrex(p)-1),p))
#else
#define rt_inc(p) __disable_irq();(*p)++;__enable_irq();
#define rt_dec(p) __disable_irq();(*p)--;__enable_irq();
#endif
__inline static U32 rt_inc_qi (U32 size, U8 *count, U8 *first) {
U32 cnt,c2;
#ifdef __USE_EXCLUSIVE_ACCESS
do {
if ((cnt = __ldrex(count)) == size) {
__clrex();
return (cnt); }
} while (__strex(cnt+1, count));
do {
c2 = (cnt = __ldrex(first)) + 1;
if (c2 == size) c2 = 0;
} while (__strex(c2, first));
#else
__disable_irq();
if ((cnt = *count) < size) {
*count = cnt+1;
c2 = (cnt = *first) + 1;
if (c2 == size) c2 = 0;
*first = c2;
}
__enable_irq ();
#endif
return (cnt);
}
__inline static void rt_systick_init (void) {
NVIC_ST_RELOAD = os_trv;
NVIC_ST_CURRENT = 0;
NVIC_ST_CTRL = 0x0007;
NVIC_SYS_PRI3 |= 0xFF000000;
}
__inline static void rt_svc_init (void) {
#if !(__TARGET_ARCH_6S_M)
int sh,prigroup;
#endif
NVIC_SYS_PRI3 |= 0x00FF0000;
#if (__TARGET_ARCH_6S_M)
NVIC_SYS_PRI2 |= (NVIC_SYS_PRI3<<(8+1)) & 0xFC000000;
#else
sh = 8 - __clz (~((NVIC_SYS_PRI3 << 8) & 0xFF000000));
prigroup = ((NVIC_AIR_CTRL >> 8) & 0x07);
if (prigroup >= sh) {
sh = prigroup + 1;
}
NVIC_SYS_PRI2 = ((0xFEFFFFFF << sh) & 0xFF000000) | (NVIC_SYS_PRI2 & 0x00FFFFFF);
#endif
}
extern void rt_set_PSP (U32 stack);
extern U32 rt_get_PSP (void);
extern void os_set_env (void);
extern void *_alloc_box (void *box_mem);
extern int _free_box (void *box_mem, void *box);
extern void rt_init_stack (P_TCB p_TCB, FUNCP task_body);
extern void rt_ret_val (P_TCB p_TCB, U32 v0);
extern void rt_ret_val2 (P_TCB p_TCB, U32 v0, U32 v1);
extern void dbg_init (void);
extern void dbg_task_notify (P_TCB p_tcb, BOOL create);
extern void dbg_task_switch (U32 task_id);
#ifdef DBG_MSG
#define DBG_INIT() dbg_init()
#define DBG_TASK_NOTIFY(p_tcb,create) if (dbg_msg) dbg_task_notify(p_tcb,create)
#define DBG_TASK_SWITCH(task_id) if (dbg_msg && (os_tsk.new_tsk != os_tsk.run)) \
dbg_task_switch(task_id)
#else
#define DBG_INIT()
#define DBG_TASK_NOTIFY(p_tcb,create)
#define DBG_TASK_SWITCH(task_id)
#endif
/*----------------------------------------------------------------------------
* end of file
*---------------------------------------------------------------------------*/
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2006 Andras Kovacs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT
STRINGTABLE
{
IDS_FULLFRAMES "Teljes képkockák (tömörítetlen)"
}
ICM_CHOOSE_COMPRESSOR DIALOG 36, 24, 210, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Video tömörítés"
FONT 8, "MS Shell Dlg"
{
DEFPUSHBUTTON "OK",IDOK,154,2,52,14
PUSHBUTTON "Mégse",IDCANCEL,154,18,52,14
LTEXT "&Tömörítõ:",-1,9,6,135,8
COMBOBOX IDC_COMP_LIST,9,16,135,67,CBS_DROPDOWNLIST|WS_VSCROLL|WS_TABSTOP
PUSHBUTTON "Beállí&tás...",IDC_CONFIGURE,154,36,52,14
PUSHBUTTON "&About",IDC_ABOUT,154,52,52,14
SCROLLBAR IDC_QUALITY_SCROLL,9,44,135,10,WS_TABSTOP
LTEXT "Tömörítési minõsé&g:",IDC_QUALITY_TXT,9,34,135,8
CONTROL "&Kulcs képkocka minden",IDC_KEYFRAME_CHECKBOX,"Button",BS_AUTOCHECKBOX|WS_TABSTOP,9,60,86,12
EDITTEXT IDC_KEYFRAME,98,60,22,12
LTEXT "képkockánként",IDC_KEYFRAME_FRAMES,123,62,26,10
CONTROL "A&dat arány",IDC_DATARATE_CHECKBOX,"Button",BS_AUTOCHECKBOX|WS_TABSTOP,9,76,86,12
EDITTEXT IDC_DATARATE,98,76,22,12
LTEXT "KB/sec",IDC_DATARATE_KB,123,78,26,10
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2007 Freescale Semiconductor, Inc.
* Dave Liu <daveliu@freescale.com>
*
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef __CONFIG_H
#define __CONFIG_H
/*
* High Level Configuration Options
*/
#define CONFIG_E300 1 /* E300 family */
#define CONFIG_MPC837x 1 /* MPC837x CPU specific */
#define CONFIG_MPC837XEMDS 1 /* MPC837XEMDS board specific */
#define CONFIG_SYS_TEXT_BASE 0xFE000000
/*
* System Clock Setup
*/
#ifdef CONFIG_PCISLAVE
#define CONFIG_83XX_PCICLK 66000000 /* in HZ */
#else
#define CONFIG_83XX_CLKIN 66000000 /* in Hz */
#endif
#ifndef CONFIG_SYS_CLK_FREQ
#define CONFIG_SYS_CLK_FREQ 66000000
#endif
/*
* Hardware Reset Configuration Word
* if CLKIN is 66MHz, then
* CSB = 396MHz, CORE = 594MHz, DDRC = 396MHz, LBC = 396MHz
*/
#define CONFIG_SYS_HRCW_LOW (\
HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\
HRCWL_DDR_TO_SCB_CLK_1X1 |\
HRCWL_SVCOD_DIV_2 |\
HRCWL_CSB_TO_CLKIN_6X1 |\
HRCWL_CORE_TO_CSB_1_5X1)
#ifdef CONFIG_PCISLAVE
#define CONFIG_SYS_HRCW_HIGH (\
HRCWH_PCI_AGENT |\
HRCWH_PCI1_ARBITER_DISABLE |\
HRCWH_CORE_ENABLE |\
HRCWH_FROM_0XFFF00100 |\
HRCWH_BOOTSEQ_DISABLE |\
HRCWH_SW_WATCHDOG_DISABLE |\
HRCWH_ROM_LOC_LOCAL_16BIT |\
HRCWH_RL_EXT_LEGACY |\
HRCWH_TSEC1M_IN_RGMII |\
HRCWH_TSEC2M_IN_RGMII |\
HRCWH_BIG_ENDIAN |\
HRCWH_LDP_CLEAR)
#else
#define CONFIG_SYS_HRCW_HIGH (\
HRCWH_PCI_HOST |\
HRCWH_PCI1_ARBITER_ENABLE |\
HRCWH_CORE_ENABLE |\
HRCWH_FROM_0X00000100 |\
HRCWH_BOOTSEQ_DISABLE |\
HRCWH_SW_WATCHDOG_DISABLE |\
HRCWH_ROM_LOC_LOCAL_16BIT |\
HRCWH_RL_EXT_LEGACY |\
HRCWH_TSEC1M_IN_RGMII |\
HRCWH_TSEC2M_IN_RGMII |\
HRCWH_BIG_ENDIAN |\
HRCWH_LDP_CLEAR)
#endif
/* Arbiter Configuration Register */
#define CONFIG_SYS_ACR_PIPE_DEP 3 /* Arbiter pipeline depth is 4 */
#define CONFIG_SYS_ACR_RPTCNT 3 /* Arbiter repeat count is 4 */
/* System Priority Control Register */
#define CONFIG_SYS_SPCR_TSECEP 3 /* eTSEC1/2 emergency has highest priority */
/*
* IP blocks clock configuration
*/
#define CONFIG_SYS_SCCR_TSEC1CM 1 /* CSB:eTSEC1 = 1:1 */
#define CONFIG_SYS_SCCR_TSEC2CM 1 /* CSB:eTSEC2 = 1:1 */
#define CONFIG_SYS_SCCR_SATACM SCCR_SATACM_2 /* CSB:SATA[0:3] = 2:1 */
/*
* System IO Config
*/
#define CONFIG_SYS_SICRH 0x00000000
#define CONFIG_SYS_SICRL 0x00000000
/*
* Output Buffer Impedance
*/
#define CONFIG_SYS_OBIR 0x31100000
#define CONFIG_BOARD_EARLY_INIT_R
#define CONFIG_HWCONFIG
/*
* IMMR new address
*/
#define CONFIG_SYS_IMMR 0xE0000000
/*
* DDR Setup
*/
#define CONFIG_SYS_DDR_BASE 0x00000000 /* DDR is system memory */
#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE
#define CONFIG_SYS_DDR_SDRAM_BASE CONFIG_SYS_DDR_BASE
#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05
#define CONFIG_SYS_83XX_DDR_USES_CS0
#define CONFIG_SYS_DDRCDR_VALUE (DDRCDR_DHC_EN \
| DDRCDR_ODT \
| DDRCDR_Q_DRN)
/* 0x80080001 */ /* ODT 150ohm on SoC */
#undef CONFIG_DDR_ECC /* support DDR ECC function */
#undef CONFIG_DDR_ECC_CMD /* Use DDR ECC user commands */
#define CONFIG_SPD_EEPROM /* Use SPD EEPROM for DDR setup */
#define CONFIG_NEVER_ASSERT_ODT_TO_CPU /* Never assert ODT to internal IOs */
#if defined(CONFIG_SPD_EEPROM)
#define SPD_EEPROM_ADDRESS 0x51 /* I2C address of DDR SODIMM SPD */
#else
/*
* Manually set up DDR parameters
* WHITE ELECTRONIC DESIGNS - W3HG64M72EEU403PD4 SO-DIMM
* consist of nine chips from SAMSUNG K4T51083QE-ZC(L)D5
*/
#define CONFIG_SYS_DDR_SIZE 512 /* MB */
#define CONFIG_SYS_DDR_CS0_BNDS 0x0000001f
#define CONFIG_SYS_DDR_CS0_CONFIG (CSCONFIG_EN \
| CSCONFIG_ODT_RD_NEVER /* ODT_RD to none */ \
| CSCONFIG_ODT_WR_ONLY_CURRENT /* ODT_WR to CSn */ \
| CSCONFIG_ROW_BIT_14 \
| CSCONFIG_COL_BIT_10)
/* 0x80010202 */
#define CONFIG_SYS_DDR_TIMING_3 0x00000000
#define CONFIG_SYS_DDR_TIMING_0 ((0 << TIMING_CFG0_RWT_SHIFT) \
| (0 << TIMING_CFG0_WRT_SHIFT) \
| (0 << TIMING_CFG0_RRT_SHIFT) \
| (0 << TIMING_CFG0_WWT_SHIFT) \
| (6 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) \
| (2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) \
| (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) \
| (2 << TIMING_CFG0_MRS_CYC_SHIFT))
/* 0x00620802 */
#define CONFIG_SYS_DDR_TIMING_1 ((3 << TIMING_CFG1_PRETOACT_SHIFT) \
| (9 << TIMING_CFG1_ACTTOPRE_SHIFT) \
| (3 << TIMING_CFG1_ACTTORW_SHIFT) \
| (5 << TIMING_CFG1_CASLAT_SHIFT) \
| (13 << TIMING_CFG1_REFREC_SHIFT) \
| (3 << TIMING_CFG1_WRREC_SHIFT) \
| (2 << TIMING_CFG1_ACTTOACT_SHIFT) \
| (2 << TIMING_CFG1_WRTORD_SHIFT))
/* 0x3935d322 */
#define CONFIG_SYS_DDR_TIMING_2 ((1 << TIMING_CFG2_ADD_LAT_SHIFT) \
| (6 << TIMING_CFG2_CPO_SHIFT) \
| (2 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) \
| (4 << TIMING_CFG2_RD_TO_PRE_SHIFT) \
| (2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) \
| (3 << TIMING_CFG2_CKE_PLS_SHIFT) \
| (8 << TIMING_CFG2_FOUR_ACT_SHIFT))
/* 0x131088c8 */
#define CONFIG_SYS_DDR_INTERVAL ((0x03E0 << SDRAM_INTERVAL_REFINT_SHIFT) \
| (0x0100 << SDRAM_INTERVAL_BSTOPRE_SHIFT))
/* 0x03E00100 */
#define CONFIG_SYS_DDR_SDRAM_CFG 0x43000000
#define CONFIG_SYS_DDR_SDRAM_CFG2 0x00001000 /* 1 posted refresh */
#define CONFIG_SYS_DDR_MODE ((0x0448 << SDRAM_MODE_ESD_SHIFT) \
| (0x1432 << SDRAM_MODE_SD_SHIFT))
/* ODT 150ohm CL=3, AL=1 on SDRAM */
#define CONFIG_SYS_DDR_MODE2 0x00000000
#endif
/*
* Memory test
*/
#undef CONFIG_SYS_DRAM_TEST /* memory test, takes time */
#define CONFIG_SYS_MEMTEST_START 0x00040000 /* memtest region */
#define CONFIG_SYS_MEMTEST_END 0x00140000
/*
* The reserved memory
*/
#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
#define CONFIG_SYS_RAMBOOT
#else
#undef CONFIG_SYS_RAMBOOT
#endif
/* CONFIG_SYS_MONITOR_LEN must be a multiple of CONFIG_ENV_SECT_SIZE */
#define CONFIG_SYS_MONITOR_LEN (512 * 1024) /* Reserve 512 kB for Mon */
#define CONFIG_SYS_MALLOC_LEN (512 * 1024) /* Reserved for malloc */
/*
* Initial RAM Base Address Setup
*/
#define CONFIG_SYS_INIT_RAM_LOCK 1
#define CONFIG_SYS_INIT_RAM_ADDR 0xE6000000 /* Initial RAM address */
#define CONFIG_SYS_INIT_RAM_SIZE 0x1000 /* Size of used area in RAM */
#define CONFIG_SYS_GBL_DATA_OFFSET \
(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
/*
* Local Bus Configuration & Clock Setup
*/
#define CONFIG_SYS_LCRR_DBYP LCRR_DBYP
#define CONFIG_SYS_LCRR_CLKDIV LCRR_CLKDIV_8
#define CONFIG_SYS_LBC_LBCR 0x00000000
#define CONFIG_FSL_ELBC 1
/*
* FLASH on the Local Bus
*/
#define CONFIG_SYS_FLASH_CFI /* use the Common Flash Interface */
#define CONFIG_FLASH_CFI_DRIVER /* use the CFI driver */
#define CONFIG_SYS_FLASH_BASE 0xFE000000 /* FLASH base address */
#define CONFIG_SYS_FLASH_SIZE 32 /* max FLASH size is 32M */
#define CONFIG_SYS_FLASH_PROTECTION 1 /* Use h/w Flash protection. */
/* Window base at flash base */
#define CONFIG_SYS_LBLAWBAR0_PRELIM CONFIG_SYS_FLASH_BASE
#define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_32MB)
#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE \
| BR_PS_16 /* 16 bit port */ \
| BR_MS_GPCM /* MSEL = GPCM */ \
| BR_V) /* valid */
#define CONFIG_SYS_OR0_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
| OR_UPM_XAM \
| OR_GPCM_CSNT \
| OR_GPCM_ACS_DIV2 \
| OR_GPCM_XACS \
| OR_GPCM_SCY_15 \
| OR_GPCM_TRLX_SET \
| OR_GPCM_EHTR_SET \
| OR_GPCM_EAD)
/* 0xFE000FF7 */
#define CONFIG_SYS_MAX_FLASH_BANKS 1 /* number of banks */
#define CONFIG_SYS_MAX_FLASH_SECT 256 /* max sectors per device */
#undef CONFIG_SYS_FLASH_CHECKSUM
#define CONFIG_SYS_FLASH_ERASE_TOUT 60000 /* Flash Erase Timeout (ms) */
#define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (ms) */
/*
* BCSR on the Local Bus
*/
#define CONFIG_SYS_BCSR 0xF8000000
/* Access window base at BCSR base */
#define CONFIG_SYS_LBLAWBAR1_PRELIM CONFIG_SYS_BCSR
#define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_32KB)
#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_BCSR \
| BR_PS_8 \
| BR_MS_GPCM \
| BR_V)
/* 0xF8000801 */
#define CONFIG_SYS_OR1_PRELIM (OR_AM_32KB \
| OR_GPCM_XAM \
| OR_GPCM_CSNT \
| OR_GPCM_XACS \
| OR_GPCM_SCY_15 \
| OR_GPCM_TRLX_SET \
| OR_GPCM_EHTR_SET \
| OR_GPCM_EAD)
/* 0xFFFFE9F7 */
/*
* NAND Flash on the Local Bus
*/
#define CONFIG_SYS_MAX_NAND_DEVICE 1
#define CONFIG_NAND_FSL_ELBC 1
#define CONFIG_SYS_NAND_BASE 0xE0600000
#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_NAND_BASE \
| BR_DECC_CHK_GEN /* Use HW ECC */ \
| BR_PS_8 /* 8 bit port */ \
| BR_MS_FCM /* MSEL = FCM */ \
| BR_V) /* valid */
#define CONFIG_SYS_OR3_PRELIM (OR_AM_32KB \
| OR_FCM_BCTLD \
| OR_FCM_CST \
| OR_FCM_CHT \
| OR_FCM_SCY_1 \
| OR_FCM_RST \
| OR_FCM_TRLX \
| OR_FCM_EHTR)
/* 0xFFFF919E */
#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_NAND_BASE
#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_32KB)
/*
* Serial Port
*/
#define CONFIG_CONS_INDEX 1
#define CONFIG_SYS_NS16550_SERIAL
#define CONFIG_SYS_NS16550_REG_SIZE 1
#define CONFIG_SYS_NS16550_CLK get_bus_freq(0)
#define CONFIG_SYS_BAUDRATE_TABLE \
{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR+0x4500)
#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR+0x4600)
/* I2C */
#define CONFIG_SYS_I2C
#define CONFIG_SYS_I2C_FSL
#define CONFIG_SYS_FSL_I2C_SPEED 400000
#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
#define CONFIG_SYS_FSL_I2C_OFFSET 0x3000
#define CONFIG_SYS_I2C_NOPROBES { {0, 0x51} }
/*
* Config on-board RTC
*/
#define CONFIG_RTC_DS1374 /* use ds1374 rtc via i2c */
#define CONFIG_SYS_I2C_RTC_ADDR 0x68 /* at address 0x68 */
/*
* General PCI
* Addresses are mapped 1-1.
*/
#define CONFIG_SYS_PCI_MEM_BASE 0x80000000
#define CONFIG_SYS_PCI_MEM_PHYS CONFIG_SYS_PCI_MEM_BASE
#define CONFIG_SYS_PCI_MEM_SIZE 0x10000000 /* 256M */
#define CONFIG_SYS_PCI_MMIO_BASE 0x90000000
#define CONFIG_SYS_PCI_MMIO_PHYS CONFIG_SYS_PCI_MMIO_BASE
#define CONFIG_SYS_PCI_MMIO_SIZE 0x10000000 /* 256M */
#define CONFIG_SYS_PCI_IO_BASE 0x00000000
#define CONFIG_SYS_PCI_IO_PHYS 0xE0300000
#define CONFIG_SYS_PCI_IO_SIZE 0x100000 /* 1M */
#define CONFIG_SYS_PCI_SLV_MEM_LOCAL CONFIG_SYS_SDRAM_BASE
#define CONFIG_SYS_PCI_SLV_MEM_BUS 0x00000000
#define CONFIG_SYS_PCI_SLV_MEM_SIZE 0x80000000
#define CONFIG_SYS_PCIE1_BASE 0xA0000000
#define CONFIG_SYS_PCIE1_CFG_BASE 0xA0000000
#define CONFIG_SYS_PCIE1_CFG_SIZE 0x08000000
#define CONFIG_SYS_PCIE1_MEM_BASE 0xA8000000
#define CONFIG_SYS_PCIE1_MEM_PHYS 0xA8000000
#define CONFIG_SYS_PCIE1_MEM_SIZE 0x10000000
#define CONFIG_SYS_PCIE1_IO_BASE 0x00000000
#define CONFIG_SYS_PCIE1_IO_PHYS 0xB8000000
#define CONFIG_SYS_PCIE1_IO_SIZE 0x00800000
#define CONFIG_SYS_PCIE2_BASE 0xC0000000
#define CONFIG_SYS_PCIE2_CFG_BASE 0xC0000000
#define CONFIG_SYS_PCIE2_CFG_SIZE 0x08000000
#define CONFIG_SYS_PCIE2_MEM_BASE 0xC8000000
#define CONFIG_SYS_PCIE2_MEM_PHYS 0xC8000000
#define CONFIG_SYS_PCIE2_MEM_SIZE 0x10000000
#define CONFIG_SYS_PCIE2_IO_BASE 0x00000000
#define CONFIG_SYS_PCIE2_IO_PHYS 0xD8000000
#define CONFIG_SYS_PCIE2_IO_SIZE 0x00800000
#ifdef CONFIG_PCI
#define CONFIG_PCI_INDIRECT_BRIDGE
#ifndef __ASSEMBLY__
extern int board_pci_host_broken(void);
#endif
#define CONFIG_PCIE
#define CONFIG_PQ_MDS_PIB 1 /* PQ MDS Platform IO Board */
#define CONFIG_HAS_FSL_DR_USB 1 /* fixup device tree for the DR USB */
#define CONFIG_USB_EHCI_FSL
#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
#undef CONFIG_EEPRO100
#undef CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */
#define CONFIG_SYS_PCI_SUBSYS_VENDORID 0x1957 /* Freescale */
#endif /* CONFIG_PCI */
/*
* TSEC
*/
#define CONFIG_TSEC_ENET /* TSEC ethernet support */
#define CONFIG_SYS_TSEC1_OFFSET 0x24000
#define CONFIG_SYS_TSEC1 (CONFIG_SYS_IMMR+CONFIG_SYS_TSEC1_OFFSET)
#define CONFIG_SYS_TSEC2_OFFSET 0x25000
#define CONFIG_SYS_TSEC2 (CONFIG_SYS_IMMR+CONFIG_SYS_TSEC2_OFFSET)
/*
* TSEC ethernet configuration
*/
#define CONFIG_MII 1 /* MII PHY management */
#define CONFIG_TSEC1 1
#define CONFIG_TSEC1_NAME "eTSEC0"
#define CONFIG_TSEC2 1
#define CONFIG_TSEC2_NAME "eTSEC1"
#define TSEC1_PHY_ADDR 2
#define TSEC2_PHY_ADDR 3
#define TSEC1_PHY_ADDR_SGMII 8
#define TSEC2_PHY_ADDR_SGMII 4
#define TSEC1_PHYIDX 0
#define TSEC2_PHYIDX 0
#define TSEC1_FLAGS (TSEC_GIGABIT | TSEC_REDUCED)
#define TSEC2_FLAGS (TSEC_GIGABIT | TSEC_REDUCED)
/* Options are: TSEC[0-1] */
#define CONFIG_ETHPRIME "eTSEC1"
/* SERDES */
#define CONFIG_FSL_SERDES
#define CONFIG_FSL_SERDES1 0xe3000
#define CONFIG_FSL_SERDES2 0xe3100
/*
* SATA
*/
#define CONFIG_LIBATA
#define CONFIG_FSL_SATA
#define CONFIG_SYS_SATA_MAX_DEVICE 2
#define CONFIG_SATA1
#define CONFIG_SYS_SATA1_OFFSET 0x18000
#define CONFIG_SYS_SATA1 (CONFIG_SYS_IMMR + CONFIG_SYS_SATA1_OFFSET)
#define CONFIG_SYS_SATA1_FLAGS FLAGS_DMA
#define CONFIG_SATA2
#define CONFIG_SYS_SATA2_OFFSET 0x19000
#define CONFIG_SYS_SATA2 (CONFIG_SYS_IMMR + CONFIG_SYS_SATA2_OFFSET)
#define CONFIG_SYS_SATA2_FLAGS FLAGS_DMA
#ifdef CONFIG_FSL_SATA
#define CONFIG_LBA48
#endif
/*
* Environment
*/
#ifndef CONFIG_SYS_RAMBOOT
#define CONFIG_ENV_ADDR \
(CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)
#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K(one sector) for env */
#define CONFIG_ENV_SIZE 0x2000
#else
#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
#define CONFIG_ENV_SIZE 0x2000
#endif
#define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
#define CONFIG_SYS_LOADS_BAUD_CHANGE 1 /* allow baudrate change */
/*
* BOOTP options
*/
#define CONFIG_BOOTP_BOOTFILESIZE
#define CONFIG_BOOTP_BOOTPATH
#define CONFIG_BOOTP_GATEWAY
#define CONFIG_BOOTP_HOSTNAME
/*
* Command line configuration.
*/
#define CONFIG_CMDLINE_EDITING 1 /* add command line history */
#define CONFIG_AUTO_COMPLETE /* add autocompletion support */
#undef CONFIG_WATCHDOG /* watchdog disabled */
#ifdef CONFIG_MMC
#define CONFIG_FSL_ESDHC
#define CONFIG_FSL_ESDHC_PIN_MUX
#define CONFIG_SYS_FSL_ESDHC_ADDR CONFIG_SYS_MPC83xx_ESDHC_ADDR
#endif
/*
* Miscellaneous configurable options
*/
#define CONFIG_SYS_LONGHELP /* undef to save memory */
#define CONFIG_SYS_LOAD_ADDR 0x2000000 /* default load address */
/*
* For booting Linux, the board info and command line data
* have to be in the first 256 MB of memory, since this is
* the maximum mapped by the Linux kernel during initialization.
*/
#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Initial Memory map for Linux */
#define CONFIG_SYS_BOOTM_LEN (64 << 20) /* Increase max gunzip size */
/*
* Core HID Setup
*/
#define CONFIG_SYS_HID0_INIT 0x000000000
#define CONFIG_SYS_HID0_FINAL (HID0_ENABLE_MACHINE_CHECK | \
HID0_ENABLE_INSTRUCTION_CACHE)
#define CONFIG_SYS_HID2 HID2_HBE
/*
* MMU Setup
*/
#define CONFIG_HIGH_BATS 1 /* High BATs supported */
/* DDR: cache cacheable */
#define CONFIG_SYS_SDRAM_LOWER CONFIG_SYS_SDRAM_BASE
#define CONFIG_SYS_SDRAM_UPPER (CONFIG_SYS_SDRAM_BASE + 0x10000000)
#define CONFIG_SYS_IBAT0L (CONFIG_SYS_SDRAM_LOWER \
| BATL_PP_RW \
| BATL_MEMCOHERENCE)
#define CONFIG_SYS_IBAT0U (CONFIG_SYS_SDRAM_LOWER \
| BATU_BL_256M \
| BATU_VS \
| BATU_VP)
#define CONFIG_SYS_DBAT0L CONFIG_SYS_IBAT0L
#define CONFIG_SYS_DBAT0U CONFIG_SYS_IBAT0U
#define CONFIG_SYS_IBAT1L (CONFIG_SYS_SDRAM_UPPER \
| BATL_PP_RW \
| BATL_MEMCOHERENCE)
#define CONFIG_SYS_IBAT1U (CONFIG_SYS_SDRAM_UPPER \
| BATU_BL_256M \
| BATU_VS \
| BATU_VP)
#define CONFIG_SYS_DBAT1L CONFIG_SYS_IBAT1L
#define CONFIG_SYS_DBAT1U CONFIG_SYS_IBAT1U
/* IMMRBAR, PCI IO and NAND: cache-inhibit and guarded */
#define CONFIG_SYS_IBAT2L (CONFIG_SYS_IMMR \
| BATL_PP_RW \
| BATL_CACHEINHIBIT \
| BATL_GUARDEDSTORAGE)
#define CONFIG_SYS_IBAT2U (CONFIG_SYS_IMMR \
| BATU_BL_8M \
| BATU_VS \
| BATU_VP)
#define CONFIG_SYS_DBAT2L CONFIG_SYS_IBAT2L
#define CONFIG_SYS_DBAT2U CONFIG_SYS_IBAT2U
/* BCSR: cache-inhibit and guarded */
#define CONFIG_SYS_IBAT3L (CONFIG_SYS_BCSR \
| BATL_PP_RW \
| BATL_CACHEINHIBIT \
| BATL_GUARDEDSTORAGE)
#define CONFIG_SYS_IBAT3U (CONFIG_SYS_BCSR \
| BATU_BL_128K \
| BATU_VS \
| BATU_VP)
#define CONFIG_SYS_DBAT3L CONFIG_SYS_IBAT3L
#define CONFIG_SYS_DBAT3U CONFIG_SYS_IBAT3U
/* FLASH: icache cacheable, but dcache-inhibit and guarded */
#define CONFIG_SYS_IBAT4L (CONFIG_SYS_FLASH_BASE \
| BATL_PP_RW \
| BATL_MEMCOHERENCE)
#define CONFIG_SYS_IBAT4U (CONFIG_SYS_FLASH_BASE \
| BATU_BL_32M \
| BATU_VS \
| BATU_VP)
#define CONFIG_SYS_DBAT4L (CONFIG_SYS_FLASH_BASE \
| BATL_PP_RW \
| BATL_CACHEINHIBIT \
| BATL_GUARDEDSTORAGE)
#define CONFIG_SYS_DBAT4U CONFIG_SYS_IBAT4U
/* Stack in dcache: cacheable, no memory coherence */
#define CONFIG_SYS_IBAT5L (CONFIG_SYS_INIT_RAM_ADDR | BATL_PP_RW)
#define CONFIG_SYS_IBAT5U (CONFIG_SYS_INIT_RAM_ADDR \
| BATU_BL_128K \
| BATU_VS \
| BATU_VP)
#define CONFIG_SYS_DBAT5L CONFIG_SYS_IBAT5L
#define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
#ifdef CONFIG_PCI
/* PCI MEM space: cacheable */
#define CONFIG_SYS_IBAT6L (CONFIG_SYS_PCI_MEM_PHYS \
| BATL_PP_RW \
| BATL_MEMCOHERENCE)
#define CONFIG_SYS_IBAT6U (CONFIG_SYS_PCI_MEM_PHYS \
| BATU_BL_256M \
| BATU_VS \
| BATU_VP)
#define CONFIG_SYS_DBAT6L CONFIG_SYS_IBAT6L
#define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
/* PCI MMIO space: cache-inhibit and guarded */
#define CONFIG_SYS_IBAT7L (CONFIG_SYS_PCI_MMIO_PHYS \
| BATL_PP_RW \
| BATL_CACHEINHIBIT \
| BATL_GUARDEDSTORAGE)
#define CONFIG_SYS_IBAT7U (CONFIG_SYS_PCI_MMIO_PHYS \
| BATU_BL_256M \
| BATU_VS \
| BATU_VP)
#define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
#define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
#else
#define CONFIG_SYS_IBAT6L (0)
#define CONFIG_SYS_IBAT6U (0)
#define CONFIG_SYS_IBAT7L (0)
#define CONFIG_SYS_IBAT7U (0)
#define CONFIG_SYS_DBAT6L CONFIG_SYS_IBAT6L
#define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
#define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
#define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
#endif
#if defined(CONFIG_CMD_KGDB)
#define CONFIG_KGDB_BAUDRATE 230400 /* speed of kgdb serial port */
#endif
/*
* Environment Configuration
*/
#define CONFIG_ENV_OVERWRITE
#if defined(CONFIG_TSEC_ENET)
#define CONFIG_HAS_ETH0
#define CONFIG_HAS_ETH1
#endif
#define CONFIG_LOADADDR 800000 /* default location for tftp and bootm */
#define CONFIG_EXTRA_ENV_SETTINGS \
"netdev=eth0\0" \
"consoledev=ttyS0\0" \
"ramdiskaddr=1000000\0" \
"ramdiskfile=ramfs.83xx\0" \
"fdtaddr=780000\0" \
"fdtfile=mpc8379_mds.dtb\0" \
""
#define CONFIG_NFSBOOTCOMMAND \
"setenv bootargs root=/dev/nfs rw " \
"nfsroot=$serverip:$rootpath " \
"ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:" \
"$netdev:off " \
"console=$consoledev,$baudrate $othbootargs;" \
"tftp $loadaddr $bootfile;" \
"tftp $fdtaddr $fdtfile;" \
"bootm $loadaddr - $fdtaddr"
#define CONFIG_RAMBOOTCOMMAND \
"setenv bootargs root=/dev/ram rw " \
"console=$consoledev,$baudrate $othbootargs;" \
"tftp $ramdiskaddr $ramdiskfile;" \
"tftp $loadaddr $bootfile;" \
"tftp $fdtaddr $fdtfile;" \
"bootm $loadaddr $ramdiskaddr $fdtaddr"
#define CONFIG_BOOTCOMMAND CONFIG_NFSBOOTCOMMAND
#endif /* __CONFIG_H */
|
{
"pile_set_name": "Github"
}
|
/*
** cpu.c ARM cpu-description file
** (c) in 2004,2006,2010,2011 by Frank Wille
*/
#include "vasm.h"
mnemonic mnemonics[] = {
#include "opcodes.h"
};
int mnemonic_cnt = sizeof(mnemonics)/sizeof(mnemonics[0]);
char *cpu_copyright = "vasm ARM cpu backend 0.2f (c) 2004,2006,2010,2011 Frank Wille";
char *cpuname = "ARM";
int bitsperbyte = 8;
int bytespertaddr = 4;
uint32_t cpu_type = AAANY;
int arm_be_mode = 0; /* Little-endian is default */
int thumb_mode = 0; /* 1: Thumb instruction set (16 bit) is active */
/* options */
static unsigned char opt_ldrpc = 0; /* LDR r,sym -> ADD / LDR */
static unsigned char opt_adr = 0; /* ADR r,sym -> ADRL (ADD/ADD|SUB/SUB) */
/* constant data */
static const char *condition_codes = "eqnecsccmiplvsvchilsgeltgtlealnvhsloul";
static const char *addrmode_strings[] = {
"da","ia","db","ib",
"fa","fd","ea","ed",
"bt","tb","sb","sh","t","b","h","s","l",NULL,"<none>"
};
enum {
AM_DA=0,AM_IA,AM_DB,AM_IB,AM_FA,AM_FD,AM_EA,AM_ED,
AM_BT,AM_TB,AM_SB,AM_SH,AM_T,AM_B,AM_H,AM_S,AM_L,AM_NULL,AM_NONE
};
#define NUM_SHIFTTYPES 6
static const char *shift_strings[NUM_SHIFTTYPES] = {
"LSL","LSR","ASR","ROR","RRX","ASL"
};
static int OC_SWP,OC_NOP;
static int elfoutput = 0; /* output will be an ELF object file */
static hashtable *regsymhash; /* hash-table for ARM register symbols */
static section *last_section = 0;
static int last_data_type = -1; /* for mapping symbol generation */
#define TYPE_ARM 0
#define TYPE_THUMB 1
#define TYPE_DATA 2
#define THB_PREFETCH 4 /* prefetch-correction for Thumb-branches */
#define ARM_PREFETCH 8 /* prefetch-correction for ARM-branches */
operand *new_operand(void)
{
return mycalloc(sizeof(operand));
}
int cpu_available(int idx)
{
return (mnemonics[idx].ext.available & cpu_type) != 0;
}
static int addregsym(char *sym,int val)
/* add a new register symbol, return 0 if already exists */
{
hashdata data;
regsym *new;
if (find_name_nc(regsymhash,sym,&data))
return 0;
data.ptr = new = mymalloc(sizeof(regsym));
new->name = mymalloc(strlen(sym)+1);
strcpy(new->name,sym);
new->value = val;
add_hashentry(regsymhash,new->name,data);
return 1;
}
char *parse_cpu_special(char *start)
/* parse cpu-specific directives; return pointer to end of
cpu-specific text */
{
char *name=start,*s=start;
if (ISIDSTART(*s)) {
s++;
while (ISIDCHAR(*s))
s++;
if (s-name==6 && !strncmp(name,".thumb",6)) {
thumb_mode = 1;
return s;
}
else if (s-name==4 && !strncmp(name,".arm",4)) {
thumb_mode = 0;
return s;
}
}
return start;
}
char *parse_instruction(char *s,int *inst_len,char **ext,int *ext_len,
int *ext_cnt)
/* parse instruction and save extension locations */
{
char *inst = s;
int cnt = *ext_cnt;
while (*s && !isspace((unsigned char)*s))
s++;
if (thumb_mode) { /* no qualifiers in THUMB code */
*inst_len = s - inst;
}
else { /* ARM mode - we might have up to 2 different qualifiers */
int len = s - inst;
if (len > 2) {
if (*inst=='b' && strncmp(inst,"bic",3) && (len==3 || len==4)) {
*inst_len = len - 2;
}
else if ((*inst=='u' || *inst=='s') && *(inst+1)=='m' && len>=5) {
*inst_len = 5;
}
else
*inst_len = 3;
len -= *inst_len;
if (len > 0) {
char *p = inst + *inst_len;
if (len >= 2) {
const char *cc = condition_codes;
while (*cc) {
if (*p==*cc && *(p+1)==*(cc+1))
break;
cc += 2;
}
if (*cc) { /* matched against a condition code */
ext[cnt] = p;
ext_len[cnt++] = 2;
p += 2;
len -= 2;
}
}
if (len >= 1) {
const char **am = addrmode_strings;
do {
if (len==strlen(*am) && !strncmp(*am,p,len))
break;
am++;
}
while (*am);
if (*am!=NULL || (len==1 && *p=='s')) {
ext[cnt] = p;
ext_len[cnt++] = len;
}
}
}
else if (len < 0)
ierror(0);
}
else
*inst_len = len;
*ext_cnt = cnt;
}
return s;
}
int set_default_qualifiers(char **q,int *q_len)
/* fill in pointers to default qualifiers, return number of qualifiers */
{
return 0;
}
static int parse_reg(char **pp)
/* parse register, return -1 on error */
{
hashdata data;
char *p = *pp;
char *name = p;
if (ISIDSTART(*p)) {
p++;
while (ISIDCHAR(*p))
p++;
if (find_namelen_nc(regsymhash,name,p-name,&data)) {
regsym *sym = data.ptr;
*pp = p;
return sym->value;
}
}
return -1; /* no valid register found */
}
static int parse_reglist(char **pp)
/* parse register-list, return -1 on error */
{
hashdata data;
int r=0,list=0,lastreg=-1;
char *p = *pp;
char *name;
regsym *sym;
if (*p++ == '{') {
p = skip(p);
do {
if (ISIDSTART(*p)) {
name = p++;
while (ISIDCHAR(*p))
p++;
if (find_namelen_nc(regsymhash,name,p-name,&data)) {
sym = data.ptr;
r = sym->value;
if (lastreg >= 0) { /* range-mode? */
if (lastreg < r) {
r = lastreg;
lastreg = sym->value;
}
for (; r<=lastreg; list |= 1<<r++);
}
else
list |= 1<<r;
p = skip(p);
}
else
return -1;
}
if (*p == ',') {
lastreg = -1;
p = skip(p+1);
}
else if (*p == '-') {
lastreg = r;
p = skip(p+1);
}
}
while (*p!='\0' && *p!='}');
if (*p) {
*pp = ++p;
return list;
}
}
return -1;
}
int parse_operand(char *p,int len,operand *op,int optype)
/* Parses operands, reads expressions and assigns relocation types */
{
char *start = p;
op->type = optype;
op->flags = 0;
op->value = NULL;
p = skip(p);
if (thumb_mode) {
if (ARMOPER(optype)) { /* standard ARM instruction */
return PO_NOMATCH;
}
else if (THREGOPER(optype)) {
/* parse a register */
int r;
if (optype==TR5IN || optype==TPCPR || optype==TSPPR) {
if (*p++ != '[')
return PO_NOMATCH;
p = skip(p);
}
if ((r = parse_reg(&p)) < 0)
return PO_NOMATCH;
op->value = number_expr((taddr)r);
if ((optype==TPCRG || optype==TPCPR) && r!=15) {
return PO_NOMATCH;
}
else if ((optype==TSPRG || optype==TSPPR) && r!=13) {
return PO_NOMATCH;
}
else if (optype==THR02 || optype==THR05) {
if (r<8 || r>15)
return PO_NOMATCH;
}
else {
if (r<0 || r>7)
return PO_NOMATCH;
}
if (optype == TR8IN) {
p = skip(p);
if (*p++ != ']')
return PO_NOMATCH;
}
else if (optype == TR10W) {
if (*p++ != '!')
return PO_NOMATCH;
}
}
else if (THREGLIST(optype)) {
taddr list = parse_reglist(&p);
if (optype == TRLST) {
if (list & ~0xff)
return PO_NOMATCH; /* only r0-r7 allowed */
}
else {
if ((list&0x8000) && optype==TRLPC) {
list = list&~0x8000 | 0x100;
}
else if ((list&0x4000) && optype==TRLLR) {
list = list&~0x4000 | 0x100;
}
if (list & ~0x1ff)
return PO_NOMATCH; /* only r0-r7 / pc / lr allowed */
}
op->value = number_expr(list);
}
else { /* just parse an expression */
char *q;
if (THIMMOPER(optype)) {
if (*p++ != '#')
return PO_NOMATCH;
p = skip(p);
}
q = p;
if (*q=='+' || *q=='-')
q = skip(q+1);
if (!ISIDSTART(*q) && !isdigit((unsigned char)*q))
return PO_NOMATCH;
op->value = parse_expr(&p);
if (THIMMINDIR(optype)) {
p = skip(p);
if (*p++ != ']')
return PO_NOMATCH;
}
}
}
else { /* ARM mode */
if (THUMBOPER(optype)) { /* Thumb instruction */
return PO_NOMATCH;
}
else if (STDOPER(optype)) {
/* parse an expression (register, label, imm.) and assign to 'value' */
if (IMMEDOPER(optype)) {
if (*p++ != '#')
return PO_NOMATCH;
p = skip(p);
}
else if (optype==R19PR || optype==R19PO) {
if (*p++ != '[')
return PO_NOMATCH;
p = skip(p);
}
if (UPDOWNOPER(optype)) {
if (*p == '-') {
p = skip(p+1);
}
else {
if (*p == '+')
p = skip(p+1);
op->flags |= OFL_UP;
}
}
if (REGOPER(optype)) {
int r = parse_reg(&p);
if (r >= 0)
op->value = number_expr((taddr)r);
else
return PO_NOMATCH;
}
else { /* an expression */
if (ISIDSTART(*p) || isdigit((unsigned char)*p) ||
(!UPDOWNOPER(optype) && (*p=='-' || *p=='+')))
op->value = parse_expr(&p);
else
return PO_NOMATCH;
}
if (optype==R19PO || optype==R3UD1 || optype==IMUD1 || optype==IMCP1) {
p = skip(p);
if (*p++ != ']')
return PO_NOMATCH;
}
if (optype==R19WB || optype==R3UD1 || optype==IMUD1 || optype==IMCP1) {
if (*p == '!') {
p++;
op->flags |= OFL_WBACK;
}
}
}
else if (SHIFTOPER(optype)) {
char *name = p;
int i;
p = skip_identifier(p);
if (p == NULL)
return PO_NOMATCH;
for (i=0; i<NUM_SHIFTTYPES; i++) {
if (!strnicmp(shift_strings[i],name,p-name))
break;
}
if (i >= NUM_SHIFTTYPES)
return PO_NOMATCH;
if (i == 4) {
/* RRX is ROR with immediate value 0 */
op->flags |= OFL_IMMEDSHIFT;
op->value = number_expr(0);
i = 3; /* ROR */
}
else {
/* parse immediate or register for LSL, LSR, ASR, ROR */
p = skip(p);
if (i == 5)
i = 0; /* ASL -> LSL */
if (*p == '#') {
p++;
op->flags |= OFL_IMMEDSHIFT;
op->value = parse_expr(&p);
}
else if (optype == SHIFT) {
int r = parse_reg(&p);
if (r >= 0)
op->value = number_expr((taddr)r);
else
return PO_NOMATCH;
}
else
return PO_NOMATCH; /* no shift-count in register allowed */
}
op->flags |= i & OFL_SHIFTOP;
if (optype == SHIM1) {
/* check for pre-indexed with optional write-back */
p = skip(p);
if (*p++ != ']')
return PO_NOMATCH;
if (*p == '!') {
p++;
op->flags |= OFL_WBACK;
}
}
}
else if (optype == CSPSR) {
char *name = p;
p = skip_identifier(p);
if (p == NULL)
return PO_NOMATCH;
if (!strnicmp(name,"CPSR",p-name))
op->flags &= ~OFL_SPSR;
else if (!strnicmp(name,"SPSR",p-name))
op->flags |= OFL_SPSR;
else
return PO_NOMATCH;
op->value = number_expr(0xf); /* all fields f,s,x,c */
}
else if (optype == PSR_F) {
char *name = p;
taddr fields = 0xf;
p = skip_identifier(p);
if (p==NULL || (p-name)<4)
return PO_NOMATCH;
if (!strnicmp(name,"CPSR",4))
op->flags &= ~OFL_SPSR;
else if (!strnicmp(name,"SPSR",4))
op->flags |= OFL_SPSR;
else
return PO_NOMATCH;
if ((p-name)>5 && *(name+4)=='_') {
fields = 0;
name += 5;
while (name < p) {
switch (tolower((unsigned char)*name++)) {
case 'f': fields |= 1; break;
case 's': fields |= 2; break;
case 'x': fields |= 4; break;
case 'c': fields |= 8; break;
default: return PO_NOMATCH;
}
}
}
else if ((p-name) > 4)
return PO_NOMATCH;
op->value = number_expr(fields);
}
else if (optype == RLIST) {
taddr list = parse_reglist(&p);
if (list >= 0) {
op->value = number_expr(list);
if (*p == '^') {
p++;
op->flags |= OFL_FORCE; /* set "load PSR / force user mode" flag */
}
}
else
return PO_NOMATCH;
}
else
ierror(0);
}
return (skip(p)-start < len) ? PO_NOMATCH : PO_MATCH;
}
static void create_mapping_symbol(int type,section *sec,taddr pc)
/* create mapping symbol ($a, $t, $d) as required by ARM ELF ABI */
{
static char names[3][4] = { "$a","$t","$d" };
static int types[3] = { TYPE_FUNCTION,TYPE_FUNCTION,TYPE_OBJECT };
symbol *sym;
if (type<TYPE_ARM || type>TYPE_DATA)
ierror(0);
if (elfoutput) {
sym = mymalloc(sizeof(symbol));
sym->type = LABSYM;
sym->flags = types[type];
sym->name = names[type];
sym->sec = sec;
sym->pc = pc;
sym->expr = 0;
sym->size = 0;
sym->align = 0;
add_symbol(sym);
}
last_data_type = type;
}
taddr eval_thumb_operands(instruction *ip,section *sec,taddr pc,
uint16_t *insn,dblock *db)
/* evaluate expressions and try to optimize THUMB instruction,
return size of instruction */
{
operand op;
mnemonic *mnemo = &mnemonics[ip->code];
int opcnt = 0;
taddr isize = 2;
if (insn) {
if (pc & 1)
cpu_error(27); /* instruction at unaligned address */
if (ip->op[0] == NULL) {
/* handle inst. without operands, which don't have Thumb entries */
if (ip->code == OC_NOP)
*insn = 0x46c0; /* nop => mov r0,r0 */
return 2;
}
else
*insn = (uint16_t)mnemo->ext.opcode;
}
for (opcnt=0; ip->op[opcnt]!=NULL && opcnt<MAX_OPERANDS; opcnt++) {
taddr val;
symbol *base = NULL;
int btype;
op = *(ip->op[opcnt]);
if (!eval_expr(op.value,&val,sec,pc))
btype = find_base(op.value,&base,sec,pc);
/* do optimizations first */
if (op.type==TPCLW || THBRANCH(op.type)) {
/* PC-relative offsets (take prefetch into account: PC+4) */
if (base!=NULL && btype==BASE_OK) {
if (base->type==LABSYM && base->sec==sec) {
/* no relocation required, can be resolved immediately */
if (op.type == TPCLW) {
/* bit 1 of PC is forced to 0 */
val -= (pc&~2) + 4;
}
else
val -= pc + 4;
if (op.type == TBR08) {
if (val<-0x100 || val>0xfe) {
/* optimize to: B<!cc> .+4 ; B label */
if (insn) {
*insn++ ^= 0x100; /* negate branch-condition */
*insn = 0xe000; /* B unconditional to label */
}
if (val < 0)
val -= 2; /* backward-branches are 2 bytes longer */
isize += 2;
op.type = TBR11;
}
}
else if (op.type == TBRHL) {
/* BL always consists of two instructions */
isize += 2;
}
else if (op.type == TPCLW) {
/* @@@ optimization makes any sense? */
op.type = TUIMA;
base = NULL; /* no more checks */
}
}
else {
/* symbol is in a different section or externally declared */
if (op.type == TBRHL) {
val -= THB_PREFETCH;
if (db) {
add_nreloc_masked(&db->relocs,base,val,REL_PC,11,16+5,0xffe);
add_nreloc_masked(&db->relocs,base,val,REL_PC,11,5,0x7ff000);
}
}
else if (op.type == TPCLW) {
/* val -= THB_PREFETCH; @@@ only positive offsets allowed! */
op.type = TUIMA;
if (db)
add_nreloc_masked(&db->relocs,base,val,REL_PC,8,8,0x3fc);
base = NULL; /* no more checks */
}
else if (insn)
cpu_error(22); /* operation not allowed on external symbols */
}
}
else if (insn)
cpu_error(2); /* label from current section required */
}
/* optimizations should be finished at this stage -
inserts operands into the opcode now: */
if (insn) {
if (THREGOPER(op.type)) {
/* insert register operand, check was already done in parse_operand */
if (!THPCORSP(op.type)) {
switch (op.type) {
case TRG02:
case THR02:
*insn |= val&7;
break;
case TRG05:
case THR05:
case TR5IN:
*insn |= (val&7) << 3;
break;
case TRG08:
case TR8IN:
*insn |= (val&7) << 6;
break;
case TRG10:
case TR10W:
*insn |= (val&7) << 8;
break;
default:
ierror(0);
break;
}
}
}
else if (THREGLIST(op.type)) {
/* register list was already checked in parse_operand - just insert */
*insn |= val;
}
else if (THIMMOPER(op.type) || op.type==TSWI8) {
/* immediate operand */
switch (op.type) {
case TUIM3:
if (val>=0 && val<=7) {
*insn |= val<<6;
}
else
cpu_error(25,3,(long)val); /* immediate offset out of range */
break;
case TUIM5:
case TUI5I:
if (val>=0 && val<=0x1f) {
*insn |= val<<6;
}
else
cpu_error(25,5,(long)val); /* immediate offset out of range */
break;
case TUI6I:
if (val>=0 && val<=0x3e) {
if ((val & 1) == 0)
*insn |= (val&0x3e)<<5;
else
cpu_error(26,2); /* offset has to be a multiple of 2 */
}
else
cpu_error(25,6,(long)val); /* immediate offset out of range */
break;
case TUI7I:
if (val>=0 && val<=0x7c) {
if ((val & 3) == 0)
*insn |= (val&0x7c)<<4;
else
cpu_error(26,4); /* offset has to be a multiple of 4 */
}
else
cpu_error(25,7,(long)val); /* immediate offset out of range */
break;
case TUIM8:
case TSWI8:
if (val>=0 && val<=0xff) {
*insn |= val;
}
else
cpu_error(25,8,(long)val); /* immediate offset out of range */
break;
case TSIM9:
if (val>=-0x1fc && val<=0x1fc) {
if ((val & 3) == 0) {
if (val < 0)
val = 0x80 - (val>>2);
*insn |= val;
}
else
cpu_error(26,4); /* offset has to be a multiple of 4 */
}
else
cpu_error(20,9,(long)val); /* immediate offset out of range */
break;
case TUIMA:
case TUIAI:
if (val>=0 && val<=0x3fc) {
if ((val & 3) == 0)
*insn |= val>>2;
else
cpu_error(26,4); /* offset has to be a multiple of 4 */
}
else
cpu_error(25,10,(long)val); /* immediate offset out of range */
break;
}
if (base!=NULL && db!=NULL) {
if (btype == BASE_OK) {
if (op.type==TUIM5 || op.type==TUI5I)
add_nreloc_masked(&db->relocs,base,val,REL_ABS,5,5,0x1f);
else if (op.type == TSWI8)
add_nreloc_masked(&db->relocs,base,val,REL_ABS,8,8,0xff);
else
cpu_error(6); /* constant integer expression required */
}
else
general_error(38); /* illegal relocation */
}
}
else if (op.type == TBR08) {
/* only write offset, relocs and optimizations are handled above */
if (val & 1)
cpu_error(8,(long)val); /* branch to unaligned address */
*insn |= (val>>1) & 0xff;
}
else if (op.type == TBR11) {
/* only write offset, relocs and optimizations are handled above */
if (val<-0x800 || val>0x7fe)
cpu_error(3,(long)val); /* branch offset is out of range */
if (val & 1)
cpu_error(8,(long)val); /* branch to unaligned address */
*insn |= (val>>1) & 0x7ff;
}
else if (op.type == TBRHL) {
/* split 23-bit offset over two instructions, ignoring bit 0 */
if (val<-0x400000 || val>0x3ffffe)
cpu_error(3,(long)val); /* branch offset is out of range */
if (val & 1)
cpu_error(8,(long)val); /* branch to unaligned address */
*insn++ |= (val>>12) & 0x7ff;
*insn = 0xf800 | ((val>>1) & 0x7ff);
}
else
ierror(0);
}
}
return isize;
}
#define ROTFAIL (0xffffff)
static uint32_t rotated_immediate(uint32_t val)
/* check if a 32-bit value can be represented as 8-bit-rotated,
return ROTFAIL when impossible */
{
uint32_t i,a;
for (i=0; i<32; i+=2) {
if ((a = val<<i | val>>(32-i)) <= 0xff)
return (i<<7) | a;
}
return ROTFAIL;
}
static int negated_rot_immediate(uint32_t val,mnemonic *mnemo,
uint32_t *insn)
/* check if negating the ALU-operation makes a valid 8-bit-rotated value,
insert it into the current instruction, when successful */
{
uint32_t neg = rotated_immediate(-val);
uint32_t inv = rotated_immediate(~val);
uint32_t op = (mnemo->ext.opcode & 0x01e00000) >> 21;
switch (op) {
/* AND <-> BIC */
case 0: op=14; val=inv; break;
case 14: op=0; val=inv; break;
/* ADD <-> SUB */
case 2: op=4; val=neg; break;
case 4: op=2; val=neg; break;
/* ADC <-> SBC */
case 5: op=6; val=inv; break;
case 6: op=5; val=inv; break;
/* CMP <-> CMN */
case 10: op=11; val=neg; break;
case 11: op=10; val=neg; break;
/* MOV <-> MVN */
case 13: op=15; val=inv; break;
case 15: op=13; val=inv; break;
default: return 0;
}
if (val == ROTFAIL)
return 0;
if (insn) {
*insn &= ~0x01e00000;
*insn |= (op<<21) | val;
}
return 1;
}
static uint32_t double_rot_immediate(uint32_t val,uint32_t *hi)
/* check if a 32-bit value can be represented by combining two
8-bit rotated values, return ROTFAIL otherwise */
{
uint32_t i,a;
for (i=0; i<32; i+=2) {
if (((a = val<<i | val>>(32-i)) & 0xff) != 0) {
if (a & 0xff00) {
if (a & 0xffff0000)
continue;
*hi = ((i+24)<<7) | (a>>8);
}
else if (a & 0xff0000) {
if (a & 0xff000000)
continue;
*hi = ((i+16)<<7) | (a>>16);
}
else if (a & 0xff000000)
*hi = ((i+8)<<7) | (a>>24);
else
ierror(0);
return (i<<7) | (a&0xff);
}
}
return ROTFAIL;
}
static uint32_t calc_2nd_rot_opcode(uint32_t op)
/* calculates ALU operation for second instruction */
{
if (op == 13)
op = 12; /* MOV + ORR */
else if (op == 15)
op = 1; /* MVN + EOR */
/* ADD and SUB stay the same */
return op << 21;
}
static int negated_double_rot_immediate(uint32_t val,uint32_t *insn)
/* check if negating the ALU-operation and/or a second ADD/SUB operation
makes a valid 8-bit-rotated value, insert it into the current
instruction, when successful */
{
uint32_t op = (*insn & 0x01e00000) >> 21;
if ((op==2 || op==4 || op==13 || op==15) && insn!=NULL) {
/* combined instructions only possible for ADD/SUB/MOV/MVN */
uint32_t lo,hi;
*(insn+1) = *insn & ~0x01ef0000;
*(insn+1) |= (*insn&0xf000) << 4; /* Rn = Rd of first instruction */
if ((lo = double_rot_immediate(val,&hi)) != ROTFAIL) {
*insn++ |= hi;
*insn |= calc_2nd_rot_opcode(op) | lo;
return 1;
}
/* @@@ try negated or inverted values */
}
return 0;
}
static uint32_t get_condcode(instruction *ip)
/* returns condition (bit 31-28) from instruction's qualifiers */
{
const char *cc = condition_codes;
char *q;
if (q = ip->qualifiers[0]) {
uint32_t code = 0;
while (*cc) {
if (*q==*cc && *(q+1)==*(cc+1) && *(q+2)=='\0')
break;
cc += 2;
code++;
}
if (*cc) { /* condition code in qualifier valid */
if (code == 16) /* hs -> cs */
code = 2;
else if (code==17 || code==18) /* lo/ul -> cc */
code = 3;
return code<<28;
}
}
return 0xe0000000; /* AL - always */
}
static int get_addrmode(instruction *ip)
/* return addressing mode from instruction's qualifiers */
{
char *q;
if ((q = ip->qualifiers[1]) == NULL)
q = ip->qualifiers[0];
if (q) {
const char **am = addrmode_strings;
int mode = AM_DA;
do {
if (!strcmp(*am,q))
break;
am++;
mode++;
}
while (*am);
if (*am != NULL)
return mode;
}
return AM_NONE;
}
taddr eval_arm_operands(instruction *ip,section *sec,taddr pc,
uint32_t *insn,dblock *db)
/* evaluate expressions and try to optimize ARM instruction,
return size of instruction */
{
operand op;
mnemonic *mnemo = &mnemonics[ip->code];
int am = get_addrmode(ip);
int aa4ldst = 0;
int opcnt = 0;
taddr isize = 4;
taddr chkreg = -1;
if (insn) {
if (pc & 3)
cpu_error(27); /* instruction at unaligned address */
*insn = mnemo->ext.opcode | get_condcode(ip);
if (mnemo->ext.flags & SETCC) {
if (am == AM_S)
*insn |= 0x00100000; /* set-condition-codes flag */
}
if (!strcmp(mnemo->name,"ldr") || !strcmp(mnemo->name,"str")) {
if (am==AM_T || am==AM_B || am==AM_BT || am==AM_TB) { /* std. ldr/str */
if (am != AM_B) {
*insn |= 0x00200000; /* W-flag for post-indexed mode */
*insn &= ~0x01000000; /* force post-indexed */
}
if (am != AM_T)
*insn |= 0x00400000; /* B-flag for byte-transfer */
}
else if (am==AM_SB || am==AM_H || am==AM_SH) { /* arch.4 ldr/str */
if (cpu_type & AA4UP) {
/* take P-, I- and L-bit from previous standard instruction */
*insn = (*insn&0xf1100000)
| (((*insn&0x02000000)^0x02000000)>>3) /* I-bit is flipped */
| 0x90;
if (am != AM_H) {
if (*insn & 0x00100000) /* load */
*insn |= 0x40; /* signed transfer */
else
cpu_error(18,addrmode_strings[am]); /* illegal addr. mode */
}
if (am != AM_SB)
*insn |= 0x20; /* halfword-transfer */
aa4ldst = 1;
}
else
cpu_error(0); /* instruction not supported on selected arch. */
}
else if (am != AM_NONE)
cpu_error(18,addrmode_strings[am]); /* illegal addr. mode */
}
else if (ip->code == OC_SWP) {
if (am == AM_B)
*insn |= 0x00400000; /* swap bytes */
else if (am != AM_NONE)
cpu_error(18,addrmode_strings[am]); /* illegal addr. mode */
}
}
else { /* called by instruction_size() */
if (am==AM_SB || am==AM_H || am==AM_SH)
aa4ldst = 1;
}
for (opcnt=0; ip->op[opcnt]!=NULL && opcnt<MAX_OPERANDS; opcnt++) {
taddr val;
symbol *base = NULL;
int btype;
op = *(ip->op[opcnt]);
if (!eval_expr(op.value,&val,sec,pc))
btype = find_base(op.value,&base,sec,pc);
/* do optimizations first */
if (op.type==PCL12 || op.type==PCLRT ||
op.type==PCLCP || op.type==BRA24) {
/* PC-relative offsets (take prefetch into account: PC+8) */
if (base!=NULL && btype==BASE_OK) {
if (base->type==LABSYM && base->sec==sec) {
/* no relocation required, can be resolved immediately */
val -= pc + 8;
switch (op.type) {
case BRA24:
if (val>=0x2000000 || val<-0x2000000) {
/* @@@ optimize? to what? */
if (insn)
cpu_error(3,(long)val); /* branch offset is out of range */
}
break;
case PCL12:
if ((!aa4ldst && val<0x1000 && val>-0x1000) ||
(aa4ldst && val<0x100 && val>-0x100)) {
op.type = IMUD2; /* handle as normal #+/-Imm12 */
if (val < 0)
val = -val;
else
op.flags |= OFL_UP;
base = NULL; /* no more checks */
}
else {
if (opt_ldrpc &&
((!aa4ldst && val<0x100000 && val>-0x100000) ||
(aa4ldst && val<0x10000 && val>-0x10000))) {
/* ADD/SUB Rd,PC,#offset&0xff000 */
/* LDR/STR Rd,[Rd,#offset&0xfff] */
if (insn) {
taddr v;
*(insn+1) = *insn;
*insn &= 0xf0000000; /* clear all except cond. */
if (val < 0) {
v = -val;
*insn |= 0x024f0a00; /* SUB */
*(insn+1) &= ~0x00800000; /* clear U-bit */
}
else {
v = val;
*insn |= 0x028f0a00; /* ADD */
*(insn+1) |= 0x00800000; /* set U-bit */
}
if (aa4ldst)
*insn |= (*(insn+1)&0xf000) | ((v&0xff00)>>8);
else
*insn |= (*(insn+1)&0xf000) | ((v&0xff000)>>12);
*(insn+1) &= ~0x000f0000; /* replace PC by Rd */
*(insn+1) |= (*insn & 0xf000) << 4;
insn++;
}
if (val < 0)
val = -val;
else
op.flags |= OFL_UP;
val = aa4ldst ? (val & 0xff) : (val & 0xfff);
isize += 4;
op.type = IMUD2;
base = NULL; /* no more checks */
}
else {
op.type = NOOP;
if (insn)
cpu_error(4,val); /* PC-relative ldr/str out of range */
}
}
break;
case PCLCP:
if (val<0x400 && val>-0x400) {
op.type = IMCP2; /* handle as normal #+/-Imm10>>2 */
if (val < 0)
val = -val;
else
op.flags |= OFL_UP;
base = NULL; /* no more checks */
}
else {
/* no optimization, because we don't have a free register */
op.type = NOOP;
if (insn)
cpu_error(4,val); /* PC-relative ldc/stc out of range */
}
break;
case PCLRT:
op.type = NOOP; /* is handled here */
if (val < 0) {
/* use SUB instead of ADD */
if (insn)
*insn ^= 0x00c00000;
val = -val;
}
if ((val = rotated_immediate(val)) != ROTFAIL) {
if (insn)
*insn |= val;
}
else if (opt_adr || am==AM_L) {
/* ADRL or optimize ADR automatically to ADRL */
uint32_t hi,lo;
isize += 4;
if ((lo = double_rot_immediate(val,&hi)) != ROTFAIL) {
/* ADD/SUB Rd,PC,#hi8rotated */
/* ADD/SUB Rd,Rd,#lo8rotated */
if (insn) {
*(insn+1) = *insn & ~0xf0000;
*(insn+1) |= (*insn&0xf000) << 4;
*insn++ |= hi;
*insn |= lo;
}
}
else if (insn)
cpu_error(5,(uint32_t)val); /* Cannot make rot.immed.*/
}
else if (insn)
cpu_error(5,(uint32_t)val); /* Cannot make rot.immed.*/
break;
default:
ierror(0);
}
}
else {
/* symbol is in a different section or externally declared */
switch (op.type) {
case BRA24:
val -= ARM_PREFETCH;
if (db)
add_nreloc_masked(&db->relocs,base,val,REL_PC,24,8,0x3fffffc);
break;
case PCL12:
op.type = IMUD2;
if (db) {
if (val<0x1000 && val>-0x1000) {
add_nreloc_masked(&db->relocs,base,val,REL_PC,12,20,0x1fff);
base = NULL; /* don't add another REL_ABS below */
}
else
cpu_error(22); /* operation not allowed on external symbols */
}
break;
case PCLCP:
if (db)
cpu_error(22); /* operation not allowed on external symbols */
break;
case PCLRT:
op.type = NOOP;
if (am==AM_L && val==0) { /* ADRL */
isize += 4; /* always reserve two ADD instructions */
if (insn!=NULL && db!=NULL) {
*(insn+1) = *insn & ~0xf0000;
*(insn+1) |= (*insn&0xf000) << 4;
add_nreloc_masked(&db->relocs,base,val,REL_PC,8,24,0xff00);
add_nreloc_masked(&db->relocs,base,val,REL_PC,8,32+24,0xff);
}
}
else if (val == 0) { /* ADR */
if (db)
add_nreloc_masked(&db->relocs,base,val,REL_PC,8,24,0xff);
}
else if (db)
cpu_error(22); /* operation not allowed on external symbols */
break;
default:
ierror(0);
}
}
}
else if (insn) {
op.type = NOOP;
cpu_error(2); /* label from current section required */
}
}
else if (op.type == IMROT) {
op.type = NOOP; /* is handled here */
if (base == NULL) {
uint32_t rotval;
if ((rotval = rotated_immediate(val)) != ROTFAIL) {
if (insn)
*insn |= rotval;
}
else if (!negated_rot_immediate(val,mnemo,insn)) {
/* rotation, negation and inversion failed - try a 2nd operation */
isize += 4;
if (insn) {
if (!negated_double_rot_immediate(val,insn))
cpu_error(7,(uint32_t)val); /* const not suitable */
}
}
}
else if (insn)
cpu_error(6); /* constant integer expression required */
}
/* optimizations should be finished at this stage -
inserts operands into the opcode now: */
if (insn) {
if (REGOPER(op.type)) {
/* insert register operand */
if (base!=NULL || val<0 || val>15)
cpu_error(9); /* not a valid ARM register */
if (REG19OPER(op.type))
*insn |= val<<16;
else if (REG15OPER(op.type))
*insn |= val<<12;
else if (REG11OPER(op.type))
*insn |= val<<8;
else if (REG03OPER(op.type))
*insn |= val;
if (op.type==R3UD1 && !(*insn&0x01000000))
cpu_error(21); /* post-indexed addressing mode expected */
if (op.flags & OFL_WBACK)
*insn |= 0x00200000;
if (op.flags & OFL_UP)
*insn |= 0x00800000;
/* some more checks: */
if ((mnemo->ext.flags&NOPC) && val==15)
cpu_error(10); /* PC (r15) not allowed in this mode */
if ((mnemo->ext.flags&NOPCR03) && val==15 && REG03OPER(op.type))
cpu_error(11); /* PC (r15) not allowed for offset register Rm */
if ((mnemo->ext.flags&NOPC) && val==15 && (op.flags&OFL_WBACK))
cpu_error(12); /* PC (r15) not allowed with write-back */
/* check for illegal double register specifications */
if (((mnemo->ext.flags&DIFR03) && REG03OPER(op.type)) ||
((mnemo->ext.flags&DIFR11) && REG11OPER(op.type)) ||
((mnemo->ext.flags&DIFR15) && REG15OPER(op.type)) ||
((mnemo->ext.flags&DIFR19) && REG19OPER(op.type))) {
if (chkreg != -1) {
if (val == chkreg)
cpu_error(13,(long)val); /* register was used multiple times */
}
else
chkreg = val;
}
}
else if (op.type == BRA24) {
/* only write offset, relocs and optimizations are handled above */
if (val & 3)
cpu_error(8,(long)val); /* branch to unaligned address */
*insn |= (val>>2) & 0xffffff;
}
else if (op.type==IMUD1 || op.type==IMUD2) {
if (aa4ldst) {
/* insert splitted 8-bit immediate for signed/halfword ldr/str */
if (val>=0 && val<=0xff) {
*insn |= ((val&0xf0)<<4) | (val&0x0f);
}
else
cpu_error(20,8,(long)val); /* immediate offset out of range */
}
else {
/* insert immediate 12-bit with up/down flag */
if (val>=0 && val<=0xfff) {
*insn |= val;
}
else
cpu_error(20,12,(long)val); /* immediate offset out of range */
}
if (op.type==IMUD1 && !(*insn&0x01000000))
cpu_error(21); /* post-indexed addressing mode exptected */
if (op.flags & OFL_WBACK)
*insn |= 0x00200000; /* set write-back flag */
if (op.flags & OFL_UP)
*insn |= 0x00800000; /* set UP-flag */
if (base) {
if (btype == BASE_OK) {
if (base->type == IMPORT) {
if (!aa4ldst) {
/* @@@ does this make any sense? */
*insn |= 0x00800000; /* only UP */
add_nreloc_masked(&db->relocs,base,val,REL_ABS,12,20,0xfff);
}
else
cpu_error(22); /* operation not allowed on external symbols */
}
else
cpu_error(6); /* constant integer expression required */
}
else
general_error(38); /* illegal relocation */
}
}
else if (op.type==IMCP1 || op.type==IMCP2) {
/* insert immediate 10-bit shifted left by 2, with up/down flag */
if (val>=0 && val<=0x3ff) {
if ((val & 3) == 0)
*insn |= val>>2;
else
cpu_error(23); /* ldc/stc offset has to be a multiple of 4 */
}
else
cpu_error(20,10,(long)val); /* immediate offset out of range */
if (op.flags & OFL_WBACK)
*insn |= 0x00200000; /* set write-back flag */
if (op.flags & OFL_UP)
*insn |= 0x00800000; /* set UP-flag */
if (base)
cpu_error(6); /* constant integer expression required */
}
else if (op.type == SWI24) {
/* insert 24-bit immediate (SWI instruction) */
if (val>=0 && val<0x1000000) {
*insn |= val;
if (base!=NULL && db!=NULL)
add_nreloc_masked(&db->relocs,base,val,REL_ABS,24,8,0xffffff);
}
else
cpu_error(16); /* 24-bit unsigned immediate expected */
}
else if (SHIFTOPER(op.type)) {
/* insert a register- or immediate shift */
int sh_op = op.flags & OFL_SHIFTOP;
if (aa4ldst)
cpu_error(19); /* signed/halfword ldr/str doesn't support shifts */
if (op.type==SHIM1 && !(*insn&0x01000000))
cpu_error(21); /* post-indexed addressing mode exptected */
if (op.flags & OFL_IMMEDSHIFT) {
if (sh_op==1 || sh_op==2) { /* lsr/asr permit shift-count #32 */
if (val == 32)
val = 0;
}
if (base==NULL && val>=0 && val<32) {
*insn |= (val<<7) | ((op.flags&OFL_SHIFTOP)<<5);
if (op.flags & OFL_WBACK)
*insn |= 0x00200000;
}
else
cpu_error(14,(long)val); /* illegal immediate shift count */
}
else { /* shift count in register */
if (base==NULL && val>=0 && val<16) {
*insn |= (val<<8) | ((op.flags&OFL_SHIFTOP)<<5) | 0x10;
}
else
cpu_error(15); /* not a valid shift register */
}
}
else if (CPOPCODE(op.type)) {
/* insert coprocessor operation/type */
if (base == NULL) {
switch (op.type) {
case CPOP3:
if (val>=0 && val<8)
*insn |= val<<21;
else
cpu_error(24,val); /* illegal coprocessor operation */
break;
case CPOP4:
if (val>=0 && val<16)
*insn |= val<<20;
else
cpu_error(24,val); /* illegal coprocessor operation */
break;
case CPTYP:
if (val>=0 && val<8)
*insn |= val<<5;
else
cpu_error(24,val); /* illegal coprocessor operation */
break;
default: ierror(0);
}
}
else
cpu_error(24,val); /* illegal coprocessor operation */
}
else if (op.type==CSPSR || op.type==PSR_F) {
/* insert PSR type - no checks needed */
*insn |= val<<16;
if (op.flags & OFL_SPSR)
*insn |= 0x00400000;
}
else if (op.type == RLIST) {
/* insert register-list field */
if (am<AM_DA || am>AM_ED)
cpu_error(18,addrmode_strings[am]); /* illegal addr. mode */
if (am>=AM_FA && am<=AM_ED) {
/* fix stack-addressing mode */
if (!(mnemo->ext.opcode & 0x00100000))
am ^= 3; /* invert P/U modes for store operations */
}
*insn |= ((am&3)<<23) | val;
if (op.flags & OFL_FORCE)
*insn |= 0x00400000;
}
else if (op.type != NOOP)
ierror(0);
}
}
return isize;
}
taddr instruction_size(instruction *ip,section *sec,taddr pc)
/* Calculate the size of the current instruction; must be identical
to the data created by eval_instruction. */
{
if (mnemonics[ip->code].ext.flags & THUMB)
return eval_thumb_operands(ip,sec,pc,NULL,NULL);
/* ARM mode */
return eval_arm_operands(ip,sec,pc,NULL,NULL);
}
dblock *eval_instruction(instruction *ip,section *sec,taddr pc)
/* Convert an instruction into a DATA atom including relocations,
if necessary. */
{
dblock *db = new_dblock();
int inst_type;
if (sec != last_section) {
last_section = sec;
last_data_type = -1;
}
inst_type = (mnemonics[ip->code].ext.flags & THUMB) ? TYPE_THUMB : TYPE_ARM;
if (inst_type == TYPE_THUMB) {
uint16_t insn[2];
if (db->size = eval_thumb_operands(ip,sec,pc,insn,db)) {
unsigned char *d = db->data = mymalloc(db->size);
int i;
for (i=0; i<db->size/2; i++)
d = setval(arm_be_mode,d,2,insn[i]);
}
}
else { /* ARM mode */
uint32_t insn[2];
if (db->size = eval_arm_operands(ip,sec,pc,insn,db)) {
unsigned char *d = db->data = mymalloc(db->size);
int i;
for (i=0; i<db->size/4; i++)
d = setval(arm_be_mode,d,4,insn[i]);
}
}
if (inst_type != last_data_type)
create_mapping_symbol(inst_type,sec,pc);
return db;
}
dblock *eval_data(operand *op,taddr bitsize,section *sec,taddr pc)
/* Create a dblock (with relocs, if necessary) for size bits of data. */
{
dblock *db = new_dblock();
taddr val;
if (sec != last_section) {
last_section = sec;
last_data_type = -1;
}
if ((bitsize & 7) || bitsize > 32)
cpu_error(17,bitsize); /* data size not supported */
if (op->type != DATA_OP)
ierror(0);
db->size = bitsize >> 3;
db->data = mymalloc(db->size);
if (!eval_expr(op->value,&val,sec,pc)) {
symbol *base;
int btype;
btype = find_base(op->value,&base,sec,pc);
if (base)
add_nreloc(&db->relocs,base,val,
btype==BASE_PCREL?REL_PC:REL_ABS,bitsize,0);
else
general_error(38); /* illegal relocation */
}
switch (db->size) {
case 1:
db->data[0] = val & 0xff;
break;
case 2:
case 4:
setval(arm_be_mode,db->data,db->size,val);
break;
default:
ierror(0);
break;
}
if (last_data_type != TYPE_DATA)
create_mapping_symbol(TYPE_DATA,sec,pc);
return db;
}
int init_cpu()
{
char r[4];
int i;
for (i=0; i<mnemonic_cnt; i++) {
if (!strcmp(mnemonics[i].name,"swp"))
OC_SWP = i;
else if (!strcmp(mnemonics[i].name,"nop"))
OC_NOP = i;
}
if (!strcmp(output_format,"elf"))
elfoutput = 1;
/* define register symbols */
regsymhash = new_hashtable(REGSYMHTSIZE);
for (i=0; i<16; i++) {
sprintf(r,"r%d",i);
addregsym(r,i);
sprintf(r,"c%d",i);
addregsym(r,i);
sprintf(r,"p%d",i);
addregsym(r,i);
}
/* ATPCS synonyms */
for (i=0; i<8; i++) {
if (i < 4) {
sprintf(r,"a%d",i+1);
addregsym(r,i);
}
sprintf(r,"v%d",i+1);
addregsym(r,i+4);
}
/* well known aliases */
addregsym("wr",7);
addregsym("sb",9);
addregsym("sl",10);
addregsym("fp",11);
addregsym("ip",12);
addregsym("sp",13);
addregsym("lr",14);
addregsym("pc",15);
return 1;
}
int cpu_args(char *p)
{
if (!strncmp(p,"-m",2)) {
p += 2;
if (!strcmp(p,"2")) cpu_type = ARM2;
else if (!strcmp(p,"250")) cpu_type = ARM250;
else if (!strcmp(p,"3")) cpu_type = ARM3;
else if (!strcmp(p,"6")) cpu_type = ARM6;
else if (!strcmp(p,"600")) cpu_type = ARM600;
else if (!strcmp(p,"610")) cpu_type = ARM610;
else if (!strcmp(p,"7")) cpu_type = ARM7;
else if (!strcmp(p,"710")) cpu_type = ARM710;
else if (!strcmp(p,"7500")) cpu_type = ARM7500;
else if (!strcmp(p,"7d")) cpu_type = ARM7d;
else if (!strcmp(p,"7di")) cpu_type = ARM7di;
else if (!strcmp(p,"7dm")) cpu_type = ARM7dm;
else if (!strcmp(p,"7dmi")) cpu_type = ARM7dmi;
else if (!strcmp(p,"7tdmi")) cpu_type = ARM7tdmi;
else if (!strcmp(p,"8")) cpu_type = ARM8;
else if (!strcmp(p,"810")) cpu_type = ARM810;
else if (!strcmp(p,"9")) cpu_type = ARM9;
else if (!strcmp(p,"920")) cpu_type = ARM920;
else if (!strcmp(p,"920t")) cpu_type = ARM920t;
else if (!strcmp(p,"9tdmi")) cpu_type = ARM9tdmi;
else if (!strcmp(p,"sa1")) cpu_type = SA1;
else if (!strcmp(p,"strongarm")) cpu_type = STRONGARM;
else if (!strcmp(p,"strongarm110")) cpu_type = STRONGARM110;
else if (!strcmp(p,"strongarm1100")) cpu_type = STRONGARM1100;
else return 0;
}
else if (!strncmp(p,"-a",2)) {
p += 2;
if (!strcmp(p,"2")) cpu_type = AA2;
else if (!strcmp(p,"3")) cpu_type = AA3;
else if (!strcmp(p,"3m")) cpu_type = AA3M;
else if (!strcmp(p,"4")) cpu_type = AA4;
else if (!strcmp(p,"4t")) cpu_type = AA4T;
else return 0;
}
else if (!strcmp(p,"-little"))
arm_be_mode = 0;
else if (!strcmp(p,"-big"))
arm_be_mode = 1;
else if (!strcmp(p,"-thumb"))
thumb_mode = 1;
else if (!strcmp(p,"-opt-ldrpc"))
opt_ldrpc = 1;
else if (!strcmp(p,"-opt-adr"))
opt_adr = 1;
return 1;
}
|
{
"pile_set_name": "Github"
}
|
/* $OpenBSD: tar.h,v 1.7 2003/06/02 23:32:09 millert Exp $ */
/* $NetBSD: tar.h,v 1.3 1995/03/21 09:07:51 cgd Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Keith Muller of the University of California, San Diego.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)tar.h 8.2 (Berkeley) 4/18/94
*/
/*
* defines and data structures common to all tar formats
*/
#define CHK_LEN 8 /* length of checksum field */
#define TNMSZ 100 /* size of name field */
#ifdef _PAX_
#define NULLCNT 2 /* number of null blocks in trailer */
#define CHK_OFFSET 148 /* start of chksum field */
#define BLNKSUM 256L /* sum of checksum field using ' ' */
#endif /* _PAX_ */
/*
* Values used in typeflag field in all tar formats
* (only REGTYPE, LNKTYPE and SYMTYPE are used in old bsd tar headers)
*/
#define REGTYPE '0' /* Regular File */
#define AREGTYPE '\0' /* Regular File */
#define LNKTYPE '1' /* Link */
#define SYMTYPE '2' /* Symlink */
#define CHRTYPE '3' /* Character Special File */
#define BLKTYPE '4' /* Block Special File */
#define DIRTYPE '5' /* Directory */
#define FIFOTYPE '6' /* FIFO */
#define CONTTYPE '7' /* high perf file */
/*
* GNU tar compatibility;
*/
#define LONGLINKTYPE 'K' /* Long Symlink */
#define LONGNAMETYPE 'L' /* Long File */
/*
* Mode field encoding of the different file types - values in octal
*/
#define TSUID 04000 /* Set UID on execution */
#define TSGID 02000 /* Set GID on execution */
#define TSVTX 01000 /* Reserved */
#define TUREAD 00400 /* Read by owner */
#define TUWRITE 00200 /* Write by owner */
#define TUEXEC 00100 /* Execute/Search by owner */
#define TGREAD 00040 /* Read by group */
#define TGWRITE 00020 /* Write by group */
#define TGEXEC 00010 /* Execute/Search by group */
#define TOREAD 00004 /* Read by other */
#define TOWRITE 00002 /* Write by other */
#define TOEXEC 00001 /* Execute/Search by other */
#ifdef _PAX_
/*
* Pad with a bit mask, much faster than doing a mod but only works on powers
* of 2. Macro below is for block of 512 bytes.
*/
#define TAR_PAD(x) ((512 - ((x) & 511)) & 511)
#endif /* _PAX_ */
/*
* structure of an old tar header as it appeared in BSD releases
*/
typedef struct {
char name[TNMSZ]; /* name of entry */
char mode[8]; /* mode */
char uid[8]; /* uid */
char gid[8]; /* gid */
char size[12]; /* size */
char mtime[12]; /* modification time */
char chksum[CHK_LEN]; /* checksum */
char linkflag; /* norm, hard, or sym. */
char linkname[TNMSZ]; /* linked to name */
} HD_TAR;
#ifdef _PAX_
/*
* -o options for BSD tar to not write directories to the archive
*/
#define TAR_NODIR "nodir"
#define TAR_OPTION "write_opt"
/*
* default device names
*/
#define DEV_0 "/dev/rst0"
#define DEV_1 "/dev/rst1"
#define DEV_4 "/dev/rst4"
#define DEV_5 "/dev/rst5"
#define DEV_7 "/dev/rst7"
#define DEV_8 "/dev/rst8"
#endif /* _PAX_ */
/*
* Data Interchange Format - Extended tar header format - POSIX 1003.1-1990
*/
#define TPFSZ 155
#define TMAGIC "ustar" /* ustar and a null */
#define TMAGLEN 6
#define TVERSION "00" /* 00 and no null */
#define TVERSLEN 2
typedef struct {
char name[TNMSZ]; /* name of entry */
char mode[8]; /* mode */
char uid[8]; /* uid */
char gid[8]; /* gid */
char size[12]; /* size */
char mtime[12]; /* modification time */
char chksum[CHK_LEN]; /* checksum */
char typeflag; /* type of file. */
char linkname[TNMSZ]; /* linked to name */
char magic[TMAGLEN]; /* magic cookie */
char version[TVERSLEN]; /* version */
char uname[32]; /* ascii owner name */
char gname[32]; /* ascii group name */
char devmajor[8]; /* major device number */
char devminor[8]; /* minor device number */
char prefix[TPFSZ]; /* linked to name */
} HD_USTAR;
|
{
"pile_set_name": "Github"
}
|
#
# test/Makefile
#
DIR= test
TOP= ..
CC= cc
INCLUDES= -I$(TOP) -I../include $(KRB5_INCLUDES)
CFLAG= -g
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
PERL= perl
# KRB5 stuff
KRB5_INCLUDES=
LIBKRB5=
TEST= igetest.c
PEX_LIBS=
EX_LIBS= #-lnsl -lsocket
CFLAGS= $(INCLUDES) $(CFLAG)
GENERAL=Makefile maketests.com \
tests.com testenc.com tx509.com trsa.com tcrl.com tsid.com treq.com \
tpkcs7.com tpkcs7d.com tverify.com testgen.com testss.com testssl.com \
testca.com VMSca-response.1 VMSca-response.2
DLIBCRYPTO= ../libcrypto.a
DLIBSSL= ../libssl.a
LIBCRYPTO= -L.. -lcrypto
LIBSSL= -L.. -lssl
BNTEST= bntest
ECTEST= ectest
ECDSATEST= ecdsatest
ECDHTEST= ecdhtest
EXPTEST= exptest
IDEATEST= ideatest
SHATEST= shatest
SHA1TEST= sha1test
SHA256TEST= sha256t
SHA512TEST= sha512t
MDC2TEST= mdc2test
RMDTEST= rmdtest
MD2TEST= md2test
MD4TEST= md4test
MD5TEST= md5test
HMACTEST= hmactest
WPTEST= wp_test
RC2TEST= rc2test
RC4TEST= rc4test
RC5TEST= rc5test
BFTEST= bftest
CASTTEST= casttest
DESTEST= destest
RANDTEST= randtest
DHTEST= dhtest
DSATEST= dsatest
METHTEST= methtest
SSLTEST= ssltest
RSATEST= rsa_test
ENGINETEST= enginetest
EVPTEST= evp_test
EVPEXTRATEST=evp_extra_test
IGETEST= igetest
JPAKETEST= jpaketest
SRPTEST= srptest
V3NAMETEST= v3nametest
ASN1TEST= asn1test
HEARTBEATTEST= heartbeat_test
CONSTTIMETEST= constant_time_test
TESTS= alltests
EXE= $(BNTEST)$(EXE_EXT) $(ECTEST)$(EXE_EXT) $(ECDSATEST)$(EXE_EXT) $(ECDHTEST)$(EXE_EXT) $(IDEATEST)$(EXE_EXT) \
$(MD2TEST)$(EXE_EXT) $(MD4TEST)$(EXE_EXT) $(MD5TEST)$(EXE_EXT) $(HMACTEST)$(EXE_EXT) $(WPTEST)$(EXE_EXT) \
$(RC2TEST)$(EXE_EXT) $(RC4TEST)$(EXE_EXT) $(RC5TEST)$(EXE_EXT) \
$(DESTEST)$(EXE_EXT) $(SHATEST)$(EXE_EXT) $(SHA1TEST)$(EXE_EXT) $(SHA256TEST)$(EXE_EXT) $(SHA512TEST)$(EXE_EXT) \
$(MDC2TEST)$(EXE_EXT) $(RMDTEST)$(EXE_EXT) \
$(RANDTEST)$(EXE_EXT) $(DHTEST)$(EXE_EXT) $(ENGINETEST)$(EXE_EXT) \
$(BFTEST)$(EXE_EXT) $(CASTTEST)$(EXE_EXT) $(SSLTEST)$(EXE_EXT) $(EXPTEST)$(EXE_EXT) $(DSATEST)$(EXE_EXT) $(RSATEST)$(EXE_EXT) \
$(EVPTEST)$(EXE_EXT) $(EVPEXTRATEST)$(EXE_EXT) $(IGETEST)$(EXE_EXT) $(JPAKETEST)$(EXE_EXT) $(SRPTEST)$(EXE_EXT) \
$(ASN1TEST)$(EXE_EXT) $(V3NAMETEST)$(EXE_EXT) $(HEARTBEATTEST)$(EXE_EXT) \
$(CONSTTIMETEST)$(EXE_EXT)
# $(METHTEST)$(EXE_EXT)
OBJ= $(BNTEST).o $(ECTEST).o $(ECDSATEST).o $(ECDHTEST).o $(IDEATEST).o \
$(MD2TEST).o $(MD4TEST).o $(MD5TEST).o \
$(HMACTEST).o $(WPTEST).o \
$(RC2TEST).o $(RC4TEST).o $(RC5TEST).o \
$(DESTEST).o $(SHATEST).o $(SHA1TEST).o $(SHA256TEST).o $(SHA512TEST).o \
$(MDC2TEST).o $(RMDTEST).o \
$(RANDTEST).o $(DHTEST).o $(ENGINETEST).o $(CASTTEST).o \
$(BFTEST).o $(SSLTEST).o $(DSATEST).o $(EXPTEST).o $(RSATEST).o \
$(EVPTEST).o $(EVPEXTRATEST).o $(IGETEST).o $(JPAKETEST).o $(ASN1TEST).o $(V3NAMETEST).o \
$(HEARTBEATTEST).o $(CONSTTIMETEST).o
SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \
$(MD2TEST).c $(MD4TEST).c $(MD5TEST).c \
$(HMACTEST).c $(WPTEST).c \
$(RC2TEST).c $(RC4TEST).c $(RC5TEST).c \
$(DESTEST).c $(SHATEST).c $(SHA1TEST).c $(MDC2TEST).c $(RMDTEST).c \
$(RANDTEST).c $(DHTEST).c $(ENGINETEST).c $(CASTTEST).c \
$(BFTEST).c $(SSLTEST).c $(DSATEST).c $(EXPTEST).c $(RSATEST).c \
$(EVPTEST).c $(EVPEXTRATEST).c $(IGETEST).c $(JPAKETEST).c $(SRPTEST).c $(ASN1TEST).c \
$(V3NAMETEST).c $(HEARTBEATTEST).c $(CONSTTIMETEST).c
EXHEADER=
HEADER= testutil.h $(EXHEADER)
ALL= $(GENERAL) $(SRC) $(HEADER)
top:
(cd ..; $(MAKE) DIRS=$(DIR) TESTS=$(TESTS) all)
all: exe
exe: $(EXE) dummytest$(EXE_EXT)
files:
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
links:
generate: $(SRC)
$(SRC):
@sh $(TOP)/util/point.sh dummytest.c $@
errors:
install:
tags:
ctags $(SRC)
tests: exe apps $(TESTS)
apps:
@(cd ..; $(MAKE) DIRS=apps all)
alltests: \
test_des test_idea test_sha test_md4 test_md5 test_hmac \
test_md2 test_mdc2 test_wp \
test_rmd test_rc2 test_rc4 test_rc5 test_bf test_cast test_aes \
test_rand test_bn test_ec test_ecdsa test_ecdh \
test_enc test_x509 test_rsa test_crl test_sid \
test_gen test_req test_pkcs7 test_verify test_dh test_dsa \
test_ss test_ca test_engine test_evp test_evp_extra test_ssl test_tsa test_ige \
test_jpake test_srp test_cms test_ocsp test_v3name test_heartbeat \
test_constant_time
test_evp: $(EVPTEST)$(EXE_EXT) evptests.txt
../util/shlib_wrap.sh ./$(EVPTEST) evptests.txt
test_evp_extra: $(EVPEXTRATEST)$(EXE_EXT)
../util/shlib_wrap.sh ./$(EVPEXTRATEST)
test_des: $(DESTEST)$(EXE_EXT)
../util/shlib_wrap.sh ./$(DESTEST)
test_idea: $(IDEATEST)$(EXE_EXT)
../util/shlib_wrap.sh ./$(IDEATEST)
test_sha: $(SHATEST)$(EXE_EXT) $(SHA1TEST)$(EXE_EXT) $(SHA256TEST)$(EXE_EXT) $(SHA512TEST)$(EXE_EXT)
../util/shlib_wrap.sh ./$(SHATEST)
../util/shlib_wrap.sh ./$(SHA1TEST)
../util/shlib_wrap.sh ./$(SHA256TEST)
../util/shlib_wrap.sh ./$(SHA512TEST)
test_mdc2: $(MDC2TEST)$(EXE_EXT)
../util/shlib_wrap.sh ./$(MDC2TEST)
test_md5: $(MD5TEST)$(EXE_EXT)
../util/shlib_wrap.sh ./$(MD5TEST)
test_md4: $(MD4TEST)$(EXE_EXT)
../util/shlib_wrap.sh ./$(MD4TEST)
test_hmac: $(HMACTEST)$(EXE_EXT)
../util/shlib_wrap.sh ./$(HMACTEST)
test_wp: $(WPTEST)$(EXE_EXT)
../util/shlib_wrap.sh ./$(WPTEST)
test_md2: $(MD2TEST)$(EXE_EXT)
../util/shlib_wrap.sh ./$(MD2TEST)
test_rmd: $(RMDTEST)$(EXE_EXT)
../util/shlib_wrap.sh ./$(RMDTEST)
test_bf: $(BFTEST)$(EXE_EXT)
../util/shlib_wrap.sh ./$(BFTEST)
test_cast: $(CASTTEST)$(EXE_EXT)
../util/shlib_wrap.sh ./$(CASTTEST)
test_rc2: $(RC2TEST)$(EXE_EXT)
../util/shlib_wrap.sh ./$(RC2TEST)
test_rc4: $(RC4TEST)$(EXE_EXT)
../util/shlib_wrap.sh ./$(RC4TEST)
test_rc5: $(RC5TEST)$(EXE_EXT)
../util/shlib_wrap.sh ./$(RC5TEST)
test_rand: $(RANDTEST)$(EXE_EXT)
../util/shlib_wrap.sh ./$(RANDTEST)
test_enc: ../apps/openssl$(EXE_EXT) testenc
@sh ./testenc
test_x509: ../apps/openssl$(EXE_EXT) tx509 testx509.pem v3-cert1.pem v3-cert2.pem
echo test normal x509v1 certificate
sh ./tx509 2>/dev/null
echo test first x509v3 certificate
sh ./tx509 v3-cert1.pem 2>/dev/null
echo test second x509v3 certificate
sh ./tx509 v3-cert2.pem 2>/dev/null
test_rsa: $(RSATEST)$(EXE_EXT) ../apps/openssl$(EXE_EXT) trsa testrsa.pem
@sh ./trsa 2>/dev/null
../util/shlib_wrap.sh ./$(RSATEST)
test_crl: ../apps/openssl$(EXE_EXT) tcrl testcrl.pem
@sh ./tcrl 2>/dev/null
test_sid: ../apps/openssl$(EXE_EXT) tsid testsid.pem
@sh ./tsid 2>/dev/null
test_req: ../apps/openssl$(EXE_EXT) treq testreq.pem testreq2.pem
@sh ./treq 2>/dev/null
@sh ./treq testreq2.pem 2>/dev/null
test_pkcs7: ../apps/openssl$(EXE_EXT) tpkcs7 tpkcs7d testp7.pem pkcs7-1.pem
@sh ./tpkcs7 2>/dev/null
@sh ./tpkcs7d 2>/dev/null
test_bn: $(BNTEST)$(EXE_EXT) $(EXPTEST)$(EXE_EXT) bctest
@echo starting big number library test, could take a while...
@../util/shlib_wrap.sh ./$(BNTEST) >tmp.bntest
@echo quit >>tmp.bntest
@echo "running bc"
@<tmp.bntest sh -c "`sh ./bctest ignore`" | $(PERL) -e '$$i=0; while (<STDIN>) {if (/^test (.*)/) {print STDERR "\nverify $$1";} elsif (!/^0$$/) {die "\nFailed! bc: $$_";} else {print STDERR "."; $$i++;}} print STDERR "\n$$i tests passed\n"'
@echo 'test a^b%c implementations'
../util/shlib_wrap.sh ./$(EXPTEST)
test_ec: $(ECTEST)$(EXE_EXT)
@echo 'test elliptic curves'
../util/shlib_wrap.sh ./$(ECTEST)
test_ecdsa: $(ECDSATEST)$(EXE_EXT)
@echo 'test ecdsa'
../util/shlib_wrap.sh ./$(ECDSATEST)
test_ecdh: $(ECDHTEST)$(EXE_EXT)
@echo 'test ecdh'
../util/shlib_wrap.sh ./$(ECDHTEST)
test_verify: ../apps/openssl$(EXE_EXT)
@echo "The following command should have some OK's and some failures"
@echo "There are definitly a few expired certificates"
../util/shlib_wrap.sh ../apps/openssl verify -CApath ../certs/demo ../certs/demo/*.pem
test_dh: $(DHTEST)$(EXE_EXT)
@echo "Generate a set of DH parameters"
../util/shlib_wrap.sh ./$(DHTEST)
test_dsa: $(DSATEST)$(EXE_EXT)
@echo "Generate a set of DSA parameters"
../util/shlib_wrap.sh ./$(DSATEST)
../util/shlib_wrap.sh ./$(DSATEST) -app2_1
test_gen testreq.pem: ../apps/openssl$(EXE_EXT) testgen test.cnf
@echo "Generate and verify a certificate request"
@sh ./testgen
test_ss keyU.ss certU.ss certCA.ss certP1.ss keyP1.ss certP2.ss keyP2.ss \
intP1.ss intP2.ss: testss CAss.cnf Uss.cnf P1ss.cnf P2ss.cnf \
../apps/openssl$(EXE_EXT)
@echo "Generate and certify a test certificate"
@sh ./testss
@cat certCA.ss certU.ss > intP1.ss
@cat certCA.ss certU.ss certP1.ss > intP2.ss
test_engine: $(ENGINETEST)$(EXE_EXT)
@echo "Manipulate the ENGINE structures"
../util/shlib_wrap.sh ./$(ENGINETEST)
test_ssl: keyU.ss certU.ss certCA.ss certP1.ss keyP1.ss certP2.ss keyP2.ss \
intP1.ss intP2.ss $(SSLTEST)$(EXE_EXT) testssl testsslproxy \
../apps/server2.pem serverinfo.pem
@echo "test SSL protocol"
@if [ -n "$(FIPSCANLIB)" ]; then \
sh ./testfipsssl keyU.ss certU.ss certCA.ss; \
fi
../util/shlib_wrap.sh ./$(SSLTEST) -test_cipherlist
@sh ./testssl keyU.ss certU.ss certCA.ss
@sh ./testsslproxy keyP1.ss certP1.ss intP1.ss
@sh ./testsslproxy keyP2.ss certP2.ss intP2.ss
test_ca: ../apps/openssl$(EXE_EXT) testca CAss.cnf Uss.cnf
@if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then \
echo "skipping CA.sh test -- requires RSA"; \
else \
echo "Generate and certify a test certificate via the 'ca' program"; \
sh ./testca; \
fi
test_aes: #$(AESTEST)
# @echo "test Rijndael"
# ../util/shlib_wrap.sh ./$(AESTEST)
test_tsa: ../apps/openssl$(EXE_EXT) testtsa CAtsa.cnf ../util/shlib_wrap.sh
@if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then \
echo "skipping testtsa test -- requires RSA"; \
else \
sh ./testtsa; \
fi
test_ige: $(IGETEST)$(EXE_EXT)
@echo "Test IGE mode"
../util/shlib_wrap.sh ./$(IGETEST)
test_jpake: $(JPAKETEST)$(EXE_EXT)
@echo "Test JPAKE"
../util/shlib_wrap.sh ./$(JPAKETEST)
test_cms: ../apps/openssl$(EXE_EXT) cms-test.pl smcont.txt
@echo "CMS consistency test"
$(PERL) cms-test.pl
test_srp: $(SRPTEST)$(EXE_EXT)
@echo "Test SRP"
../util/shlib_wrap.sh ./srptest
test_ocsp: ../apps/openssl$(EXE_EXT) tocsp
@echo "Test OCSP"
@sh ./tocsp
test_v3name: $(V3NAMETEST)$(EXE_EXT)
@echo "Test X509v3_check_*"
../util/shlib_wrap.sh ./$(V3NAMETEST)
test_heartbeat: $(HEARTBEATTEST)$(EXE_EXT)
../util/shlib_wrap.sh ./$(HEARTBEATTEST)
test_constant_time: $(CONSTTIMETEST)$(EXE_EXT)
@echo "Test constant time utilites"
../util/shlib_wrap.sh ./$(CONSTTIMETEST)
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
depend:
@if [ -z "$(THIS)" ]; then \
$(MAKE) -f $(TOP)/Makefile reflect THIS=$@; \
else \
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC); \
fi
dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
mv -f Makefile.new $(MAKEFILE)
rm -f $(SRC) $(SHA256TEST).c $(SHA512TEST).c evptests.txt newkey.pem testkey.pem \
testreq.pem
clean:
rm -f .rnd tmp.bntest tmp.bctest *.o *.obj *.dll lib tags core .pure .nfs* *.old *.bak fluff $(EXE) *.ss *.srl log dummytest
$(DLIBSSL):
(cd ..; $(MAKE) DIRS=ssl all)
$(DLIBCRYPTO):
(cd ..; $(MAKE) DIRS=crypto all)
BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
shlib_target="$(SHLIB_TARGET)"; \
fi; \
LIBRARIES="$(LIBSSL) $(LIBCRYPTO) $(LIBKRB5)"; \
$(MAKE) -f $(TOP)/Makefile.shared -e \
CC="$${CC}" APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \
LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \
link_app.$${shlib_target}
FIPS_BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
shlib_target="$(SHLIB_TARGET)"; \
fi; \
LIBRARIES="$(LIBSSL) $(LIBCRYPTO) $(LIBKRB5)"; \
if [ -z "$(SHARED_LIBS)" -a -n "$(FIPSCANLIB)" ] ; then \
FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; export CC FIPSLD_CC; \
fi; \
$(MAKE) -f $(TOP)/Makefile.shared -e \
CC="$${CC}" APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \
LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \
link_app.$${shlib_target}
BUILD_CMD_STATIC=shlib_target=; \
LIBRARIES="$(DLIBSSL) $(DLIBCRYPTO) $(LIBKRB5)"; \
$(MAKE) -f $(TOP)/Makefile.shared -e \
APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \
LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \
link_app.$${shlib_target}
$(RSATEST)$(EXE_EXT): $(RSATEST).o $(DLIBCRYPTO)
@target=$(RSATEST); $(BUILD_CMD)
$(BNTEST)$(EXE_EXT): $(BNTEST).o $(DLIBCRYPTO)
@target=$(BNTEST); $(BUILD_CMD)
$(ECTEST)$(EXE_EXT): $(ECTEST).o $(DLIBCRYPTO)
@target=$(ECTEST); $(BUILD_CMD)
$(EXPTEST)$(EXE_EXT): $(EXPTEST).o $(DLIBCRYPTO)
@target=$(EXPTEST); $(BUILD_CMD)
$(IDEATEST)$(EXE_EXT): $(IDEATEST).o $(DLIBCRYPTO)
@target=$(IDEATEST); $(BUILD_CMD)
$(MD2TEST)$(EXE_EXT): $(MD2TEST).o $(DLIBCRYPTO)
@target=$(MD2TEST); $(BUILD_CMD)
$(SHATEST)$(EXE_EXT): $(SHATEST).o $(DLIBCRYPTO)
@target=$(SHATEST); $(BUILD_CMD)
$(SHA1TEST)$(EXE_EXT): $(SHA1TEST).o $(DLIBCRYPTO)
@target=$(SHA1TEST); $(BUILD_CMD)
$(SHA256TEST)$(EXE_EXT): $(SHA256TEST).o $(DLIBCRYPTO)
@target=$(SHA256TEST); $(BUILD_CMD)
$(SHA512TEST)$(EXE_EXT): $(SHA512TEST).o $(DLIBCRYPTO)
@target=$(SHA512TEST); $(BUILD_CMD)
$(RMDTEST)$(EXE_EXT): $(RMDTEST).o $(DLIBCRYPTO)
@target=$(RMDTEST); $(BUILD_CMD)
$(MDC2TEST)$(EXE_EXT): $(MDC2TEST).o $(DLIBCRYPTO)
@target=$(MDC2TEST); $(BUILD_CMD)
$(MD4TEST)$(EXE_EXT): $(MD4TEST).o $(DLIBCRYPTO)
@target=$(MD4TEST); $(BUILD_CMD)
$(MD5TEST)$(EXE_EXT): $(MD5TEST).o $(DLIBCRYPTO)
@target=$(MD5TEST); $(BUILD_CMD)
$(HMACTEST)$(EXE_EXT): $(HMACTEST).o $(DLIBCRYPTO)
@target=$(HMACTEST); $(BUILD_CMD)
$(WPTEST)$(EXE_EXT): $(WPTEST).o $(DLIBCRYPTO)
@target=$(WPTEST); $(BUILD_CMD)
$(RC2TEST)$(EXE_EXT): $(RC2TEST).o $(DLIBCRYPTO)
@target=$(RC2TEST); $(BUILD_CMD)
$(BFTEST)$(EXE_EXT): $(BFTEST).o $(DLIBCRYPTO)
@target=$(BFTEST); $(BUILD_CMD)
$(CASTTEST)$(EXE_EXT): $(CASTTEST).o $(DLIBCRYPTO)
@target=$(CASTTEST); $(BUILD_CMD)
$(RC4TEST)$(EXE_EXT): $(RC4TEST).o $(DLIBCRYPTO)
@target=$(RC4TEST); $(BUILD_CMD)
$(RC5TEST)$(EXE_EXT): $(RC5TEST).o $(DLIBCRYPTO)
@target=$(RC5TEST); $(BUILD_CMD)
$(DESTEST)$(EXE_EXT): $(DESTEST).o $(DLIBCRYPTO)
@target=$(DESTEST); $(BUILD_CMD)
$(RANDTEST)$(EXE_EXT): $(RANDTEST).o $(DLIBCRYPTO)
@target=$(RANDTEST); $(BUILD_CMD)
$(DHTEST)$(EXE_EXT): $(DHTEST).o $(DLIBCRYPTO)
@target=$(DHTEST); $(BUILD_CMD)
$(DSATEST)$(EXE_EXT): $(DSATEST).o $(DLIBCRYPTO)
@target=$(DSATEST); $(BUILD_CMD)
$(METHTEST)$(EXE_EXT): $(METHTEST).o $(DLIBCRYPTO)
@target=$(METHTEST); $(BUILD_CMD)
$(SSLTEST)$(EXE_EXT): $(SSLTEST).o $(DLIBSSL) $(DLIBCRYPTO)
@target=$(SSLTEST); $(FIPS_BUILD_CMD)
$(ENGINETEST)$(EXE_EXT): $(ENGINETEST).o $(DLIBCRYPTO)
@target=$(ENGINETEST); $(BUILD_CMD)
$(EVPTEST)$(EXE_EXT): $(EVPTEST).o $(DLIBCRYPTO)
@target=$(EVPTEST); $(BUILD_CMD)
$(EVPEXTRATEST)$(EXE_EXT): $(EVPEXTRATEST).o $(DLIBCRYPTO)
@target=$(EVPEXTRATEST); $(BUILD_CMD)
$(ECDSATEST)$(EXE_EXT): $(ECDSATEST).o $(DLIBCRYPTO)
@target=$(ECDSATEST); $(BUILD_CMD)
$(ECDHTEST)$(EXE_EXT): $(ECDHTEST).o $(DLIBCRYPTO)
@target=$(ECDHTEST); $(BUILD_CMD)
$(IGETEST)$(EXE_EXT): $(IGETEST).o $(DLIBCRYPTO)
@target=$(IGETEST); $(BUILD_CMD)
$(JPAKETEST)$(EXE_EXT): $(JPAKETEST).o $(DLIBCRYPTO)
@target=$(JPAKETEST); $(BUILD_CMD)
$(ASN1TEST)$(EXE_EXT): $(ASN1TEST).o $(DLIBCRYPTO)
@target=$(ASN1TEST); $(BUILD_CMD)
$(SRPTEST)$(EXE_EXT): $(SRPTEST).o $(DLIBCRYPTO)
@target=$(SRPTEST); $(BUILD_CMD)
$(V3NAMETEST)$(EXE_EXT): $(V3NAMETEST).o $(DLIBCRYPTO)
@target=$(V3NAMETEST); $(BUILD_CMD)
$(HEARTBEATTEST)$(EXE_EXT): $(HEARTBEATTEST).o $(DLIBCRYPTO)
@target=$(HEARTBEATTEST); $(BUILD_CMD_STATIC)
$(CONSTTIMETEST)$(EXE_EXT): $(CONSTTIMETEST).o
@target=$(CONSTTIMETEST) $(BUILD_CMD)
#$(AESTEST).o: $(AESTEST).c
# $(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c
#$(AESTEST)$(EXE_EXT): $(AESTEST).o $(DLIBCRYPTO)
# if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \
# $(CC) -o $(AESTEST)$(EXE_EXT) $(CFLAGS) $(AESTEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \
# else \
# $(CC) -o $(AESTEST)$(EXE_EXT) $(CFLAGS) $(AESTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \
# fi
dummytest$(EXE_EXT): dummytest.o $(DLIBCRYPTO)
@target=dummytest; $(BUILD_CMD)
# DO NOT DELETE THIS LINE -- make depend depends on it.
asn1test.o: ../include/openssl/asn1.h ../include/openssl/asn1_mac.h
asn1test.o: ../include/openssl/bio.h ../include/openssl/buffer.h
asn1test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
asn1test.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
asn1test.o: ../include/openssl/ecdsa.h ../include/openssl/evp.h
asn1test.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
asn1test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
asn1test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
asn1test.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h
asn1test.o: ../include/openssl/sha.h ../include/openssl/stack.h
asn1test.o: ../include/openssl/symhacks.h ../include/openssl/x509.h
asn1test.o: ../include/openssl/x509_vfy.h asn1test.c
bftest.o: ../e_os.h ../include/openssl/blowfish.h ../include/openssl/e_os2.h
bftest.o: ../include/openssl/opensslconf.h bftest.c
bntest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
bntest.o: ../include/openssl/bn.h ../include/openssl/buffer.h
bntest.o: ../include/openssl/crypto.h ../include/openssl/dh.h
bntest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
bntest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
bntest.o: ../include/openssl/ecdsa.h ../include/openssl/err.h
bntest.o: ../include/openssl/evp.h ../include/openssl/lhash.h
bntest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
bntest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
bntest.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
bntest.o: ../include/openssl/rand.h ../include/openssl/rsa.h
bntest.o: ../include/openssl/safestack.h ../include/openssl/sha.h
bntest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
bntest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h bntest.c
casttest.o: ../e_os.h ../include/openssl/cast.h ../include/openssl/e_os2.h
casttest.o: ../include/openssl/opensslconf.h casttest.c
constant_time_test.o: ../crypto/constant_time_locl.h ../e_os.h
constant_time_test.o: ../include/openssl/e_os2.h
constant_time_test.o: ../include/openssl/opensslconf.h constant_time_test.c
destest.o: ../include/openssl/des.h ../include/openssl/des_old.h
destest.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
destest.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
destest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
destest.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h destest.c
dhtest.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/bn.h
dhtest.o: ../include/openssl/crypto.h ../include/openssl/dh.h
dhtest.o: ../include/openssl/e_os2.h ../include/openssl/err.h
dhtest.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
dhtest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
dhtest.o: ../include/openssl/rand.h ../include/openssl/safestack.h
dhtest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h dhtest.c
dsatest.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/bn.h
dsatest.o: ../include/openssl/crypto.h ../include/openssl/dh.h
dsatest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
dsatest.o: ../include/openssl/err.h ../include/openssl/lhash.h
dsatest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
dsatest.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h
dsatest.o: ../include/openssl/safestack.h ../include/openssl/stack.h
dsatest.o: ../include/openssl/symhacks.h dsatest.c
ecdhtest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
ecdhtest.o: ../include/openssl/bn.h ../include/openssl/crypto.h
ecdhtest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
ecdhtest.o: ../include/openssl/ecdh.h ../include/openssl/err.h
ecdhtest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
ecdhtest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
ecdhtest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
ecdhtest.o: ../include/openssl/rand.h ../include/openssl/safestack.h
ecdhtest.o: ../include/openssl/sha.h ../include/openssl/stack.h
ecdhtest.o: ../include/openssl/symhacks.h ecdhtest.c
ecdsatest.o: ../include/openssl/asn1.h ../include/openssl/bio.h
ecdsatest.o: ../include/openssl/bn.h ../include/openssl/buffer.h
ecdsatest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
ecdsatest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
ecdsatest.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
ecdsatest.o: ../include/openssl/err.h ../include/openssl/evp.h
ecdsatest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
ecdsatest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
ecdsatest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
ecdsatest.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
ecdsatest.o: ../include/openssl/safestack.h ../include/openssl/sha.h
ecdsatest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
ecdsatest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
ecdsatest.o: ecdsatest.c
ectest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
ectest.o: ../include/openssl/bn.h ../include/openssl/buffer.h
ectest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
ectest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
ectest.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
ectest.o: ../include/openssl/err.h ../include/openssl/evp.h
ectest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
ectest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
ectest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
ectest.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
ectest.o: ../include/openssl/safestack.h ../include/openssl/sha.h
ectest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
ectest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h ectest.c
enginetest.o: ../include/openssl/asn1.h ../include/openssl/bio.h
enginetest.o: ../include/openssl/buffer.h ../include/openssl/crypto.h
enginetest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
enginetest.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
enginetest.o: ../include/openssl/engine.h ../include/openssl/err.h
enginetest.o: ../include/openssl/evp.h ../include/openssl/lhash.h
enginetest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
enginetest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
enginetest.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
enginetest.o: ../include/openssl/safestack.h ../include/openssl/sha.h
enginetest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
enginetest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
enginetest.o: enginetest.c
evp_extra_test.o: ../include/openssl/asn1.h ../include/openssl/bio.h
evp_extra_test.o: ../include/openssl/buffer.h ../include/openssl/crypto.h
evp_extra_test.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
evp_extra_test.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
evp_extra_test.o: ../include/openssl/err.h ../include/openssl/evp.h
evp_extra_test.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
evp_extra_test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
evp_extra_test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
evp_extra_test.o: ../include/openssl/pkcs7.h ../include/openssl/rsa.h
evp_extra_test.o: ../include/openssl/safestack.h ../include/openssl/sha.h
evp_extra_test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
evp_extra_test.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
evp_extra_test.o: evp_extra_test.c
evp_test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
evp_test.o: ../include/openssl/buffer.h ../include/openssl/conf.h
evp_test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
evp_test.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
evp_test.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
evp_test.o: ../include/openssl/err.h ../include/openssl/evp.h
evp_test.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
evp_test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
evp_test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
evp_test.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h
evp_test.o: ../include/openssl/sha.h ../include/openssl/stack.h
evp_test.o: ../include/openssl/symhacks.h ../include/openssl/x509.h
evp_test.o: ../include/openssl/x509_vfy.h evp_test.c
exptest.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/bn.h
exptest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
exptest.o: ../include/openssl/err.h ../include/openssl/lhash.h
exptest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
exptest.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h
exptest.o: ../include/openssl/safestack.h ../include/openssl/stack.h
exptest.o: ../include/openssl/symhacks.h exptest.c
heartbeat_test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
heartbeat_test.o: ../include/openssl/buffer.h ../include/openssl/comp.h
heartbeat_test.o: ../include/openssl/crypto.h ../include/openssl/dsa.h
heartbeat_test.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h
heartbeat_test.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
heartbeat_test.o: ../include/openssl/ecdsa.h ../include/openssl/err.h
heartbeat_test.o: ../include/openssl/evp.h ../include/openssl/hmac.h
heartbeat_test.o: ../include/openssl/kssl.h ../include/openssl/lhash.h
heartbeat_test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
heartbeat_test.o: ../include/openssl/opensslconf.h
heartbeat_test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
heartbeat_test.o: ../include/openssl/pem.h ../include/openssl/pem2.h
heartbeat_test.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h
heartbeat_test.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
heartbeat_test.o: ../include/openssl/sha.h ../include/openssl/srtp.h
heartbeat_test.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
heartbeat_test.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
heartbeat_test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
heartbeat_test.o: ../include/openssl/tls1.h ../include/openssl/x509.h
heartbeat_test.o: ../include/openssl/x509_vfy.h ../ssl/ssl_locl.h
heartbeat_test.o: ../test/testutil.h heartbeat_test.c
hmactest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
hmactest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
hmactest.o: ../include/openssl/evp.h ../include/openssl/hmac.h
hmactest.o: ../include/openssl/md5.h ../include/openssl/obj_mac.h
hmactest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
hmactest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
hmactest.o: ../include/openssl/safestack.h ../include/openssl/stack.h
hmactest.o: ../include/openssl/symhacks.h hmactest.c
ideatest.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/idea.h
ideatest.o: ../include/openssl/opensslconf.h ideatest.c
igetest.o: ../include/openssl/aes.h ../include/openssl/e_os2.h
igetest.o: ../include/openssl/opensslconf.h ../include/openssl/ossl_typ.h
igetest.o: ../include/openssl/rand.h igetest.c
jpaketest.o: ../include/openssl/buffer.h ../include/openssl/crypto.h
jpaketest.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
jpaketest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
jpaketest.o: ../include/openssl/safestack.h ../include/openssl/stack.h
jpaketest.o: ../include/openssl/symhacks.h jpaketest.c
md2test.o: ../include/openssl/buffer.h ../include/openssl/crypto.h
md2test.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
md2test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
md2test.o: ../include/openssl/safestack.h ../include/openssl/stack.h
md2test.o: ../include/openssl/symhacks.h md2test.c
md4test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
md4test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
md4test.o: ../include/openssl/evp.h ../include/openssl/md4.h
md4test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
md4test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
md4test.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
md4test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h md4test.c
md5test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
md5test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
md5test.o: ../include/openssl/evp.h ../include/openssl/md5.h
md5test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
md5test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
md5test.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
md5test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h md5test.c
mdc2test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
mdc2test.o: ../include/openssl/crypto.h ../include/openssl/des.h
mdc2test.o: ../include/openssl/des_old.h ../include/openssl/e_os2.h
mdc2test.o: ../include/openssl/evp.h ../include/openssl/mdc2.h
mdc2test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
mdc2test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
mdc2test.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
mdc2test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
mdc2test.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h mdc2test.c
randtest.o: ../e_os.h ../include/openssl/e_os2.h
randtest.o: ../include/openssl/opensslconf.h ../include/openssl/ossl_typ.h
randtest.o: ../include/openssl/rand.h randtest.c
rc2test.o: ../e_os.h ../include/openssl/e_os2.h
rc2test.o: ../include/openssl/opensslconf.h ../include/openssl/rc2.h rc2test.c
rc4test.o: ../e_os.h ../include/openssl/e_os2.h
rc4test.o: ../include/openssl/opensslconf.h ../include/openssl/rc4.h
rc4test.o: ../include/openssl/sha.h rc4test.c
rc5test.o: ../include/openssl/buffer.h ../include/openssl/crypto.h
rc5test.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
rc5test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
rc5test.o: ../include/openssl/safestack.h ../include/openssl/stack.h
rc5test.o: ../include/openssl/symhacks.h rc5test.c
rmdtest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
rmdtest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
rmdtest.o: ../include/openssl/evp.h ../include/openssl/obj_mac.h
rmdtest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
rmdtest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
rmdtest.o: ../include/openssl/ripemd.h ../include/openssl/safestack.h
rmdtest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h rmdtest.c
rsa_test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
rsa_test.o: ../include/openssl/bn.h ../include/openssl/crypto.h
rsa_test.o: ../include/openssl/e_os2.h ../include/openssl/err.h
rsa_test.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
rsa_test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
rsa_test.o: ../include/openssl/rand.h ../include/openssl/rsa.h
rsa_test.o: ../include/openssl/safestack.h ../include/openssl/stack.h
rsa_test.o: ../include/openssl/symhacks.h rsa_test.c
sha1test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
sha1test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
sha1test.o: ../include/openssl/evp.h ../include/openssl/obj_mac.h
sha1test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
sha1test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
sha1test.o: ../include/openssl/safestack.h ../include/openssl/sha.h
sha1test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h sha1test.c
shatest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
shatest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
shatest.o: ../include/openssl/evp.h ../include/openssl/obj_mac.h
shatest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
shatest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
shatest.o: ../include/openssl/safestack.h ../include/openssl/sha.h
shatest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h shatest.c
srptest.o: ../include/openssl/bio.h ../include/openssl/bn.h
srptest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
srptest.o: ../include/openssl/err.h ../include/openssl/lhash.h
srptest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
srptest.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h
srptest.o: ../include/openssl/safestack.h ../include/openssl/srp.h
srptest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h srptest.c
ssltest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
ssltest.o: ../include/openssl/bn.h ../include/openssl/buffer.h
ssltest.o: ../include/openssl/comp.h ../include/openssl/conf.h
ssltest.o: ../include/openssl/crypto.h ../include/openssl/dh.h
ssltest.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h
ssltest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
ssltest.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
ssltest.o: ../include/openssl/engine.h ../include/openssl/err.h
ssltest.o: ../include/openssl/evp.h ../include/openssl/hmac.h
ssltest.o: ../include/openssl/kssl.h ../include/openssl/lhash.h
ssltest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
ssltest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
ssltest.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
ssltest.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
ssltest.o: ../include/openssl/pqueue.h ../include/openssl/rand.h
ssltest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
ssltest.o: ../include/openssl/sha.h ../include/openssl/srp.h
ssltest.o: ../include/openssl/srtp.h ../include/openssl/ssl.h
ssltest.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
ssltest.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
ssltest.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
ssltest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
ssltest.o: ../include/openssl/x509v3.h ssltest.c
v3nametest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
v3nametest.o: ../include/openssl/buffer.h ../include/openssl/conf.h
v3nametest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
v3nametest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
v3nametest.o: ../include/openssl/ecdsa.h ../include/openssl/evp.h
v3nametest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
v3nametest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
v3nametest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
v3nametest.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h
v3nametest.o: ../include/openssl/sha.h ../include/openssl/stack.h
v3nametest.o: ../include/openssl/symhacks.h ../include/openssl/x509.h
v3nametest.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h
v3nametest.o: v3nametest.c
wp_test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
wp_test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
wp_test.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
wp_test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
wp_test.o: ../include/openssl/whrlpool.h wp_test.c
|
{
"pile_set_name": "Github"
}
|
@ECHO OFF
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S _ReSharper.*') DO echo "%%G" && rd /Q /S "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S *Debug*') DO echo "%%G" && rd /Q /S "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S *Release*') DO echo "%%G" && rd /Q /S "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S *ipch') DO echo "%%G" && rd /Q /S "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /S *.user') DO echo "%%G" && del /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /S *.bak') DO echo "%%G" && del /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /S *.ncb') DO echo "%%G" && del /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /S *.zip') DO echo "%%G" && del /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /S *.xml') DO echo "%%G" && del /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /S *.sdf') DO echo "%%G" && del /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /S /AH *.suo') DO echo "%%G" && del /Q /AH "%%G"
|
{
"pile_set_name": "Github"
}
|
// Copyright ©2016 The Gonum Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//+build !noasm,!appengine
#include "textflag.h"
// MOVSHDUP X3, X2
#define MOVSHDUP_X3_X2 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xD3
// MOVSLDUP X3, X3
#define MOVSLDUP_X3_X3 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xDB
// ADDSUBPS X2, X3
#define ADDSUBPS_X2_X3 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xDA
// MOVSHDUP X5, X4
#define MOVSHDUP_X5_X4 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xE5
// MOVSLDUP X5, X5
#define MOVSLDUP_X5_X5 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xED
// ADDSUBPS X4, X5
#define ADDSUBPS_X4_X5 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xEC
// MOVSHDUP X7, X6
#define MOVSHDUP_X7_X6 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xF7
// MOVSLDUP X7, X7
#define MOVSLDUP_X7_X7 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xFF
// ADDSUBPS X6, X7
#define ADDSUBPS_X6_X7 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xFE
// MOVSHDUP X9, X8
#define MOVSHDUP_X9_X8 BYTE $0xF3; BYTE $0x45; BYTE $0x0F; BYTE $0x16; BYTE $0xC1
// MOVSLDUP X9, X9
#define MOVSLDUP_X9_X9 BYTE $0xF3; BYTE $0x45; BYTE $0x0F; BYTE $0x12; BYTE $0xC9
// ADDSUBPS X8, X9
#define ADDSUBPS_X8_X9 BYTE $0xF2; BYTE $0x45; BYTE $0x0F; BYTE $0xD0; BYTE $0xC8
// func AxpyUnitary(alpha complex64, x, y []complex64)
TEXT ·AxpyUnitary(SB), NOSPLIT, $0
MOVQ x_base+8(FP), SI // SI = &x
MOVQ y_base+32(FP), DI // DI = &y
MOVQ x_len+16(FP), CX // CX = min( len(x), len(y) )
CMPQ y_len+40(FP), CX
CMOVQLE y_len+40(FP), CX
CMPQ CX, $0 // if CX == 0 { return }
JE caxy_end
PXOR X0, X0 // Clear work registers and cache-align loop
PXOR X1, X1
MOVSD alpha+0(FP), X0 // X0 = { 0, 0, imag(a), real(a) }
SHUFPD $0, X0, X0 // X0 = { imag(a), real(a), imag(a), real(a) }
MOVAPS X0, X1
SHUFPS $0x11, X1, X1 // X1 = { real(a), imag(a), real(a), imag(a) }
XORQ AX, AX // i = 0
MOVQ DI, BX // Align on 16-byte boundary for ADDPS
ANDQ $15, BX // BX = &y & 15
JZ caxy_no_trim // if BX == 0 { goto caxy_no_trim }
// Trim first value in unaligned buffer
XORPS X2, X2 // Clear work registers and cache-align loop
XORPS X3, X3
XORPS X4, X4
MOVSD (SI)(AX*8), X3 // X3 = { imag(x[i]), real(x[i]) }
MOVSHDUP_X3_X2 // X2 = { imag(x[i]), imag(x[i]) }
MOVSLDUP_X3_X3 // X3 = { real(x[i]), real(x[i]) }
MULPS X1, X2 // X2 = { real(a) * imag(x[i]), imag(a) * imag(x[i]) }
MULPS X0, X3 // X3 = { imag(a) * real(x[i]), real(a) * real(x[i]) }
// X3 = { imag(a)*real(x[i]) + real(a)*imag(x[i]), real(a)*real(x[i]) - imag(a)*imag(x[i]) }
ADDSUBPS_X2_X3
MOVSD (DI)(AX*8), X4 // X3 += y[i]
ADDPS X4, X3
MOVSD X3, (DI)(AX*8) // y[i] = X3
INCQ AX // i++
DECQ CX // --CX
JZ caxy_end // if CX == 0 { return }
caxy_no_trim:
MOVAPS X0, X10 // Copy X0 and X1 for pipelineing
MOVAPS X1, X11
MOVQ CX, BX
ANDQ $7, CX // CX = n % 8
SHRQ $3, BX // BX = floor( n / 8 )
JZ caxy_tail // if BX == 0 { goto caxy_tail }
caxy_loop: // do {
// X_i = { imag(x[i]), real(x[i]), imag(x[i+1]), real(x[i+1]) }
MOVUPS (SI)(AX*8), X3
MOVUPS 16(SI)(AX*8), X5
MOVUPS 32(SI)(AX*8), X7
MOVUPS 48(SI)(AX*8), X9
// X_(i-1) = { imag(x[i]), imag(x[i]), imag(x[i]+1), imag(x[i]+1) }
MOVSHDUP_X3_X2
MOVSHDUP_X5_X4
MOVSHDUP_X7_X6
MOVSHDUP_X9_X8
// X_i = { real(x[i]), real(x[i]), real(x[i+1]), real(x[i+1]) }
MOVSLDUP_X3_X3
MOVSLDUP_X5_X5
MOVSLDUP_X7_X7
MOVSLDUP_X9_X9
// X_i = { imag(a) * real(x[i]), real(a) * real(x[i]),
// imag(a) * real(x[i+1]), real(a) * real(x[i+1]) }
// X_(i-1) = { real(a) * imag(x[i]), imag(a) * imag(x[i]),
// real(a) * imag(x[i+1]), imag(a) * imag(x[i+1]) }
MULPS X1, X2
MULPS X0, X3
MULPS X11, X4
MULPS X10, X5
MULPS X1, X6
MULPS X0, X7
MULPS X11, X8
MULPS X10, X9
// X_i = {
// imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]),
// real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]),
// imag(result[i+1]): imag(a)*real(x[i+1]) + real(a)*imag(x[i+1]),
// real(result[i+1]): real(a)*real(x[i+1]) - imag(a)*imag(x[i+1]),
// }
ADDSUBPS_X2_X3
ADDSUBPS_X4_X5
ADDSUBPS_X6_X7
ADDSUBPS_X8_X9
// X_i = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]),
// imag(result[i+1]) + imag(y[i+1]), real(result[i+1]) + real(y[i+1]) }
ADDPS (DI)(AX*8), X3
ADDPS 16(DI)(AX*8), X5
ADDPS 32(DI)(AX*8), X7
ADDPS 48(DI)(AX*8), X9
MOVUPS X3, (DI)(AX*8) // y[i:i+1] = X_i
MOVUPS X5, 16(DI)(AX*8)
MOVUPS X7, 32(DI)(AX*8)
MOVUPS X9, 48(DI)(AX*8)
ADDQ $8, AX // i += 8
DECQ BX // --BX
JNZ caxy_loop // } while BX > 0
CMPQ CX, $0 // if CX == 0 { return }
JE caxy_end
caxy_tail: // do {
MOVSD (SI)(AX*8), X3 // X3 = { imag(x[i]), real(x[i]) }
MOVSHDUP_X3_X2 // X2 = { imag(x[i]), imag(x[i]) }
MOVSLDUP_X3_X3 // X3 = { real(x[i]), real(x[i]) }
MULPS X1, X2 // X2 = { real(a) * imag(x[i]), imag(a) * imag(x[i]) }
MULPS X0, X3 // X3 = { imag(a) * real(x[i]), real(a) * real(x[i]) }
// X3 = { imag(a)*real(x[i]) + real(a)*imag(x[i]),
// real(a)*real(x[i]) - imag(a)*imag(x[i]) }
ADDSUBPS_X2_X3
MOVSD (DI)(AX*8), X4 // X3 += y[i]
ADDPS X4, X3
MOVSD X3, (DI)(AX*8) // y[i] = X3
INCQ AX // ++i
LOOP caxy_tail // } while --CX > 0
caxy_end:
RET
|
{
"pile_set_name": "Github"
}
|
config DRM_MSM
tristate "MSM DRM"
depends on DRM
depends on ARCH_QCOM || (ARM && COMPILE_TEST)
depends on OF && COMMON_CLK
depends on MMU
select QCOM_MDT_LOADER if ARCH_QCOM
select REGULATOR
select DRM_KMS_HELPER
select DRM_PANEL
select SHMEM
select TMPFS
select QCOM_SCM
select SND_SOC_HDMI_CODEC if SND_SOC
select SYNC_FILE
select PM_OPP
default y
help
DRM/KMS driver for MSM/snapdragon.
config DRM_MSM_REGISTER_LOGGING
bool "MSM DRM register logging"
depends on DRM_MSM
default n
help
Compile in support for logging register reads/writes in a format
that can be parsed by envytools demsm tool. If enabled, register
logging can be switched on via msm.reglog=y module param.
config DRM_MSM_HDMI_HDCP
bool "Enable HDMI HDCP support in MSM DRM driver"
depends on DRM_MSM && QCOM_SCM
default y
help
Choose this option to enable HDCP state machine
config DRM_MSM_DSI
bool "Enable DSI support in MSM DRM driver"
depends on DRM_MSM
select DRM_PANEL
select DRM_MIPI_DSI
default y
help
Choose this option if you have a need for MIPI DSI connector
support.
config DRM_MSM_DSI_PLL
bool "Enable DSI PLL driver in MSM DRM"
depends on DRM_MSM_DSI && COMMON_CLK
default y
help
Choose this option to enable DSI PLL driver which provides DSI
source clocks under common clock framework.
config DRM_MSM_DSI_28NM_PHY
bool "Enable DSI 28nm PHY driver in MSM DRM"
depends on DRM_MSM_DSI
default y
help
Choose this option if the 28nm DSI PHY is used on the platform.
config DRM_MSM_DSI_20NM_PHY
bool "Enable DSI 20nm PHY driver in MSM DRM"
depends on DRM_MSM_DSI
default y
help
Choose this option if the 20nm DSI PHY is used on the platform.
config DRM_MSM_DSI_28NM_8960_PHY
bool "Enable DSI 28nm 8960 PHY driver in MSM DRM"
depends on DRM_MSM_DSI
default y
help
Choose this option if the 28nm DSI PHY 8960 variant is used on the
platform.
config DRM_MSM_DSI_14NM_PHY
bool "Enable DSI 14nm PHY driver in MSM DRM (used by MSM8996/APQ8096)"
depends on DRM_MSM_DSI
default y
help
Choose this option if DSI PHY on 8996 is used on the platform.
|
{
"pile_set_name": "Github"
}
|
2
0
0
0
0
0
2
0
5
0
0
0
0
2
5
0
0
4
3
2
0
0
2
2
0
2
0
4
0
0
2
0
0
2
0
0
2
2
0
2
2
7
2
0
0
5
2
0
2
2
5
0
1
4
2
2
0
0
5
0
2
2
4
0
0
2
2
0
3
2
0
0
4
0
0
4
0
4
0
3
0
0
2
0
2
2
0
8
0
0
0
1
2
0
2
3
0
4
0
2
1
2
0
0
2
4
0
2
0
0
2
0
0
0
3
0
2
2
0
0
2
2
0
4
0
3
4
0
0
0
0
2
4
2
2
2
0
8
2
0
0
0
2
4
0
2
4
0
4
2
0
0
1
2
1
2
0
2
2
0
0
2
0
4
3
0
0
0
0
0
9
4
2
0
0
2
0
3
0
0
4
1
0
0
0
2
4
0
0
0
0
0
4
0
2
9
2
2
4
2
2
0
0
1
5
0
0
4
0
0
4
0
0
0
4
2
2
0
2
2
2
2
2
0
2
2
0
0
0
2
0
2
2
0
0
2
0
4
2
2
0
5
0
2
1
0
2
0
2
2
0
0
2
2
4
0
4
2
2
0
2
0
0
4
2
2
4
0
2
0
2
0
0
0
2
0
0
0
0
0
2
4
0
2
0
2
2
0
|
{
"pile_set_name": "Github"
}
|
$NetBSD: patch-ab,v 1.12 2001/03/10 10:50:38 drochner Exp $
--- gdk/Makefile.in.orig Fri Mar 2 20:49:25 2001
+++ gdk/Makefile.in Wed Mar 7 21:54:58 2001
@@ -135,7 +135,7 @@
# libtool stuff: set version and export symbols for resolving
libgdkincludedir = $(includedir)/gtk-1.2/gdk
-libgdk_la_LDFLAGS = @STRIP_BEGIN@ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) -export-dynamic @GLIB_DEPLIBS@ @x_ldflags@ @x_libs@ -lm @STRIP_END@
+libgdk_la_LDFLAGS = @STRIP_BEGIN@ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -export-dynamic @GLIB_DEPLIBS@ @x_ldflags@ @x_libs@ -lm @STRIP_END@
#
|
{
"pile_set_name": "Github"
}
|
/**
* \file
*
* \brief Linker script for running in internal FLASH on the SAMD21E18A
*
* Copyright (c) 2014 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
SEARCH_DIR(.)
/* Memory Spaces Definitions */
MEMORY
{
rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
}
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
/* Section Definitions */
SECTIONS
{
.text :
{
. = ALIGN(4);
_sfixed = .;
KEEP(*(.vectors .vectors.*))
*(.text .text.* .gnu.linkonce.t.*)
*(.glue_7t) *(.glue_7)
*(.rodata .rodata* .gnu.linkonce.r.*)
*(.ARM.extab* .gnu.linkonce.armextab.*)
/* Support C constructors, and C destructors in both user code
and the C library. This also provides support for C++ code. */
. = ALIGN(4);
KEEP(*(.init))
. = ALIGN(4);
__preinit_array_start = .;
KEEP (*(.preinit_array))
__preinit_array_end = .;
. = ALIGN(4);
__init_array_start = .;
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array))
__init_array_end = .;
. = ALIGN(4);
KEEP (*crtbegin.o(.ctors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*crtend.o(.ctors))
. = ALIGN(4);
KEEP(*(.fini))
. = ALIGN(4);
__fini_array_start = .;
KEEP (*(.fini_array))
KEEP (*(SORT(.fini_array.*)))
__fini_array_end = .;
KEEP (*crtbegin.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*crtend.o(.dtors))
. = ALIGN(4);
_efixed = .; /* End of text section */
} > rom
/* .ARM.exidx is sorted, so has to go in its own output section. */
PROVIDE_HIDDEN (__exidx_start = .);
.ARM.exidx :
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
} > rom
PROVIDE_HIDDEN (__exidx_end = .);
. = ALIGN(4);
_etext = .;
.relocate : AT (_etext)
{
. = ALIGN(4);
_srelocate = .;
*(.ramfunc .ramfunc.*);
*(.data .data.*);
. = ALIGN(4);
_erelocate = .;
} > ram
/* .bss section which is used for uninitialized data */
.bss (NOLOAD) :
{
. = ALIGN(4);
_sbss = . ;
_szero = .;
*(.bss .bss.*)
*(COMMON)
. = ALIGN(4);
_ebss = . ;
_ezero = .;
} > ram
/* stack section */
.stack (NOLOAD):
{
. = ALIGN(8);
_sstack = .;
. = . + STACK_SIZE;
. = ALIGN(8);
_estack = .;
} > ram
. = ALIGN(4);
_end = . ;
}
|
{
"pile_set_name": "Github"
}
|
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/* Copyright (c) 2002 Graz University of Technology. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment:
*
* "This product includes software developed by IAIK of Graz University of
* Technology."
*
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Graz University of Technology" and "IAIK of Graz University of
* Technology" must not be used to endorse or promote products derived from
* this software without prior written permission.
*
* 5. Products derived from this software may not be called
* "IAIK PKCS Wrapper", nor may "IAIK" appear in their name, without prior
* written permission of Graz University of Technology.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package sun.security.pkcs11.wrapper;
/**
* interface CK_DESTROYMUTEX.<p>
*
* @author Karl Scheibelhofer <Karl.Scheibelhofer@iaik.at>
* @author Martin Schlaeffer <schlaeff@sbox.tugraz.at>
*/
public interface CK_DESTROYMUTEX {
/**
* Method CK_DESTROYMUTEX
*
* @param pMutex The mutex (lock) object.
* @exception PKCS11Exception
*/
public void CK_DESTROYMUTEX(Object pMutex) throws PKCS11Exception;
}
|
{
"pile_set_name": "Github"
}
|
#!/bin/sh -
# $Id$
#
# Build the S60 files.
msgc="/* DO NOT EDIT: automatically built by dist/s_s60. */"
. RELEASE
s=/tmp/__db_a
t=/tmp/__db_b
trap 'rm -f $s $t ; exit 0' 0
trap 'rm -f $s $t ; exit 1' 1 2 3 13 15
# Build the S60 db.h.
cat <<ENDOFSEDTEXT > $s
/@inttypes_h_decl@/d
/@stdint_h_decl@/d
s/@stddef_h_decl@/#include <stddef.h>/
/@unistd_h_decl@/d
s/@thread_h_decl@/#include <pthread.h>/
/@u_int8_decl@/d
/@int16_decl@/d
/@u_int16_decl@/d
/@int32_decl@/d
/@u_int32_decl@/d
/@int64_decl@/d
/@u_int64_decl@/d
/@u_char_decl@/d
/@u_int_decl@/d
/@u_long_decl@/d
/@u_short_decl@/d
s/@uintmax_t_decl@/typedef unsigned long uintmax_t;/
/@uintptr_t_decl@/d
/@FILE_t_decl@/d
/@off_t_decl@/d
/@pid_t_decl@/d
/@size_t_decl@/d
/@ssize_t_decl@/d
/@time_t_decl@/d
s/@db_seq_decl@/typedef int32_t db_seq_t;/
s/@db_threadid_t_decl@/typedef pthread_t db_threadid_t;/
s/@DB_VERSION_MAJOR@/$DB_VERSION_MAJOR/
s/@DB_VERSION_MINOR@/$DB_VERSION_MINOR/
s/@DB_VERSION_PATCH@/$DB_VERSION_PATCH/
s/@DB_VERSION_STRING@/"$DB_VERSION_STRING"/
s/@DB_VERSION_UNIQUE_NAME@//
s/@DB_CONST@//
s/@DB_PROTO1@/#undef __P/
s/@DB_PROTO2@/#define __P(protos) protos/
/@platform_header@/d
/@platform_footer@/d
ENDOFSEDTEXT
(echo "$msgc" &&
sed -f $s ../dbinc/db.in &&
cat ../dbinc_auto/api_flags.in &&
cat ../dbinc_auto/ext_prot.in) > $t
test `egrep '@.*@' $t` && {
egrep '@.*@' $t
echo 'Unexpanded autoconf variables found in S60 db.h.'
exit 1
}
f=../build_s60/db.h
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
# Build the S60 db_int.h.
cat <<ENDOFSEDTEXT > $s
s/@PATH_SEPARATOR@/\\\\\\\\\/:/
s/@db_int_def@//
ENDOFSEDTEXT
(echo "$msgc" && sed -f $s ../dbinc/db_int.in) > $t
test `egrep '@.*@' $t` && {
egrep '@.*@' $t
echo 'Unexpanded autoconf variables found in S60 db_int.h.'
exit 1
}
f=../build_s60/db_int.h
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
# Build the S60 db_config.h
# We don't fail, but we complain if the s60_config.in file isn't up-to-date.
check_config()
{
egrep '^#undef' config.hin | awk '{print $2}' | sort > $s
(egrep '#undef' $1 | awk '{print $3}'
egrep '^#define' $1 | awk '{print $2}') | sort > $t
cmp $s $t > /dev/null || {
echo "config.hin and $1 differ"
echo "<<< config.hin >>> $1"
diff $s $t
}
}
check_config s60/s60_config.in
f=../build_s60/db_config.h
(echo "$msgc" &&
sed "s/__EDIT_DB_VERSION__/$DB_VERSION/" s60/s60_config.in) > $t
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
# Build the S60 clib_port.h.
cat <<ENDOFSEDTEXT > $s
/@INT64_FMT@/d
/@UINT64_FMT@/d
ENDOFSEDTEXT
sed -f $s clib_port.in > $t
test `egrep '@.*@' $t` && {
egrep '@.*@' $t
echo 'Unexpanded autoconf variables found in S60 clib_port.h.'
exit 1
}
f=../build_s60/clib_port.h
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
exit 0
|
{
"pile_set_name": "Github"
}
|
#include <cstdio>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
#define fst first
#define snd second
const int MAXB = 17;
const int MAXN = 100100;
const long long INF = 1LL << 40;
typedef pair<int, int> PII;
typedef pair<int, long long> PIL;
typedef pair<long long, PII> PLPII;
struct DisjointSet {
int p[MAXN];
void init(int n) {
for (int i = 0; i < n; ++i) {
p[i] = i;
}
}
int root(int i) {
return p[i] = p[i] == i ? i : root(p[i]);
}
bool setp(int i, int j) {
i = root(i);
j = root(j);
if (i != j) {
p[i] = j;
return true;
} else {
return false;
}
}
} ds;
vector<PIL> e[MAXN];
vector<PLPII> ex;
int d[MAXN];
PIL p[MAXN][MAXB];
void dfs(int u, int v) {
for (int i = 1; i < MAXB; ++i) {
const PIL& q = p[p[u][i - 1].fst][i - 1];
p[u][i].fst = q.fst;
p[u][i].snd = max(p[u][i - 1].snd, q.snd);
}
for (vector<PIL>::const_iterator it = e[u].begin(); it != e[u].end(); ++it) {
int w = it->fst;
if (w == v) {
continue;
}
d[w] = d[u] + 1;
p[w][0].fst = u;
p[w][0].snd = it->snd;
dfs(w, u);
}
}
PIL up(int u, int n) {
long long snd = 0;
for (int i = 0; n > 0; ++i) {
if (n % 2 != 0) {
snd = max(snd, p[u][i].snd);
u = p[u][i].fst;
}
n >>= 1;
}
return make_pair(u, snd);
}
long long gao(int u, int v) {
int l = 0, r = min(d[u], d[v]) + 1, m;
while (l < r) { // TODO: faster LCA
m = (l + r) / 2;
if (up(u, d[u] - m).fst == up(v, d[v] - m).fst) {
l = m + 1;
} else {
r = m;
}
}
m = l - 1;
return max(up(u, d[u] - m).snd, up(v, d[v] - m).snd);
}
int main() {
int n, m, a, b, c;
long long sum, ans;
scanf("%d%d", &n, &m);
for (int i = 1; i < n; ++i) {
ex.push_back(make_pair(INF, make_pair(i - 1, i)));
}
for (int i = 0; i < m; ++i) {
scanf("%d%d%d", &a, &b, &c);
ex.push_back(make_pair(c, make_pair(a - 1, b - 1)));
}
sort(ex.begin(), ex.end());
ds.init(n);
sum = 0;
for (vector<PLPII>::const_iterator it = ex.begin(); it != ex.end(); ++it) {
if (ds.setp(it->snd.fst, it->snd.snd)) {
sum += it->fst;
e[it->snd.fst].push_back(make_pair(it->snd.snd, it->fst));
e[it->snd.snd].push_back(make_pair(it->snd.fst, it->fst));
}
}
d[0] = 0;
p[0][0] = make_pair(0, 0);
dfs(0, -1);
scanf("%d", &m);
for (int i = 0; i < m; ++i) {
scanf("%d%d", &a, &b);
ans = sum - gao(a - 1, b - 1);
// printf("%lld\n", ans < INF ? ans : -1LL);
printf("%I64d\n", ans < INF ? ans : -1LL);
}
return 0;
}
// <orz myself>
//# When Who Problem Lang Verdict Time Memory
//213473 Dec 11, 2010 10:09:15 PM watashi E - Baldman and the military GNU C++ Accepted 1670 ms 50032 KB
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2002-2010 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.lwjgl.opencl;
import org.lwjgl.PointerBuffer;
import org.lwjgl.util.generator.*;
import org.lwjgl.util.generator.opencl.*;
import java.nio.ByteBuffer;
@CLPlatformExtension
@CLDeviceExtension
@Extension(postfix = "KHR", className = "KHRGLSharing")
public interface KHR_gl_sharing {
/**
* Returned by clCreateContext, clCreateContextFromType, and
* clGetGLContextInfoKHR when an invalid OpenGL context or share group
* object handle is specified in <properties>:
*/
int CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR = -1000;
/** Accepted as the <param_name> argument of clGetGLContextInfoKHR: */
int CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR = 0x2006,
CL_DEVICES_FOR_GL_CONTEXT_KHR = 0x2007;
/**
* Accepted as an attribute name in the 'properties' argument of
* clCreateContext and clCreateContextFromType:
*/
int CL_GL_CONTEXT_KHR = 0x2008,
CL_EGL_DISPLAY_KHR = 0x2009,
CL_GLX_DISPLAY_KHR = 0x200A,
CL_WGL_HDC_KHR = 0x200B,
CL_CGL_SHAREGROUP_KHR = 0x200C;
@Code(
javaBeforeNative = "\t\tif ( param_value_size_ret == null && APIUtil.isDevicesParam(param_name) ) param_value_size_ret = APIUtil.getBufferPointer();",
javaAfterNative = "\t\tif ( __result == CL10.CL_SUCCESS && param_value != null && APIUtil.isDevicesParam(param_name) ) APIUtil.getCLPlatform(properties).registerCLDevices(param_value, param_value_size_ret);"
)
@cl_int
int clGetGLContextInfoKHR(@NullTerminated @Const @NativeType("cl_context_properties") PointerBuffer properties,
@NativeType("cl_gl_context_info") int param_name,
@AutoSize(value = "param_value", canBeNull = true) @size_t long param_value_size,
@OutParameter @Check(canBeNull = true) @cl_void ByteBuffer param_value,
@OutParameter @Check(value = "1", canBeNull = true) @NativeType("size_t") PointerBuffer param_value_size_ret);
}
|
{
"pile_set_name": "Github"
}
|
import React from 'react';
import PropTypes from 'prop-types';
const UilLink = (props) => {
const { color, size, ...otherProps } = props
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
height: size,
viewBox: '0 0 24 24',
fill: color,
...otherProps
}, React.createElement('path', {
d: 'M10,17.55,8.23,19.27a2.47,2.47,0,0,1-3.5-3.5l4.54-4.55a2.46,2.46,0,0,1,3.39-.09l.12.1a1,1,0,0,0,1.4-1.43A2.75,2.75,0,0,0,14,9.59a4.46,4.46,0,0,0-6.09.22L3.31,14.36a4.48,4.48,0,0,0,6.33,6.33L11.37,19A1,1,0,0,0,10,17.55ZM20.69,3.31a4.49,4.49,0,0,0-6.33,0L12.63,5A1,1,0,0,0,14,6.45l1.73-1.72a2.47,2.47,0,0,1,3.5,3.5l-4.54,4.55a2.46,2.46,0,0,1-3.39.09l-.12-.1a1,1,0,0,0-1.4,1.43,2.75,2.75,0,0,0,.23.21,4.47,4.47,0,0,0,6.09-.22l4.55-4.55A4.49,4.49,0,0,0,20.69,3.31Z'
}));
};
UilLink.propTypes = {
color: PropTypes.string,
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};
UilLink.defaultProps = {
color: 'currentColor',
size: '24',
};
export default UilLink;
|
{
"pile_set_name": "Github"
}
|
/*
* Pixel drawing function templates for QEMU SM501 Device
*
* Copyright (c) 2008 Shin-ichiro KAWASAKI
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#if DEPTH == 8
#define BPP 1
#define PIXEL_TYPE uint8_t
#elif DEPTH == 15 || DEPTH == 16
#define BPP 2
#define PIXEL_TYPE uint16_t
#elif DEPTH == 32
#define BPP 4
#define PIXEL_TYPE uint32_t
#else
#error unsupport depth
#endif
#ifdef BGR_FORMAT
#define PIXEL_NAME glue(DEPTH, bgr)
#else
#define PIXEL_NAME DEPTH
#endif /* BGR_FORMAT */
static void glue(draw_line8_, PIXEL_NAME)(
uint8_t *d, const uint8_t *s, int width, const uint32_t *pal)
{
uint8_t v, r, g, b;
do {
v = ldub_raw(s);
r = (pal[v] >> 16) & 0xff;
g = (pal[v] >> 8) & 0xff;
b = (pal[v] >> 0) & 0xff;
((PIXEL_TYPE *) d)[0] = glue(rgb_to_pixel, PIXEL_NAME)(r, g, b);
s ++;
d += BPP;
} while (-- width != 0);
}
static void glue(draw_line16_, PIXEL_NAME)(
uint8_t *d, const uint8_t *s, int width, const uint32_t *pal)
{
uint16_t rgb565;
uint8_t r, g, b;
do {
rgb565 = lduw_raw(s);
r = ((rgb565 >> 11) & 0x1f) << 3;
g = ((rgb565 >> 5) & 0x3f) << 2;
b = ((rgb565 >> 0) & 0x1f) << 3;
((PIXEL_TYPE *) d)[0] = glue(rgb_to_pixel, PIXEL_NAME)(r, g, b);
s += 2;
d += BPP;
} while (-- width != 0);
}
static void glue(draw_line32_, PIXEL_NAME)(
uint8_t *d, const uint8_t *s, int width, const uint32_t *pal)
{
uint8_t r, g, b;
do {
ldub_raw(s);
#if defined(TARGET_WORDS_BIGENDIAN)
r = s[1];
g = s[2];
b = s[3];
#else
b = s[0];
g = s[1];
r = s[2];
#endif
((PIXEL_TYPE *) d)[0] = glue(rgb_to_pixel, PIXEL_NAME)(r, g, b);
s += 4;
d += BPP;
} while (-- width != 0);
}
/**
* Draw hardware cursor image on the given line.
*/
static void glue(draw_hwc_line_, PIXEL_NAME)(SM501State * s, int crt,
uint8_t * palette, int c_y, uint8_t *d, int width)
{
int x, i;
uint8_t bitset = 0;
/* get hardware cursor pattern */
uint32_t cursor_addr = get_hwc_address(s, crt);
assert(0 <= c_y && c_y < SM501_HWC_HEIGHT);
cursor_addr += 64 * c_y / 4; /* 4 pixels per byte */
cursor_addr += s->base;
/* get cursor position */
x = get_hwc_x(s, crt);
d += x * BPP;
for (i = 0; i < SM501_HWC_WIDTH && x + i < width; i++) {
uint8_t v;
/* get pixel value */
if (i % 4 == 0) {
cpu_physical_memory_rw(cursor_addr, &bitset, 1, 0);
cursor_addr++;
}
v = bitset & 3;
bitset >>= 2;
/* write pixel */
if (v) {
v--;
uint8_t r = palette[v * 3 + 0];
uint8_t g = palette[v * 3 + 1];
uint8_t b = palette[v * 3 + 2];
((PIXEL_TYPE *) d)[0] = glue(rgb_to_pixel, PIXEL_NAME)(r, g, b);
}
d += BPP;
}
}
#undef DEPTH
#undef BPP
#undef PIXEL_TYPE
#undef PIXEL_NAME
#undef BGR_FORMAT
|
{
"pile_set_name": "Github"
}
|
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BLUEPRINT\-APPLY" "1" "December 2011" "DevStructure" "Blueprint"
.
.SH "NAME"
\fBblueprint\-apply\fR \- run a blueprint\'s generated shell code
.
.SH "SYNOPSIS"
\fBblueprint apply\fR [\fB\-r\fR] [\fB\-q\fR] [\fIname\fR]
.
.SH "DESCRIPTION"
\fBblueprint\-apply\fR generated POSIX shell code for the blueprint \fIname\fR and executes it\. It is equivalent to
.
.IP "" 4
.
.nf
blueprint show <name> \-\-sh | sh
.
.fi
.
.IP "" 0
.
.P
and provided for convenience and completeness\.
.
.P
If \fIname\fR is omitted or \fB\-\fR, a blueprint is read from standard input and applied in the same manner\. See \fBblueprint\fR(5) for the details of the format\.
.
.SH "OPTIONS"
.
.TP
\fB\-r\fR, \fB\-\-relaxed\fR
Relax version constraints in generated code\.
.
.TP
\fB\-q\fR, \fB\-\-quiet\fR
Operate quietly\.
.
.TP
\fB\-h\fR, \fB\-\-help\fR
Show a help message\.
.
.SH "FILES"
.
.TP
\fB~/\.blueprints\.git\fR
The local repsitory where blueprints are stored, each on its own branch\.
.
.SH "THEME SONG"
The Flaming Lips \- "The W\.A\.N\.D\. (The Will Always Negates Defeat)"
.
.SH "AUTHOR"
Richard Crowley \fIrichard@devstructure\.com\fR
.
.SH "SEE ALSO"
Part of \fBblueprint\fR(1)\.
|
{
"pile_set_name": "Github"
}
|
#include <glm/vector_relational.hpp>
#include <glm/mat2x2.hpp>
#include <glm/mat2x3.hpp>
#include <glm/mat2x4.hpp>
#include <glm/mat3x2.hpp>
#include <glm/mat3x3.hpp>
#include <glm/mat3x4.hpp>
#include <glm/mat4x2.hpp>
#include <glm/mat4x3.hpp>
#include <glm/mat4x4.hpp>
#include <vector>
static bool test_operators()
{
glm::mat3x4 l(1.0f);
glm::mat3x4 m(1.0f);
glm::vec3 u(1.0f);
glm::vec4 v(1.0f);
float x = 1.0f;
glm::vec4 a = m * u;
glm::vec3 b = v * m;
glm::mat3x4 n = x / m;
glm::mat3x4 o = m / x;
glm::mat3x4 p = x * m;
glm::mat3x4 q = m * x;
bool R = m != q;
bool S = m == l;
return (S && !R) ? 0 : 1;
}
int test_ctr()
{
int Error(0);
#if(GLM_HAS_INITIALIZER_LISTS)
glm::mat3x4 m0(
glm::vec4(0, 1, 2, 3),
glm::vec4(4, 5, 6, 7),
glm::vec4(8, 9, 10, 11));
glm::mat3x4 m1{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
glm::mat3x4 m2{
{0, 1, 2, 3},
{4, 5, 6, 7},
{8, 9, 10, 11}};
for(glm::length_t i = 0; i < m0.length(); ++i)
Error += glm::all(glm::equal(m0[i], m2[i])) ? 0 : 1;
for(glm::length_t i = 0; i < m1.length(); ++i)
Error += glm::all(glm::equal(m1[i], m2[i])) ? 0 : 1;
std::vector<glm::mat3x4> v1{
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11},
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
};
std::vector<glm::mat3x4> v2{
{
{ 0, 1, 2, 3},
{ 4, 5, 6, 7},
{ 8, 9, 10, 11}
},
{
{ 0, 1, 2, 3},
{ 4, 5, 6, 7},
{ 8, 9, 10, 11}
}
};
#endif//GLM_HAS_INITIALIZER_LISTS
return Error;
}
namespace cast
{
template<typename genType>
int entry()
{
int Error = 0;
genType A(1.0f);
glm::mat3x4 B(A);
glm::mat3x4 Identity(1.0f);
for(glm::length_t i = 0, length = B.length(); i < length; ++i)
Error += glm::all(glm::equal(B[i], Identity[i])) ? 0 : 1;
return Error;
}
int test()
{
int Error = 0;
Error += entry<glm::mat2x2>();
Error += entry<glm::mat2x3>();
Error += entry<glm::mat2x4>();
Error += entry<glm::mat3x2>();
Error += entry<glm::mat3x3>();
Error += entry<glm::mat3x4>();
Error += entry<glm::mat4x2>();
Error += entry<glm::mat4x3>();
Error += entry<glm::mat4x4>();
return Error;
}
}//namespace cast
int test_size()
{
int Error = 0;
Error += 48 == sizeof(glm::mat3x4) ? 0 : 1;
Error += 96 == sizeof(glm::dmat3x4) ? 0 : 1;
Error += glm::mat3x4().length() == 3 ? 0 : 1;
Error += glm::dmat3x4().length() == 3 ? 0 : 1;
Error += glm::mat3x4::length() == 3 ? 0 : 1;
Error += glm::dmat3x4::length() == 3 ? 0 : 1;
return Error;
}
int main()
{
int Error = 0;
Error += cast::test();
Error += test_ctr();
Error += test_operators();
Error += test_size();
return Error;
}
|
{
"pile_set_name": "Github"
}
|
:107E000001C0B7C0112484B790E89093610010922C
:107E10006100882361F0982F9A70923041F081FFC1
:107E200002C097EF94BF282E80E0C6D0E9C085E05D
:107E30008093810082E08093C00088E18093C1003C
:107E400083E08093C40086E08093C2008EE0B4D0CB
:107E5000279A84E02EE33EEF91E030938500209353
:107E6000840096BBB09BFECF1F9AA8954091C0009E
:107E700047FD02C0815089F793D0813479F490D0C6
:107E8000182FA0D0123811F480E004C088E0113817
:107E900009F083E07ED080E17CD0EECF823419F40B
:107EA00084E198D0F8CF853411F485E0FACF853598
:107EB00041F476D0C82F74D0D82FCC0FDD1F82D0DC
:107EC000EACF863519F484E085D0DECF843691F58B
:107ED00067D066D0F82E64D0D82E00E011E05801AB
:107EE0008FEFA81AB80A5CD0F80180838501FA10D8
:107EF000F6CF68D0F5E4DF1201C0FFCF50E040E0DC
:107F000063E0CE0136D08E01E0E0F1E06F0182E067
:107F1000C80ED11C4081518161E0C8012AD00E5F9A
:107F20001F4FF601FC10F2CF50E040E065E0CE01BB
:107F300020D0B1CF843771F433D032D0F82E30D086
:107F400041D08E01F80185918F0123D0FA94F11070
:107F5000F9CFA1CF853739F435D08EE11AD085E934
:107F600018D081E197CF813509F0A9CF88E024D0DE
:107F7000A6CFFC010A0167BFE895112407B600FCF3
:107F8000FDCF667029F0452B19F481E187BFE89594
:107F900008959091C00095FFFCCF8093C60008958E
:107FA0008091C00087FFFCCF8091C00084FD01C09C
:107FB000A8958091C6000895E0E6F0E098E19083EE
:107FC00080830895EDDF803219F088E0F5DFFFCF80
:107FD00084E1DFCFCF93C82FE3DFC150E9F7CF9122
:027FE000F1CFDF
:027FFE00000879
:0400000300007E007B
:00000001FF
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>three.js webgl - viewer 3</title>
<meta charset="utf-8">
<style type="text/css">
body {
margin:0;
overflow: hidden;
background: #000;
line-height:1.25em
}
#file_dialog {
width:100%;
height:100%;
position:absolute;
top:0px;
left:0px;
z-index:100;
}
#drop_zone {
position:absolute;
width:100%;
height:100%;
padding:9% 0;
color: #eee;
}
#drop_label {
text-align: left;
font: 20pt bold georgia;
font-variant:small-caps;
text-transform:uppercase;
}
#help {
background: rgba(0, 0, 0, 0.9);
padding:2em;
width:400px;
margin:1em auto;
text-align:left;
}
.hh { color:gold }
.kw { color:red }
#file_list {
text-align: left;
}
ul { padding:0; margin:0 }
ul li { list-style-type:none }
.missing { color:red; font-weight:bold }
.loaded { color:black; font-weight:bold }
.fsize { font-size:0.9em; color:#444 }
#gui_wrapper {
position:absolute;
top:0px;
right:0px;
width:200px;
height:100%;
background:hsla(10,30%,80%, 0.75);
padding:10px 15px;
z-index:200;
overflow:auto;
font-size:0.9em;
}
.lbl {
font-weight:bold;
cursor:pointer;
}
.chk {
background:hsla(10,80%,50%, 0.4);
color:#fff;
width:14px;
height:14px;
display:inline-block;
text-align:center;
font-weight:bold;
font-family:verdana;
font-size:14px;
line-height:10px;
cursor:pointer;
}
#l_fog { margin-right:1em }
#l_bgDark { margin-right:0.25em }
#morphs {
background: rgba(0, 0, 0, 0.9);
padding:0 1em 1em;
z-index:500;
position:absolute;
top:1em;
left:100px;
color:#fff;
display:none;
}
#camera {
background: rgba(0, 0, 0, 0.9);
padding:0 1em;
z-index:250;
position:absolute;
bottom:1em;
left:1em;
color:#fff;
display:block;
}
.number { display:inline-block; width:4em }
.morph_label { display:inline-block; width:4em; margin:0 0.5em }
.morph_pct { display:inline-block; width:3.5em; color:#555; text-align:right }
.sval { color:darkred; border:solid 0px red; display:block; margin:0.5em 0 1em 0; }
.slabel { color:#333 }
.sgroup { background: rgba(0,0,0,0.1); padding:0.2em 0.5em 0.2em; margin:0.5em 0; }
.sheader { font-weight:bold; }
.sinner { padding:0 0 1em 0; display:none }
.tbutton { display:inline-block;
background:rgba(0,0,0,0.25);
color:#fff;
width:20px;
height:20px;
text-align:center;
font-weight:bold;
cursor:pointer;
margin:0 -5px 0;
float:right;
}
.button_action { background:#400; color:#fff; padding:0.2em 0.5em; margin:0 0 0.5em 0; cursor:pointer; font-weight:bold; }
.zshadow { box-shadow: 0px 0px 5px rgba(0,0,0,0.35) }
.hud { display:block }
#hud_button {
background:#000;
color:#fff;
width:20px;
height:20px;
text-align:center;
font-weight:bold;
position:absolute;
top:0px;
right:0px;
z-index:250;
cursor:pointer;
}
.header {
color: hsl(10, 80%, 30%);
font-weight:bold;
text-transform:uppercase;
}
.overlay {
position:absolute;
left:0px;
top:0px;
width:100%;
height:100%;
background-size: 100%;
z-index:50;
display:none;
}
#overlayDirt {
background: url(textures/layers/VignetteWithDirt_alpha.png) no-repeat;
}
#overlayVignette {
background: url(textures/layers/Vignette_alpha.png) no-repeat;
}
#overlayLensFlare {
background: url(textures/layers/LensFlare_alpha.png) no-repeat;
}
#images {
border:solid 2px red;
position:absolute;
top:0px;
left:0px;
z-index:200;
}
.button {
color:white;
background:darkred;
font-size:0.9em;
font-weight:bold;
font-variant:small-caps;
text-transform:uppercase;
padding:0.2em 0.5em;
cursor:pointer;
}
#files_div { display:none }
#textures_div { display:none }
</style>
</head>
<body>
<div id="viewport"></div>
<script type="text/javascript" src="js/Three.js"></script>
<script type="text/javascript" src="js/animal.js"></script>
<script type="text/javascript" src="js/Slider.js"></script>
<script type="text/javascript" src="js/Detector.js"></script>
<script type="text/javascript" src="js/RequestAnimationFrame.js"></script>
<script type="text/javascript" src="js/Stats.js"></script>
<div class="overlay" id="overlayDirt"></div>
<div class="overlay" id="overlayVignette"></div>
<div class="overlay" id="overlayLensFlare"></div>
<div id="images"></div>
<div id="morphs">
<p><span class="hh">Morphing</span>
<p>A <span class="kw morph_label" id="morph_a">aaa</span> <span class="kw morph_pct" id="morph_a_pct">10%</span><br/>
B <span class="kw morph_label" id="morph_b">bbb</span> <span class="kw morph_pct" id="morph_b_pct">90%</span>
<div id="slider_wrap2"> </div>
<p>Speed <span class="morph_pct" id="speed_val">1.0</span>
<div id="slider_wrap1"> </div><br/>
</div>
<div id="camera">
<p><span class="hh" id="cam_type">Orbit camera</span><br/>
<span id="cam_location"></span>
</div>
<div class="hud" id="file_dialog">
<div id="drop_zone">
<div id="help">
<div id="drop_label">Drop files here</div>
<small>JSON format version 2</small>
<p>Drop to <span class="hh">left</span> half of window to <span class="hh">reset</span> scene<br/>
drop to <span class="hh">right</span> half window to <span class="hh">append</span> to existing scene
<p>Press <span class="kw">SPACE</span> to toggle user interface<br/>
Press <span class="kw">R</span> to toggle axis + grid<br/>
Press <span class="kw">1</span>, <span class="kw">2</span> to change camera mode<br/>
<p><span class="hh">1: Camera orbit mode</span>
<p><span class="kw">SHIFT</span> + mouse to rotate<br/>
Mouse wheel to zoom
<p><span class="hh">2: Camera fly mode</span>
<p>Navigate with <span class="kw">WASD</span> / arrows / mouse<br/>
<span class="kw">PgUp</span> / <span class="kw">PgDn</span> change speed<br/>
Press <span class="kw">0</span> to reset fly camera
<p><span class="hh">Morphing</span>
<p>Move mouse left-right to control morph blending<br/>
Press <span class="kw">O</span> to cycle through morphs sources A<br/>
Press <span class="kw">P</span> to cycle through morphs sources B<br/>
</div>
</div>
</div>
<div class="hud" id="gui_wrapper">
<!--
<div class="button_action zshadow" id="btn_png">Create image</div>
-->
<span class="header">Postprocessing</span><br/>
<span id="b_noise" class="chk"> </span> <span id="l_noise" class="lbl">Noise</span> <br/>
<span id="b_bloom" class="chk"> </span> <span id="l_bloom" class="lbl">Bloom</span> <br/>
<span id="b_bloomnoise" class="chk"> </span> <span id="l_bloomnoise" class="lbl">Bloom + Noise</span> <br/>
<span id="b_none" class="chk"> </span> <span id="l_none" class="lbl">None</span> <br/>
<br/>
<span class="header">Overlays</span><br/>
<span id="b_film" class="chk"> </span> <span id="l_film" class="lbl">Film strips</span> <br/>
<span id="b_vignette" class="chk"> </span> <span id="l_vignette" class="lbl">Vignette</span> <br/>
<span id="b_dirt" class="chk"> </span> <span id="l_dirt" class="lbl">Dirt</span> <br/>
<span id="b_lensFlare" class="chk"> </span> <span id="l_lensFlare" class="lbl">Lens flare</span> <br/>
<br/>
<span class="header">Light</span><br/>
<span id="b_lightWhite" class="chk"> </span> <span id="l_lightWhite" class="lbl">White</span> <br/>
<span id="b_lightCold" class="chk"> </span> <span id="l_lightCold" class="lbl">Cold</span> <br/>
<span id="b_lightWarm" class="chk"> </span> <span id="l_lightWarm" class="lbl">Warm</span> <br/>
<span id="b_lightSunset" class="chk"> </span> <span id="l_lightSunset" class="lbl">Sunset</span> <br/>
<br/>
<span class="header">Scale</span><br/>
<span id="b_s0001" class="chk"> </span> <span id="l_s0001" class="lbl">0.001</span>
<span id="b_s001" class="chk"> </span> <span id="l_s001" class="lbl">0.01</span>
<span id="b_s01" class="chk"> </span> <span id="l_s01" class="lbl">0.1</span>
<span id="b_s05" class="chk"> </span> <span id="l_s05" class="lbl">0.5</span><br/>
<span id="b_s1" class="chk">♦</span> <span id="l_s1" class="lbl">1</span>
<span id="b_s2" class="chk">♦</span> <span id="l_s2" class="lbl">2</span>
<span id="b_s5" class="chk">♦</span> <span id="l_s5" class="lbl">5</span>
<span id="b_s10" class="chk"> </span> <span id="l_s10" class="lbl">10</span>
<span id="b_s100" class="chk"> </span> <span id="l_s100" class="lbl">100</span>
<br/><br/>
<div class="button_action zshadow" id="btn_set">Export settings</div>
<div class="sgroup zshadow">
<div class="tbutton" id="btn_fog">+</div>
<div class="sheader">Fog</div>
<div class="sinner" id="grp_fog">
<div class="sval"><span class="slabel">Density:</span> <span id="fog_density">0.0000</span></div>
<div id="slider_wrap_fog_d"> </div>
<div class="sval"><span class="slabel">Hue:</span> <span id="fog_hue">0.00</span></div>
<div id="slider_wrap_fog_h"> </div>
<div class="sval"><span class="slabel">Saturation:</span> <span id="fog_sat">0.00</span></div>
<div id="slider_wrap_fog_s"> </div>
<div class="sval"><span class="slabel">Value:</span> <span id="fog_val">0.00</span></div>
<div id="slider_wrap_fog_v"> </div>
</div>
</div>
<div class="sgroup zshadow">
<div class="tbutton" id="btn_noise">+</div>
<div class="sheader">Noise</div>
<div class="sinner" id="grp_noise">
<div class="sval"><span class="slabel">Noise intensity:</span> <span id="noise_intensity">0.00</span></div>
<div id="slider_wrap_noise_i"> </div>
<div class="sval"><span class="slabel">Scanlines intensity:</span> <span id="scanlines_intensity">0.00</span></div>
<div id="slider_wrap_scanlines_i"> </div>
<div class="sval"><span class="slabel">Scanlines count:</span> <span id="scanlines_count">0</span></div>
<div id="slider_wrap_linecount"> </div>
</div>
</div>
<div class="sgroup zshadow">
<div class="tbutton" id="btn_bloom">+</div>
<div class="sheader">Bloom</div>
<div class="sinner" id="grp_bloom">
<div class="sval"><span class="slabel">Intensity:</span> <span id="bloom_intensity">0.00</span></div>
<div id="slider_wrap_bloom"> </div>
</div>
</div>
<div class="sgroup zshadow">
<div class="tbutton" id="btn_alight">+</div>
<div class="sheader">Ambient light</div>
<div class="sinner" id="grp_alight">
<div class="sval"><span class="slabel">Hue:</span> <span id="al_hue">0.00</span></div>
<div id="slider_wrap_al_h"> </div>
<div class="sval"><span class="slabel">Saturation:</span> <span id="al_sat">0.00</span></div>
<div id="slider_wrap_al_s"> </div>
<div class="sval"><span class="slabel">Value:</span> <span id="al_val">0.00</span></div>
<div id="slider_wrap_al_v"> </div>
</div>
</div>
<div class="sgroup zshadow">
<div class="tbutton" id="btn_dlight1">+</div>
<div class="sheader">Directional light 1</div>
<div class="sinner" id="grp_dlight1">
<div class="sval"><span class="slabel">Hue:</span> <span id="dl1_hue">0.00</span></div>
<div id="slider_wrap_dl1_h"> </div>
<div class="sval"><span class="slabel">Saturation:</span> <span id="dl1_sat">0.00</span></div>
<div id="slider_wrap_dl1_s"> </div>
<div class="sval"><span class="slabel">Value:</span> <span id="dl1_val">0.00</span></div>
<div id="slider_wrap_dl1_v"> </div>
<div class="sval"><span class="slabel">Phi:</span> <span id="dl1_phi">0.00</span></div>
<div id="slider_wrap_dl1_phi"> </div>
<div class="sval"><span class="slabel">Theta:</span> <span id="dl1_theta">0.00</span></div>
<div id="slider_wrap_dl1_theta"> </div>
</div>
</div>
<div class="sgroup zshadow">
<div class="tbutton" id="btn_dlight2">+</div>
<div class="sheader">Directional light 2</div>
<div class="sinner" id="grp_dlight2">
<div class="sval"><span class="slabel">Hue:</span> <span id="dl2_hue">0.00</span></div>
<div id="slider_wrap_dl2_h"> </div>
<div class="sval"><span class="slabel">Saturation:</span> <span id="dl2_sat">0.00</span></div>
<div id="slider_wrap_dl2_s"> </div>
<div class="sval"><span class="slabel">Value:</span> <span id="dl2_val">0.00</span></div>
<div id="slider_wrap_dl2_v"> </div>
<div class="sval"><span class="slabel">Phi:</span> <span id="dl2_phi">0.00</span></div>
<div id="slider_wrap_dl2_phi"> </div>
<div class="sval"><span class="slabel">Theta:</span> <span id="dl2_theta">0.00</span></div>
<div id="slider_wrap_dl2_theta"> </div>
</div>
</div>
<!--
<div class="sgroup zshadow">
<div class="tbutton" id="btn_lensflare">+</div>
<div class="sheader">Lens Flare</div>
<div class="sinner" id="grp_lensflare">
<div class="sval"><span class="slabel">Vertical angle:</span> <span id="lf_x">0.00</span></div>
<div id="slider_wrap_lf_x"> </div>
<div class="sval"><span class="slabel">Horizontal angle:</span> <span id="lf_y">0.00</span></div>
<div id="slider_wrap_lf_y"> </div>
</div>
</div>
-->
<div id="files_div">
<span class="header">Files</span><br/>
<div id="file_list"></div>
<br/>
</div>
<div id="textures_div">
<span class="header">Textures</span><br/>
<div id="texture_list"></div>
<br/>
</div>
</div>
<div id="hud_button">+</div>
<script type="text/javascript">
window.onload = init;
if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
if ( ! Detector.fileapi ) alert( 'The File APIs are not fully supported in this browser.' );
// GUI
var guiVisible = true;
// scales
var GLOBAL_SCALE = 1,
BASE_SCALE = 1,
SCALES = [ [ "b_s0001", 0.001 ],
[ "b_s001", 0.01 ],
[ "b_s01", 0.1 ],
[ "b_s05", 0.5 ],
[ "b_s1", 1 ],
[ "b_s2", 2 ],
[ "b_s5", 5 ],
[ "b_s10", 10 ],
[ "b_s100", 100 ] ];
// overlays
var overlays = {
filmStrip: false,
dirt: false,
vignette: false,
lensFlare: false
};
// fog
var fogdensity = 0.000125;
var FOG = {
"h": 0.0,
"s": 0.0,
"v": 0.0
};
// lights
var ambientLight, directionalLight1, directionalLight2;
var lightColors = {
"white": [ { h: 0.0, s: 0.0, v: 0.1 }, { h: 0.0, s: 0.0, v: 1.0 }, { h: 0.0, s: 0.0, v: 0.2 } ],
"cold": [ { h: 0.6, s: 0.2, v: 0.1 }, { h: 0.6, s: 0.2, v: 1.0 }, { h: 0.6, s: 0.4, v: 0.2 } ],
"warm": [ { h: 0.1, s: 0.2, v: 0.1 }, { h: 0.1, s: 0.2, v: 1.0 }, { h: 0.1, s: 0.4, v: 0.2 } ],
"sunset": [ { h: 0.1, s: 0.5, v: 0.1 }, { h: 0.1, s: 0.7, v: 1.0 }, { h: 0.1, s: 0.9, v: 0.2 } ]
};
var lightType = "white";
var ALIGHT = {
"h": 0.0,
"s": 0.0,
"v": 0.0
};
var DLIGHT1 = {
"h": 0.0,
"s": 0.0,
"v": 0.0,
"x": 1.0,
"y": 1.0,
"z": 1.0,
"phi": 2.2,
"theta": 0.33
};
var DLIGHT2 = {
"h": 0.0,
"s": 0.0,
"v": 0.0,
"x": -1.0,
"y": -1.0,
"z": -1.0,
"phi": -0.5,
"theta": 0.33
};
function updateHSV( src, dst ) {
dst.h = src.h;
dst.s = src.s;
dst.v = src.v;
};
function updateUnitVector( src ) {
src.x = Math.sin( src.phi ) * Math.cos( src.theta );
src.y = Math.cos( src.phi );
src.z = Math.sin( src.phi ) * Math.sin( src.theta );
};
updateHSV( lightColors[ lightType ][ 0 ], ALIGHT );
updateHSV( lightColors[ lightType ][ 1 ], DLIGHT1 );
updateHSV( lightColors[ lightType ][ 2 ], DLIGHT2 );
updateUnitVector( DLIGHT1 );
updateUnitVector( DLIGHT2 );
var dl1SliderH, dl1SliderS, dl1SliderV,
dl2SliderH, dl2SliderS, dl2SliderV;
var alSliderH, alSliderS, alSliderV;
var lensFlare;
var lensFlareRotate;
// camera
var useOrbitCamera = true;
var cameraDistance = 20,
cameraHeight = 5,
cameraHeightOriginal = cameraHeight,
cameraDistanceOriginal = cameraDistance;
var elCamLocation = $( "cam_location" ),
elCamType = $( "cam_type" );
// scene
var axisVisible = true;
var arrow1, arrow2;
// controls
var mouseX, mouseY, mouseDelta;
var windowHalfX = window.innerWidth / 2;
var windowHalfY = window.innerHeight / 2;
var isShiftDown = false,
theta = 45;
// postprocessing
var postprocessing = { enabled : false };
var nSliderN, nSliderS, nSliderC;
var bSlider;
// morphing
var morphA, morphB, morphObject,
morphSpeed = 1.0;
var elMorphAPct = $( "morph_a_pct" ),
elMorphBPct = $( "morph_b_pct" ),
elMorphA = $( "morph_a" ),
elMorphB = $( "morph_b" );
// globals
var SCREEN_WIDTH = window.innerWidth;
var SCREEN_HEIGHT = window.innerHeight;
var TEXTURE_MAP = {},
IMAGE_MAP = {};
var DragAndDrop = {};
var viewport, stats;
var camera, orbitCamera, flyCamera;
var scene, sceneTemp, renderer;
var delta, time, oldTime;
var auxRoot, sceneRoot;
//init();
//animate();
function init() {
viewport = $( "viewport" );
scene = new THREE.Scene();
scene.fog = new THREE.FogExp2( 0x000000, 0 );
renderer = new THREE.WebGLRenderer();
renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT );
renderer.autoClear = false;
renderer.sortObjects = false;
renderer.setClearColor( scene.fog.color, 1 );
renderer.domElement.style.position = "absolute";
renderer.domElement.style.top = "0px";
renderer.domElement.style.left = "0px";
viewport.appendChild( renderer.domElement );
initPostprocessingBloomNoise( postprocessing );
// CAMERAS
orbitCamera = new THREE.Camera( 40, window.innerWidth / window.innerHeight, 1, 100000 );
orbitCamera.position.set( 0, cameraHeight, cameraDistance );
orbitCamera.target.position.set( 0, 0, 0 );
flyCamera = new THREE.QuakeCamera( { fov: 40, aspect: SCREEN_WIDTH / SCREEN_HEIGHT, near: 1, far: 100000,
movementSpeed: 8, lookSpeed: 0.0025, noFly: false, lookVertical: true,
activeLook: false
} );
flyCamera.position.set( 0, cameraHeight, cameraDistance );
flyCamera.lon = -90;
camera = orbitCamera;
// LIGHTS
var acolor;
acolor = lightColors[ lightType ][ 0 ];
d1color = lightColors[ lightType ][ 1 ];
d2color = lightColors[ lightType ][ 2 ];
ambientLight = new THREE.AmbientLight();
ambientLight.color.setHSV( acolor.h, acolor.s, acolor.v );
scene.addLight( ambientLight );
directionalLight1 = new THREE.DirectionalLight( );
scene.addLight( directionalLight1 );
directionalLight2 = new THREE.DirectionalLight( );
scene.addLight( directionalLight2 );
// STATS
stats = new Stats();
stats.domElement.style.position = 'absolute';
stats.domElement.style.top = '0px';
stats.domElement.style.left = '0px';
stats.domElement.style.zIndex = 400;
viewport.appendChild( stats.domElement );
iniGui();
// sliders - morphs
var speedSlider = new Slider( $( "slider_wrap1" ), 200, 10, 0.01, 1.5, 1, changeMorphSpeed );
var morphSlider = new Slider( $( "slider_wrap2" ), 200, 10, 0.0, 1.0, 0, changeMorphPercent );
// sliders - fog
var swidth = 170, sd = 5;
var fogSliderD = new Slider( $( "slider_wrap_fog_d" ), swidth, sd, 0.0, 0.0005, 0, function(val) { scene.fog.density = val; $("fog_density").innerHTML = val.toFixed(7); } );
var fogSliderH = new Slider( $( "slider_wrap_fog_h" ), swidth, sd, 0.0, 1.0, 0, function(val) { FOG.h = val; updateFog(); $("fog_hue").innerHTML = val.toFixed(2); } );
var fogSliderS = new Slider( $( "slider_wrap_fog_s" ), swidth, sd, 0.0, 1.0, 0, function(val) { FOG.s = val; updateFog(); $("fog_sat").innerHTML = val.toFixed(2); } );
var fogSliderV = new Slider( $( "slider_wrap_fog_v" ), swidth, sd, 0.0, 1.0, 0, function(val) { FOG.v = val; updateFog(); $("fog_val").innerHTML = val.toFixed(2); } );
addGroupToggle( "btn_fog", "grp_fog" );
hide( "grp_fog" );
// sliders - noise
nSliderN = new Slider( $( "slider_wrap_noise_i" ), swidth, sd, 0.0, 1.0, 0, function(val) { postprocessing.materialFilm.uniforms.nIntensity.value = val; updateNoiseDisplay(); } );
nSliderS = new Slider( $( "slider_wrap_scanlines_i" ), swidth, sd, 0.0, 1.0, 0, function(val) { postprocessing.materialFilm.uniforms.sIntensity.value = val; updateNoiseDisplay(); } );
nSliderC = new Slider( $( "slider_wrap_linecount" ), swidth, sd, 0, 4096, 0, function(val) { postprocessing.materialFilm.uniforms.sCount.value = val; updateNoiseDisplay(); } );
function updateNoiseDisplay() {
if ( postprocessing.materialFilm ) {
var u = postprocessing.materialFilm.uniforms;
$("noise_intensity").innerHTML = u.nIntensity.value.toFixed(2);
$("scanlines_intensity").innerHTML = u.sIntensity.value.toFixed(2);
$("scanlines_count").innerHTML = u.sCount.value.toFixed(2);
}
};
if ( postprocessing.materialFilm ) {
var u = postprocessing.materialFilm.uniforms;
nSliderN.setValue( u.nIntensity.value );
nSliderS.setValue( u.sIntensity.value );
nSliderC.setValue( u.sCount.value );
}
updateNoiseDisplay();
addGroupToggle( "btn_noise", "grp_noise" );
hide( "grp_noise" );
// sliders - bloom
bSlider = new Slider( $( "slider_wrap_bloom" ), swidth, sd, 0.0, 3.0, 0, function(val) { postprocessing.materialScreen.uniforms.opacity.value = val; $("bloom_intensity").innerHTML = val.toFixed(2); } );
if ( postprocessing.materialScreen ) {
var u = postprocessing.materialScreen.uniforms;
bSlider.setValue( u.opacity.value );
$("bloom_intensity").innerHTML = u.opacity.value.toFixed(2);
}
addGroupToggle( "btn_bloom", "grp_bloom" );
hide( "grp_bloom" );
// sliders - directional light
function angleDegrees( rad ) {
var deg = rad * ( 180 / Math.PI );
return deg.toFixed(0);
};
// sliders - directional light 1
dl1SliderH = new Slider( $( "slider_wrap_dl1_h" ), swidth, sd, 0.0, 1.0, d1color.h, function(val) { DLIGHT1.h = val; updateDLight1(); $("dl1_hue").innerHTML = val.toFixed(2); } );
dl1SliderS = new Slider( $( "slider_wrap_dl1_s" ), swidth, sd, 0.0, 1.0, d1color.s, function(val) { DLIGHT1.s = val; updateDLight1(); $("dl1_sat").innerHTML = val.toFixed(2); } );
dl1SliderV = new Slider( $( "slider_wrap_dl1_v" ), swidth, sd, 0.0, 1.0, d1color.v, function(val) { DLIGHT1.v = val; updateDLight1(); $("dl1_val").innerHTML = val.toFixed(2); } );
var dl1SliderX = new Slider( $( "slider_wrap_dl1_phi" ), swidth, sd, -3.14, 3.14, DLIGHT1.phi, function(val) { DLIGHT1.phi = val; updateDLight1(); $("dl1_phi").innerHTML = angleDegrees( val ); } );
var dl1SliderY = new Slider( $( "slider_wrap_dl1_theta" ), swidth, sd, -3.14, 3.14, DLIGHT1.theta, function(val) { DLIGHT1.theta = val; updateDLight1(); $("dl1_theta").innerHTML = angleDegrees( val ); } );
$( "dl1_phi" ).innerHTML = angleDegrees( DLIGHT1.phi );
$( "dl1_theta" ).innerHTML = angleDegrees( DLIGHT1.theta );
addGroupToggle( "btn_dlight1", "grp_dlight1" );
hide( "grp_dlight1" );
// sliders - directional light 2
dl2SliderH = new Slider( $( "slider_wrap_dl2_h" ), swidth, sd, 0.0, 1.0, d2color.h, function(val) { DLIGHT2.h = val; updateDLight2(); $("dl2_hue").innerHTML = val.toFixed(2); } );
dl2SliderS = new Slider( $( "slider_wrap_dl2_s" ), swidth, sd, 0.0, 1.0, d2color.s, function(val) { DLIGHT2.s = val; updateDLight2(); $("dl2_sat").innerHTML = val.toFixed(2); } );
dl2SliderV = new Slider( $( "slider_wrap_dl2_v" ), swidth, sd, 0.0, 1.0, d2color.v, function(val) { DLIGHT2.v = val; updateDLight2(); $("dl2_val").innerHTML = val.toFixed(2); } );
var dl2SliderX = new Slider( $( "slider_wrap_dl2_phi" ), swidth, sd, -3.14, 3.14, DLIGHT2.phi, function(val) { DLIGHT2.phi = val; updateDLight2(); $("dl2_phi").innerHTML = angleDegrees( val ); } );
var dl2SliderY = new Slider( $( "slider_wrap_dl2_theta" ), swidth, sd, -3.14, 3.14, DLIGHT2.theta, function(val) { DLIGHT2.theta = val; updateDLight2(); $("dl2_theta").innerHTML = angleDegrees( val ); } );
$( "dl2_phi" ).innerHTML = angleDegrees( DLIGHT2.phi );
$( "dl2_theta" ).innerHTML = angleDegrees( DLIGHT2.theta );
addGroupToggle( "btn_dlight2", "grp_dlight2" );
hide( "grp_dlight2" );
// sliders - lens flare
/*
var flSliderX = new Slider( $( "slider_wrap_lf_x" ), swidth, sd, 0.0, 45.0, 0, function(val) { updateLensflare( val, -1 ); $("lf_x").innerHTML = val.toFixed(0); } );
var flSliderY = new Slider( $( "slider_wrap_lf_y" ), swidth, sd, 0.0, 360.0, 0, function(val) { updateLensflare( -1, val ); $("lf_y").innerHTML = val.toFixed(0); } );
addGroupToggle( "btn_lensflare", "grp_lensflare" );
hide( "grp_lensflare" );
*/
// sliders - ambientLight light
alSliderH = new Slider( $( "slider_wrap_al_h" ), swidth, sd, 0.0, 1.0, acolor.h, function(val) { ALIGHT.h = val; updateALight(); $("al_hue").innerHTML = val.toFixed(2); } );
alSliderS = new Slider( $( "slider_wrap_al_s" ), swidth, sd, 0.0, 1.0, acolor.s, function(val) { ALIGHT.s = val; updateALight(); $("al_sat").innerHTML = val.toFixed(2); } );
alSliderV = new Slider( $( "slider_wrap_al_v" ), swidth, sd, 0.0, 1.0, acolor.v, function(val) { ALIGHT.v = val; updateALight(); $("al_val").innerHTML = val.toFixed(2); } );
addGroupToggle( "btn_alight", "grp_alight" );
hide( "grp_alight" );
// export image
// doesn't work in Chrome canary and occasionally crashes dev-channel
//$( "btn_png" ).addEventListener( "click", function() { window.open( renderer.domElement.toDataURL("image/png"), "_blank" ) }, false )
// export settings
$( "btn_set" ).addEventListener( "click", function() { window.open( generateSettingsURL(), "_blank" ) }, false )
// lensflare
lensFlare = new THREE.LensFlare( ImageUtils.loadTexture( "textures/lensflare/lensflare0.png" ), 700, 0.0, THREE.AdditiveBlending );
lensFlare.add( ImageUtils.loadTexture( "textures/lensflare/lensflare2.png" ), 512, 0.0, THREE.AdditiveBlending );
lensFlare.add( lensFlare.lensFlares[ 1 ].texture, 512, 0.0, THREE.AdditiveBlending );
lensFlare.add( lensFlare.lensFlares[ 1 ].texture, 512, 0.0, THREE.AdditiveBlending );
lensFlare.add( ImageUtils.loadTexture( "textures/lensflare/lensflare3.png" ), 60, 0.6, THREE.AdditiveBlending );
lensFlare.add( lensFlare.lensFlares[ 4 ].texture, 70, 0.7, THREE.AdditiveBlending );
lensFlare.add( lensFlare.lensFlares[ 4 ].texture, 120, 0.9, THREE.AdditiveBlending );
lensFlare.add( lensFlare.lensFlares[ 4 ].texture, 70, 1.0, THREE.AdditiveBlending );
lensFlare.customUpdateCallback = lensFlareUpdateCallback;
lensFlare.position.set( 0, 0, -99000 );
lensFlareRotate = new THREE.Object3D();
lensFlareRotate.addChild( lensFlare );
scene.addChild( lensFlareRotate );
// axis
auxRoot = new THREE.Object3D();
sceneRoot = new THREE.Object3D();
var axis = createAxis();
arrow1 = createArrow( 0xffaa00 );
arrow2 = createArrow( 0xff2200 );
var tempScene = createTempScene();
auxRoot.addChild( axis );
auxRoot.addChild( arrow1 );
auxRoot.addChild( arrow2 );
sceneRoot.addChild( tempScene );
scene.addChild( auxRoot );
scene.addChild( sceneRoot );
window.addEventListener( 'resize', onWindowResize, false );
window.addEventListener( 'keydown', onKeyDown, false );
window.addEventListener( 'keyup', onKeyUp, false );
window.addEventListener( 'mousemove', onMouseMove, false );
window.addEventListener( 'mousewheel', onMouseWheel, false );
oldTime = new Date().getTime();
elSpeedVal = $( "speed_val" );
animate();
setLight( lightType );
updateDLight1();
updateDLight2();
};
// export
function generateSettingsURL() {
var pars = {},
tmp = "";
pars.fogDensity = scene.fog.density;
pars.fogColor = FOG;
pars.ambientLight = ALIGHT;
pars.directionalLight1 = DLIGHT1;
pars.directionalLight2 = DLIGHT2;
pars.effectEnabled = postprocessing.enabled;
pars.effectType = postprocessing.type;
if( postprocessing.materialFilm ) {
pars.postprocessingNoise = {
nIntensity: postprocessing.materialFilm.uniforms.nIntensity.value,
sIntensity: postprocessing.materialFilm.uniforms.sIntensity.value,
sCount: postprocessing.materialFilm.uniforms.sCount.value
};
}
if( postprocessing.materialScreen ) {
pars.postprocessingBloom = {
opacity: postprocessing.materialScreen.uniforms.opacity.value
};
}
pars.flyCamera = { position: flyCamera.position, target: flyCamera.target.position };
pars.sceneScale = GLOBAL_SCALE;
tmp += "data:text/plain;charset=utf-8,";
tmp += JSON.stringify(pars, null, " ");
return tmp;
};
// event handlers
function onKeyDown ( event ) {
switch( event.keyCode ) {
/* space */
case 32: toggleHUD( event ); break;
/* shift */
case 16: isShiftDown = true; break;
/* 1 */
case 49: setOrbitCamera(); break;
/* 2 */
case 50: setFlyCamera(); break;
/* 0 */
case 48: resetFlyCamera(); break;
/* r */
case 82: toggleAxis(); break;
/* o */
case 79: cycleMorphA(); break;
/* p */
case 80: cycleMorphB(); break;
/* pgup */
case 33: cameraFaster(); break;
/* pgdn */
case 34: cameraSlower(); break;
}
//console.log( "keyCode", event.keyCode );
};
function onKeyUp( event ) {
switch( event.keyCode ) {
/* shift */
case 16: isShiftDown = false; break;
}
};
function onMouseMove ( event ) {
mouseX = event.clientX - windowHalfX;
mouseY = event.clientY - windowHalfY;
};
function onMouseWheel( event ) {
if ( event.wheelDelta ) mouseDelta = event.wheelDelta / 120;
if ( event.detail ) mouseDelta = - event.detail / 3;
zoomCamera( mouseDelta );
};
function onWindowResize( event ) {
updateViewport();
};
function addGroupToggle( button_id, group_id ) {
$( button_id ).addEventListener( 'click', function() { toggle( group_id ); }, false );
};
// fog
function updateFog() {
scene.fog.color.setHSV( FOG.h, FOG.s, FOG.v );
renderer.setClearColor( scene.fog.color );
};
// lights
var tmpVec = new THREE.Vector3(), unitVector = new THREE.Vector3();
function updateDLight1() {
updateUnitVector( DLIGHT1 );
directionalLight1.position.set( DLIGHT1.x, DLIGHT1.y, DLIGHT1.z );
directionalLight1.color.setHSV( DLIGHT1.h, DLIGHT1.s, DLIGHT1.v );
tmpVec.copy( directionalLight1.position );
tmpVec.multiplyScalar( -1 );
arrow1.lookAt( tmpVec );
};
function updateDLight2() {
updateUnitVector( DLIGHT2 );
directionalLight2.position.set( DLIGHT2.x, DLIGHT2.y, DLIGHT2.z );
directionalLight2.color.setHSV( DLIGHT2.h, DLIGHT2.s, DLIGHT2.v );
tmpVec.copy( directionalLight2.position );
tmpVec.multiplyScalar( -1 );
arrow2.lookAt( tmpVec );
};
function updateALight() {
ambientLight.color.setHSV( ALIGHT.h, ALIGHT.s, ALIGHT.v );
};
function updateLensflare( newX, newY ) {
// update X?
if( newX !== -1 ) {
lensFlareRotate.rotation.x = newX * Math.PI / 180;
} else {
lensFlareRotate.rotation.y = newY * Math.PI / 180;
}
}
function lensFlareUpdateCallback( visibility, object ) {
var f, fl = object.lensFlares.length;
var flare;
var vecX = -object.positionScreen.x * 2;
var vecY = -object.positionScreen.y * 2;
for( f = 0; f < fl; f++ ) {
flare = object.lensFlares[ f ];
flare.x = object.positionScreen.x + vecX * flare.distance;
flare.y = object.positionScreen.y + vecY * flare.distance;
flare.wantedScale = visibility * 0.1 + 0.9;
flare.wantedOpacity = visibility;
flare.scale += ( flare.wantedScale - flare.scale ) * 0.15;
flare.opacity += ( flare.wantedOpacity - flare.opacity ) * 0.5;
flare.rotation = 0;
}
// hard coded stuff
object.lensFlares[ 1 ].scale = visibility * 0.3 + 0.9;
object.lensFlares[ 2 ].y += 0.025;
object.lensFlares[ 2 ].scale = visibility * 0.3 + 0.6;
object.lensFlares[ 2 ].opacity = Math.max( 0, object.lensFlares[ 2 ].opacity - 0.20 * visibility );
object.lensFlares[ 3 ].rotation = object.positionScreen.x * 0.5 + 45 * Math.PI / 180;
object.lensFlares[ 3 ].scale += 0.1;
object.lensFlares[ 3 ].opacity = Math.max( 0, object.lensFlares[ 3 ].opacity - 0.10 * visibility );
object.lensFlares[ 4 ].opacity = Math.max( 0, object.lensFlares[ 4 ].opacity - 0.20 );
object.lensFlares[ 5 ].opacity = Math.max( 0, object.lensFlares[ 4 ].opacity - 0.10 * visibility );
object.lensFlares[ 6 ].opacity = Math.max( 0, object.lensFlares[ 4 ].opacity - 0.15 );
object.lensFlares[ 7 ].opacity = Math.max( 0, object.lensFlares[ 4 ].opacity - 0.25 * visibility );
}
// axis
function createAxis() {
var axis = new THREE.Object3D(),
d = 0.05;
var mesh = new THREE.Mesh( new Cube( 1, d, d ), new THREE.MeshLambertMaterial( { color: 0xff0000 } ) );
mesh.position.set( 0.5, 0, 0 );
axis.addChild( mesh );
mesh = new THREE.Mesh( new Cube( d, 1, d ), new THREE.MeshLambertMaterial( { color: 0x00ff00 } ) );
mesh.position.set( 0, 0.5, 0 );
axis.addChild( mesh );
mesh = new THREE.Mesh( new Cube( d, d, 1 ), new THREE.MeshLambertMaterial( { color: 0x0000ff } ) );
mesh.position.set( 0, 0, 0.5 );
axis.addChild( mesh );
mesh = new THREE.Mesh( new Plane( 100, 100, 100, 100 ), new THREE.MeshLambertMaterial( { color: 0xffffff, wireframe: true } ) );
mesh.rotation.set( -1.57, 0, 0 );
axis.addChild( mesh );
return axis;
};
function createArrow( color ) {
var arrow = new THREE.Object3D(),
d = 0.05;
var material = new THREE.MeshBasicMaterial( { color: color } );
var mesh = new THREE.Mesh( new Cube( d, d, 1 ), material );
mesh.position.set( 0, 0, -0.5 );
arrow.addChild( mesh );
mesh = new THREE.Mesh( new Cylinder( 4, 0.001, 0.25, 0.5 ), material );
mesh.position.set( 0, 0, -1 );
arrow.addChild( mesh );
arrow.rotation.set( 0, 0, 0 );
return arrow;
};
function toggleAxis() {
axisVisible = !axisVisible;
SceneUtils.showHierarchy( auxRoot, axisVisible );
};
// camera controls
function cameraFaster() {
flyCamera.movementSpeed += 0.125;
};
function cameraSlower() {
flyCamera.movementSpeed = cap_bottom( flyCamera.movementSpeed - 0.125, 0 );
};
function setOrbitCamera() {
camera = orbitCamera;
elCamType.innerHTML = "Orbit camera";
};
function setFlyCamera() {
camera = flyCamera;
elCamType.innerHTML = "Fly camera";
};
function resetFlyCamera() {
flyCamera.position.set( 0, cameraHeightOriginal, cameraDistanceOriginal );
flyCamera.target.position.set( 0, 0, 0 );
flyCamera.lon = -90;
};
function zoomCamera( delta ) {
cameraDistance = cap_bottom( cameraDistance - 0.75 * delta, 1 );
};
// morph controls
function updateMorphs() {
var nameA = morphObject.availableAnimals[ morphA ],
nameB = morphObject.availableAnimals[ morphB ];
morphObject.play( nameA, nameB );
elMorphA.innerHTML = nameA;
elMorphB.innerHTML = nameB;
};
function cycleMorphA() {
if( morphObject && morphObject.availableAnimals && morphObject.availableAnimals.length > 1 ) {
morphA = ( morphA + 1 ) % morphObject.availableAnimals.length;
updateMorphs();
}
};
function cycleMorphB() {
if( morphObject && morphObject.availableAnimals && morphObject.availableAnimals.length > 1 ) {
morphB = ( morphB + 1 ) % morphObject.availableAnimals.length;
updateMorphs();
}
};
function changeMorphSpeed( val ) {
elSpeedVal.innerHTML = val.toFixed( 2 );
if ( morphObject ) {
morphObject.animalA.timeScale = morphObject.animalB.timeScale = val;
}
};
function changeMorphPercent( val ) {
if ( morphObject ) {
morphObject.morph = val;
elMorphAPct.innerHTML = ( 100 * morphObject.morph ).toFixed( 1 ) + " %";
elMorphBPct.innerHTML = ( 100 * ( 1 - morphObject.morph) ).toFixed( 1 ) + " %";
}
};
// temp scene
function createTempScene() {
var tempScene = new THREE.Object3D();
var i, x, y, z,
d = 10000,
s = BASE_SCALE,
mesh,
geo = new Cube( 400, 400, 400 ),
mat = new THREE.MeshLambertMaterial( {color:0xffffff} );
for ( i = 0; i < 1000; i++ ) {
mesh = new THREE.Mesh( geo, mat );
x = rr( -d, d );
y = rr( -d, d );
z = rr( -d, d );
mesh.position.set( x, y, z );
x = rr( -3, 3 );
y = rr( -3, 3 );
z = rr( -3, 3 );
mesh.rotation.set( x, y, z );
mesh.scale.set( s, s, s );
mesh.matrixAutoUpdate = false;
mesh.updateMatrix();
mesh.update();
tempScene.addChild( mesh );
}
return tempScene;
};
function resetScene() {
scene.removeChild( sceneRoot );
sceneRoot = new THREE.Object3D();
scene.addChild( sceneRoot );
};
function rescaleScene( s ) {
sceneRoot.scale.set( s, s, s );
};
// DOM helpers
function toggle( id, how ) {
var elStyle = $( id ).style;
if ( elStyle.display == "none" )
elStyle.display = how !==undefined ? how : "block";
else
elStyle.display = "none";
};
function show( id ) {
$( id ).style.display = "block";
};
function hide( id ) {
$( id ).style.display = "none";
};
// Utils
function $( id ) { return document.getElementById( id ); }
function rr( a, b ) { return a + ( b - a ) * Math.random(); }
function renderNumber( n, precision ) {
return "<span class='number'>" + n.toFixed( precision ) + "</span>";
};
function renderBigNumber( n ) {
return "<span class='number'>" + pretty_number( n.toFixed( 0 ) ) + "</span>";
};
function renderVec3( v, precision ) {
if ( Math.abs( v.x ) > 10000 || Math.abs( v.y ) > 10000 || Math.abs( v.z ) > 10000 ) {
return renderBigNumber( v.x ) + " " + renderBigNumber( v.y ) + " " + renderBigNumber( v.z );
} else {
return renderNumber( v.x, precision ) + " " + renderNumber( v.y, precision ) + " " + renderNumber( v.z, precision );
}
};
function capitalize( s ) {
return s[ 0 ].toUpperCase() + s.substring( 1, s.length );
};
function pretty_number( x ) {
var delimiter = "'";
var strx = x.toString();
var pretty = "";
for( var i = strx.length - 1; i >= 0; i-- ) {
if ( ( strx.length - 1 - i ) % 3 == 0 && ( strx.length - 1 - i ) > 0 )
pretty = delimiter+pretty;
pretty = strx[ i ] + pretty;
}
return pretty;
};
function pretty_size( x ) {
var kb = x / 1024;
return pretty_number( kb.toFixed( 0 ) ) + " KB";
};
function cap_string( s, n ) {
if ( n < s.length - 2 )
return s.substring( 0, n ) + " ...";
else
return s;
};
function cap_bottom( n, b ) {
return n > b ? n : b;
};
// GUI
function toggleHUD( e ) {
guiVisible = !guiVisible;
e.stopPropagation();
e.preventDefault();
toggle( "file_dialog" );
toggle( "gui_wrapper" );
//toggle( "camera" );
camera.activeLook = !guiVisible;
};
function toggleFog() {
if ( scene.fog.density == 0 ) {
scene.fog.density = fogdensity;
} else {
scene.fog.density = 0;
}
refreshGUI();
};
function setPostNoise() {
initPostprocessingNoise( postprocessing );
postprocessing.enabled = true;
refreshGUI();
};
function setPostBloom() {
initPostprocessingBloom( postprocessing );
postprocessing.enabled = true;
refreshGUI();
};
function setPostBloomNoise() {
initPostprocessingBloomNoise( postprocessing );
postprocessing.enabled = true;
refreshGUI();
};
function setPostNone() {
postprocessing.enabled = false;
refreshGUI();
};
function updateAspect() {
camera.aspect = SCREEN_WIDTH / SCREEN_HEIGHT;
camera.updateProjectionMatrix();
renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT );
};
function updateViewport() {
if ( overlays.filmStrip ) {
SCREEN_WIDTH = window.innerWidth;
SCREEN_HEIGHT = window.innerHeight - 200;
updateAspect();
renderer.domElement.style.top = "100px";
} else {
SCREEN_WIDTH = window.innerWidth;
SCREEN_HEIGHT = window.innerHeight;
updateAspect();
renderer.domElement.style.top = "0px";
}
if ( postprocessing.type == "bloom" )
initPostprocessingBloom( postprocessing );
else
initPostprocessingNoise( postprocessing );
};
function toggleFilm() {
overlays.filmStrip = !overlays.filmStrip;
updateViewport();
refreshGUI();
};
function setLight( ltype ) {
lightType = ltype;
var acolor = lightColors[ lightType ][ 0 ];
var d1color = lightColors[ lightType ][ 1 ];
var d2color = lightColors[ lightType ][ 2 ];
ambientLight.color.setHSV( acolor.h, acolor.s, acolor.v );
directionalLight1.color.setHSV( d1color.h, d1color.s, d1color.v );
directionalLight2.color.setHSV( d2color.h, d2color.s, d2color.v );
updateHSV( lightColors[lightType][0], ALIGHT );
updateHSV( lightColors[lightType][1], DLIGHT1 );
updateHSV( lightColors[lightType][0], DLIGHT2 );
$("al_hue").innerHTML = acolor.h.toFixed(2);
$("al_sat").innerHTML = acolor.s.toFixed(2);
$("al_val").innerHTML = acolor.v.toFixed(2);
$("dl1_hue").innerHTML = d1color.h.toFixed(2);
$("dl1_sat").innerHTML = d1color.s.toFixed(2);
$("dl1_val").innerHTML = d1color.v.toFixed(2);
$("dl2_hue").innerHTML = d2color.h.toFixed(2);
$("dl2_sat").innerHTML = d2color.s.toFixed(2);
$("dl2_val").innerHTML = d2color.v.toFixed(2);
alSliderH.setValue( acolor.h );
alSliderS.setValue( acolor.s );
alSliderV.setValue( acolor.v );
dl1SliderH.setValue( d1color.h );
dl1SliderS.setValue( d1color.s );
dl1SliderV.setValue( d1color.v );
dl2SliderH.setValue( d2color.h );
dl2SliderS.setValue( d2color.s );
dl2SliderV.setValue( d2color.v );
refreshGUI();
};
function toggleOverlay( label ) {
overlays[ label ] = !overlays[ label ];
var id = "overlay" + capitalize( label );
if ( overlays[ label ] )
show( id );
else
hide( id );
refreshGUI();
};
function refreshGUI() {
// checkboxes
$( "b_film" ).innerHTML = overlays.filmStrip ? "x" : " ";
$( "b_dirt" ).innerHTML = overlays.dirt ? "x" : " ";
$( "b_vignette" ).innerHTML = overlays.vignette ? "x" : " ";
$( "b_lensFlare" ).innerHTML = overlays.lensFlare ? "x" : " ";
// selections
$( "b_noise" ).innerHTML = ( postprocessing.enabled && postprocessing.type == "noise" ) ? "♦" : " ";
$( "b_bloom" ).innerHTML = ( postprocessing.enabled && postprocessing.type == "bloom" ) ? "♦" : " ";
$( "b_bloomnoise" ).innerHTML = ( postprocessing.enabled && postprocessing.type == "bloomnoise" ) ? "♦" : " ";
$( "b_none" ).innerHTML = ( ! postprocessing.enabled ) ? "♦" : " ";
$( "b_lightWhite" ).innerHTML = ( lightType == "white" ) ? "♦" : " ";
$( "b_lightCold" ).innerHTML = ( lightType == "cold" ) ? "♦" : " ";
$( "b_lightWarm" ).innerHTML = ( lightType == "warm" ) ? "♦" : " ";
$( "b_lightSunset" ).innerHTML = ( lightType == "sunset" ) ? "♦" : " ";
var i, s;
for ( i = 0; i < SCALES.length; i++ ) {
s = SCALES[ i ];
if( GLOBAL_SCALE == s[1] ) {
$( s[0] ).innerHTML = "♦"
} else {
$( s[0] ).innerHTML = " ";
}
}
magicRepaint();
};
function magicRepaint() {
// workaround Chrome compositing bug
//$( "gui_wrapper" ).style.display = "none";
//$( "gui_wrapper" ).offsetHeight;
//$( "gui_wrapper" ).style.display = "block";
};
function handleScale( values ) {
function generateHandler( s ) {
return function() {
GLOBAL_SCALE = s;
rescaleScene( BASE_SCALE * s );
refreshGUI();
}
};
var i, id, s;
for ( i = 0; i < values.length; i++ ) {
id = values[ i ][ 0 ];
s = values[ i ][ 1 ];
$( id ).addEventListener( "click", generateHandler( s ), true );
}
};
function handleProperty( ids, handler ) {
for ( var i = 0; i < ids.length; i++ )
$( ids[ i ] ).addEventListener( "click", handler, true );
};
function iniGui() {
$( "hud_button" ).addEventListener( "click", toggleHUD, true );
handleProperty( [ "b_noise", "l_noise" ], setPostNoise );
handleProperty( [ "b_bloom", "l_bloom" ], setPostBloom );
handleProperty( [ "b_bloomnoise", "l_bloomnoise" ], setPostBloomNoise );
handleProperty( [ "b_none", "l_none" ], setPostNone );
handleProperty( [ "b_film", "l_film" ], toggleFilm );
handleProperty( [ "b_dirt", "l_dirt" ], function() { toggleOverlay( "dirt") } );
handleProperty( [ "b_vignette", "l_vignette" ], function() { toggleOverlay( "vignette") } );
handleProperty( [ "b_lensFlare", "l_lensFlare" ], function() { toggleOverlay( "lensFlare") } );
handleScale( SCALES );
handleProperty( [ "b_lightWhite", "l_lightWhite" ], function() { setLight( "white" ) } );
handleProperty( [ "b_lightCold", "l_lightCold" ], function() { setLight( "cold" ) } );
handleProperty( [ "b_lightWarm", "l_lightWarm" ], function() { setLight( "warm" ) } );
handleProperty( [ "b_lightSunset", "l_lightSunset" ], function() { setLight( "sunset" ) } );
refreshGUI();
};
DragAndDrop.onDragOver = function( evt ) {
evt.stopPropagation();
evt.preventDefault();
};
DragAndDrop.onDragFileDrop = function( evt ) {
evt.stopPropagation();
evt.preventDefault();
console.log( evt );
var sceneResetFlag = true;
if( evt.offsetX > windowHalfX ) sceneResetFlag = false;
var i, f,
files = evt.dataTransfer.files,
output = [],
loader = new THREE.JSONLoader(),
callbackObject = function( geometry ) { addObject( geometry, 0, 0, 0, 1, sceneResetFlag ) };
for ( i = 0; f = files[i]; i++ ) {
output.push('<li><strong>' + cap_string( f.name, 17 ) + '</strong> <span class="fsize">' + pretty_size( f.size ) + '</span></li>');
var reader = new FileReader();
if ( f.type.indexOf( "javascript" ) >= 0 ) {
reader.onload = ( function( theFile ) {
return function( e ) {
var content = e.target.result,
bb, blobURL = new BlobBuilder();
bb = new BlobBuilder();
bb.append( content );
if ( window.webkitURL )
blobURL = window.webkitURL.createObjectURL( bb.getBlob() );
else
blobURL = window.URL.createObjectURL( bb.getBlob() );
loader.load( { model: blobURL, callback: callbackObject } );
};
})(f);
reader.readAsText( f );
$('file_list').innerHTML = "";
} else if ( f.type.indexOf( "image" ) >= 0 ) {
reader.onload = ( function( theFile ) {
return function( e ) {
var span = document.createElement( 'span' );
span.innerHTML = [ '<img class="thumb" src="', e.target.result,
'" title="', theFile.name, '"/>' ].join( '' );
//$( 'images' ).insertBefore( span, null );
//alert("handling [" + theFile.name + "]");
//addImage( theFile.name, e.target.result );
// hack to work around Chrome crash bug
// when dropping first model and then textures
setTimeout( function() { addImage( theFile.name, e.target.result ); }, 500 );
};
})(f);
reader.readAsDataURL(f);
}
}
$('file_list').innerHTML += '<ul>' + output.join('') + '</ul>';
show( "files_div" );
};
function extractTexture( map, dst ) {
var s;
if ( map ) {
s = map.sourceFile;
if ( s ) {
if ( dst[ s ] == undefined ) {
dst[ s ] = [ map ];
} else {
dst[ s ].push( map );
}
}
}
};
function collectTextures( geometry ) {
var textureMap = {},
i, m, s, materials = geometry.materials;
for ( i = 0; i < materials.length; i++ ) {
m = materials[ i ][ 0 ];
extractTexture( m.map, textureMap );
extractTexture( m.lightMap, textureMap );
}
updateTextureList( "texture_list", textureMap );
return textureMap;
};
function updateTextureList( id, map ) {
var fname, item, zclass,
lst = [],
tmp = "";
el = $( id );
for ( fname in map ) {
if ( map[ fname ].__textureLoaded )
zclass = "loaded";
else
zclass = "missing";
item = "<li><span class='" + zclass + "'>" + fname + "</span></li>";
lst.push( item );
}
if ( lst.length ) {
tmp = "<ul>" + lst.join("") + "</ul>";
el.innerHTML = tmp;
show( "textures_div" );
} else {
hide( "textures_div" );
}
};
function checkTextureImages() {
var i, tid, mid, maps, img;
for ( tid in IMAGE_MAP ) {
if ( TEXTURE_MAP[ tid ] != undefined ) {
maps = TEXTURE_MAP[ tid ];
for( i = 0; i < maps.length; i++ ) {
img = document.createElement( 'img' );
img.src = IMAGE_MAP[ tid ];
maps[ i ].image = img;
maps[ i ].needsUpdate = true;
maps[ i ].__wasSetOnce = false;
}
maps.__textureLoaded = true;
}
}
updateTextureList( "texture_list", TEXTURE_MAP );
};
function addObject( geometry, x, y, z, s, sceneResetFlag ) {
if ( sceneResetFlag ) resetScene();
var material, mesh;
console.log(geometry);
if ( geometry.morphTargets !== undefined && geometry.morphTargets.length > 0 ) {
morphObject = ROME.Animal( geometry, true );
mesh = morphObject.mesh;
cameraDistanceOriginal = mesh.boundRadius * 10;
cameraHeightOriginal = mesh.boundRadius * 0.1;
if( morphObject.availableAnimals && morphObject.availableAnimals.length > 0 ) {
morphA = 0;
morphB = ( morphA + 1 ) % morphObject.availableAnimals.length;
morphObject.animalA.timeScale = 0.5;
updateMorphs();
}
$( "morphs" ).style.display = "block";
} else {
morphObject = null;
material = new THREE.MeshFaceMaterial(),
mesh = new THREE.Mesh( geometry, material );
if ( mesh.boundRadius > 0.25 * camera.far ) {
cameraDistanceOriginal = 0.25 * camera.far;
cameraHeightOriginal = 0.01 * camera.far;
} else {
cameraDistanceOriginal = mesh.boundRadius * 3;
cameraHeightOriginal = mesh.boundRadius * 0.1;
}
$( "morphs" ).style.display = "none";
}
TEXTURE_MAP = collectTextures( geometry );
checkTextureImages();
mesh.position.set( x, y, z );
mesh.scale.set( s, s, s );
mesh.matrixAutoUpdate = false;
mesh.updateMatrix();
mesh.update();
sceneRoot.addChild( mesh );
cameraDistance = cameraDistanceOriginal;
cameraHeight = cameraHeightOriginal;
camera.position.set( 0, cameraHeight, cameraDistance );
camera.target.position.set( 0, 0, 0 );
axisVisible = false;
SceneUtils.showHierarchy( auxRoot, axisVisible );
//console.log( mesh.boundRadius, camera );
};
function addImage( name, uri ) {
IMAGE_MAP[ name ] = uri;
checkTextureImages();
};
function initPostprocessingNoise( effect ) {
effect.type = "noise";
effect.scene = new THREE.Scene();
effect.camera = new THREE.Camera();
effect.camera.projectionMatrix = THREE.Matrix4.makeOrtho( SCREEN_WIDTH / - 2, SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, SCREEN_HEIGHT / - 2, -10000, 10000 );
effect.camera.position.z = 100;
effect.texture = new THREE.WebGLRenderTarget( SCREEN_WIDTH, SCREEN_HEIGHT, { minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter } );
var film_shader = ShaderUtils.lib["film"];
var film_uniforms = Uniforms.clone( film_shader.uniforms );
film_uniforms["tDiffuse"].texture = effect.texture;
effect.materialFilm = new THREE.MeshShaderMaterial( { uniforms: film_uniforms, vertexShader: film_shader.vertexShader, fragmentShader: film_shader.fragmentShader } );
effect.materialFilm.uniforms.grayscale.value = 0;
var quad = new THREE.Mesh( new Plane( SCREEN_WIDTH, SCREEN_HEIGHT ), effect.materialFilm );
quad.position.z = -500;
effect.scene.addObject( quad );
}
function initPostprocessingBloom( effect ) {
effect.type = "bloom";
effect.scene = new THREE.Scene();
effect.camera = new THREE.Camera();
effect.camera.projectionMatrix = THREE.Matrix4.makeOrtho( SCREEN_WIDTH / - 2, SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, SCREEN_HEIGHT / - 2, -10000, 10000 );
effect.camera.position.z = 100;
var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter };
effect.rtTexture1 = new THREE.WebGLRenderTarget( SCREEN_WIDTH, SCREEN_HEIGHT, pars );
effect.rtTexture2 = new THREE.WebGLRenderTarget( 512, 512, pars );
effect.rtTexture3 = new THREE.WebGLRenderTarget( 512, 512, pars );
var screen_shader = ShaderUtils.lib["screen"];
var screen_uniforms = Uniforms.clone( screen_shader.uniforms );
screen_uniforms["tDiffuse"].texture = effect.rtTexture1;
screen_uniforms["opacity"].value = 1.0;
effect.materialScreen = new THREE.MeshShaderMaterial( {
uniforms: screen_uniforms,
vertexShader: screen_shader.vertexShader,
fragmentShader: screen_shader.fragmentShader,
blending: THREE.AdditiveBlending,
transparent: true
} );
var convolution_shader = ShaderUtils.lib["convolution"];
var convolution_uniforms = Uniforms.clone( convolution_shader.uniforms );
effect.blurx = new THREE.Vector2( 0.001953125, 0.0 ),
effect.blury = new THREE.Vector2( 0.0, 0.001953125 );
convolution_uniforms["tDiffuse"].texture = effect.rtTexture1;
convolution_uniforms["uImageIncrement"].value = effect.blurx;
convolution_uniforms["cKernel"].value = ShaderUtils.buildKernel( 4.0 );
effect.materialConvolution = new THREE.MeshShaderMaterial( {
uniforms: convolution_uniforms,
vertexShader: "#define KERNEL_SIZE 25.0\n" + convolution_shader.vertexShader,
fragmentShader: "#define KERNEL_SIZE 25\n" + convolution_shader.fragmentShader
} );
var film_shader = ShaderUtils.lib["film"];
var film_uniforms = Uniforms.clone( film_shader.uniforms );
film_uniforms["tDiffuse"].texture = effect.rtTexture1;
effect.materialFilm = new THREE.MeshShaderMaterial( { uniforms: film_uniforms, vertexShader: film_shader.vertexShader, fragmentShader: film_shader.fragmentShader } );
effect.materialFilm.uniforms.grayscale.value = 0;
effect.materialFilm.uniforms.nIntensity.value = 1;
//effect.materialFilm.uniforms.sIntensity.value = 0.25;
//effect.materialFilm.uniforms.sCount.value = 2048;
effect.quad = new THREE.Mesh( new Plane( SCREEN_WIDTH, SCREEN_HEIGHT ), effect.materialConvolution );
effect.quad.position.z = -500;
effect.scene.addObject( effect.quad );
}
function initPostprocessingBloomNoise( effect ) {
initPostprocessingBloom( effect );
effect.type = "bloomnoise";
};
// updates
function animate() {
requestAnimationFrame( animate );
time = new Date().getTime();
delta = time - oldTime;
oldTime = time;
updateCamera( delta );
updateMorph( delta );
render( delta );
stats.update();
};
function updateMorph( delta ) {
if ( morphObject ) {
THREE.AnimationHandler.update( delta );
}
};
function updateCamera( delta ) {
if ( camera == orbitCamera ) {
if ( isShiftDown ) {
theta += mouseX * delta * 0.0001;
}
camera.position.x = cameraDistance * Math.sin( theta * Math.PI / 360 );
camera.position.z = cameraDistance * Math.cos( theta * Math.PI / 360 );
camera.position.y = cameraHeight;
}
elCamLocation.innerHTML = renderVec3( camera.position, 2 );
if ( camera == flyCamera ) {
elCamLocation.innerHTML += " speed: " + camera.movementSpeed.toFixed(3);
}
//lensFlareRotate.position.set( camera.position.x, camera.position.y, camera.position.z );
};
function render( delta ) {
renderer.clear();
if ( postprocessing.enabled ) {
if ( postprocessing.type == "noise" ) {
postprocessing.materialFilm.uniforms.time.value += 0.01 * delta;
renderer.render( scene, camera, postprocessing.texture, true );
renderer.render( postprocessing.scene, postprocessing.camera );
} else if ( postprocessing.type == "bloom" || postprocessing.type == "bloomnoise" ) {
// Render scene into texture
renderer.render( scene, camera, postprocessing.rtTexture1, true );
// Render quad with blured scene into texture (convolution pass 1)
postprocessing.quad.materials = [ postprocessing.materialConvolution ];
postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture1;
postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blurx;
renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture2, true );
// Render quad with blured scene into texture (convolution pass 2)
postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture2;
postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blury;
renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture3, true );
// Render original scene with superimposed blur to texture
postprocessing.quad.materials = [ postprocessing.materialScreen ];
postprocessing.materialScreen.blending = THREE.AdditiveBlending;
postprocessing.materialScreen.uniforms.tDiffuse.texture = postprocessing.rtTexture3;
//postprocessing.materialScreen.uniforms.opacity.value = 1.0;
renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture1, false );
// Render to screen
if ( postprocessing.type == "bloomnoise" ) {
postprocessing.materialFilm.uniforms.time.value += 0.01 * delta;
postprocessing.quad.materials = [ postprocessing.materialFilm ];
} else {
postprocessing.materialScreen.blending = THREE.NormalBlending;
postprocessing.quad.materials = [ postprocessing.materialScreen ];
}
postprocessing.materialScreen.uniforms.tDiffuse.texture = postprocessing.rtTexture1;
renderer.render( postprocessing.scene, postprocessing.camera );
}
} else {
renderer.render( scene, camera );
}
};
// it's nicer to be able to drop anywhere in the window
//$( 'drop_zone' ).addEventListener( 'dragover', DragAndDrop.onDragOver, false );
//$( 'drop_zone' ).addEventListener( 'drop', DragAndDrop.onDragFileDrop, false );
window.addEventListener( 'dragover', DragAndDrop.onDragOver, false );
window.addEventListener( 'drop', DragAndDrop.onDragFileDrop, false );
</script>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
.\objects\stm32f10x_rcc.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\StdPeriph_Driver\src\stm32f10x_rcc.c
.\objects\stm32f10x_rcc.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\StdPeriph_Driver\inc\stm32f10x_rcc.h
.\objects\stm32f10x_rcc.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\Include\stm32f10x.h
.\objects\stm32f10x_rcc.o: D:\Git\stm32f103-keil\i2c-master-polling\RTE\RTE_Components.h
.\objects\stm32f10x_rcc.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.2.0\CMSIS\Include\core_cm3.h
.\objects\stm32f10x_rcc.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
.\objects\stm32f10x_rcc.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.2.0\CMSIS\Include\core_cmInstr.h
.\objects\stm32f10x_rcc.o: C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.2.0\CMSIS\Include\core_cmFunc.h
.\objects\stm32f10x_rcc.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\Include\system_stm32f10x.h
.\objects\stm32f10x_rcc.o: D:\Git\stm32f103-keil\i2c-master-polling\RTE\Device\STM32F103C8\stm32f10x_conf.h
.\objects\stm32f10x_rcc.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\StdPeriph_Driver\inc\stm32f10x_gpio.h
.\objects\stm32f10x_rcc.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\Include\stm32f10x.h
.\objects\stm32f10x_rcc.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\StdPeriph_Driver\inc\stm32f10x_i2c.h
.\objects\stm32f10x_rcc.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\StdPeriph_Driver\inc\stm32f10x_rcc.h
.\objects\stm32f10x_rcc.o: C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.0.0\Device\StdPeriph_Driver\inc\misc.h
|
{
"pile_set_name": "Github"
}
|
/**
* \file
*
* \brief Instance description for TC3
*
* Copyright (c) 2014 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
#ifndef _SAMD20_TC3_INSTANCE_
#define _SAMD20_TC3_INSTANCE_
/* ========== Register definition for TC3 peripheral ========== */
#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
#define REG_TC3_CTRLA (0x42002C00U) /**< \brief (TC3) Control A */
#define REG_TC3_READREQ (0x42002C02U) /**< \brief (TC3) Read Request */
#define REG_TC3_CTRLBCLR (0x42002C04U) /**< \brief (TC3) Control B Clear */
#define REG_TC3_CTRLBSET (0x42002C05U) /**< \brief (TC3) Control B Set */
#define REG_TC3_CTRLC (0x42002C06U) /**< \brief (TC3) Control C */
#define REG_TC3_DBGCTRL (0x42002C08U) /**< \brief (TC3) Debug Control */
#define REG_TC3_EVCTRL (0x42002C0AU) /**< \brief (TC3) Event Control */
#define REG_TC3_INTENCLR (0x42002C0CU) /**< \brief (TC3) Interrupt Enable Clear */
#define REG_TC3_INTENSET (0x42002C0DU) /**< \brief (TC3) Interrupt Enable Set */
#define REG_TC3_INTFLAG (0x42002C0EU) /**< \brief (TC3) Interrupt Flag Status and Clear */
#define REG_TC3_STATUS (0x42002C0FU) /**< \brief (TC3) Status */
#define REG_TC3_COUNT16_COUNT (0x42002C10U) /**< \brief (TC3) COUNT16 Counter Value */
#define REG_TC3_COUNT16_CC0 (0x42002C18U) /**< \brief (TC3) COUNT16 Compare/Capture 0 */
#define REG_TC3_COUNT16_CC1 (0x42002C1AU) /**< \brief (TC3) COUNT16 Compare/Capture 1 */
#define REG_TC3_COUNT32_COUNT (0x42002C10U) /**< \brief (TC3) COUNT32 Counter Value */
#define REG_TC3_COUNT32_CC0 (0x42002C18U) /**< \brief (TC3) COUNT32 Compare/Capture 0 */
#define REG_TC3_COUNT32_CC1 (0x42002C1CU) /**< \brief (TC3) COUNT32 Compare/Capture 1 */
#define REG_TC3_COUNT8_COUNT (0x42002C10U) /**< \brief (TC3) COUNT8 Counter Value */
#define REG_TC3_COUNT8_PER (0x42002C14U) /**< \brief (TC3) COUNT8 Period Value */
#define REG_TC3_COUNT8_CC0 (0x42002C18U) /**< \brief (TC3) COUNT8 Compare/Capture 0 */
#define REG_TC3_COUNT8_CC1 (0x42002C19U) /**< \brief (TC3) COUNT8 Compare/Capture 1 */
#else
#define REG_TC3_CTRLA (*(RwReg16*)0x42002C00U) /**< \brief (TC3) Control A */
#define REG_TC3_READREQ (*(RwReg16*)0x42002C02U) /**< \brief (TC3) Read Request */
#define REG_TC3_CTRLBCLR (*(RwReg8 *)0x42002C04U) /**< \brief (TC3) Control B Clear */
#define REG_TC3_CTRLBSET (*(RwReg8 *)0x42002C05U) /**< \brief (TC3) Control B Set */
#define REG_TC3_CTRLC (*(RwReg8 *)0x42002C06U) /**< \brief (TC3) Control C */
#define REG_TC3_DBGCTRL (*(RwReg8 *)0x42002C08U) /**< \brief (TC3) Debug Control */
#define REG_TC3_EVCTRL (*(RwReg16*)0x42002C0AU) /**< \brief (TC3) Event Control */
#define REG_TC3_INTENCLR (*(RwReg8 *)0x42002C0CU) /**< \brief (TC3) Interrupt Enable Clear */
#define REG_TC3_INTENSET (*(RwReg8 *)0x42002C0DU) /**< \brief (TC3) Interrupt Enable Set */
#define REG_TC3_INTFLAG (*(RwReg8 *)0x42002C0EU) /**< \brief (TC3) Interrupt Flag Status and Clear */
#define REG_TC3_STATUS (*(RoReg8 *)0x42002C0FU) /**< \brief (TC3) Status */
#define REG_TC3_COUNT16_COUNT (*(RwReg16*)0x42002C10U) /**< \brief (TC3) COUNT16 Counter Value */
#define REG_TC3_COUNT16_CC0 (*(RwReg16*)0x42002C18U) /**< \brief (TC3) COUNT16 Compare/Capture 0 */
#define REG_TC3_COUNT16_CC1 (*(RwReg16*)0x42002C1AU) /**< \brief (TC3) COUNT16 Compare/Capture 1 */
#define REG_TC3_COUNT32_COUNT (*(RwReg *)0x42002C10U) /**< \brief (TC3) COUNT32 Counter Value */
#define REG_TC3_COUNT32_CC0 (*(RwReg *)0x42002C18U) /**< \brief (TC3) COUNT32 Compare/Capture 0 */
#define REG_TC3_COUNT32_CC1 (*(RwReg *)0x42002C1CU) /**< \brief (TC3) COUNT32 Compare/Capture 1 */
#define REG_TC3_COUNT8_COUNT (*(RwReg8 *)0x42002C10U) /**< \brief (TC3) COUNT8 Counter Value */
#define REG_TC3_COUNT8_PER (*(RwReg8 *)0x42002C14U) /**< \brief (TC3) COUNT8 Period Value */
#define REG_TC3_COUNT8_CC0 (*(RwReg8 *)0x42002C18U) /**< \brief (TC3) COUNT8 Compare/Capture 0 */
#define REG_TC3_COUNT8_CC1 (*(RwReg8 *)0x42002C19U) /**< \brief (TC3) COUNT8 Compare/Capture 1 */
#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
/* ========== Instance parameters for TC3 peripheral ========== */
#define TC3_CC8_NUM 2
#define TC3_CC16_NUM 2
#define TC3_CC32_NUM 2
#define TC3_DITHERING_EXT 0
#define TC3_GCLK_ID 20
#define TC3_MASTER 0
#define TC3_OW_NUM 2
#define TC3_PERIOD_EXT 0
#define TC3_SHADOW_EXT 0
#endif /* _SAMD20_TC3_INSTANCE_ */
|
{
"pile_set_name": "Github"
}
|
/*****************************************************************************
*
* \file
*
* \brief CTRL_ACCESS interface for SD/MMC card.
*
* Copyright (c) 2009-2011 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an Atmel
* AVR product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
******************************************************************************/
//_____ I N C L U D E S ___________________________________________________
#include "conf_access.h"
#if SD_MMC_SPI_MEM == ENABLE
#include "conf_sd_mmc_spi.h"
#include "sd_mmc_spi.h"
#include "sd_mmc_spi_mem.h"
//_____ M A C R O S ________________________________________________________
#define Sd_mmc_spi_access_signal_on()
#define Sd_mmc_spi_access_signal_off()
//_____ P R I V A T E D E C L A R A T I O N _____________________________
//_____ D E F I N I T I O N ________________________________________________
//extern xdata uint32_t sd_mmc_spi_mem_size;
extern uint32_t SD_MMC_SPI_DISK_SIZE;
extern volatile uint32_t sd_mmc_spi_last_address;
extern bool sd_mmc_spi_init_done;
uint8_t sd_mmc_spi_presence_status = SD_MMC_INSERTED;
extern bool sd_mmc_spi_init_done;
//_____ D E C L A R A T I O N ______________________________________________
void sd_mmc_spi_mem_init(void)
{
sd_mmc_spi_internal_init(); // Restart Init of SD/MMC card after previous first init
}
Ctrl_status sd_mmc_spi_test_unit_ready(void)
{
Sd_mmc_spi_access_signal_on();
switch (sd_mmc_spi_presence_status)
{
case SD_MMC_REMOVED:
sd_mmc_spi_init_done = false;
if (sd_mmc_spi_mem_check())
{
sd_mmc_spi_presence_status = SD_MMC_INSERTED;
Sd_mmc_spi_access_signal_off();
return CTRL_BUSY;
}
Sd_mmc_spi_access_signal_off();
return CTRL_NO_PRESENT;
case SD_MMC_INSERTED:
if (!sd_mmc_spi_mem_check())
{
sd_mmc_spi_presence_status = SD_MMC_REMOVING;
sd_mmc_spi_init_done = false;
Sd_mmc_spi_access_signal_off();
return CTRL_BUSY;
}
Sd_mmc_spi_access_signal_off();
return CTRL_GOOD;
case SD_MMC_REMOVING:
sd_mmc_spi_presence_status = SD_MMC_REMOVED;
Sd_mmc_spi_access_signal_off();
return CTRL_NO_PRESENT;
default:
sd_mmc_spi_presence_status = SD_MMC_REMOVED;
Sd_mmc_spi_access_signal_off();
return CTRL_BUSY;
}
/*
if (sd_mmc_spi_mem_check())
{
if (!sd_mmc_spi_status_changed)
{
sd_mmc_spi_status_changed = true;
return CTRL_BUSY; // BUSY token must be returned to indicate a status change !
}
else
return CTRL_GOOD; // the 2nd time the host will ask for unit_ready, we can answer GOOD if we have returned BUSY first !
}
else
{
if (sd_mmc_spi_status_changed)
{
sd_mmc_spi_status_changed = false;
return CTRL_BUSY; // BUSY token must be returned to indicate a status change !
}
else
return CTRL_NO_PRESENT;
}
*/
}
Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector)
{
// sd_mmc_spi_check_presence(); // ommited because creates interferences with "sd_mmc_spi_test_unit_ready()" function
Sd_mmc_spi_access_signal_on();
if (!sd_mmc_spi_init_done)
{
sd_mmc_spi_mem_init();
}
if (sd_mmc_spi_init_done)
{
*nb_sector = sd_mmc_spi_last_block_address+1;
Sd_mmc_spi_access_signal_off();
return CTRL_GOOD;
}
else
{
Sd_mmc_spi_access_signal_off();
return CTRL_NO_PRESENT;
}
}
//!
//! @brief This function returns the write protected status of the memory.
//!
//! Only used by memory removal with a HARDWARE SPECIFIC write protected detection
//! ! The user must unplug the memory to change this write protected status,
//! which cannot be for a SD_MMC.
//!
//! @return false -> the memory is not write-protected (always)
//!/
bool sd_mmc_spi_wr_protect(void)
{
return false;
}
//!
//! @brief This function tells if the memory has been removed or not.
//!
//! @return false -> The memory isn't removed
//!/
bool sd_mmc_spi_removal(void)
{
return false;
// return ((sd_mmc_spi_check_presence()) ? false : true);
}
//------------ STANDARD FUNCTIONS to read/write the memory --------------------
#if ACCESS_USB == true
#include "conf_usb.h"
#ifdef USB_DEVICE_VENDOR_ID
// USB Device Stack V2
#include "udi_msc.h"
#else
// USB Device Stack V1
#include "usb_drv.h"
#include "scsi_decoder.h"
#endif
Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector)
{
if (!sd_mmc_spi_init_done)
{
sd_mmc_spi_mem_init();
}
if (!sd_mmc_spi_init_done)
return CTRL_NO_PRESENT;
Sd_mmc_spi_access_signal_on();
if( !sd_mmc_spi_read_open(addr) )
goto sd_mmc_spi_usb_read_10_fail;
if( !sd_mmc_spi_read_multiple_sector(nb_sector) )
goto sd_mmc_spi_usb_read_10_fail;
if( !sd_mmc_spi_read_close() )
goto sd_mmc_spi_usb_read_10_fail;
Sd_mmc_spi_access_signal_off();
return CTRL_GOOD;
sd_mmc_spi_usb_read_10_fail:
Sd_mmc_spi_access_signal_off();
return CTRL_FAIL;
}
void sd_mmc_spi_read_multiple_sector_callback(const void *psector)
{
#ifdef USB_DEVICE_VENDOR_ID
// USB Device Stack V2
udi_msc_trans_block( true, (uint8_t*)psector, MMC_SECTOR_SIZE, NULL);
#else
// USB Device Stack V1
uint16_t data_to_transfer = MMC_SECTOR_SIZE;
while (data_to_transfer)
{
while (!Is_usb_in_ready(g_scsi_ep_ms_in));
Usb_reset_endpoint_fifo_access(g_scsi_ep_ms_in);
data_to_transfer = usb_write_ep_txpacket(g_scsi_ep_ms_in, psector,
data_to_transfer, &psector);
Usb_ack_in_ready_send(g_scsi_ep_ms_in);
}
#endif
}
Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector)
{
bool status;
if (!sd_mmc_spi_init_done)
{
sd_mmc_spi_mem_init();
}
if (sd_mmc_spi_init_done)
{
Sd_mmc_spi_access_signal_on();
sd_mmc_spi_write_open(addr);
status = sd_mmc_spi_write_multiple_sector(nb_sector);
sd_mmc_spi_write_close();
Sd_mmc_spi_access_signal_off();
if (status)
return CTRL_GOOD;
else
return CTRL_NO_PRESENT;
}
else
return CTRL_NO_PRESENT;
}
void sd_mmc_spi_write_multiple_sector_callback(void *psector)
{
#ifdef USB_DEVICE_VENDOR_ID
// USB Device Stack V2
udi_msc_trans_block( false, (uint8_t*)psector, MMC_SECTOR_SIZE, NULL);
#else
// USB Device Stack V1
uint16_t data_to_transfer = MMC_SECTOR_SIZE;
while (data_to_transfer)
{
while (!Is_usb_out_received(g_scsi_ep_ms_out));
Usb_reset_endpoint_fifo_access(g_scsi_ep_ms_out);
data_to_transfer = usb_read_ep_rxpacket(g_scsi_ep_ms_out, psector,
data_to_transfer, &psector);
Usb_ack_out_received_free(g_scsi_ep_ms_out);
}
#endif
}
#endif // ACCESS_USB == true
//------------ Standard functions for read/write 1 sector to 1 sector ram buffer -----------------
#if ACCESS_MEM_TO_RAM == true
Ctrl_status sd_mmc_spi_mem_2_ram(uint32_t addr, void *ram)
{
Sd_mmc_spi_access_signal_on();
sd_mmc_spi_check_presence();
if (!sd_mmc_spi_init_done)
{
sd_mmc_spi_mem_init();
}
if (!sd_mmc_spi_init_done)
return CTRL_NO_PRESENT;
if( !sd_mmc_spi_read_open(addr) )
goto sd_mmc_spi_mem_2_ram_fail;
if( !sd_mmc_spi_read_sector_to_ram(ram))
goto sd_mmc_spi_mem_2_ram_fail;
if( !sd_mmc_spi_read_close() )
goto sd_mmc_spi_mem_2_ram_fail;
Sd_mmc_spi_access_signal_off();
return CTRL_GOOD;
sd_mmc_spi_mem_2_ram_fail:
Sd_mmc_spi_access_signal_off();
return CTRL_FAIL;
}
//! This fonction initialises the memory for a write operation
//! from ram buffer to SD/MMC (1 sector)
//!
//! DATA FLOW is: RAM => SD/MMC
//!
//! (sector = 512B)
//! @param addr Sector address to write
//! @param ram Ram buffer pointer
//!
//! @return Ctrl_status
//! It is ready -> CTRL_GOOD
//! An error occurs -> CTRL_FAIL
//!
Ctrl_status sd_mmc_spi_ram_2_mem(uint32_t addr, const void *ram)
{
Sd_mmc_spi_access_signal_on();
sd_mmc_spi_check_presence();
if (!sd_mmc_spi_init_done)
{
sd_mmc_spi_mem_init();
}
if (sd_mmc_spi_init_done)
{
sd_mmc_spi_write_open(addr);
if (!sd_mmc_spi_write_sector_from_ram(ram))
{
sd_mmc_spi_write_close();
Sd_mmc_spi_access_signal_off();
return CTRL_NO_PRESENT;
}
sd_mmc_spi_write_close();
Sd_mmc_spi_access_signal_off();
return CTRL_GOOD;
}
Sd_mmc_spi_access_signal_off();
return CTRL_NO_PRESENT;
}
#endif // ACCESS_MEM_TO_RAM == true
#endif // SD_MMC_SPI_MEM == ENABLE
|
{
"pile_set_name": "Github"
}
|
{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf320
{\fonttbl\f0\fnil\fcharset0 Verdana;\f1\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red73\green73\blue73;}
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}}
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}}
\vieww9000\viewh8400\viewkind0
\deftab720
\pard\pardeftab720\sl400\sa280\ql\qnatural
\f0\fs24 \cf2 Copyright (c) 2010, Oomph Inc.
\f1 \uc0\u8232
\f0 All rights reserved.\
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\
\pard\tx220\tx720\pardeftab720\li720\fi-720\sl400\sa20\ql\qnatural
\ls1\ilvl0\cf2 {\listtext \'95 }Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\
{\listtext \'95 }Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\
{\listtext \'95 }Neither the name of Oomph Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\
\pard\pardeftab720\sl400\sa280\ql\qnatural
\cf2 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.}
|
{
"pile_set_name": "Github"
}
|
#
# This is a copy of innodb-alter.test except using remote tablespaces
# and showing those files.
#
SET default_storage_engine=InnoDB;
SET GLOBAL innodb_file_per_table=ON;
SET NAMES utf8;
Warnings:
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
CREATE TABLE t1 (
c1 INT PRIMARY KEY, c2 INT DEFAULT 1, ct TEXT,
INDEX(c2))
ENGINE=InnoDB DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir';
INSERT INTO t1 SET c1=1;
CREATE TABLE sys_tables SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLES
WHERE NAME LIKE 'test/t%';
CREATE TABLE sys_indexes SELECT i.* FROM INFORMATION_SCHEMA.INNODB_INDEXES i
INNER JOIN sys_tables st ON i.TABLE_ID=st.TABLE_ID;
CREATE TABLE t1p LIKE t1;
CREATE TABLE t1c (c1 INT PRIMARY KEY, c2 INT, c3 INT, INDEX(c2), INDEX(c3),
CONSTRAINT t1c2 FOREIGN KEY (c2) REFERENCES t1(c2),
CONSTRAINT t1c3 FOREIGN KEY (c3) REFERENCES t1p(c2))
ENGINE=InnoDB DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir';
CREATE TABLE sys_foreign SELECT i.*
FROM INFORMATION_SCHEMA.INNODB_FOREIGN i
WHERE FOR_NAME LIKE 'test/t%';
SELECT i.FOR_COL_NAME, i.REF_COL_NAME, i.POS FROM INFORMATION_SCHEMA.INNODB_FOREIGN_COLS i
INNER JOIN sys_foreign sf ON i.ID = sf.ID;
FOR_COL_NAME REF_COL_NAME POS
c2 c2 1
c3 c2 1
SELECT i.NAME,i.POS,i.MTYPE,i.PRTYPE,i.LEN
FROM INFORMATION_SCHEMA.INNODB_COLUMNS i
INNER JOIN sys_tables st ON i.TABLE_ID=st.TABLE_ID ORDER BY i.NAME,i.POS;
NAME POS MTYPE PRTYPE LEN
c1 0 6 1283 4
c2 1 6 1027 4
ct 2 5 16711932 10
SELECT si.NAME,i.POS,i.NAME FROM INFORMATION_SCHEMA.INNODB_FIELDS i
INNER JOIN sys_indexes si ON i.INDEX_ID=si.INDEX_ID ORDER BY si.NAME, i.POS;
NAME POS NAME
c2 0 c2
PRIMARY 0 c1
SELECT i.FOR_COL_NAME, i.REF_COL_NAME, i.POS FROM INFORMATION_SCHEMA.INNODB_FOREIGN_COLS i
INNER JOIN sys_foreign sf ON i.ID = sf.ID;
FOR_COL_NAME REF_COL_NAME POS
c2 c2 1
c3 c2 1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int NOT NULL,
`c2` int DEFAULT '1',
`ct` text,
PRIMARY KEY (`c1`),
KEY `c2` (`c2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
ALTER TABLE t1 ALTER c2 DROP DEFAULT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int NOT NULL,
`c2` int,
`ct` text,
PRIMARY KEY (`c1`),
KEY `c2` (`c2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
### files in MYSQL_DATA_DIR/test
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1p.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
t1.ibd
t1c.ibd
SELECT i.NAME,i.POS,i.MTYPE,i.PRTYPE,i.LEN
FROM INFORMATION_SCHEMA.INNODB_COLUMNS i
INNER JOIN sys_tables st ON i.TABLE_ID=st.TABLE_ID ORDER BY i.NAME,i.POS;
NAME POS MTYPE PRTYPE LEN
c1 0 6 1283 4
c2 1 6 1027 4
ct 2 5 16711932 10
SELECT si.NAME,i.POS,i.NAME FROM INFORMATION_SCHEMA.INNODB_FIELDS i
INNER JOIN sys_indexes si ON i.INDEX_ID=si.INDEX_ID ORDER BY si.NAME, i.POS;
NAME POS NAME
c2 0 c2
PRIMARY 0 c1
SELECT i.FOR_COL_NAME, i.REF_COL_NAME, i.POS FROM INFORMATION_SCHEMA.INNODB_FOREIGN_COLS i
INNER JOIN sys_foreign sf ON i.ID = sf.ID;
FOR_COL_NAME REF_COL_NAME POS
c2 c2 1
c3 c2 1
ALTER TABLE t1 CHANGE c2 c2 INT AFTER c1;
ALTER TABLE t1 CHANGE c1 c1 INT FIRST;
### files in MYSQL_DATA_DIR/test
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1p.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
t1.ibd
t1c.ibd
SELECT i.NAME,i.POS,i.MTYPE,i.PRTYPE,i.LEN
FROM INFORMATION_SCHEMA.INNODB_COLUMNS i
INNER JOIN sys_tables st ON i.TABLE_ID=st.TABLE_ID ORDER BY i.NAME,i.POS;
NAME POS MTYPE PRTYPE LEN
c1 0 6 1283 4
c2 1 6 1027 4
ct 2 5 16711932 10
SELECT si.NAME,i.POS,i.NAME FROM INFORMATION_SCHEMA.INNODB_FIELDS i
INNER JOIN sys_indexes si ON i.INDEX_ID=si.INDEX_ID ORDER BY si.NAME, i.POS;
NAME POS NAME
c2 0 c2
PRIMARY 0 c1
SELECT i.FOR_COL_NAME, i.REF_COL_NAME, i.POS FROM INFORMATION_SCHEMA.INNODB_FOREIGN_COLS i
INNER JOIN sys_foreign sf ON i.ID = sf.ID;
FOR_COL_NAME REF_COL_NAME POS
c2 c2 1
c3 c2 1
ALTER TABLE t1 CHANGE C2 c3 INT;
### files in MYSQL_DATA_DIR/test
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1p.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
t1.ibd
t1c.ibd
SELECT i.NAME,i.POS,i.MTYPE,i.PRTYPE,i.LEN
FROM INFORMATION_SCHEMA.INNODB_COLUMNS i
INNER JOIN sys_tables st ON i.TABLE_ID=st.TABLE_ID ORDER BY i.NAME,i.POS;
NAME POS MTYPE PRTYPE LEN
c1 0 6 1283 4
c3 1 6 1027 4
ct 2 5 16711932 10
SELECT si.NAME,i.POS,i.NAME FROM INFORMATION_SCHEMA.INNODB_FIELDS i
INNER JOIN sys_indexes si ON i.INDEX_ID=si.INDEX_ID ORDER BY si.NAME, i.POS;
NAME POS NAME
c2 0 c3
PRIMARY 0 c1
SELECT i.FOR_COL_NAME, i.REF_COL_NAME, i.POS FROM INFORMATION_SCHEMA.INNODB_FOREIGN_COLS i
INNER JOIN sys_foreign sf ON i.ID = sf.ID;
FOR_COL_NAME REF_COL_NAME POS
c2 c3 1
c3 c2 1
ALTER TABLE t1 CHANGE c3 C INT;
### files in MYSQL_DATA_DIR/test
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1p.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
t1.ibd
t1c.ibd
SELECT i.NAME,i.POS,i.MTYPE,i.PRTYPE,i.LEN
FROM INFORMATION_SCHEMA.INNODB_COLUMNS i
INNER JOIN sys_tables st ON i.TABLE_ID=st.TABLE_ID ORDER BY i.NAME,i.POS;
NAME POS MTYPE PRTYPE LEN
C 1 6 1027 4
c1 0 6 1283 4
ct 2 5 16711932 10
SELECT si.NAME,i.POS,i.NAME FROM INFORMATION_SCHEMA.INNODB_FIELDS i
INNER JOIN sys_indexes si ON i.INDEX_ID=si.INDEX_ID ORDER BY si.NAME, i.POS;
NAME POS NAME
c2 0 C
PRIMARY 0 c1
SELECT i.FOR_COL_NAME, i.REF_COL_NAME, i.POS FROM INFORMATION_SCHEMA.INNODB_FOREIGN_COLS i
INNER JOIN sys_foreign sf ON i.ID = sf.ID;
FOR_COL_NAME REF_COL_NAME POS
c2 C 1
c3 c2 1
ALTER TABLE t1 CHANGE C Cöŀumň_TWO INT;
### files in MYSQL_DATA_DIR/test
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1p.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
t1.ibd
t1c.ibd
SELECT i.FOR_COL_NAME, i.REF_COL_NAME, i.POS FROM INFORMATION_SCHEMA.INNODB_FOREIGN_COLS i
INNER JOIN sys_foreign sf ON i.ID = sf.ID;
FOR_COL_NAME REF_COL_NAME POS
c2 Cöŀumň_TWO 1
c3 c2 1
SELECT i.NAME,i.POS,i.MTYPE,i.PRTYPE,i.LEN
FROM INFORMATION_SCHEMA.INNODB_COLUMNS i
INNER JOIN sys_tables st ON i.TABLE_ID=st.TABLE_ID ORDER BY i.NAME,i.POS;
NAME POS MTYPE PRTYPE LEN
c1 0 6 1283 4
Cöŀumň_TWO 1 6 1027 4
ct 2 5 16711932 10
SELECT si.NAME,i.POS,i.NAME FROM INFORMATION_SCHEMA.INNODB_FIELDS i
INNER JOIN sys_indexes si ON i.INDEX_ID=si.INDEX_ID ORDER BY si.NAME, i.POS;
NAME POS NAME
c2 0 Cöŀumň_TWO
PRIMARY 0 c1
SELECT i.FOR_COL_NAME, i.REF_COL_NAME, i.POS FROM INFORMATION_SCHEMA.INNODB_FOREIGN_COLS i
INNER JOIN sys_foreign sf ON i.ID = sf.ID;
FOR_COL_NAME REF_COL_NAME POS
c2 Cöŀumň_TWO 1
c3 c2 1
ALTER TABLE t1 CHANGE cöĿǖmň_two c3 INT;
ERROR 42S22: Unknown column 'cöĿǖmň_two' in 't1'
ALTER TABLE t1 CHANGE cÖĿUMŇ_two c3 INT, RENAME TO t3;
### files in MYSQL_DATA_DIR/test
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1p.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
t1c.ibd
t3.ibd
SELECT st.NAME, i.NAME
FROM sys_tables st INNER JOIN INFORMATION_SCHEMA.INNODB_TABLES i
ON i.TABLE_ID=st.TABLE_ID;
NAME NAME
test/t1 test/t3
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
`c1` int NOT NULL,
`c3` int DEFAULT NULL,
`ct` text,
PRIMARY KEY (`c1`),
KEY `c2` (`c3`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
SHOW CREATE TABLE t1c;
Table Create Table
t1c CREATE TABLE `t1c` (
`c1` int NOT NULL,
`c2` int DEFAULT NULL,
`c3` int DEFAULT NULL,
PRIMARY KEY (`c1`),
KEY `c2` (`c2`),
KEY `c3` (`c3`),
CONSTRAINT `t1c2` FOREIGN KEY (`c2`) REFERENCES `t3` (`c3`),
CONSTRAINT `t1c3` FOREIGN KEY (`c3`) REFERENCES `t1p` (`c2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
ALTER TABLE t3 CHANGE c3
`12345678901234567890123456789012345678901234567890123456789012345` INT;
ERROR 42000: Identifier name '12345678901234567890123456789012345678901234567890123456789012345' is too long
ALTER TABLE t3 CHANGE c3
`1234567890123456789012345678901234567890123456789012345678901234` INT;
### files in MYSQL_DATA_DIR/test
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1p.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
t1c.ibd
t3.ibd
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
`c1` int NOT NULL,
`1234567890123456789012345678901234567890123456789012345678901234` int DEFAULT NULL,
`ct` text,
PRIMARY KEY (`c1`),
KEY `c2` (`1234567890123456789012345678901234567890123456789012345678901234`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
ALTER TABLE t3 CHANGE
`1234567890123456789012345678901234567890123456789012345678901234`
`倀倁倂倃倄倅倆倇倈倉倊個倌倍倎倏倐們倒倓倔倕倖倗倘候倚倛倜倝倞借倠倡倢倣値倥倦倧倨倩倪倫倬倭倮倯倰倱倲倳倴倵倶倷倸倹债倻值倽倾倿偀` INT;
ERROR 42000: Identifier name '倀倁倂倃倄倅倆倇倈倉倊個倌倍倎倏倐們倒倓倔倕倖倗倘候倚倛倜倝倞借倠?' is too long
ALTER TABLE t3 CHANGE
`1234567890123456789012345678901234567890123456789012345678901234`
`倀倁倂倃倄倅倆倇倈倉倊個倌倍倎倏倐們倒倓倔倕倖倗倘候倚倛倜倝倞借倠倡倢倣値倥倦倧倨倩倪倫倬倭倮倯倰倱倲倳倴倵倶倷倸倹债倻值倽倾倿ä` INT;
ERROR 42000: Identifier name '倀倁倂倃倄倅倆倇倈倉倊個倌倍倎倏倐們倒倓倔倕倖倗倘候倚倛倜倝倞借倠?' is too long
ALTER TABLE t3 CHANGE
`1234567890123456789012345678901234567890123456789012345678901234`
`倀倁倂倃倄倅倆倇倈倉倊個倌倍倎倏倐們倒倓倔倕倖倗倘候倚倛倜倝倞借倠倡倢倣値倥倦倧倨倩倪倫倬倭倮倯倰倱倲倳倴倵倶倷倸倹债倻值倽倾ä` INT;
### files in MYSQL_DATA_DIR/test
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1p.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
t1c.ibd
t3.ibd
ALTER TABLE t3 CHANGE
`倀倁倂倃倄倅倆倇倈倉倊個倌倍倎倏倐們倒倓倔倕倖倗倘候倚倛倜倝倞借倠倡倢倣値倥倦倧倨倩倪倫倬倭倮倯倰倱倲倳倴倵倶倷倸倹债倻值倽倾Ä`
c3 INT;
### files in MYSQL_DATA_DIR/test
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1p.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
t1c.ibd
t3.ibd
ALTER TABLE t3 CHANGE c3 𐌀𐌁𐌂𐌃𐌄𐌅𐌆𐌇𐌈𐌉𐌊𐌋𐌌𐌍𐌎𐌏𐌐𐌑𐌒𐌓𐌔𐌕𐌖𐌗𐌘𐌙𐌚𐌛𐌜 INT;
ERROR HY000: Invalid utf8 character string: '\xF0\x90\x8C\x80\xF0\x90\x8C\x81\xF0\x90\x8C\x82\xF0\x90\x8C\x83'
ALTER TABLE t3 CHANGE c3 😲 INT;
ERROR HY000: Invalid utf8 character string: '\xF0\x9F\x98\xB2'
ALTER TABLE t3 RENAME TO t2;
### files in MYSQL_DATA_DIR/test
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1p.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
t1c.ibd
t2.ibd
SELECT st.NAME, i.NAME
FROM sys_tables st INNER JOIN INFORMATION_SCHEMA.INNODB_TABLES i
ON i.TABLE_ID=st.TABLE_ID;
NAME NAME
test/t1 test/t2
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`c1` int NOT NULL,
`c3` int DEFAULT NULL,
`ct` text,
PRIMARY KEY (`c1`),
KEY `c2` (`c3`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
RENAME TABLE t2 TO t1;
SELECT st.NAME, i.NAME
FROM sys_tables st INNER JOIN INFORMATION_SCHEMA.INNODB_TABLES i
ON i.TABLE_ID=st.TABLE_ID;
NAME NAME
test/t1 test/t1
### files in MYSQL_DATA_DIR/test
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1p.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
t1.ibd
t1c.ibd
SELECT i.NAME,i.POS,i.MTYPE,i.PRTYPE,i.LEN
FROM INFORMATION_SCHEMA.INNODB_COLUMNS i
INNER JOIN sys_tables st ON i.TABLE_ID=st.TABLE_ID ORDER BY i.NAME,i.POS;
NAME POS MTYPE PRTYPE LEN
c1 0 6 1283 4
c3 1 6 1027 4
ct 2 5 16711932 10
SELECT si.NAME,i.POS,i.NAME FROM INFORMATION_SCHEMA.INNODB_FIELDS i
INNER JOIN sys_indexes si ON i.INDEX_ID=si.INDEX_ID ORDER BY si.NAME, i.POS;
NAME POS NAME
c2 0 c3
PRIMARY 0 c1
SELECT i.FOR_COL_NAME, i.REF_COL_NAME, i.POS FROM INFORMATION_SCHEMA.INNODB_FOREIGN_COLS i
INNER JOIN sys_foreign sf ON i.ID = sf.ID;
FOR_COL_NAME REF_COL_NAME POS
c2 c3 1
c3 c2 1
ALTER TABLE t1 DROP INDEX c2;
ERROR HY000: Cannot drop index 'c2': needed in a foreign key constraint
ALTER TABLE t1 DROP INDEX c4;
ERROR 42000: Can't DROP 'c4'; check that column/key exists
ALTER TABLE t1c DROP FOREIGN KEY c2;
ERROR 42000: Can't DROP 'c2'; check that column/key exists
ALTER TABLE t1c DROP FOREIGN KEY t1c2, DROP FOREIGN KEY c2;
ERROR 42000: Can't DROP 'c2'; check that column/key exists
ALTER TABLE t1c DROP FOREIGN KEY t1c2, DROP FOREIGN KEY c2, DROP INDEX c2;
ERROR 42000: Can't DROP 'c2'; check that column/key exists
ALTER TABLE t1c DROP INDEX c2;
ERROR HY000: Cannot drop index 'c2': needed in a foreign key constraint
ALTER TABLE t1c DROP FOREIGN KEY ẗ1C2;
ERROR 42000: Can't DROP 'ẗ1C2'; check that column/key exists
SHOW CREATE TABLE t1c;
Table Create Table
t1c CREATE TABLE `t1c` (
`c1` int NOT NULL,
`c2` int DEFAULT NULL,
`c3` int DEFAULT NULL,
PRIMARY KEY (`c1`),
KEY `c2` (`c2`),
KEY `c3` (`c3`),
CONSTRAINT `t1c2` FOREIGN KEY (`c2`) REFERENCES `t1` (`c3`),
CONSTRAINT `t1c3` FOREIGN KEY (`c3`) REFERENCES `t1p` (`c2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
SET foreign_key_checks=0;
DROP TABLE t1p;
SET foreign_key_checks=1;
SHOW CREATE TABLE t1c;
Table Create Table
t1c CREATE TABLE `t1c` (
`c1` int NOT NULL,
`c2` int DEFAULT NULL,
`c3` int DEFAULT NULL,
PRIMARY KEY (`c1`),
KEY `c2` (`c2`),
KEY `c3` (`c3`),
CONSTRAINT `t1c2` FOREIGN KEY (`c2`) REFERENCES `t1` (`c3`),
CONSTRAINT `t1c3` FOREIGN KEY (`c3`) REFERENCES `t1p` (`c2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
### files in MYSQL_DATA_DIR/test
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
t1.ibd
t1c.ibd
SELECT i.NAME,i.POS,i.MTYPE,i.PRTYPE,i.LEN
FROM INFORMATION_SCHEMA.INNODB_COLUMNS i
INNER JOIN sys_tables st ON i.TABLE_ID=st.TABLE_ID ORDER BY i.NAME,i.POS;
NAME POS MTYPE PRTYPE LEN
c1 0 6 1283 4
c3 1 6 1027 4
ct 2 5 16711932 10
SELECT si.NAME,i.POS,i.NAME FROM INFORMATION_SCHEMA.INNODB_FIELDS i
INNER JOIN sys_indexes si ON i.INDEX_ID=si.INDEX_ID ORDER BY si.NAME, i.POS;
NAME POS NAME
c2 0 c3
PRIMARY 0 c1
SELECT i.FOR_COL_NAME, i.REF_COL_NAME, i.POS FROM INFORMATION_SCHEMA.INNODB_FOREIGN_COLS i
INNER JOIN sys_foreign sf ON i.ID = sf.ID;
FOR_COL_NAME REF_COL_NAME POS
c2 c3 1
c3 c2 1
CREATE TABLE t1p (c1 INT PRIMARY KEY, c2 INT, INDEX(c2))
ENGINE=InnoDB DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir';
ALTER TABLE t1c DROP INDEX C2, DROP INDEX C3;
ERROR HY000: Cannot drop index 'c2': needed in a foreign key constraint
ALTER TABLE t1c DROP INDEX C3;
ERROR HY000: Cannot drop index 'c3': needed in a foreign key constraint
SET foreign_key_checks=0;
ALTER TABLE t1c DROP INDEX C3;
ERROR HY000: Cannot drop index 'c3': needed in a foreign key constraint
### files in MYSQL_DATA_DIR/test
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
t1.ibd
t1c.ibd
t1p.ibd
SET foreign_key_checks=1;
SHOW CREATE TABLE t1c;
Table Create Table
t1c CREATE TABLE `t1c` (
`c1` int NOT NULL,
`c2` int DEFAULT NULL,
`c3` int DEFAULT NULL,
PRIMARY KEY (`c1`),
KEY `c2` (`c2`),
KEY `c3` (`c3`),
CONSTRAINT `t1c2` FOREIGN KEY (`c2`) REFERENCES `t1` (`c3`),
CONSTRAINT `t1c3` FOREIGN KEY (`c3`) REFERENCES `t1p` (`c2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
SELECT i.NAME,i.POS,i.MTYPE,i.PRTYPE,i.LEN
FROM INFORMATION_SCHEMA.INNODB_COLUMNS i
INNER JOIN sys_tables st ON i.TABLE_ID=st.TABLE_ID ORDER BY i.NAME,i.POS;
NAME POS MTYPE PRTYPE LEN
c1 0 6 1283 4
c3 1 6 1027 4
ct 2 5 16711932 10
SELECT si.NAME,i.POS,i.NAME FROM INFORMATION_SCHEMA.INNODB_FIELDS i
INNER JOIN sys_indexes si ON i.INDEX_ID=si.INDEX_ID ORDER BY si.NAME, i.POS;
NAME POS NAME
c2 0 c3
PRIMARY 0 c1
SELECT i.FOR_COL_NAME, i.REF_COL_NAME, i.POS FROM INFORMATION_SCHEMA.INNODB_FOREIGN_COLS i
INNER JOIN sys_foreign sf ON i.ID = sf.ID;
FOR_COL_NAME REF_COL_NAME POS
c2 c3 1
c3 c2 1
ALTER TABLE t1c DROP FOREIGN KEY t1C3;
### files in MYSQL_DATA_DIR/test
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
t1.ibd
t1c.ibd
t1p.ibd
SHOW CREATE TABLE t1c;
Table Create Table
t1c CREATE TABLE `t1c` (
`c1` int NOT NULL,
`c2` int DEFAULT NULL,
`c3` int DEFAULT NULL,
PRIMARY KEY (`c1`),
KEY `c2` (`c2`),
KEY `c3` (`c3`),
CONSTRAINT `t1c2` FOREIGN KEY (`c2`) REFERENCES `t1` (`c3`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
SELECT i.NAME,i.POS,i.MTYPE,i.PRTYPE,i.LEN
FROM INFORMATION_SCHEMA.INNODB_COLUMNS i
INNER JOIN sys_tables st ON i.TABLE_ID=st.TABLE_ID ORDER BY i.NAME,i.POS;
NAME POS MTYPE PRTYPE LEN
c1 0 6 1283 4
c3 1 6 1027 4
ct 2 5 16711932 10
SELECT si.NAME,i.POS,i.NAME FROM INFORMATION_SCHEMA.INNODB_FIELDS i
INNER JOIN sys_indexes si ON i.INDEX_ID=si.INDEX_ID ORDER BY si.NAME, i.POS;
NAME POS NAME
c2 0 c3
PRIMARY 0 c1
SELECT i.FOR_COL_NAME, i.REF_COL_NAME, i.POS FROM INFORMATION_SCHEMA.INNODB_FOREIGN_COLS i
INNER JOIN sys_foreign sf ON i.ID = sf.ID;
FOR_COL_NAME REF_COL_NAME POS
c2 c3 1
ALTER TABLE t1c DROP INDEX c2, DROP FOREIGN KEY t1C2;
### files in MYSQL_DATA_DIR/test
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
t1.ibd
t1c.ibd
t1p.ibd
SHOW CREATE TABLE t1c;
Table Create Table
t1c CREATE TABLE `t1c` (
`c1` int NOT NULL,
`c2` int DEFAULT NULL,
`c3` int DEFAULT NULL,
PRIMARY KEY (`c1`),
KEY `c3` (`c3`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
SELECT i.NAME,i.POS,i.MTYPE,i.PRTYPE,i.LEN
FROM INFORMATION_SCHEMA.INNODB_COLUMNS i
INNER JOIN sys_tables st ON i.TABLE_ID=st.TABLE_ID ORDER BY i.NAME,i.POS;
NAME POS MTYPE PRTYPE LEN
c1 0 6 1283 4
c3 1 6 1027 4
ct 2 5 16711932 10
SELECT si.NAME,i.POS,i.NAME FROM INFORMATION_SCHEMA.INNODB_FIELDS i
INNER JOIN sys_indexes si ON i.INDEX_ID=si.INDEX_ID ORDER BY si.NAME, i.POS;
NAME POS NAME
c2 0 c3
PRIMARY 0 c1
SELECT i.FOR_COL_NAME, i.REF_COL_NAME, i.POS FROM INFORMATION_SCHEMA.INNODB_FOREIGN_COLS i
INNER JOIN sys_foreign sf ON i.ID = sf.ID;
FOR_COL_NAME REF_COL_NAME POS
ALTER TABLE t1 DROP INDEX c2, CHANGE c3 c2 INT;
### files in MYSQL_DATA_DIR/test
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
t1.ibd
t1c.ibd
t1p.ibd
SELECT i.NAME,i.POS,i.MTYPE,i.PRTYPE,i.LEN
FROM INFORMATION_SCHEMA.INNODB_COLUMNS i
INNER JOIN sys_tables st ON i.TABLE_ID=st.TABLE_ID ORDER BY i.NAME,i.POS;
NAME POS MTYPE PRTYPE LEN
c1 0 6 1283 4
c2 1 6 1027 4
ct 2 5 16711932 10
SELECT si.NAME,i.POS,i.NAME FROM INFORMATION_SCHEMA.INNODB_FIELDS i
INNER JOIN sys_indexes si ON i.INDEX_ID=si.INDEX_ID ORDER BY si.NAME, i.POS;
NAME POS NAME
PRIMARY 0 c1
SELECT i.FOR_COL_NAME, i.REF_COL_NAME, i.POS FROM INFORMATION_SCHEMA.INNODB_FOREIGN_COLS i
INNER JOIN sys_foreign sf ON i.ID = sf.ID;
FOR_COL_NAME REF_COL_NAME POS
CREATE TABLE t1o LIKE t1;
ALTER TABLE t1 ADD FULLTEXT INDEX (ct),
CHANGE c1 pk INT, ALTER c2 SET DEFAULT 42, RENAME TO tt,
ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED.
ALTER TABLE t1 ADD FULLTEXT INDEX (ct),
CHANGE c1 pk INT, ALTER c2 SET DEFAULT 42, RENAME TO tt,
ALGORITHM=INPLACE, LOCK=SHARED;
Warnings:
Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
### files in MYSQL_DATA_DIR/test
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1o.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
t1c.ibd
t1p.ibd
tt.ibd
SELECT i.NAME,i.POS,i.MTYPE,i.PRTYPE,i.LEN
FROM INFORMATION_SCHEMA.INNODB_COLUMNS i
INNER JOIN sys_tables st ON i.TABLE_ID=st.TABLE_ID ORDER BY i.NAME,i.POS;
NAME POS MTYPE PRTYPE LEN
SELECT si.NAME,i.POS,i.NAME FROM INFORMATION_SCHEMA.INNODB_FIELDS i
INNER JOIN sys_indexes si ON i.INDEX_ID=si.INDEX_ID ORDER BY si.NAME, i.POS;
NAME POS NAME
SELECT i.FOR_COL_NAME, i.REF_COL_NAME, i.POS FROM INFORMATION_SCHEMA.INNODB_FOREIGN_COLS i
INNER JOIN sys_foreign sf ON i.ID = sf.ID;
FOR_COL_NAME REF_COL_NAME POS
SHOW CREATE TABLE tt;
Table Create Table
tt CREATE TABLE `tt` (
`pk` int NOT NULL,
`c2` int DEFAULT '42',
`ct` text,
PRIMARY KEY (`pk`),
FULLTEXT KEY `ct` (`ct`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
ALTER TABLE t1o CHANGE c1 dB_row_Id INT, ALGORITHM=COPY;
ERROR 42000: Incorrect column name 'dB_row_Id'
ALTER TABLE t1o CHANGE c1 dB_row_Id INT, ALGORITHM=INPLACE;
ERROR 42000: Incorrect column name 'DB_ROW_ID'
ALTER TABLE t1o CHANGE c1 DB_TRX_ID INT;
ERROR 42000: Incorrect column name 'DB_TRX_ID'
ALTER TABLE t1o CHANGE c1 db_roll_ptr INT;
ERROR 42000: Incorrect column name 'db_roll_ptr'
ALTER TABLE t1o ADD FULLTEXT INDEX(ct), CHANGE c1 FTS_DOC_ID INT,
ALGORITHM=COPY;
ERROR HY000: Column 'FTS_DOC_ID' is of wrong type for an InnoDB FULLTEXT index
ALTER TABLE t1o ADD FULLTEXT INDEX(ct), CHANGE c1 FTS_DOC_ID INT,
ALGORITHM=INPLACE;
ERROR HY000: Column 'FTS_DOC_ID' is of wrong type for an InnoDB FULLTEXT index
ALTER TABLE t1o ADD FULLTEXT INDEX(ct), CHANGE c1 FTS_Doc_ID INT,
ALGORITHM=INPLACE;
ERROR HY000: Column 'FTS_Doc_ID' is of wrong type for an InnoDB FULLTEXT index
ALTER TABLE t1o ADD FULLTEXT INDEX(ct),
CHANGE c1 FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY.
CREATE TABLE t1n LIKE t1o;
ALTER TABLE t1n ADD FULLTEXT INDEX(ct);
Warnings:
Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
### files in MYSQL_DATA_DIR/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1n.ibd
t1o.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
t1c.ibd
t1p.ibd
tt.ibd
ALTER TABLE t1n CHANGE c1 Fts_DOC_ID INT, ALGORITHM=INPLACE;
ERROR HY000: Column 'Fts_DOC_ID' is of wrong type for an InnoDB FULLTEXT index
ALTER TABLE t1n CHANGE c1 Fts_DOC_ID INT, ALGORITHM=COPY;
ERROR HY000: Column 'Fts_DOC_ID' is of wrong type for an InnoDB FULLTEXT index
ALTER TABLE t1n CHANGE FTS_DOC_ID c11 INT, ALGORITHM=INPLACE;
ERROR 42S22: Unknown column 'FTS_DOC_ID' in 't1n'
ALTER TABLE t1n CHANGE c1 FTS_DOC_ïD INT, ALGORITHM=INPLACE;
### files in MYSQL_DATA_DIR/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1n.ibd
t1o.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
t1c.ibd
t1p.ibd
tt.ibd
ALTER TABLE t1n CHANGE FTS_DOC_ÏD c1 INT, ALGORITHM=INPLACE;
### files in MYSQL_DATA_DIR/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1n.ibd
t1o.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
t1c.ibd
t1p.ibd
tt.ibd
ALTER TABLE t1n CHANGE c1 c2 INT, CHANGE c2 ct INT, CHANGE ct c1 TEXT,
ALGORITHM=INPLACE;
### files in MYSQL_DATA_DIR/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1n.ibd
t1o.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
t1c.ibd
t1p.ibd
tt.ibd
SHOW CREATE TABLE t1n;
Table Create Table
t1n CREATE TABLE `t1n` (
`c2` int NOT NULL,
`ct` int DEFAULT NULL,
`c1` text,
PRIMARY KEY (`c2`),
FULLTEXT KEY `ct` (`c1`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
ALTER TABLE t1n CHANGE c2 c1 INT, CHANGE ct c2 INT, CHANGE c1 ct TEXT,
ALGORITHM=COPY;
### files in MYSQL_DATA_DIR/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1n.ibd
t1o.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
t1c.ibd
t1p.ibd
tt.ibd
SHOW CREATE TABLE t1n;
Table Create Table
t1n CREATE TABLE `t1n` (
`c1` int NOT NULL,
`c2` int DEFAULT NULL,
`ct` text,
PRIMARY KEY (`c1`),
FULLTEXT KEY `ct` (`ct`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
ALTER TABLE t1n ADD INDEX(c2), CHANGE c2 c4 INT, ALGORITHM=INPLACE;
ERROR 42000: Key column 'c2' doesn't exist in table
ALTER TABLE t1n ADD INDEX(c2), CHANGE c2 c4 INT, ALGORITHM=COPY;
ERROR 42000: Key column 'c2' doesn't exist in table
ALTER TABLE t1n ADD INDEX(c4), CHANGE c2 c4 INT, ALGORITHM=INPLACE;
### files in MYSQL_DATA_DIR/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1n.ibd
t1o.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
t1c.ibd
t1p.ibd
tt.ibd
SHOW CREATE TABLE t1n;
Table Create Table
t1n CREATE TABLE `t1n` (
`c1` int NOT NULL,
`c4` int DEFAULT NULL,
`ct` text,
PRIMARY KEY (`c1`),
KEY `c4` (`c4`),
FULLTEXT KEY `ct` (`ct`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
ALTER TABLE t1n DROP INDEX c4;
### files in MYSQL_DATA_DIR/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1n.ibd
t1o.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
t1c.ibd
t1p.ibd
tt.ibd
ALTER TABLE t1n CHANGE c4 c1 INT, ADD INDEX(c1), ALGORITHM=INPLACE;
ERROR 42S21: Duplicate column name 'c1'
ALTER TABLE t1n CHANGE c4 c11 INT, ADD INDEX(c11), ALGORITHM=INPLACE;
### files in MYSQL_DATA_DIR/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1n.ibd
t1o.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
t1c.ibd
t1p.ibd
tt.ibd
SHOW CREATE TABLE t1n;
Table Create Table
t1n CREATE TABLE `t1n` (
`c1` int NOT NULL,
`c11` int DEFAULT NULL,
`ct` text,
PRIMARY KEY (`c1`),
KEY `c11` (`c11`),
FULLTEXT KEY `ct` (`ct`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
DROP TABLE t1n;
ALTER TABLE t1o MODIFY c1 BIGINT UNSIGNED NOT NULL;
### files in MYSQL_DATA_DIR/test
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1o.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
t1c.ibd
t1p.ibd
tt.ibd
ALTER TABLE t1o ADD FULLTEXT INDEX(ct),
CHANGE c1 FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
ALGORITHM=INPLACE;
### files in MYSQL_DATA_DIR/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1o.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
t1c.ibd
t1p.ibd
tt.ibd
ALTER TABLE t1o CHANGE FTS_DOC_ID foo_id BIGINT UNSIGNED NOT NULL,
LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Cannot drop or rename FTS_DOC_ID. Try LOCK=SHARED.
SELECT sc.pos FROM information_schema.innodb_columns sc
INNER JOIN information_schema.innodb_tables st
ON sc.TABLE_ID=st.TABLE_ID
WHERE st.NAME='test/t1o' AND sc.NAME='FTS_DOC_ID';
pos
0
SHOW CREATE TABLE t1o;
Table Create Table
t1o CREATE TABLE `t1o` (
`FTS_DOC_ID` bigint unsigned NOT NULL,
`c2` int DEFAULT NULL,
`ct` text,
PRIMARY KEY (`FTS_DOC_ID`),
FULLTEXT KEY `ct` (`ct`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
ALTER TABLE t1o CHANGE FTS_DOC_ID foo_id BIGINT UNSIGNED NOT NULL,
DROP INDEX ct, LOCK=NONE;
### files in MYSQL_DATA_DIR/test
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1o.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
t1c.ibd
t1p.ibd
tt.ibd
SHOW CREATE TABLE t1o;
Table Create Table
t1o CREATE TABLE `t1o` (
`foo_id` bigint unsigned NOT NULL,
`c2` int DEFAULT NULL,
`ct` text,
PRIMARY KEY (`foo_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
DROP TABLE t1c, t1p, sys_tables, sys_indexes, sys_foreign;
CREATE TABLE sys_tables SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLES
WHERE NAME='test/t1o';
CREATE TABLE sys_indexes SELECT i.* FROM INFORMATION_SCHEMA.INNODB_INDEXES i
INNER JOIN sys_tables st ON i.TABLE_ID=st.TABLE_ID;
CREATE TABLE sys_foreign SELECT i.*
FROM INFORMATION_SCHEMA.INNODB_FOREIGN i WHERE FOR_NAME='test/t1o';
SELECT i.NAME,i.POS,i.MTYPE,i.PRTYPE,i.LEN
FROM INFORMATION_SCHEMA.INNODB_COLUMNS i
INNER JOIN sys_tables st ON i.TABLE_ID=st.TABLE_ID ORDER BY i.NAME,i.POS;
NAME POS MTYPE PRTYPE LEN
c2 1 6 1027 4
ct 2 5 16711932 10
foo_id 0 6 1800 8
SELECT si.NAME,i.POS,i.NAME FROM INFORMATION_SCHEMA.INNODB_FIELDS i
INNER JOIN sys_indexes si ON i.INDEX_ID=si.INDEX_ID ORDER BY si.NAME, i.POS;
NAME POS NAME
PRIMARY 0 foo_id
SELECT i.FOR_COL_NAME, i.REF_COL_NAME, i.POS FROM INFORMATION_SCHEMA.INNODB_FOREIGN_COLS i
INNER JOIN sys_foreign sf ON i.ID = sf.ID;
FOR_COL_NAME REF_COL_NAME POS
ALTER TABLE t1o ADD UNIQUE INDEX FTS_DOC_ID_INDEX(foo_id);
### files in MYSQL_DATA_DIR/test
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1o.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
tt.ibd
ALTER TABLE t1o CHANGE foo_id FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
ADD FULLTEXT INDEX(ct);
### files in MYSQL_DATA_DIR/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
sys_foreign.ibd
sys_indexes.ibd
sys_tables.ibd
t1o.ibd
### files in MYSQL_TMP_DIR/alt_dir/test
fts_aux_index_1.ibd
fts_aux_index_2.ibd
fts_aux_index_3.ibd
fts_aux_index_4.ibd
fts_aux_index_5.ibd
fts_aux_index_6.ibd
fts_aux_being_deleted.ibd
fts_aux_being_deleted_cache.ibd
fts_aux_config.ibd
fts_aux_deleted.ibd
fts_aux_deleted_cache.ibd
tt.ibd
ALTER TABLE t1o CHANGE FTS_DOC_ID foo_id BIGINT UNSIGNED NOT NULL;
ERROR HY000: Index 'FTS_DOC_ID_INDEX' is of wrong type for an InnoDB FULLTEXT index
DROP TABLE sys_indexes;
CREATE TABLE sys_indexes SELECT i.* FROM INFORMATION_SCHEMA.INNODB_INDEXES i
INNER JOIN sys_tables st ON i.TABLE_ID=st.TABLE_ID;
SELECT i.NAME,i.POS,i.MTYPE,i.PRTYPE,i.LEN
FROM INFORMATION_SCHEMA.INNODB_COLUMNS i
INNER JOIN sys_tables st ON i.TABLE_ID=st.TABLE_ID ORDER BY i.NAME,i.POS;
NAME POS MTYPE PRTYPE LEN
c2 1 6 1027 4
ct 2 5 16711932 10
FTS_DOC_ID 0 6 1800 8
SELECT si.NAME,i.POS,i.NAME FROM INFORMATION_SCHEMA.INNODB_FIELDS i
INNER JOIN sys_indexes si ON i.INDEX_ID=si.INDEX_ID ORDER BY si.NAME, i.POS;
NAME POS NAME
ct 0 ct
FTS_DOC_ID_INDEX 0 FTS_DOC_ID
PRIMARY 0 FTS_DOC_ID
SELECT i.FOR_COL_NAME, i.REF_COL_NAME, i.POS FROM INFORMATION_SCHEMA.INNODB_FOREIGN_COLS i
INNER JOIN sys_foreign sf ON i.ID = sf.ID;
FOR_COL_NAME REF_COL_NAME POS
#
# Cleanup
#
DROP TABLE tt, t1o, sys_tables, sys_indexes, sys_foreign;
### files in MYSQL_DATA_DIR/test
### files in MYSQL_TMP_DIR/alt_dir/test
|
{
"pile_set_name": "Github"
}
|
$ASSIGN MASTER='S:\beam_ra.MASTER', DELETE
$ASSIGN DBALL='S:\beam_ra.DBALL', DELETE
$*
SOL SEMODES
$
$INCLUDE 'pchdispa.alt'
$*
CEND
$*
$*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$*
$* CASE CONTROL
$*
$*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$*
TITLE = Simple Beam Example
SUBTITLE = Modes
ECHO = SORT
$*
$* GLOBAL CASE
$*
SPC = 1
ELFOR(PUNCH)=ALL
STRESS(PUNCH)=ALL
METHOD = 1
DISP = ALL
OUTPUT(XYPLOT)
XYPRINT DISP / 1(T2), 2(T2), 3(T2), 4(T2)
$*
$*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$*
$* BULK DATA
$*
$*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$*
BEGIN BULK
$*
$* PARAM CARDS
$*
PARAM AUTOSPC YES
PARAM GRDPNT 0
PARAM K6ROT 100.0000
PARAM OUGCORD GLOBAL
PARAM POST -2
PARAM POSTEXT YES
$*
EIGRL 1 10 MAX
$*
INCLUDE 'cbarao_cbeam.blk'
$*
$* RESTRAINT CARDS
$*
SPC 1 1 123456 0.0
$*
$* USET, U2 CARDS
$*
USET U2 1 123
$*
ENDDATA
|
{
"pile_set_name": "Github"
}
|
/* Stable */
.stable {border: none; border-color: #D0D0D0 #FFFFFF #FFFFFF #D0D0D0; overflow: hidden; display: block; -moz-user-select: none; -moz-user-focus: normal; -moz-user-input: enabled; }
.stable td {font: menu; white-space: nowrap; padding: 1px}
/* Head */
.stable-head {position: absolute; background: #F5F5F5; overflow: hidden; -moz-user-select: none; border: none; border-color: #FFFFFF #D0D0D0 #D0D0D0 #FFFFFF; border-bottom: 0; z-index: 10}
.stable-head table {table-layout: fixed; width: 0}
.stable-head table tr {background: transparent url(./images/header.gif) repeat-x scroll center top}
.stable-head table tr td {height: 14px; font-size: 11px; font-family: inherit; border: 1px solid; border-color: #FFFFFF #D0D0D0 #2b2b2b #FFFFFF; background: transparent url(./images/blank.gif) no-repeat scroll right center; line-height: 14px; overflow: hidden; white-space: nowrap; vertical-align: top; text-shadow: 1px 1px #f1f1f1;}
.stable-head td div {padding: 0 12px 0 4px}
.stable-head div.resz {border: 1px solid #FF0000; width: 5px; height: 14px; padding: 0 !important; float: right; background: transparent url(./images/s.gif) no-repeat scroll left center; cursor: e-resize}
.stable-head .rowcover { position: absolute; left: 0; top: 0; height: 20px; width: 1000px; background: transparent; display: none; }
/* Body */
.stable-body {background: window; overflow: auto; background: #F5F5F5;}
.stable-body table {table-layout: fixed; width: 0; }
.stable-body tr {cursor: pointer}
.stable-body tr.selected td {background-color: #2b2b2b; color: #f0f0f0; font-weight: 600;}
.stable-body tr td:first-child {border-left: 2px solid #999;}
.stable-body tr.selected td:first-child {border-left: 2px solid #fff;}
.stable-body tr.odd td {background-color: #EEE;}
.stable-body tr.even td {background-color: #F9F9F9;}
.stable-body td {border-color: #FFFFFF #CFCFCF #CFCFCF #FFFFFF; border-style: solid; border-width: 1px 0; padding: 0; text-align: center; vertical-align: middle; height: 16px; overflow: hidden;}
.stable-body td div { margin: 0 2px 0 2px !important; font-size: 11px; line-height: 16px; font-family: inherit; overflow: hidden; height: 16px !important;}
.ie .stable-body td, .ie .stable-body td div {zoom: 1 !important; height: 16px !important; line-height: 16px !important; vertical-align: top; float: none; white-space: nowrap !important}
.konqueror .stable-body td div { margin: 0 0px 0 0px !important }
.stable-icon {width: 16px; height: 16px; margin-right: -6px; margin: 0 5px; padding: 0 !important; float: left; background-image: url("./images/sprite.png")}
.ie .stable-icon {}
/* Move & Resize */
.stable-move-header {position: absolute; background: transparent url(./images/header_move.gif) repeat-x scroll center top rgba(255,255,255,0.7); top: 0px; font: menu; padding: 2px 12px 2px 4px; line-height: 12px; -moz-user-select: none; visibility: visible; border: 1px solid #0099FF; overflow: hidden; }
.gecko .stable-move-header {background: rgba(255,255,255,0.7); -moz-opacity: 0.7;}
.ie .stable-move-header {background: rgba(255,255,255,0.7); filter:alpha(opacity=70)}
.webkit .stable-move-header {background: rgba(255,255,255,0.7);}
.opera .stable-move-header {background: rgba(255,255,255,0.7);}
.stable-active-header {border-color: threedface !important}
.stable-separator-header {position: absolute; top: 0px; left: 0px; font: menu; height: 1em; width: 1px; overflow: hidden; background: #0099FF; padding: 3px 0px}
.stable-resize-header { position: absolute; background-color: #A0A0A0; width: 1px; top: 0px; font: menu; -moz-user-select: none; visibility: hidden; overflow: hidden; z-index: 100; }
.stable-virtpad {width: 10px; height: 0px}
.stable-lpad {width: 5px; height: 16px; margin: 0; padding: 0; float: left; }
.stable-scrollpos {width: 80%; height: 16px; left: 10%; top: 50%; position: absolute; padding: 0 5px; margin-top: -8px; background: #FFFFFF; color: #AAAAAA; font-size: 11px; font-family: inherit; font-weight: bold; text-align: center; overflow: hidden; display: none; white-space: nowrap}
/* Meter */
.meter-value { float: left; background-color: #99D699; border: 1px inset #BBBBBB; border-bottom: none;}
.meter-text { position: relative; text-align: left; float: left; width: 0px; height: 0px; overflow: visible; left: 40%; font-size: 11px; font-family: inherit; z-index: 1; }
.meter-value-start-color { background-color: #FFFF00 }
.meter-value-end-color { background-color: #99D699 }
|
{
"pile_set_name": "Github"
}
|
:107C000001C0F6C011248FEF98E09EBF8DBF84B7EE
:107C100090E89093610010926100882369F0982F9A
:107C20009A70923049F081FF02C097EF94BF282EDE
:107C300080E001D10C94000085E08093810082E017
:107C40008093C00088E18093C10080E18093C400EC
:107C500086E08093C2008EE0EED0259A84E028E191
:107C60003EEF91E0309385002093840096BBB09B5B
:107C7000FECF1D9AA8954091C00047FD02C08150DB
:107C800089F7CDD0813479F4CAD0C82FDAD0C23880
:107C900011F480E004C088E0C13809F083E0B8D076
:107CA00080E1B6D0EECF823419F484E1D2D0F8CF9F
:107CB000853411F485E0FACF853581F4B0D0E82E13
:107CC000AED0F82E87FF07C08BB781608BBFEE0C5C
:107CD000FF1CB7D0E5CF8BB78E7FF8CF863579F410
:107CE0009ED08D3451F49BD0CBB799D0C170880F02
:107CF0008C2B8BBF81E0ADD0CCCF83E0FCCF843622
:107D000009F045C08CD0C82FD0E0DC2FCC2787D01D
:107D1000C82B85D0D82E5E01B39400E011E0480155
:107D2000EFEF8E1A9E0A7BD0F801808384018A14BB
:107D30009B04A9F786D0F5E410E000E0DF1609F116
:107D400050E040E063E0C70153D08701C12CDD243F
:107D5000D394F601419151916F0161E0C80148D07F
:107D60000E5F1F4F2297A9F750E040E065E0C70182
:107D70003FD096CF6081C8018E0D9F1D79D00F5FD7
:107D80001F4FF801F395C017D107A1F789CF8437AA
:107D900001F545D0C82FD0E0DC2FCC2740D0C82B30
:107DA0003ED0D82E4ED08701F5E4DF120BC0CE0DA9
:107DB000DF1DC80155D02CD00F5F1F4FC017D10752
:107DC000C1F76ECFF80187918F0122D02197D1F7AB
:107DD00067CF853739F435D08EE11AD085E918D0D0
:107DE00081E85DCF813509F074CF88E024D071CF70
:107DF000FC010A0167BFE895112407B600FCFDCF1E
:107E0000667029F0452B19F481E187BFE895089544
:107E10009091C00095FFFCCF8093C600089580919B
:107E2000C00087FFFCCF8091C00084FD01C0A895F1
:107E30008091C6000895E0E6F0E098E190838083A9
:107E40000895EDDF803219F088E0F5DFFFCF84E19F
:107E5000DFCFCF93C82FE3DFC150E9F7CF91F1CF48
:107E6000F999FECF92BD81BDF89A992780B5089502
:107E7000262FF999FECF92BD81BD20BD0FB6F89493
:0A7E8000FA9AF99A0FBE01960895D0
:027FFE00000879
:0400000300007C007D
:00000001FF
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2008-2009 Atheros Communications Inc.
*
* Modified for iPXE by Scott K Logan <logans@cottsay.net> July 2011
* Original from Linux kernel 3.0.1
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ATH_REGISTERS_H
#define ATH_REGISTERS_H
FILE_LICENCE ( BSD2 );
#define AR_MIBC 0x0040
#define AR_MIBC_COW 0x00000001
#define AR_MIBC_FMC 0x00000002
#define AR_MIBC_CMC 0x00000004
#define AR_MIBC_MCS 0x00000008
/*
* BSSID mask registers. See ath_hw_set_bssid_mask()
* for detailed documentation about these registers.
*/
#define AR_BSSMSKL 0x80e0
#define AR_BSSMSKU 0x80e4
#define AR_TFCNT 0x80ec
#define AR_RFCNT 0x80f0
#define AR_RCCNT 0x80f4
#define AR_CCCNT 0x80f8
#define AR_KEYTABLE_0 0x8800
#define AR_KEYTABLE(_n) (AR_KEYTABLE_0 + ((_n)*32))
#define AR_KEY_CACHE_SIZE 128
#define AR_RSVD_KEYTABLE_ENTRIES 4
#define AR_KEY_TYPE 0x00000007
#define AR_KEYTABLE_TYPE_40 0x00000000
#define AR_KEYTABLE_TYPE_104 0x00000001
#define AR_KEYTABLE_TYPE_128 0x00000003
#define AR_KEYTABLE_TYPE_TKIP 0x00000004
#define AR_KEYTABLE_TYPE_AES 0x00000005
#define AR_KEYTABLE_TYPE_CCM 0x00000006
#define AR_KEYTABLE_TYPE_CLR 0x00000007
#define AR_KEYTABLE_ANT 0x00000008
#define AR_KEYTABLE_VALID 0x00008000
#define AR_KEYTABLE_KEY0(_n) (AR_KEYTABLE(_n) + 0)
#define AR_KEYTABLE_KEY1(_n) (AR_KEYTABLE(_n) + 4)
#define AR_KEYTABLE_KEY2(_n) (AR_KEYTABLE(_n) + 8)
#define AR_KEYTABLE_KEY3(_n) (AR_KEYTABLE(_n) + 12)
#define AR_KEYTABLE_KEY4(_n) (AR_KEYTABLE(_n) + 16)
#define AR_KEYTABLE_TYPE(_n) (AR_KEYTABLE(_n) + 20)
#define AR_KEYTABLE_MAC0(_n) (AR_KEYTABLE(_n) + 24)
#define AR_KEYTABLE_MAC1(_n) (AR_KEYTABLE(_n) + 28)
#endif /* ATH_REGISTERS_H */
|
{
"pile_set_name": "Github"
}
|
(;CA[UTF-8]AP[YuanYu]GM[1]FF[4]
SZ[19]
GN[]
DT[2018-05-22]
PB[金毛测试]BR[9段]
PW[mahoapo]WR[9段]
KM[750]HA[0]RU[Japanese]RE[B+R]TM[1200]TC[7]TT[30]
;B[pp];W[dp];B[pc];W[dd];B[fc];W[cf];B[pf];W[qn];B[nq];W[rp];B[cq]
;W[cp];B[dq];W[fq];B[eq];W[ep];B[fr];W[dj];B[ql];W[qq];B[pn];W[qo]
;B[gq];W[fp];B[bq];W[ho];B[jd];W[pm];B[pl];W[om];B[ol];W[hq];B[gr]
;W[nm];B[kp];W[hc];B[hd];W[ic];B[id];W[jc];B[kc];W[kb];B[lc];W[lb]
;B[mc];W[gc];B[dc];W[cc];B[gd];W[ed];B[fd];W[mb];B[nb];W[qc];B[qd]
;W[pd];B[od];W[mk];B[gb];W[hb];B[eb];W[ga];B[fb];W[ob];B[nc];W[pb]
;B[pe];W[rc];B[ma];W[la];B[jb];W[na];B[ib];W[nj];B[rd];W[ra];B[oi]
;W[oj];B[pi];W[lq];B[lp];W[kq];B[jp];W[mq];B[mp];W[nr];B[or];W[oq]
;B[np];W[pr];B[gp];W[go];B[jq];W[pj];B[qj];W[bp];B[gm];W[em];B[dh]
;W[ch];B[fk];W[ek];B[fj];W[eh];B[fn];W[fo];B[en];W[dn];B[eg];W[dg]
;B[fh];W[ei];B[fi];W[fl];B[gl];W[ni];B[kj];W[lh];B[qi];W[lm];B[cb]
;W[bc];B[kh])
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2006 - 2007 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "kdc_locl.h"
#include <hex.h>
#ifdef DIGEST
#define MS_CHAP_V2 0x20
#define CHAP_MD5 0x10
#define DIGEST_MD5 0x08
#define NTLM_V2 0x04
#define NTLM_V1_SESSION 0x02
#define NTLM_V1 0x01
const struct units _kdc_digestunits[] = {
{"ms-chap-v2", 1U << 5},
{"chap-md5", 1U << 4},
{"digest-md5", 1U << 3},
{"ntlm-v2", 1U << 2},
{"ntlm-v1-session", 1U << 1},
{"ntlm-v1", 1U << 0},
{NULL, 0}
};
static krb5_error_code
get_digest_key(krb5_context context,
krb5_kdc_configuration *config,
hdb_entry_ex *server,
krb5_crypto *crypto)
{
krb5_error_code ret;
krb5_enctype enctype;
Key *key;
ret = _kdc_get_preferred_key(context,
config,
server,
"digest-service",
&enctype,
&key);
if (ret)
return ret;
return krb5_crypto_init(context, &key->key, 0, crypto);
}
/*
*
*/
static char *
get_ntlm_targetname(krb5_context context,
hdb_entry_ex *client)
{
char *targetname, *p;
targetname = strdup(krb5_principal_get_realm(context,
client->entry.principal));
if (targetname == NULL)
return NULL;
p = strchr(targetname, '.');
if (p)
*p = '\0';
strupr(targetname);
return targetname;
}
static krb5_error_code
fill_targetinfo(krb5_context context,
char *targetname,
hdb_entry_ex *client,
krb5_data *data)
{
struct ntlm_targetinfo ti;
krb5_error_code ret;
struct ntlm_buf d;
krb5_principal p;
const char *str;
memset(&ti, 0, sizeof(ti));
ti.domainname = targetname;
p = client->entry.principal;
str = krb5_principal_get_comp_string(context, p, 0);
if (str != NULL &&
(strcmp("host", str) == 0 ||
strcmp("ftp", str) == 0 ||
strcmp("imap", str) == 0 ||
strcmp("pop", str) == 0 ||
strcmp("smtp", str)))
{
str = krb5_principal_get_comp_string(context, p, 1);
ti.dnsservername = rk_UNCONST(str);
}
ret = heim_ntlm_encode_targetinfo(&ti, 1, &d);
if (ret)
return ret;
data->data = d.data;
data->length = d.length;
return 0;
}
static const unsigned char ms_chap_v2_magic1[39] = {
0x4D, 0x61, 0x67, 0x69, 0x63, 0x20, 0x73, 0x65, 0x72, 0x76,
0x65, 0x72, 0x20, 0x74, 0x6F, 0x20, 0x63, 0x6C, 0x69, 0x65,
0x6E, 0x74, 0x20, 0x73, 0x69, 0x67, 0x6E, 0x69, 0x6E, 0x67,
0x20, 0x63, 0x6F, 0x6E, 0x73, 0x74, 0x61, 0x6E, 0x74
};
static const unsigned char ms_chap_v2_magic2[41] = {
0x50, 0x61, 0x64, 0x20, 0x74, 0x6F, 0x20, 0x6D, 0x61, 0x6B,
0x65, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6F, 0x20, 0x6D, 0x6F,
0x72, 0x65, 0x20, 0x74, 0x68, 0x61, 0x6E, 0x20, 0x6F, 0x6E,
0x65, 0x20, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6F,
0x6E
};
static const unsigned char ms_rfc3079_magic1[27] = {
0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74,
0x68, 0x65, 0x20, 0x4d, 0x50, 0x50, 0x45, 0x20, 0x4d,
0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x4b, 0x65, 0x79
};
/*
*
*/
static krb5_error_code
get_password_entry(krb5_context context,
krb5_kdc_configuration *config,
const char *username,
char **password)
{
krb5_principal clientprincipal;
krb5_error_code ret;
hdb_entry_ex *user;
HDB *db;
/* get username */
ret = krb5_parse_name(context, username, &clientprincipal);
if (ret)
return ret;
ret = _kdc_db_fetch(context, config, clientprincipal,
HDB_F_GET_CLIENT, NULL, &db, &user);
krb5_free_principal(context, clientprincipal);
if (ret)
return ret;
ret = hdb_entry_get_password(context, db, &user->entry, password);
if (ret || password == NULL) {
if (ret == 0) {
ret = EINVAL;
krb5_set_error_message(context, ret, "password missing");
}
memset(user, 0, sizeof(*user));
}
_kdc_free_ent (context, user);
return ret;
}
/*
*
*/
krb5_error_code
_kdc_do_digest(krb5_context context,
krb5_kdc_configuration *config,
const struct DigestREQ *req, krb5_data *reply,
const char *from, struct sockaddr *addr)
{
krb5_error_code ret = 0;
krb5_ticket *ticket = NULL;
krb5_auth_context ac = NULL;
krb5_keytab id = NULL;
krb5_crypto crypto = NULL;
DigestReqInner ireq;
DigestRepInner r;
DigestREP rep;
krb5_flags ap_req_options;
krb5_data buf;
size_t size;
krb5_storage *sp = NULL;
Checksum res;
hdb_entry_ex *server = NULL, *user = NULL;
hdb_entry_ex *client = NULL;
char *client_name = NULL, *password = NULL;
krb5_data serverNonce;
if(!config->enable_digest) {
kdc_log(context, config, 0,
"Rejected digest request (disabled) from %s", from);
return KRB5KDC_ERR_POLICY;
}
krb5_data_zero(&buf);
krb5_data_zero(reply);
krb5_data_zero(&serverNonce);
memset(&ireq, 0, sizeof(ireq));
memset(&r, 0, sizeof(r));
memset(&rep, 0, sizeof(rep));
memset(&res, 0, sizeof(res));
kdc_log(context, config, 0, "Digest request from %s", from);
ret = krb5_kt_resolve(context, "HDB:", &id);
if (ret) {
kdc_log(context, config, 0, "Can't open database for digest");
goto out;
}
ret = krb5_rd_req(context,
&ac,
&req->apReq,
NULL,
id,
&ap_req_options,
&ticket);
if (ret)
goto out;
/* check the server principal in the ticket matches digest/R@R */
{
krb5_principal principal = NULL;
const char *p, *rr;
ret = krb5_ticket_get_server(context, ticket, &principal);
if (ret)
goto out;
ret = EINVAL;
krb5_set_error_message(context, ret, "Wrong digest server principal used");
p = krb5_principal_get_comp_string(context, principal, 0);
if (p == NULL) {
krb5_free_principal(context, principal);
goto out;
}
if (strcmp(p, KRB5_DIGEST_NAME) != 0) {
krb5_free_principal(context, principal);
goto out;
}
p = krb5_principal_get_comp_string(context, principal, 1);
if (p == NULL) {
krb5_free_principal(context, principal);
goto out;
}
rr = krb5_principal_get_realm(context, principal);
if (rr == NULL) {
krb5_free_principal(context, principal);
goto out;
}
if (strcmp(p, rr) != 0) {
krb5_free_principal(context, principal);
goto out;
}
krb5_clear_error_message(context);
ret = _kdc_db_fetch(context, config, principal,
HDB_F_GET_SERVER, NULL, NULL, &server);
if (ret)
goto out;
krb5_free_principal(context, principal);
}
/* check the client is allowed to do digest auth */
{
krb5_principal principal = NULL;
ret = krb5_ticket_get_client(context, ticket, &principal);
if (ret)
goto out;
ret = krb5_unparse_name(context, principal, &client_name);
if (ret) {
krb5_free_principal(context, principal);
goto out;
}
ret = _kdc_db_fetch(context, config, principal,
HDB_F_GET_CLIENT, NULL, NULL, &client);
krb5_free_principal(context, principal);
if (ret)
goto out;
if (client->entry.flags.allow_digest == 0) {
kdc_log(context, config, 0,
"Client %s tried to use digest "
"but is not allowed to",
client_name);
ret = KRB5KDC_ERR_POLICY;
krb5_set_error_message(context, ret,
"Client is not permitted to use digest");
goto out;
}
}
/* unpack request */
{
krb5_keyblock *key;
ret = krb5_auth_con_getremotesubkey(context, ac, &key);
if (ret)
goto out;
if (key == NULL) {
ret = EINVAL;
krb5_set_error_message(context, ret, "digest: remote subkey not found");
goto out;
}
ret = krb5_crypto_init(context, key, 0, &crypto);
krb5_free_keyblock (context, key);
if (ret)
goto out;
}
ret = krb5_decrypt_EncryptedData(context, crypto, KRB5_KU_DIGEST_ENCRYPT,
&req->innerReq, &buf);
krb5_crypto_destroy(context, crypto);
crypto = NULL;
if (ret)
goto out;
ret = decode_DigestReqInner(buf.data, buf.length, &ireq, NULL);
krb5_data_free(&buf);
if (ret) {
krb5_set_error_message(context, ret, "Failed to decode digest inner request");
goto out;
}
kdc_log(context, config, 0, "Valid digest request from %s (%s)",
client_name, from);
/*
* Process the inner request
*/
switch (ireq.element) {
case choice_DigestReqInner_init: {
unsigned char server_nonce[16], identifier;
RAND_pseudo_bytes(&identifier, sizeof(identifier));
RAND_pseudo_bytes(server_nonce, sizeof(server_nonce));
server_nonce[0] = kdc_time & 0xff;
server_nonce[1] = (kdc_time >> 8) & 0xff;
server_nonce[2] = (kdc_time >> 16) & 0xff;
server_nonce[3] = (kdc_time >> 24) & 0xff;
r.element = choice_DigestRepInner_initReply;
hex_encode(server_nonce, sizeof(server_nonce), &r.u.initReply.nonce);
if (r.u.initReply.nonce == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "Failed to decode server nonce");
goto out;
}
sp = krb5_storage_emem();
if (sp == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "malloc: out of memory");
goto out;
}
ret = krb5_store_stringz(sp, ireq.u.init.type);
if (ret) {
krb5_clear_error_message(context);
goto out;
}
if (ireq.u.init.channel) {
char *s;
asprintf(&s, "%s-%s:%s", r.u.initReply.nonce,
ireq.u.init.channel->cb_type,
ireq.u.init.channel->cb_binding);
if (s == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret,
"Failed to allocate channel binding");
goto out;
}
free(r.u.initReply.nonce);
r.u.initReply.nonce = s;
}
ret = krb5_store_stringz(sp, r.u.initReply.nonce);
if (ret) {
krb5_clear_error_message(context);
goto out;
}
if (strcasecmp(ireq.u.init.type, "CHAP") == 0) {
r.u.initReply.identifier =
malloc(sizeof(*r.u.initReply.identifier));
if (r.u.initReply.identifier == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "malloc: out of memory");
goto out;
}
asprintf(r.u.initReply.identifier, "%02X", identifier & 0xff);
if (*r.u.initReply.identifier == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "malloc: out of memory");
goto out;
}
} else
r.u.initReply.identifier = NULL;
if (ireq.u.init.hostname) {
ret = krb5_store_stringz(sp, *ireq.u.init.hostname);
if (ret) {
krb5_clear_error_message(context);
goto out;
}
}
ret = krb5_storage_to_data(sp, &buf);
if (ret) {
krb5_clear_error_message(context);
goto out;
}
ret = get_digest_key(context, config, server, &crypto);
if (ret)
goto out;
ret = krb5_create_checksum(context,
crypto,
KRB5_KU_DIGEST_OPAQUE,
0,
buf.data,
buf.length,
&res);
krb5_crypto_destroy(context, crypto);
crypto = NULL;
krb5_data_free(&buf);
if (ret)
goto out;
ASN1_MALLOC_ENCODE(Checksum, buf.data, buf.length, &res, &size, ret);
free_Checksum(&res);
if (ret) {
krb5_set_error_message(context, ret, "Failed to encode "
"checksum in digest request");
goto out;
}
if (size != buf.length)
krb5_abortx(context, "ASN1 internal error");
hex_encode(buf.data, buf.length, &r.u.initReply.opaque);
free(buf.data);
krb5_data_zero(&buf);
if (r.u.initReply.opaque == NULL) {
krb5_clear_error_message(context);
ret = ENOMEM;
goto out;
}
kdc_log(context, config, 0, "Digest %s init request successful from %s",
ireq.u.init.type, from);
break;
}
case choice_DigestReqInner_digestRequest: {
sp = krb5_storage_emem();
if (sp == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "malloc: out of memory");
goto out;
}
ret = krb5_store_stringz(sp, ireq.u.digestRequest.type);
if (ret) {
krb5_clear_error_message(context);
goto out;
}
krb5_store_stringz(sp, ireq.u.digestRequest.serverNonce);
if (ireq.u.digestRequest.hostname) {
ret = krb5_store_stringz(sp, *ireq.u.digestRequest.hostname);
if (ret) {
krb5_clear_error_message(context);
goto out;
}
}
buf.length = strlen(ireq.u.digestRequest.opaque);
buf.data = malloc(buf.length);
if (buf.data == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "malloc: out of memory");
goto out;
}
ret = hex_decode(ireq.u.digestRequest.opaque, buf.data, buf.length);
if (ret <= 0) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "Failed to decode opaque");
goto out;
}
buf.length = ret;
ret = decode_Checksum(buf.data, buf.length, &res, NULL);
free(buf.data);
krb5_data_zero(&buf);
if (ret) {
krb5_set_error_message(context, ret,
"Failed to decode digest Checksum");
goto out;
}
ret = krb5_storage_to_data(sp, &buf);
if (ret) {
krb5_clear_error_message(context);
goto out;
}
serverNonce.length = strlen(ireq.u.digestRequest.serverNonce);
serverNonce.data = malloc(serverNonce.length);
if (serverNonce.data == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "malloc: out of memory");
goto out;
}
/*
* CHAP does the checksum of the raw nonce, but do it for all
* types, since we need to check the timestamp.
*/
{
ssize_t ssize;
ssize = hex_decode(ireq.u.digestRequest.serverNonce,
serverNonce.data, serverNonce.length);
if (ssize <= 0) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "Failed to decode serverNonce");
goto out;
}
serverNonce.length = ssize;
}
ret = get_digest_key(context, config, server, &crypto);
if (ret)
goto out;
ret = krb5_verify_checksum(context, crypto,
KRB5_KU_DIGEST_OPAQUE,
buf.data, buf.length, &res);
free_Checksum(&res);
krb5_data_free(&buf);
krb5_crypto_destroy(context, crypto);
crypto = NULL;
if (ret)
goto out;
/* verify time */
{
unsigned char *p = serverNonce.data;
uint32_t t;
if (serverNonce.length < 4) {
ret = EINVAL;
krb5_set_error_message(context, ret, "server nonce too short");
goto out;
}
t = p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
if (abs((kdc_time & 0xffffffff) - t) > context->max_skew) {
ret = EINVAL;
krb5_set_error_message(context, ret, "time screw in server nonce ");
goto out;
}
}
if (strcasecmp(ireq.u.digestRequest.type, "CHAP") == 0) {
EVP_MD_CTX *ctx;
unsigned char md[MD5_DIGEST_LENGTH];
char *mdx;
char idx;
if ((config->digests_allowed & CHAP_MD5) == 0) {
kdc_log(context, config, 0, "Digest CHAP MD5 not allowed");
goto out;
}
if (ireq.u.digestRequest.identifier == NULL) {
ret = EINVAL;
krb5_set_error_message(context, ret, "Identifier missing "
"from CHAP request");
goto out;
}
if (hex_decode(*ireq.u.digestRequest.identifier, &idx, 1) != 1) {
ret = EINVAL;
krb5_set_error_message(context, ret, "failed to decode identifier");
goto out;
}
ret = get_password_entry(context, config,
ireq.u.digestRequest.username,
&password);
if (ret)
goto out;
ctx = EVP_MD_CTX_create();
EVP_DigestInit_ex(ctx, EVP_md5(), NULL);
EVP_DigestUpdate(ctx, &idx, 1);
EVP_DigestUpdate(ctx, password, strlen(password));
EVP_DigestUpdate(ctx, serverNonce.data, serverNonce.length);
EVP_DigestFinal_ex(ctx, md, NULL);
EVP_MD_CTX_destroy(ctx);
hex_encode(md, sizeof(md), &mdx);
if (mdx == NULL) {
krb5_clear_error_message(context);
ret = ENOMEM;
goto out;
}
r.element = choice_DigestRepInner_response;
ret = strcasecmp(mdx, ireq.u.digestRequest.responseData);
free(mdx);
if (ret == 0) {
r.u.response.success = TRUE;
} else {
kdc_log(context, config, 0,
"CHAP reply mismatch for %s",
ireq.u.digestRequest.username);
r.u.response.success = FALSE;
}
} else if (strcasecmp(ireq.u.digestRequest.type, "SASL-DIGEST-MD5") == 0) {
EVP_MD_CTX *ctx;
unsigned char md[MD5_DIGEST_LENGTH];
char *mdx;
char *A1, *A2;
if ((config->digests_allowed & DIGEST_MD5) == 0) {
kdc_log(context, config, 0, "Digest SASL MD5 not allowed");
goto out;
}
if (ireq.u.digestRequest.nonceCount == NULL)
goto out;
if (ireq.u.digestRequest.clientNonce == NULL)
goto out;
if (ireq.u.digestRequest.qop == NULL)
goto out;
if (ireq.u.digestRequest.realm == NULL)
goto out;
ret = get_password_entry(context, config,
ireq.u.digestRequest.username,
&password);
if (ret)
goto failed;
ctx = EVP_MD_CTX_create();
EVP_DigestInit_ex(ctx, EVP_md5(), NULL);
EVP_DigestUpdate(ctx, ireq.u.digestRequest.username,
strlen(ireq.u.digestRequest.username));
EVP_DigestUpdate(ctx, ":", 1);
EVP_DigestUpdate(ctx, *ireq.u.digestRequest.realm,
strlen(*ireq.u.digestRequest.realm));
EVP_DigestUpdate(ctx, ":", 1);
EVP_DigestUpdate(ctx, password, strlen(password));
EVP_DigestFinal_ex(ctx, md, NULL);
EVP_DigestInit_ex(ctx, EVP_md5(), NULL);
EVP_DigestUpdate(ctx, md, sizeof(md));
EVP_DigestUpdate(ctx, ":", 1);
EVP_DigestUpdate(ctx, ireq.u.digestRequest.serverNonce,
strlen(ireq.u.digestRequest.serverNonce));
EVP_DigestUpdate(ctx, ":", 1);
EVP_DigestUpdate(ctx, *ireq.u.digestRequest.nonceCount,
strlen(*ireq.u.digestRequest.nonceCount));
if (ireq.u.digestRequest.authid) {
EVP_DigestUpdate(ctx, ":", 1);
EVP_DigestUpdate(ctx, *ireq.u.digestRequest.authid,
strlen(*ireq.u.digestRequest.authid));
}
EVP_DigestFinal_ex(ctx, md, NULL);
hex_encode(md, sizeof(md), &A1);
if (A1 == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "malloc: out of memory");
EVP_MD_CTX_destroy(ctx);
goto failed;
}
EVP_DigestInit_ex(ctx, EVP_md5(), NULL);
EVP_DigestUpdate(ctx,
"AUTHENTICATE:", sizeof("AUTHENTICATE:") - 1);
EVP_DigestUpdate(ctx, *ireq.u.digestRequest.uri,
strlen(*ireq.u.digestRequest.uri));
/* conf|int */
if (strcmp(ireq.u.digestRequest.digest, "clear") != 0) {
static char conf_zeros[] = ":00000000000000000000000000000000";
EVP_DigestUpdate(ctx, conf_zeros, sizeof(conf_zeros) - 1);
}
EVP_DigestFinal_ex(ctx, md, NULL);
hex_encode(md, sizeof(md), &A2);
if (A2 == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "malloc: out of memory");
free(A1);
goto failed;
}
EVP_DigestInit_ex(ctx, EVP_md5(), NULL);
EVP_DigestUpdate(ctx, A1, strlen(A2));
EVP_DigestUpdate(ctx, ":", 1);
EVP_DigestUpdate(ctx, ireq.u.digestRequest.serverNonce,
strlen(ireq.u.digestRequest.serverNonce));
EVP_DigestUpdate(ctx, ":", 1);
EVP_DigestUpdate(ctx, *ireq.u.digestRequest.nonceCount,
strlen(*ireq.u.digestRequest.nonceCount));
EVP_DigestUpdate(ctx, ":", 1);
EVP_DigestUpdate(ctx, *ireq.u.digestRequest.clientNonce,
strlen(*ireq.u.digestRequest.clientNonce));
EVP_DigestUpdate(ctx, ":", 1);
EVP_DigestUpdate(ctx, *ireq.u.digestRequest.qop,
strlen(*ireq.u.digestRequest.qop));
EVP_DigestUpdate(ctx, ":", 1);
EVP_DigestUpdate(ctx, A2, strlen(A2));
EVP_DigestFinal_ex(ctx, md, NULL);
EVP_MD_CTX_destroy(ctx);
free(A1);
free(A2);
hex_encode(md, sizeof(md), &mdx);
if (mdx == NULL) {
krb5_clear_error_message(context);
ret = ENOMEM;
goto out;
}
r.element = choice_DigestRepInner_response;
ret = strcasecmp(mdx, ireq.u.digestRequest.responseData);
free(mdx);
if (ret == 0) {
r.u.response.success = TRUE;
} else {
kdc_log(context, config, 0,
"DIGEST-MD5 reply mismatch for %s",
ireq.u.digestRequest.username);
r.u.response.success = FALSE;
}
} else if (strcasecmp(ireq.u.digestRequest.type, "MS-CHAP-V2") == 0) {
unsigned char md[SHA_DIGEST_LENGTH], challange[SHA_DIGEST_LENGTH];
krb5_principal clientprincipal = NULL;
char *mdx;
const char *username;
struct ntlm_buf answer;
Key *key = NULL;
EVP_MD_CTX *ctp;
if ((config->digests_allowed & MS_CHAP_V2) == 0) {
kdc_log(context, config, 0, "MS-CHAP-V2 not allowed");
goto failed;
}
if (ireq.u.digestRequest.clientNonce == NULL) {
ret = EINVAL;
krb5_set_error_message(context, ret,
"MS-CHAP-V2 clientNonce missing");
goto failed;
}
if (serverNonce.length != 16) {
ret = EINVAL;
krb5_set_error_message(context, ret,
"MS-CHAP-V2 serverNonce wrong length");
goto failed;
}
/* strip of the domain component */
username = strchr(ireq.u.digestRequest.username, '\\');
if (username == NULL)
username = ireq.u.digestRequest.username;
else
username++;
ctp = EVP_MD_CTX_create();
/* ChallangeHash */
EVP_DigestInit_ex(ctp, EVP_sha1(), NULL);
{
ssize_t ssize;
krb5_data clientNonce;
clientNonce.length = strlen(*ireq.u.digestRequest.clientNonce);
clientNonce.data = malloc(clientNonce.length);
if (clientNonce.data == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret,
"malloc: out of memory");
EVP_MD_CTX_destroy(ctp);
goto out;
}
ssize = hex_decode(*ireq.u.digestRequest.clientNonce,
clientNonce.data, clientNonce.length);
if (ssize != 16) {
ret = ENOMEM;
krb5_set_error_message(context, ret,
"Failed to decode clientNonce");
EVP_MD_CTX_destroy(ctp);
goto out;
}
EVP_DigestUpdate(ctp, clientNonce.data, ssize);
free(clientNonce.data);
}
EVP_DigestUpdate(ctp, serverNonce.data, serverNonce.length);
EVP_DigestUpdate(ctp, username, strlen(username));
EVP_DigestFinal_ex(ctp, challange, NULL);
EVP_MD_CTX_destroy(ctp);
/* NtPasswordHash */
ret = krb5_parse_name(context, username, &clientprincipal);
if (ret)
goto failed;
ret = _kdc_db_fetch(context, config, clientprincipal,
HDB_F_GET_CLIENT, NULL, NULL, &user);
krb5_free_principal(context, clientprincipal);
if (ret) {
krb5_set_error_message(context, ret,
"MS-CHAP-V2 user %s not in database",
username);
goto failed;
}
ret = hdb_enctype2key(context, &user->entry,
ETYPE_ARCFOUR_HMAC_MD5, &key);
if (ret) {
krb5_set_error_message(context, ret,
"MS-CHAP-V2 missing arcfour key %s",
username);
goto failed;
}
/* ChallengeResponse */
ret = heim_ntlm_calculate_ntlm1(key->key.keyvalue.data,
key->key.keyvalue.length,
challange, &answer);
if (ret) {
krb5_set_error_message(context, ret, "NTLM missing arcfour key");
goto failed;
}
hex_encode(answer.data, answer.length, &mdx);
if (mdx == NULL) {
free(answer.data);
krb5_clear_error_message(context);
ret = ENOMEM;
goto out;
}
r.element = choice_DigestRepInner_response;
ret = strcasecmp(mdx, ireq.u.digestRequest.responseData);
if (ret == 0) {
r.u.response.success = TRUE;
} else {
kdc_log(context, config, 0,
"MS-CHAP-V2 hash mismatch for %s",
ireq.u.digestRequest.username);
r.u.response.success = FALSE;
}
free(mdx);
if (r.u.response.success) {
unsigned char hashhash[MD4_DIGEST_LENGTH];
EVP_MD_CTX *ctxp;
ctxp = EVP_MD_CTX_create();
/* hashhash */
{
EVP_DigestInit_ex(ctxp, EVP_md4(), NULL);
EVP_DigestUpdate(ctxp,
key->key.keyvalue.data,
key->key.keyvalue.length);
EVP_DigestFinal_ex(ctxp, hashhash, NULL);
}
/* GenerateAuthenticatorResponse */
EVP_DigestInit_ex(ctxp, EVP_sha1(), NULL);
EVP_DigestUpdate(ctxp, hashhash, sizeof(hashhash));
EVP_DigestUpdate(ctxp, answer.data, answer.length);
EVP_DigestUpdate(ctxp, ms_chap_v2_magic1,
sizeof(ms_chap_v2_magic1));
EVP_DigestFinal_ex(ctxp, md, NULL);
EVP_DigestInit_ex(ctxp, EVP_sha1(), NULL);
EVP_DigestUpdate(ctxp, md, sizeof(md));
EVP_DigestUpdate(ctxp, challange, 8);
EVP_DigestUpdate(ctxp, ms_chap_v2_magic2,
sizeof(ms_chap_v2_magic2));
EVP_DigestFinal_ex(ctxp, md, NULL);
r.u.response.rsp = calloc(1, sizeof(*r.u.response.rsp));
if (r.u.response.rsp == NULL) {
free(answer.data);
krb5_clear_error_message(context);
EVP_MD_CTX_destroy(ctxp);
ret = ENOMEM;
goto out;
}
hex_encode(md, sizeof(md), r.u.response.rsp);
if (r.u.response.rsp == NULL) {
free(answer.data);
krb5_clear_error_message(context);
EVP_MD_CTX_destroy(ctxp);
ret = ENOMEM;
goto out;
}
/* get_master, rfc 3079 3.4 */
EVP_DigestInit_ex(ctxp, EVP_sha1(), NULL);
EVP_DigestUpdate(ctxp, hashhash, 16);
EVP_DigestUpdate(ctxp, answer.data, answer.length);
EVP_DigestUpdate(ctxp, ms_rfc3079_magic1,
sizeof(ms_rfc3079_magic1));
EVP_DigestFinal_ex(ctxp, md, NULL);
free(answer.data);
EVP_MD_CTX_destroy(ctxp);
r.u.response.session_key =
calloc(1, sizeof(*r.u.response.session_key));
if (r.u.response.session_key == NULL) {
krb5_clear_error_message(context);
ret = ENOMEM;
goto out;
}
ret = krb5_data_copy(r.u.response.session_key, md, 16);
if (ret) {
krb5_clear_error_message(context);
goto out;
}
}
} else {
r.element = choice_DigestRepInner_error;
asprintf(&r.u.error.reason, "Unsupported digest type %s",
ireq.u.digestRequest.type);
if (r.u.error.reason == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "malloc: out of memory");
goto out;
}
r.u.error.code = EINVAL;
}
kdc_log(context, config, 0, "Digest %s request successful %s",
ireq.u.digestRequest.type, ireq.u.digestRequest.username);
break;
}
case choice_DigestReqInner_ntlmInit:
if ((config->digests_allowed & (NTLM_V1|NTLM_V1_SESSION|NTLM_V2)) == 0) {
kdc_log(context, config, 0, "NTLM not allowed");
goto failed;
}
r.element = choice_DigestRepInner_ntlmInitReply;
r.u.ntlmInitReply.flags = NTLM_NEG_UNICODE;
if ((ireq.u.ntlmInit.flags & NTLM_NEG_UNICODE) == 0) {
kdc_log(context, config, 0, "NTLM client have no unicode");
goto failed;
}
if (ireq.u.ntlmInit.flags & NTLM_NEG_NTLM)
r.u.ntlmInitReply.flags |= NTLM_NEG_NTLM;
else {
kdc_log(context, config, 0, "NTLM client doesn't support NTLM");
goto failed;
}
r.u.ntlmInitReply.flags |=
NTLM_NEG_TARGET |
NTLM_TARGET_DOMAIN |
NTLM_ENC_128;
#define ALL \
NTLM_NEG_SIGN| \
NTLM_NEG_SEAL| \
NTLM_NEG_ALWAYS_SIGN| \
NTLM_NEG_NTLM2_SESSION| \
NTLM_NEG_KEYEX
r.u.ntlmInitReply.flags |= (ireq.u.ntlmInit.flags & (ALL));
#undef ALL
r.u.ntlmInitReply.targetname =
get_ntlm_targetname(context, client);
if (r.u.ntlmInitReply.targetname == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "malloc: out of memory");
goto out;
}
r.u.ntlmInitReply.challange.data = malloc(8);
if (r.u.ntlmInitReply.challange.data == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "malloc: out of memory");
goto out;
}
r.u.ntlmInitReply.challange.length = 8;
if (RAND_bytes(r.u.ntlmInitReply.challange.data,
r.u.ntlmInitReply.challange.length) != 1)
{
ret = ENOMEM;
krb5_set_error_message(context, ret, "out of random error");
goto out;
}
/* XXX fix targetinfo */
ALLOC(r.u.ntlmInitReply.targetinfo);
if (r.u.ntlmInitReply.targetinfo == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "malloc: out of memory");
goto out;
}
ret = fill_targetinfo(context,
r.u.ntlmInitReply.targetname,
client,
r.u.ntlmInitReply.targetinfo);
if (ret) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "malloc: out of memory");
goto out;
}
/*
* Save data encryted in opaque for the second part of the
* ntlm authentication
*/
sp = krb5_storage_emem();
if (sp == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "malloc: out of memory");
goto out;
}
ret = krb5_storage_write(sp, r.u.ntlmInitReply.challange.data, 8);
if (ret != 8) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "storage write challange");
goto out;
}
ret = krb5_store_uint32(sp, r.u.ntlmInitReply.flags);
if (ret) {
krb5_clear_error_message(context);
goto out;
}
ret = krb5_storage_to_data(sp, &buf);
if (ret) {
krb5_clear_error_message(context);
goto out;
}
ret = get_digest_key(context, config, server, &crypto);
if (ret)
goto out;
ret = krb5_encrypt(context, crypto, KRB5_KU_DIGEST_OPAQUE,
buf.data, buf.length, &r.u.ntlmInitReply.opaque);
krb5_data_free(&buf);
krb5_crypto_destroy(context, crypto);
crypto = NULL;
if (ret)
goto out;
kdc_log(context, config, 0, "NTLM init from %s", from);
break;
case choice_DigestReqInner_ntlmRequest: {
krb5_principal clientprincipal;
unsigned char sessionkey[16];
unsigned char challange[8];
uint32_t flags;
Key *key = NULL;
int version;
r.element = choice_DigestRepInner_ntlmResponse;
r.u.ntlmResponse.success = 0;
r.u.ntlmResponse.flags = 0;
r.u.ntlmResponse.sessionkey = NULL;
r.u.ntlmResponse.tickets = NULL;
/* get username */
ret = krb5_parse_name(context,
ireq.u.ntlmRequest.username,
&clientprincipal);
if (ret)
goto failed;
ret = _kdc_db_fetch(context, config, clientprincipal,
HDB_F_GET_CLIENT, NULL, NULL, &user);
krb5_free_principal(context, clientprincipal);
if (ret) {
krb5_set_error_message(context, ret, "NTLM user %s not in database",
ireq.u.ntlmRequest.username);
goto failed;
}
ret = get_digest_key(context, config, server, &crypto);
if (ret)
goto failed;
ret = krb5_decrypt(context, crypto, KRB5_KU_DIGEST_OPAQUE,
ireq.u.ntlmRequest.opaque.data,
ireq.u.ntlmRequest.opaque.length, &buf);
krb5_crypto_destroy(context, crypto);
crypto = NULL;
if (ret) {
kdc_log(context, config, 0,
"Failed to decrypt nonce from %s", from);
goto failed;
}
sp = krb5_storage_from_data(&buf);
if (sp == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "malloc: out of memory");
goto out;
}
ret = krb5_storage_read(sp, challange, sizeof(challange));
if (ret != sizeof(challange)) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "NTLM storage read challange");
goto out;
}
ret = krb5_ret_uint32(sp, &flags);
if (ret) {
krb5_set_error_message(context, ret, "NTLM storage read flags");
goto out;
}
krb5_storage_free(sp);
sp = NULL;
krb5_data_free(&buf);
if ((flags & NTLM_NEG_NTLM) == 0) {
ret = EINVAL;
krb5_set_error_message(context, ret, "NTLM not negotiated");
goto out;
}
ret = hdb_enctype2key(context, &user->entry,
ETYPE_ARCFOUR_HMAC_MD5, &key);
if (ret) {
krb5_set_error_message(context, ret, "NTLM missing arcfour key");
goto out;
}
/* check if this is NTLMv2 */
if (ireq.u.ntlmRequest.ntlm.length != 24) {
struct ntlm_buf infotarget, answer;
char *targetname;
if ((config->digests_allowed & NTLM_V2) == 0) {
kdc_log(context, config, 0, "NTLM v2 not allowed");
goto out;
}
version = 2;
targetname = get_ntlm_targetname(context, client);
if (targetname == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "malloc: out of memory");
goto out;
}
answer.length = ireq.u.ntlmRequest.ntlm.length;
answer.data = ireq.u.ntlmRequest.ntlm.data;
ret = heim_ntlm_verify_ntlm2(key->key.keyvalue.data,
key->key.keyvalue.length,
ireq.u.ntlmRequest.username,
targetname,
0,
challange,
&answer,
&infotarget,
sessionkey);
free(targetname);
if (ret) {
krb5_set_error_message(context, ret, "NTLM v2 verify failed");
goto failed;
}
/* XXX verify infotarget matches client (checksum ?) */
free(infotarget.data);
/* */
} else {
struct ntlm_buf answer;
version = 1;
if (flags & NTLM_NEG_NTLM2_SESSION) {
unsigned char sessionhash[MD5_DIGEST_LENGTH];
EVP_MD_CTX *ctx;
if ((config->digests_allowed & NTLM_V1_SESSION) == 0) {
kdc_log(context, config, 0, "NTLM v1-session not allowed");
ret = EINVAL;
goto failed;
}
if (ireq.u.ntlmRequest.lm.length != 24) {
ret = EINVAL;
krb5_set_error_message(context, ret, "LM hash have wrong length "
"for NTLM session key");
goto failed;
}
ctx = EVP_MD_CTX_create();
EVP_DigestInit_ex(ctx, EVP_md5(), NULL);
EVP_DigestUpdate(ctx, challange, sizeof(challange));
EVP_DigestUpdate(ctx, ireq.u.ntlmRequest.lm.data, 8);
EVP_DigestFinal_ex(ctx, sessionhash, NULL);
memcpy(challange, sessionhash, sizeof(challange));
EVP_MD_CTX_destroy(ctx);
} else {
if ((config->digests_allowed & NTLM_V1) == 0) {
kdc_log(context, config, 0, "NTLM v1 not allowed");
goto failed;
}
}
ret = heim_ntlm_calculate_ntlm1(key->key.keyvalue.data,
key->key.keyvalue.length,
challange, &answer);
if (ret) {
krb5_set_error_message(context, ret, "NTLM missing arcfour key");
goto failed;
}
if (ireq.u.ntlmRequest.ntlm.length != answer.length ||
memcmp(ireq.u.ntlmRequest.ntlm.data, answer.data, answer.length) != 0)
{
free(answer.data);
ret = EINVAL;
krb5_set_error_message(context, ret, "NTLM hash mismatch");
goto failed;
}
free(answer.data);
{
EVP_MD_CTX *ctx;
ctx = EVP_MD_CTX_create();
EVP_DigestInit_ex(ctx, EVP_md4(), NULL);
EVP_DigestUpdate(ctx,
key->key.keyvalue.data,
key->key.keyvalue.length);
EVP_DigestFinal_ex(ctx, sessionkey, NULL);
EVP_MD_CTX_destroy(ctx);
}
}
if (ireq.u.ntlmRequest.sessionkey) {
unsigned char masterkey[MD4_DIGEST_LENGTH];
EVP_CIPHER_CTX rc4;
size_t len;
if ((flags & NTLM_NEG_KEYEX) == 0) {
ret = EINVAL;
krb5_set_error_message(context, ret,
"NTLM client failed to neg key "
"exchange but still sent key");
goto failed;
}
len = ireq.u.ntlmRequest.sessionkey->length;
if (len != sizeof(masterkey)){
ret = EINVAL;
krb5_set_error_message(context, ret,
"NTLM master key wrong length: %lu",
(unsigned long)len);
goto failed;
}
EVP_CIPHER_CTX_init(&rc4);
EVP_CipherInit_ex(&rc4, EVP_rc4(), NULL, sessionkey, NULL, 1);
EVP_Cipher(&rc4,
masterkey, ireq.u.ntlmRequest.sessionkey->data,
sizeof(masterkey));
EVP_CIPHER_CTX_cleanup(&rc4);
r.u.ntlmResponse.sessionkey =
malloc(sizeof(*r.u.ntlmResponse.sessionkey));
if (r.u.ntlmResponse.sessionkey == NULL) {
ret = EINVAL;
krb5_set_error_message(context, ret, "malloc: out of memory");
goto out;
}
ret = krb5_data_copy(r.u.ntlmResponse.sessionkey,
masterkey, sizeof(masterkey));
if (ret) {
krb5_set_error_message(context, ret, "malloc: out of memory");
goto out;
}
}
r.u.ntlmResponse.success = 1;
kdc_log(context, config, 0, "NTLM version %d successful for %s",
version, ireq.u.ntlmRequest.username);
break;
}
case choice_DigestReqInner_supportedMechs:
kdc_log(context, config, 0, "digest supportedMechs from %s", from);
r.element = choice_DigestRepInner_supportedMechs;
memset(&r.u.supportedMechs, 0, sizeof(r.u.supportedMechs));
if (config->digests_allowed & NTLM_V1)
r.u.supportedMechs.ntlm_v1 = 1;
if (config->digests_allowed & NTLM_V1_SESSION)
r.u.supportedMechs.ntlm_v1_session = 1;
if (config->digests_allowed & NTLM_V2)
r.u.supportedMechs.ntlm_v2 = 1;
if (config->digests_allowed & DIGEST_MD5)
r.u.supportedMechs.digest_md5 = 1;
if (config->digests_allowed & CHAP_MD5)
r.u.supportedMechs.chap_md5 = 1;
if (config->digests_allowed & MS_CHAP_V2)
r.u.supportedMechs.ms_chap_v2 = 1;
break;
default: {
const char *s;
ret = EINVAL;
krb5_set_error_message(context, ret, "unknown operation to digest");
failed:
s = krb5_get_error_message(context, ret);
if (s == NULL) {
krb5_clear_error_message(context);
goto out;
}
kdc_log(context, config, 0, "Digest failed with: %s", s);
r.element = choice_DigestRepInner_error;
r.u.error.reason = strdup("unknown error");
krb5_free_error_message(context, s);
if (r.u.error.reason == NULL) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "malloc: out of memory");
goto out;
}
r.u.error.code = EINVAL;
break;
}
}
ASN1_MALLOC_ENCODE(DigestRepInner, buf.data, buf.length, &r, &size, ret);
if (ret) {
krb5_set_error_message(context, ret, "Failed to encode inner digest reply");
goto out;
}
if (size != buf.length)
krb5_abortx(context, "ASN1 internal error");
krb5_auth_con_addflags(context, ac, KRB5_AUTH_CONTEXT_USE_SUBKEY, NULL);
ret = krb5_mk_rep (context, ac, &rep.apRep);
if (ret)
goto out;
{
krb5_keyblock *key;
ret = krb5_auth_con_getlocalsubkey(context, ac, &key);
if (ret)
goto out;
ret = krb5_crypto_init(context, key, 0, &crypto);
krb5_free_keyblock (context, key);
if (ret)
goto out;
}
ret = krb5_encrypt_EncryptedData(context, crypto, KRB5_KU_DIGEST_ENCRYPT,
buf.data, buf.length, 0,
&rep.innerRep);
ASN1_MALLOC_ENCODE(DigestREP, reply->data, reply->length, &rep, &size, ret);
if (ret) {
krb5_set_error_message(context, ret, "Failed to encode digest reply");
goto out;
}
if (size != reply->length)
krb5_abortx(context, "ASN1 internal error");
out:
if (ac)
krb5_auth_con_free(context, ac);
if (ret)
krb5_warn(context, ret, "Digest request from %s failed", from);
if (ticket)
krb5_free_ticket(context, ticket);
if (id)
krb5_kt_close(context, id);
if (crypto)
krb5_crypto_destroy(context, crypto);
if (sp)
krb5_storage_free(sp);
if (user)
_kdc_free_ent (context, user);
if (server)
_kdc_free_ent (context, server);
if (client)
_kdc_free_ent (context, client);
if (password) {
memset(password, 0, strlen(password));
free (password);
}
if (client_name)
free (client_name);
krb5_data_free(&buf);
krb5_data_free(&serverNonce);
free_Checksum(&res);
free_DigestREP(&rep);
free_DigestRepInner(&r);
free_DigestReqInner(&ireq);
return ret;
}
#endif /* DIGEST */
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2016 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
*/
#include <linux/pci.h>
#include "amdgpu.h"
#include "amdgpu_ih.h"
#include "soc15.h"
#include "oss/osssys_4_0_offset.h"
#include "oss/osssys_4_0_sh_mask.h"
#include "soc15_common.h"
#include "vega10_ih.h"
#define MAX_REARM_RETRY 10
static void vega10_ih_set_interrupt_funcs(struct amdgpu_device *adev);
/**
* vega10_ih_enable_interrupts - Enable the interrupt ring buffer
*
* @adev: amdgpu_device pointer
*
* Enable the interrupt ring buffer (VEGA10).
*/
static void vega10_ih_enable_interrupts(struct amdgpu_device *adev)
{
u32 ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 1);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR, 1);
if (amdgpu_sriov_vf(adev)) {
if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL, ih_rb_cntl)) {
DRM_ERROR("PSP program IH_RB_CNTL failed!\n");
return;
}
} else {
WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL, ih_rb_cntl);
}
adev->irq.ih.enabled = true;
if (adev->irq.ih1.ring_size) {
ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
RB_ENABLE, 1);
if (amdgpu_sriov_vf(adev)) {
if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL_RING1,
ih_rb_cntl)) {
DRM_ERROR("program IH_RB_CNTL_RING1 failed!\n");
return;
}
} else {
WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1, ih_rb_cntl);
}
adev->irq.ih1.enabled = true;
}
if (adev->irq.ih2.ring_size) {
ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING2);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
RB_ENABLE, 1);
if (amdgpu_sriov_vf(adev)) {
if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL_RING2,
ih_rb_cntl)) {
DRM_ERROR("program IH_RB_CNTL_RING2 failed!\n");
return;
}
} else {
WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING2, ih_rb_cntl);
}
adev->irq.ih2.enabled = true;
}
}
/**
* vega10_ih_disable_interrupts - Disable the interrupt ring buffer
*
* @adev: amdgpu_device pointer
*
* Disable the interrupt ring buffer (VEGA10).
*/
static void vega10_ih_disable_interrupts(struct amdgpu_device *adev)
{
u32 ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 0);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR, 0);
if (amdgpu_sriov_vf(adev)) {
if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL, ih_rb_cntl)) {
DRM_ERROR("PSP program IH_RB_CNTL failed!\n");
return;
}
} else {
WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL, ih_rb_cntl);
}
/* set rptr, wptr to 0 */
WREG32_SOC15(OSSSYS, 0, mmIH_RB_RPTR, 0);
WREG32_SOC15(OSSSYS, 0, mmIH_RB_WPTR, 0);
adev->irq.ih.enabled = false;
adev->irq.ih.rptr = 0;
if (adev->irq.ih1.ring_size) {
ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
RB_ENABLE, 0);
if (amdgpu_sriov_vf(adev)) {
if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL_RING1,
ih_rb_cntl)) {
DRM_ERROR("program IH_RB_CNTL_RING1 failed!\n");
return;
}
} else {
WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1, ih_rb_cntl);
}
/* set rptr, wptr to 0 */
WREG32_SOC15(OSSSYS, 0, mmIH_RB_RPTR_RING1, 0);
WREG32_SOC15(OSSSYS, 0, mmIH_RB_WPTR_RING1, 0);
adev->irq.ih1.enabled = false;
adev->irq.ih1.rptr = 0;
}
if (adev->irq.ih2.ring_size) {
ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING2);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
RB_ENABLE, 0);
if (amdgpu_sriov_vf(adev)) {
if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL_RING2,
ih_rb_cntl)) {
DRM_ERROR("program IH_RB_CNTL_RING2 failed!\n");
return;
}
} else {
WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING2, ih_rb_cntl);
}
/* set rptr, wptr to 0 */
WREG32_SOC15(OSSSYS, 0, mmIH_RB_RPTR_RING2, 0);
WREG32_SOC15(OSSSYS, 0, mmIH_RB_WPTR_RING2, 0);
adev->irq.ih2.enabled = false;
adev->irq.ih2.rptr = 0;
}
}
static uint32_t vega10_ih_rb_cntl(struct amdgpu_ih_ring *ih, uint32_t ih_rb_cntl)
{
int rb_bufsz = order_base_2(ih->ring_size / 4);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
MC_SPACE, ih->use_bus_addr ? 1 : 4);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
WPTR_OVERFLOW_CLEAR, 1);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
WPTR_OVERFLOW_ENABLE, 1);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_SIZE, rb_bufsz);
/* Ring Buffer write pointer writeback. If enabled, IH_RB_WPTR register
* value is written to memory
*/
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
WPTR_WRITEBACK_ENABLE, 1);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, MC_SNOOP, 1);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, MC_RO, 0);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, MC_VMID, 0);
return ih_rb_cntl;
}
static uint32_t vega10_ih_doorbell_rptr(struct amdgpu_ih_ring *ih)
{
u32 ih_doorbell_rtpr = 0;
if (ih->use_doorbell) {
ih_doorbell_rtpr = REG_SET_FIELD(ih_doorbell_rtpr,
IH_DOORBELL_RPTR, OFFSET,
ih->doorbell_index);
ih_doorbell_rtpr = REG_SET_FIELD(ih_doorbell_rtpr,
IH_DOORBELL_RPTR,
ENABLE, 1);
} else {
ih_doorbell_rtpr = REG_SET_FIELD(ih_doorbell_rtpr,
IH_DOORBELL_RPTR,
ENABLE, 0);
}
return ih_doorbell_rtpr;
}
/**
* vega10_ih_irq_init - init and enable the interrupt ring
*
* @adev: amdgpu_device pointer
*
* Allocate a ring buffer for the interrupt controller,
* enable the RLC, disable interrupts, enable the IH
* ring buffer and enable it (VI).
* Called at device load and reume.
* Returns 0 for success, errors for failure.
*/
static int vega10_ih_irq_init(struct amdgpu_device *adev)
{
struct amdgpu_ih_ring *ih;
u32 ih_rb_cntl, ih_chicken;
int ret = 0;
u32 tmp;
/* disable irqs */
vega10_ih_disable_interrupts(adev);
adev->nbio.funcs->ih_control(adev);
ih = &adev->irq.ih;
/* Ring Buffer base. [39:8] of 40-bit address of the beginning of the ring buffer*/
WREG32_SOC15(OSSSYS, 0, mmIH_RB_BASE, ih->gpu_addr >> 8);
WREG32_SOC15(OSSSYS, 0, mmIH_RB_BASE_HI, (ih->gpu_addr >> 40) & 0xff);
ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL);
ih_rb_cntl = vega10_ih_rb_cntl(ih, ih_rb_cntl);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RPTR_REARM,
!!adev->irq.msi_enabled);
if (amdgpu_sriov_vf(adev)) {
if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL, ih_rb_cntl)) {
DRM_ERROR("PSP program IH_RB_CNTL failed!\n");
return -ETIMEDOUT;
}
} else {
WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL, ih_rb_cntl);
}
if ((adev->asic_type == CHIP_ARCTURUS &&
adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT) ||
adev->asic_type == CHIP_RENOIR) {
ih_chicken = RREG32_SOC15(OSSSYS, 0, mmIH_CHICKEN);
if (adev->irq.ih.use_bus_addr) {
ih_chicken = REG_SET_FIELD(ih_chicken, IH_CHICKEN,
MC_SPACE_GPA_ENABLE, 1);
} else {
ih_chicken = REG_SET_FIELD(ih_chicken, IH_CHICKEN,
MC_SPACE_FBPA_ENABLE, 1);
}
WREG32_SOC15(OSSSYS, 0, mmIH_CHICKEN, ih_chicken);
}
/* set the writeback address whether it's enabled or not */
WREG32_SOC15(OSSSYS, 0, mmIH_RB_WPTR_ADDR_LO,
lower_32_bits(ih->wptr_addr));
WREG32_SOC15(OSSSYS, 0, mmIH_RB_WPTR_ADDR_HI,
upper_32_bits(ih->wptr_addr) & 0xFFFF);
/* set rptr, wptr to 0 */
WREG32_SOC15(OSSSYS, 0, mmIH_RB_WPTR, 0);
WREG32_SOC15(OSSSYS, 0, mmIH_RB_RPTR, 0);
WREG32_SOC15(OSSSYS, 0, mmIH_DOORBELL_RPTR,
vega10_ih_doorbell_rptr(ih));
ih = &adev->irq.ih1;
if (ih->ring_size) {
WREG32_SOC15(OSSSYS, 0, mmIH_RB_BASE_RING1, ih->gpu_addr >> 8);
WREG32_SOC15(OSSSYS, 0, mmIH_RB_BASE_HI_RING1,
(ih->gpu_addr >> 40) & 0xff);
ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1);
ih_rb_cntl = vega10_ih_rb_cntl(ih, ih_rb_cntl);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
WPTR_OVERFLOW_ENABLE, 0);
ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,
RB_FULL_DRAIN_ENABLE, 1);
if (amdgpu_sriov_vf(adev)) {
if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL_RING1,
ih_rb_cntl)) {
DRM_ERROR("program IH_RB_CNTL_RING1 failed!\n");
return -ETIMEDOUT;
}
} else {
WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1, ih_rb_cntl);
}
/* set rptr, wptr to 0 */
WREG32_SOC15(OSSSYS, 0, mmIH_RB_WPTR_RING1, 0);
WREG32_SOC15(OSSSYS, 0, mmIH_RB_RPTR_RING1, 0);
WREG32_SOC15(OSSSYS, 0, mmIH_DOORBELL_RPTR_RING1,
vega10_ih_doorbell_rptr(ih));
}
ih = &adev->irq.ih2;
if (ih->ring_size) {
WREG32_SOC15(OSSSYS, 0, mmIH_RB_BASE_RING2, ih->gpu_addr >> 8);
WREG32_SOC15(OSSSYS, 0, mmIH_RB_BASE_HI_RING2,
(ih->gpu_addr >> 40) & 0xff);
ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING2);
ih_rb_cntl = vega10_ih_rb_cntl(ih, ih_rb_cntl);
if (amdgpu_sriov_vf(adev)) {
if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL_RING2,
ih_rb_cntl)) {
DRM_ERROR("program IH_RB_CNTL_RING2 failed!\n");
return -ETIMEDOUT;
}
} else {
WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING2, ih_rb_cntl);
}
/* set rptr, wptr to 0 */
WREG32_SOC15(OSSSYS, 0, mmIH_RB_WPTR_RING2, 0);
WREG32_SOC15(OSSSYS, 0, mmIH_RB_RPTR_RING2, 0);
WREG32_SOC15(OSSSYS, 0, mmIH_DOORBELL_RPTR_RING2,
vega10_ih_doorbell_rptr(ih));
}
tmp = RREG32_SOC15(OSSSYS, 0, mmIH_STORM_CLIENT_LIST_CNTL);
tmp = REG_SET_FIELD(tmp, IH_STORM_CLIENT_LIST_CNTL,
CLIENT18_IS_STORM_CLIENT, 1);
WREG32_SOC15(OSSSYS, 0, mmIH_STORM_CLIENT_LIST_CNTL, tmp);
tmp = RREG32_SOC15(OSSSYS, 0, mmIH_INT_FLOOD_CNTL);
tmp = REG_SET_FIELD(tmp, IH_INT_FLOOD_CNTL, FLOOD_CNTL_ENABLE, 1);
WREG32_SOC15(OSSSYS, 0, mmIH_INT_FLOOD_CNTL, tmp);
pci_set_master(adev->pdev);
/* enable interrupts */
vega10_ih_enable_interrupts(adev);
return ret;
}
/**
* vega10_ih_irq_disable - disable interrupts
*
* @adev: amdgpu_device pointer
*
* Disable interrupts on the hw (VEGA10).
*/
static void vega10_ih_irq_disable(struct amdgpu_device *adev)
{
vega10_ih_disable_interrupts(adev);
/* Wait and acknowledge irq */
mdelay(1);
}
/**
* vega10_ih_get_wptr - get the IH ring buffer wptr
*
* @adev: amdgpu_device pointer
*
* Get the IH ring buffer wptr from either the register
* or the writeback memory buffer (VEGA10). Also check for
* ring buffer overflow and deal with it.
* Returns the value of the wptr.
*/
static u32 vega10_ih_get_wptr(struct amdgpu_device *adev,
struct amdgpu_ih_ring *ih)
{
u32 wptr, reg, tmp;
wptr = le32_to_cpu(*ih->wptr_cpu);
if (!REG_GET_FIELD(wptr, IH_RB_WPTR, RB_OVERFLOW))
goto out;
/* Double check that the overflow wasn't already cleared. */
if (ih == &adev->irq.ih)
reg = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_WPTR);
else if (ih == &adev->irq.ih1)
reg = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_WPTR_RING1);
else if (ih == &adev->irq.ih2)
reg = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_WPTR_RING2);
else
BUG();
wptr = RREG32_NO_KIQ(reg);
if (!REG_GET_FIELD(wptr, IH_RB_WPTR, RB_OVERFLOW))
goto out;
wptr = REG_SET_FIELD(wptr, IH_RB_WPTR, RB_OVERFLOW, 0);
/* When a ring buffer overflow happen start parsing interrupt
* from the last not overwritten vector (wptr + 32). Hopefully
* this should allow us to catchup.
*/
tmp = (wptr + 32) & ih->ptr_mask;
dev_warn(adev->dev, "IH ring buffer overflow "
"(0x%08X, 0x%08X, 0x%08X)\n",
wptr, ih->rptr, tmp);
ih->rptr = tmp;
if (ih == &adev->irq.ih)
reg = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_CNTL);
else if (ih == &adev->irq.ih1)
reg = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_CNTL_RING1);
else if (ih == &adev->irq.ih2)
reg = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_CNTL_RING2);
else
BUG();
tmp = RREG32_NO_KIQ(reg);
tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 1);
WREG32_NO_KIQ(reg, tmp);
out:
return (wptr & ih->ptr_mask);
}
/**
* vega10_ih_decode_iv - decode an interrupt vector
*
* @adev: amdgpu_device pointer
*
* Decodes the interrupt vector at the current rptr
* position and also advance the position.
*/
static void vega10_ih_decode_iv(struct amdgpu_device *adev,
struct amdgpu_ih_ring *ih,
struct amdgpu_iv_entry *entry)
{
/* wptr/rptr are in bytes! */
u32 ring_index = ih->rptr >> 2;
uint32_t dw[8];
dw[0] = le32_to_cpu(ih->ring[ring_index + 0]);
dw[1] = le32_to_cpu(ih->ring[ring_index + 1]);
dw[2] = le32_to_cpu(ih->ring[ring_index + 2]);
dw[3] = le32_to_cpu(ih->ring[ring_index + 3]);
dw[4] = le32_to_cpu(ih->ring[ring_index + 4]);
dw[5] = le32_to_cpu(ih->ring[ring_index + 5]);
dw[6] = le32_to_cpu(ih->ring[ring_index + 6]);
dw[7] = le32_to_cpu(ih->ring[ring_index + 7]);
entry->client_id = dw[0] & 0xff;
entry->src_id = (dw[0] >> 8) & 0xff;
entry->ring_id = (dw[0] >> 16) & 0xff;
entry->vmid = (dw[0] >> 24) & 0xf;
entry->vmid_src = (dw[0] >> 31);
entry->timestamp = dw[1] | ((u64)(dw[2] & 0xffff) << 32);
entry->timestamp_src = dw[2] >> 31;
entry->pasid = dw[3] & 0xffff;
entry->pasid_src = dw[3] >> 31;
entry->src_data[0] = dw[4];
entry->src_data[1] = dw[5];
entry->src_data[2] = dw[6];
entry->src_data[3] = dw[7];
/* wptr/rptr are in bytes! */
ih->rptr += 32;
}
/**
* vega10_ih_irq_rearm - rearm IRQ if lost
*
* @adev: amdgpu_device pointer
*
*/
static void vega10_ih_irq_rearm(struct amdgpu_device *adev,
struct amdgpu_ih_ring *ih)
{
uint32_t reg_rptr = 0;
uint32_t v = 0;
uint32_t i = 0;
if (ih == &adev->irq.ih)
reg_rptr = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_RPTR);
else if (ih == &adev->irq.ih1)
reg_rptr = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_RPTR_RING1);
else if (ih == &adev->irq.ih2)
reg_rptr = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_RPTR_RING2);
else
return;
/* Rearm IRQ / re-wwrite doorbell if doorbell write is lost */
for (i = 0; i < MAX_REARM_RETRY; i++) {
v = RREG32_NO_KIQ(reg_rptr);
if ((v < ih->ring_size) && (v != ih->rptr))
WDOORBELL32(ih->doorbell_index, ih->rptr);
else
break;
}
}
/**
* vega10_ih_set_rptr - set the IH ring buffer rptr
*
* @adev: amdgpu_device pointer
*
* Set the IH ring buffer rptr.
*/
static void vega10_ih_set_rptr(struct amdgpu_device *adev,
struct amdgpu_ih_ring *ih)
{
if (ih->use_doorbell) {
/* XXX check if swapping is necessary on BE */
*ih->rptr_cpu = ih->rptr;
WDOORBELL32(ih->doorbell_index, ih->rptr);
if (amdgpu_sriov_vf(adev))
vega10_ih_irq_rearm(adev, ih);
} else if (ih == &adev->irq.ih) {
WREG32_SOC15(OSSSYS, 0, mmIH_RB_RPTR, ih->rptr);
} else if (ih == &adev->irq.ih1) {
WREG32_SOC15(OSSSYS, 0, mmIH_RB_RPTR_RING1, ih->rptr);
} else if (ih == &adev->irq.ih2) {
WREG32_SOC15(OSSSYS, 0, mmIH_RB_RPTR_RING2, ih->rptr);
}
}
/**
* vega10_ih_self_irq - dispatch work for ring 1 and 2
*
* @adev: amdgpu_device pointer
* @source: irq source
* @entry: IV with WPTR update
*
* Update the WPTR from the IV and schedule work to handle the entries.
*/
static int vega10_ih_self_irq(struct amdgpu_device *adev,
struct amdgpu_irq_src *source,
struct amdgpu_iv_entry *entry)
{
uint32_t wptr = cpu_to_le32(entry->src_data[0]);
switch (entry->ring_id) {
case 1:
*adev->irq.ih1.wptr_cpu = wptr;
schedule_work(&adev->irq.ih1_work);
break;
case 2:
*adev->irq.ih2.wptr_cpu = wptr;
schedule_work(&adev->irq.ih2_work);
break;
default: break;
}
return 0;
}
static const struct amdgpu_irq_src_funcs vega10_ih_self_irq_funcs = {
.process = vega10_ih_self_irq,
};
static void vega10_ih_set_self_irq_funcs(struct amdgpu_device *adev)
{
adev->irq.self_irq.num_types = 0;
adev->irq.self_irq.funcs = &vega10_ih_self_irq_funcs;
}
static int vega10_ih_early_init(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
vega10_ih_set_interrupt_funcs(adev);
vega10_ih_set_self_irq_funcs(adev);
return 0;
}
static int vega10_ih_sw_init(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
int r;
r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_IH, 0,
&adev->irq.self_irq);
if (r)
return r;
r = amdgpu_ih_ring_init(adev, &adev->irq.ih, 256 * 1024, true);
if (r)
return r;
adev->irq.ih.use_doorbell = true;
adev->irq.ih.doorbell_index = adev->doorbell_index.ih << 1;
r = amdgpu_ih_ring_init(adev, &adev->irq.ih1, PAGE_SIZE, true);
if (r)
return r;
adev->irq.ih1.use_doorbell = true;
adev->irq.ih1.doorbell_index = (adev->doorbell_index.ih + 1) << 1;
r = amdgpu_ih_ring_init(adev, &adev->irq.ih2, PAGE_SIZE, true);
if (r)
return r;
adev->irq.ih2.use_doorbell = true;
adev->irq.ih2.doorbell_index = (adev->doorbell_index.ih + 2) << 1;
r = amdgpu_irq_init(adev);
return r;
}
static int vega10_ih_sw_fini(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
amdgpu_irq_fini(adev);
amdgpu_ih_ring_fini(adev, &adev->irq.ih2);
amdgpu_ih_ring_fini(adev, &adev->irq.ih1);
amdgpu_ih_ring_fini(adev, &adev->irq.ih);
return 0;
}
static int vega10_ih_hw_init(void *handle)
{
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
r = vega10_ih_irq_init(adev);
if (r)
return r;
return 0;
}
static int vega10_ih_hw_fini(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
vega10_ih_irq_disable(adev);
return 0;
}
static int vega10_ih_suspend(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
return vega10_ih_hw_fini(adev);
}
static int vega10_ih_resume(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
return vega10_ih_hw_init(adev);
}
static bool vega10_ih_is_idle(void *handle)
{
/* todo */
return true;
}
static int vega10_ih_wait_for_idle(void *handle)
{
/* todo */
return -ETIMEDOUT;
}
static int vega10_ih_soft_reset(void *handle)
{
/* todo */
return 0;
}
static void vega10_ih_update_clockgating_state(struct amdgpu_device *adev,
bool enable)
{
uint32_t data, def, field_val;
if (adev->cg_flags & AMD_CG_SUPPORT_IH_CG) {
def = data = RREG32_SOC15(OSSSYS, 0, mmIH_CLK_CTRL);
field_val = enable ? 0 : 1;
/**
* Vega10 does not have IH_RETRY_INT_CAM_MEM_CLK_SOFT_OVERRIDE
* and IH_BUFFER_MEM_CLK_SOFT_OVERRIDE field.
*/
if (adev->asic_type > CHIP_VEGA10) {
data = REG_SET_FIELD(data, IH_CLK_CTRL,
IH_RETRY_INT_CAM_MEM_CLK_SOFT_OVERRIDE, field_val);
data = REG_SET_FIELD(data, IH_CLK_CTRL,
IH_BUFFER_MEM_CLK_SOFT_OVERRIDE, field_val);
}
data = REG_SET_FIELD(data, IH_CLK_CTRL,
DBUS_MUX_CLK_SOFT_OVERRIDE, field_val);
data = REG_SET_FIELD(data, IH_CLK_CTRL,
OSSSYS_SHARE_CLK_SOFT_OVERRIDE, field_val);
data = REG_SET_FIELD(data, IH_CLK_CTRL,
LIMIT_SMN_CLK_SOFT_OVERRIDE, field_val);
data = REG_SET_FIELD(data, IH_CLK_CTRL,
DYN_CLK_SOFT_OVERRIDE, field_val);
data = REG_SET_FIELD(data, IH_CLK_CTRL,
REG_CLK_SOFT_OVERRIDE, field_val);
if (def != data)
WREG32_SOC15(OSSSYS, 0, mmIH_CLK_CTRL, data);
}
}
static int vega10_ih_set_clockgating_state(void *handle,
enum amd_clockgating_state state)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
vega10_ih_update_clockgating_state(adev,
state == AMD_CG_STATE_GATE);
return 0;
}
static int vega10_ih_set_powergating_state(void *handle,
enum amd_powergating_state state)
{
return 0;
}
const struct amd_ip_funcs vega10_ih_ip_funcs = {
.name = "vega10_ih",
.early_init = vega10_ih_early_init,
.late_init = NULL,
.sw_init = vega10_ih_sw_init,
.sw_fini = vega10_ih_sw_fini,
.hw_init = vega10_ih_hw_init,
.hw_fini = vega10_ih_hw_fini,
.suspend = vega10_ih_suspend,
.resume = vega10_ih_resume,
.is_idle = vega10_ih_is_idle,
.wait_for_idle = vega10_ih_wait_for_idle,
.soft_reset = vega10_ih_soft_reset,
.set_clockgating_state = vega10_ih_set_clockgating_state,
.set_powergating_state = vega10_ih_set_powergating_state,
};
static const struct amdgpu_ih_funcs vega10_ih_funcs = {
.get_wptr = vega10_ih_get_wptr,
.decode_iv = vega10_ih_decode_iv,
.set_rptr = vega10_ih_set_rptr
};
static void vega10_ih_set_interrupt_funcs(struct amdgpu_device *adev)
{
adev->irq.ih_funcs = &vega10_ih_funcs;
}
const struct amdgpu_ip_block_version vega10_ih_ip_block =
{
.type = AMD_IP_BLOCK_TYPE_IH,
.major = 4,
.minor = 0,
.rev = 0,
.funcs = &vega10_ih_ip_funcs,
};
|
{
"pile_set_name": "Github"
}
|
:107C000001C0F6C011248FEF98E09EBF8DBF84B7EE
:107C100090E89093610010926100882369F0982F9A
:107C20009A70923049F081FF02C097EF94BF282EDE
:107C300080E001D10C94000085E08093810082E017
:107C40008093C00088E18093C1008BE98093C400D9
:107C500086E08093C2008EE0EED0259A84E024E294
:107C60003DEF91E0309385002093840096BBB09B5C
:107C7000FECF1D9AA8954091C00047FD02C08150DB
:107C800089F7CDD0813479F4CAD0C82FDAD0C23880
:107C900011F480E004C088E0C13809F083E0B8D076
:107CA00080E1B6D0EECF823419F484E1D2D0F8CF9F
:107CB000853411F485E0FACF853581F4B0D0E82E13
:107CC000AED0F82E87FF07C08BB781608BBFEE0C5C
:107CD000FF1CB7D0E5CF8BB78E7FF8CF863579F410
:107CE0009ED08D3451F49BD0CBB799D0C170880F02
:107CF0008C2B8BBF81E0ADD0CCCF83E0FCCF843622
:107D000009F045C08CD0C82FD0E0DC2FCC2787D01D
:107D1000C82B85D0D82E5E01B39400E011E0480155
:107D2000EFEF8E1A9E0A7BD0F801808384018A14BB
:107D30009B04A9F786D0F5E410E000E0DF1609F116
:107D400050E040E063E0C70153D08701C12CDD243F
:107D5000D394F601419151916F0161E0C80148D07F
:107D60000E5F1F4F2297A9F750E040E065E0C70182
:107D70003FD096CF6081C8018E0D9F1D79D00F5FD7
:107D80001F4FF801F395C017D107A1F789CF8437AA
:107D900001F545D0C82FD0E0DC2FCC2740D0C82B30
:107DA0003ED0D82E4ED08701F5E4DF120BC0CE0DA9
:107DB000DF1DC80155D02CD00F5F1F4FC017D10752
:107DC000C1F76ECFF80187918F0122D02197D1F7AB
:107DD00067CF853739F435D08EE11AD085E918D0D0
:107DE00081E85DCF813509F074CF88E024D071CF70
:107DF000FC010A0167BFE895112407B600FCFDCF1E
:107E0000667029F0452B19F481E187BFE895089544
:107E10009091C00095FFFCCF8093C600089580919B
:107E2000C00087FFFCCF8091C00084FD01C0A895F1
:107E30008091C6000895E0E6F0E098E190838083A9
:107E40000895EDDF803219F088E0F5DFFFCF84E19F
:107E5000DFCFCF93C82FE3DFC150E9F7CF91F1CF48
:107E6000F999FECF92BD81BDF89A992780B5089502
:107E7000262FF999FECF92BD81BD20BD0FB6F89493
:0A7E8000FA9AF99A0FBE01960895D0
:027FFE00000879
:0400000300007C007D
:00000001FF
|
{
"pile_set_name": "Github"
}
|
{% import 'macros/security.macros' as SECLABEL %}
{% import 'macros/variable.macros' as VARIABLE %}
CREATE ROLE {{ conn|qtIdent(data.rolname) }} WITH{% if data.rolcanlogin and data.rolcanlogin is sameas True %}
LOGIN{% else %}
NOLOGIN{% endif %}{% if data.rolsuper %}
SUPERUSER{% else %}
NOSUPERUSER{% endif %}{% if data.rolcreatedb %}
CREATEDB{% else %}
NOCREATEDB{% endif %}{% if data.rolcreaterole %}
CREATEROLE{% else %}
NOCREATEROLE{% endif %}{% if data.rolinherit is sameas true %}
INHERIT{% else %}
NOINHERIT{% endif %}{% if data.rolreplication %}
REPLICATION{% else %}
NOREPLICATION{% endif %}{% if 'rolconnlimit' in data and data.rolconnlimit is number and data.rolconnlimit >= -1 %}
CONNECTION LIMIT {{ data.rolconnlimit }}{% endif %}{% if data.rolvaliduntil and data.rolvaliduntil is not none %}
VALID UNTIL {{ data.rolvaliduntil|qtLiteral }} {% endif %}{% if data.rolpassword %}
PASSWORD {% if data.rolpassword is none %}NULL{% else %}{% if dummy %}'xxxxxx'{% else %} {{ data.rolpassword | qtLiteral }}{% endif %}{% endif %}{% endif %};{% if data.members and data.members|length > 0 %}
GRANT {{ conn|qtIdent(data.members)|join(', ') }} TO {{ conn|qtIdent(data.rolname) }};{% endif %}{% if data.admins and data.admins|length > 0 %}
GRANT {{ conn|qtIdent(data.admins)|join(', ') }} TO {{ conn|qtIdent(data.rolname) }} WITH ADMIN OPTION;{% endif %}{% if data.seclabels and data.seclabels|length > 0 %}
{% for r in data.seclabels %}
{{ SECLABEL.APPLY(conn, 'ROLE', data.rolname, r.provider, r.label) }}
{% endfor %}{% endif %}{% if data.variables %}
{% for var in data.variables %}
{{ VARIABLE.APPLY(conn, var.database, data.rolname, var.name, var.value) }}
{% endfor %}{% endif %}{% if data.description %}
COMMENT ON ROLE {{ conn|qtIdent(data.rolname) }} IS {{ data.description|qtLiteral }};
{% endif %}
|
{
"pile_set_name": "Github"
}
|
:020000023000CC
:10FC000001C0F3C0112484B790E890936100109272
:10FC10006100882369F0982F9A70923049F081FF33
:10FC200002C097EF94BF282E80E002D10C94000010
:10FC300085E08093810082E08093D00088E180930A
:10FC4000D1008BE08093D40086E08093D2008EE0D8
:10FC5000EFD0279A84E02DE53DEF91E030938500C9
:10FC60002093840096BBB09BFECF1F9AA89540912D
:10FC7000D00047FD02C0815089F7CED0813479F49D
:10FC8000CBD0C82FDBD0C23811F480E004C088E0AC
:10FC9000C13809F083E0B9D080E1B7D0EECF82342B
:10FCA00019F484E1D3D0F8CF853411F485E0FACF8C
:10FCB000853581F4B1D0E82EAFD0F82E87FF07C08C
:10FCC0008BB781608BBFEE0CFF1CB8D0E5CF8BB734
:10FCD0008E7FF8CF863579F49FD08D3451F49CD047
:10FCE000CBB79AD0C170880F8C2B8BBF81E0AED080
:10FCF000CCCF83E0FCCF843609F046C08DD0C82F2E
:10FD0000D0E0DC2FCC2788D0C82B86D0D82E5E013F
:10FD10008EEFB81A00E012E04801EFEF8E1A9E0A4B
:10FD20007BD0F801808384018A149B04A9F786D0D4
:10FD3000F5E410E000E0DF1609F150E040E063E098
:10FD4000C70153D08701C12C92E0D92EF601419111
:10FD500051916F0161E0C80148D00E5F1F4F22979B
:10FD6000A9F750E040E065E0C7013FD095CF608142
:10FD7000C8018E0D9F1D79D00F5F1F4FF801FE5FE8
:10FD8000C017D107A1F788CF843701F545D0C82F18
:10FD9000D0E0DC2FCC2740D0C82B3ED0D82E4ED080
:10FDA0008701F5E4DF120BC0CE0DDF1DC80155D071
:10FDB0002CD00F5F1F4FC017D107C1F76DCFF801CF
:10FDC00087918F0122D02197D1F766CF853739F4FB
:10FDD00035D08EE11AD088E918D081E05CCF81352A
:10FDE00009F073CF88E024D070CFFC010A0167BF0F
:10FDF000E895112407B600FCFDCF667029F0452B6D
:10FE000019F481E187BFE89508959091D00095FF9E
:10FE1000FCCF8093D60008958091D00087FFFCCF5F
:10FE20008091D00084FD01C0A8958091D6000895EE
:10FE3000E0E6F0E098E1908380830895EDDF803282
:10FE400019F088E0F5DFFFCF84E1DFCFCF93C82F33
:10FE5000E3DFC150E9F7CF91F1CFF999FECF92BD21
:10FE600081BDF89A992780B50895262FF999FECF7C
:10FE70001FBA92BD81BD20BD0FB6F894FA9AF99AC7
:06FE80000FBE019608957B
:02FFFE000008F9
:040000033000FC00CD
:00000001FF
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright (C) 2001 Yasna.com. All rights reserved.
*
* ===================================================================
* The Apache Software License, Version 1.1
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by
* Yasna.com (http://www.yasna.com)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Yazd" and "Yasna.com" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please
* contact yazd@yasna.com.
*
* 5. Products derived from this software may not be called "Yazd",
* nor may "Yazd" appear in their name, without prior written
* permission of Yasna.com.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL YASNA.COM OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of Yasna.com. For more information
* on Yasna.com, please see <http://www.yasna.com>.
*/
/**
* Copyright (C) 2000 CoolServlets.com. All rights reserved.
*
* ===================================================================
* The Apache Software License, Version 1.1
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by
* CoolServlets.com (http://www.coolservlets.com)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Jive" and "CoolServlets.com" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please
* contact webmaster@coolservlets.com.
*
* 5. Products derived from this software may not be called "Jive",
* nor may "Jive" appear in their name, without prior written
* permission of CoolServlets.com.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL COOLSERVLETS.COM OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of CoolServlets.com. For more information
* on CoolServlets.com, please see <http://www.coolservlets.com>.
*/
package com.Yasna.forum;
import java.io.PrintStream;
import java.io.PrintWriter;
/**
* Thrown when a user record could not be loaded or does not exist.
*/
public class UserNotFoundException extends Exception {
private Throwable nestedThrowable = null;
public UserNotFoundException() {
super();
}
public UserNotFoundException(String msg) {
super(msg);
}
public UserNotFoundException(Throwable nestedThrowable) {
this.nestedThrowable = nestedThrowable;
}
public UserNotFoundException(String msg, Throwable nestedThrowable) {
super(msg);
this.nestedThrowable = nestedThrowable;
}
public void printStackTrace() {
super.printStackTrace();
if (nestedThrowable != null) {
nestedThrowable.printStackTrace();
}
}
public void printStackTrace(PrintStream ps) {
super.printStackTrace(ps);
if (nestedThrowable != null) {
nestedThrowable.printStackTrace(ps);
}
}
public void printStackTrace(PrintWriter pw) {
super.printStackTrace(pw);
if (nestedThrowable != null) {
nestedThrowable.printStackTrace(pw);
}
}
}
|
{
"pile_set_name": "Github"
}
|
Use this
```
X:7
T:Qui Tolis (Trio)
C:André Raison
M:3/4
L:1/4
Q:1/4=92
%%staves {(Pos1 Pos2) Trompette}
K:F
%
V:Pos1
%%MIDI program 78
"Positif"x3 |x3 |c'>ba|Pga/g/f|:g2a |ba2 |g2c- |c2P=B |c>de |fga |
V:Pos2
%%MIDI program 78
Mf>ed|cd/c/B|PA2d |ef/e/d |:e2f |ef2 |c>BA |GA/G/F |E>FG |ABc- |
V:Trompette
%%MIDI program 56
"Trompette"z3|z3 |z3 |z3 |:Mc>BA|PGA/G/F|PE>EF|PEF/E/D|C>CPB,|A,G,F,-|
```
to get
```abc
X:7
T:Qui Tolis (Trio)
C:André Raison
M:3/4
L:1/4
Q:1/4=92
%%staves {(Pos1 Pos2) Trompette}
K:F
%
V:Pos1
%%MIDI program 78
"Positif"x3 |x3 |c'>ba|Pga/g/f|:g2a |ba2 |g2c- |c2P=B |c>de |fga |
V:Pos2
%%MIDI program 78
Mf>ed|cd/c/B|PA2d |ef/e/d |:e2f |ef2 |c>BA |GA/G/F |E>FG |ABc- |
V:Trompette
%%MIDI program 56
"Trompette"z3|z3 |z3 |z3 |:Mc>BA|PGA/G/F|PE>EF|PEF/E/D|C>CPB,|A,G,F,-|
```
See [(this is a link to whatever)](#whatever) for an example with options
`{.abc #whatever caption="this is the caption" width=50%}`.
```{.abc #whatever caption="this is the caption" width=50%}
X:7
T:Qui Tolis (Trio)
C:André Raison
M:3/4
L:1/4
Q:1/4=92
%%staves {(Pos1 Pos2) Trompette}
K:F
%
V:Pos1
%%MIDI program 78
"Positif"x3 |x3 |c'>ba|Pga/g/f|:g2a |ba2 |g2c- |c2P=B |c>de |fga |
V:Pos2
%%MIDI program 78
Mf>ed|cd/c/B|PA2d |ef/e/d |:e2f |ef2 |c>BA |GA/G/F |E>FG |ABc- |
V:Trompette
%%MIDI program 56
"Trompette"z3|z3 |z3 |z3 |:Mc>BA|PGA/G/F|PE>EF|PEF/E/D|C>CPB,|A,G,F,-|
```
|
{
"pile_set_name": "Github"
}
|
:020000021000EC
:10FC000001C0F2C0112484B790E890936100109273
:10FC10006100882369F0982F9A70923049F081FF33
:10FC200002C097EF94BF282E80E001D10C94000011
:10FC300085E08093810082E08093C00088E180931A
:10FC4000C10087E18093C40086E08093C2008EE00B
:10FC5000EED0209A84E02DE53DEF91E030938500D1
:10FC60002093840096BBB09BFECF189AA895409134
:10FC7000C00047FD02C0815089F7CDD0813479F4AE
:10FC8000CAD0C82FDAD0C23811F480E004C088E0AE
:10FC9000C13809F083E0B8D080E1B6D0EECF82342D
:10FCA00019F484E1D2D0F8CF853411F485E0FACF8D
:10FCB000853581F4B0D0E82EAED0F82E87FF07C08E
:10FCC0008BB781608BBFEE0CFF1CB7D0E5CF8BB735
:10FCD0008E7FF8CF863579F49ED08D3451F49BD049
:10FCE000CBB799D0C170880F8C2B8BBF81E0ADD082
:10FCF000CCCF83E0FCCF843609F045C08CD0C82F30
:10FD0000D0E0DC2FCC2787D0C82B85D0D82E5E0141
:10FD1000B39400E011E04801EFEF8E1A9E0A7BD009
:10FD2000F801808384018A149B04A9F786D0F5E446
:10FD300010E000E0DF1609F150E040E063E0C701A9
:10FD400053D08701C12CDD24D394F6014191519108
:10FD50006F0161E0C80148D00E5F1F4F2297A9F7DD
:10FD600050E040E065E0C7013FD096CF6081C80118
:10FD70008E0D9F1D79D00F5F1F4FF801F395C017AF
:10FD8000D107A1F789CF843701F545D0C82FD0E03E
:10FD9000DC2FCC2740D0C82B3ED0D82E4ED08701A8
:10FDA000F5E4DF120BC0CE0DDF1DC80155D02CD0FD
:10FDB0000F5F1F4FC017D107C1F76ECFF8018791B2
:10FDC0008F0122D02197D1F767CF853739F435D00D
:10FDD0008EE11AD087E918D086E05DCF813509F031
:10FDE00074CF88E024D071CFFC010A0167BFE89589
:10FDF000112407B600FCFDCF667029F0452B19F4DD
:10FE000081E187BFE89508959091C00095FFFCCFF0
:10FE10008093C60008958091C00087FFFCCF809139
:10FE2000C00084FD01C0A8958091C6000895E0E659
:10FE3000F0E098E1908380830895EDDF803219F03F
:10FE400088E0F5DFFFCF84E1DFCFCF93C82FE3DF7A
:10FE5000C150E9F7CF91F1CFF999FECF92BD81BDA5
:10FE6000F89A992780B50895262FF999FECF1FBAE1
:10FE700092BD81BD20BD0FB6F894FA9AF99A0FBED3
:04FE8000019608954A
:02FFFE000008F9
:040000031000FC00ED
:00000001FF
|
{
"pile_set_name": "Github"
}
|
.\" $NetBSD: hunt.6,v 1.3 1997/10/10 16:32:30 lukem Exp $
.\" $OpenBSD: hunt.6,v 1.19 2007/05/31 19:19:17 jmc Exp $
.\"
.\" Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold
.\" San Francisco, California
.\"
.\" Copyright (c) 1985 Regents of the University of California.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd September 2, 2008
.Dt HUNT 6
.Os
.Sh NAME
.Nm hunt
.Nd a multi-player multi-terminal game
.Sh SYNOPSIS
.Nm
.Op Fl bcfmqSs
.Op Fl n Ar name
.Op Fl p Ar port
.Op Fl t Ar team
.Op Fl w Ar message
.Oo
.Op Fl h
.Ar host
.Oc
.Sh DESCRIPTION
The object of the game
.Nm
is to kill off the other players.
There are no rooms, no treasures, and no monsters.
Instead, you wander around a maze, find grenades, trip mines, and shoot down
walls and players.
The more players you kill before you die, the better your score is.
If the
.Fl m
flag is given,
you enter the game as a monitor
.Po
you can see the action but you cannot play
.Pc .
.Pp
.Nm
looks for an active game on the local network.
The location of the game may be specified by giving the
.Ar host
argument.
This presupposes that a hunt game is already running on that host: see
.Xr huntd 6
for details on how to set up a game on a specific host.
If more than one game is found, you may pick which game to play in.
If no games are found,
.Nm
will exit.
.Pp
If the
.Fl q
flag is given,
.Nm
queries the local network
.Pq or specific host
and reports on all active games found.
This is useful for shell startup scripts, e.g., csh's
.Pa .login .
.Pp
The player name may be specified on the command line by using the
.Fl n
option.
.Pp
The
.Fl c ,
.Fl s ,
and
.Fl f
options are for entering the game cloaked, scanning, or flying, respectively.
.Pp
The
.Fl b
option turns off beeping when you reach the typeahead limit.
.Pp
The
.Fl t
option aids team play by making everyone else on your team
appear as the team name.
A team name is a single digit to avoid conflicting with other characters
used in the game.
Use a team name consisting of a single space
.Pq Sq \
to remain on your own.
.Pp
The
.Fl p
.Ar port
option allows the rendezvous port number to be set.
.Pp
The
.Fl w
.Ar message
option is the only way to send a message to everyone else's screen when
you start up.
It is most often used to say
.Dq eat slime death - NickD's coming in .
.Pp
When you die and are asked if you wish to re-enter the game,
there are other answers than just yes or no.
You can also reply with a
.Ic w
to write a message before continuing or
.Ic o
to change how you enter the game
.Pq cloaked, scanning, or flying .
.Sh PLAYING HINTS
.Nm
only works on terminals with at least 24 lines, 80 columns, and
cursor addressing.
The screen is divided into 3 areas.
On the right hand side is the status area.
It shows damage sustained,
charges remaining,
who's in the game,
who's scanning
.Po
the
.Ql \&*
in front of the name
.Pc ,
who's cloaked
.Po
the
.Ql \&+
in front of the name
.Pc ,
and other players' scores.
The rest of the screen is taken up by your map of the maze.
The 24th line
is used for longer messages that don't fit in the status area.
.Pp
.Nm
uses the same keys to move as
.Xr vi 1
does, i.e.,
.Ic h ,
.Ic j ,
.Ic k ,
and
.Ic l
for left, down, up, right, respectively.
To change which direction you're facing in the maze,
use the upper case version of the movement key
.Po
i.e.,
.Ic HJKL
.Pc .
You can only fire or throw things in the direction you're facing.
.Pp
Other commands are:
.Bl -tag -width Ic -compact
.It Ic f No or Ic 1
Fire a bullet
.Pq Takes 1 charge
.It Ic g No or Ic 2
Throw grenade
.Pq Takes 9 charges
.It Ic F No or Ic 3
Throw satchel charge
.Pq Takes 25 charges
.It Ic G No or Ic 4
Throw bomb
.Pq Takes 49 charges
.It Ic 5
Throw big bomb
.Pq Takes 81 charges
.It Ic 6
Throw even bigger bomb
.Pq Takes 121 charges
.It Ic 7
Throw even more big bomb
.Pq Takes 169 charges
.It Ic 8
Throw even more bigger bomb
.Pq Takes 225 charges
.It Ic 9
Throw very big bomb
.Pq Takes 289 charges
.It Ic 0
Throw very, very big bomb
.Pq Takes 361 charges
.It Ic @
Throw biggest bomb
.Pq Takes 441 charges
.It Ic o
Throw small slime
.Pq Takes 5 charges
.It Ic O
Throw big slime
.Pq Takes 10 charges
.It Ic p
Throw bigger slime
.Pq Takes 15 charges
.It Ic P
Throw biggest slime
.Pq Takes 20 charges
.It Ic s
Scan
.Pq show where other players are
.Pq Takes 1 charge
.It Ic c
Cloak
.Pq hide from scanners
.Pq Takes 1 charge
.It Ic ^L
Redraw screen
.It Ic q
Quit
.El
.Pp
The symbols on the screen are:
.Bl -tag -width Ic -compact
.It Li \&- \&| \&+
walls
.It Li \&/ \e
diagonal
.Pq deflecting
walls
.It Li #
doors
.Pq dispersion walls
.It Li \&;
small mine
.It Li g
large mine
.It Li \&:
bullet
.It Li o
grenade
.It Li O
satchel charge
.It Li @
bomb
.It Li s
small slime
.It Li $
big slime
.It Li > < ^ v
you, facing right, left, up, or down
.It Li } { i \&!
other players facing right, left, up, or down
.It \&*
explosion
.It Li \&\e|/
.It Li \&-*-
grenade and large mine explosion
.It Li \&/|\e
.El
.Pp
Other helpful hints:
.Bl -bullet -compact
.It
You can only fire in the direction you are facing.
.It
You can only fire three shots in a row before the gun must cool off.
.It
Shots move 5 times faster than you do.
.It
To stab someone,
you face that player and move at them.
.It
Stabbing does 2 points worth of damage and shooting does 5 points.
.It
Slime does 5 points of damage each time it hits.
.It
You start with 15 charges and get 5 more every time a player enters
or re-enters.
.It
Grenade explosions cover a 3 by 3 area, each larger bomb cover a
correspondingly larger area
.Po
ranging from 5 by 5 to 21 by 21
.Pc .
All explosions are centered around the square the shot hits and
do the most damage in the center.
.It
Slime affects all squares it oozes over.
The number of squares is equal to the number of charges used,
multiplied by
.Va slimefactor
as set by
.Xr huntd 6
.Pq default 3 .
.It
One small mine and one large mine are placed in the maze for every new player.
A mine has a 2% probability of tripping when you walk forward on to it;
50% when going sideways;
95% when backing up.
Tripping a mine costs you 5 points or 10 points, respectively.
Defusing a mine is worth 1 charge or 9 charges, respectively.
.It
You cannot see behind you.
.It
Cloaking consumes 1 ammo charge per 20 of your moves.
.It
Scanning consumes 1 ammo charge per (20 \(mu the number of players)
of other player moves.
.It
Turning on cloaking turns off scanning \(em turning on scanning turns off
cloaking.
.It
When you kill someone,
you get 2 more damage capacity points and 2 damage points get taken away.
.It
Maximum typeahead is 5 characters.
.It
A shot destroys normal
.Pq i.e., non-diagonal, non-door
walls.
.It
Diagonal walls deflect shots and change orientation.
.It
Doors disperse shots in random directions
.Pq up, down, left, right .
.It
Diagonal walls and doors cannot be destroyed by direct shots but may
be destroyed by an adjacent grenade explosion.
.It
Slime goes around walls, not through them.
.It
Walls regenerate, reappearing in the order they were destroyed.
One percent of the regenerated walls will be diagonal walls or doors.
When a wall is generated directly beneath a player, he is thrown in
a random direction for a random period of time.
When he lands, he
sustains damage
.Po
up to 20 percent of the amount of damage already sustained
.Pc ;
i.e.,
the less damage he had, the more nimble he is and
therefore less likely to hurt himself on landing.
.It
Every 30 deaths or so, a
.Ql \&?
will appear.
It is a wandering bomb which will explode when it hits someone, or
when it is slimed.
.It
If no one moves, everything stands still.
But see the
.Va simstep
configuration variable in
.Xr huntd 6
.It
The environment variable
.Ev HUNT
is checked to get the player name.
If you don't have this variable set,
.Nm
will ask you what name you want to play under.
If you wish to set other options than just your name,
you can enumerate the options as follows:
.Dl setenv HUNT "name=Sneaky,team=1,cloak,mapkey=zoFfGg1f2g3F4G"
sets the player name to Sneaky,
sets the team to one,
sets the enter game attribute to cloaked,
and the maps
.Ic z No to Ic o ,
.Ic F No to Ic f ,
.Ic G No to Ic g ,
.Ic 1 No to Ic f ,
.Ic 2 No to Ic g ,
.Ic 3 No to Ic F ,
and
.Ic 4 No to Ic G .
The
.Ic mapkey
option must be last.
Other options are:
.Ic scan , fly , nobeep ,
.Ic port= Ns Ar string ,
.Ic host= Ns Ar string ,
and
.Ic message= Ns Ar string
\(em which correspond to the command line options.
String options cannot contain commas since commas
are used to separate options.
.It
It's a boring game if you're the only one playing.
.El
.Pp
Your score is the decayed average of the ratio of number of kills to number
of times you entered the game and is only kept for the duration
of a single session of
.Nm .
.Sh STATISTICS
The
.Fl S
option fetches the current game statistics.
.Pp
Two groups of statistics are presented: the first group of statistics is
that of the clients currently connected to the game, and is reset each
time the client rejoins, while the second group of statistics is on all
players
.Pq dead or alive
by name, and collected over the lifetime of the
game daemon.
.Pp
The meaning of the column headings are as follows:
.Bl -tag -width No -compact
.It Score
the player's last score
.It Ducked
how many shots a player ducked
.It Absorb
how many shots a player absorbed
.It Faced
how many shots were fired at player's face
.It Shot
how many shots were fired at player
.It Robbed
how many of player's shots were absorbed
.It Missed
how many of player's shots were ducked
.It SlimeK
how many slime kills player had
.It Enemy
how many enemies were killed
.It Friend
how many friends were killed
.Pq self and same team
.It Deaths
how many times player died
.It Still
how many times player died without typing in any commands
.It Saved
how many times a shot/bomb would have killed player if he hadn't
ducked or absorbed it
.It Connect
current connection state(s) of player:
.Sq p
for playing,
.Sq m
for monitoring
.El
.Sh FILES
.Bl -tag -width Pa -compact
.It Pa /usr/games/huntd
game coordinator
.El
.Sh SEE ALSO
.Xr huntd 6
.Sh AUTHORS
Conrad Huang, Ken Arnold, and Greg Couch;
.br
University of California, San Francisco, Computer Graphics Lab
.Sh BUGS
To keep up the pace, not everything is as realistic as possible.
.Pp
The historic behaviour of
.Nm
automatically starting
.Xr huntd 6
is no longer supported.
.Sh ACKNOWLEDGEMENTS
We thank Don Kneller,
John Thomason, Eric Pettersen, Mark Day,
and Scott Weiner for providing
endless hours of play-testing to improve the character of the game.
We hope their significant others will forgive them;
we certainly don't.
|
{
"pile_set_name": "Github"
}
|
:020000023000CC
:10FC000001C0F3C0112484B790E890936100109272
:10FC10006100882369F0982F9A70923049F081FF33
:10FC200002C097EF94BF282E80E002D10C94000010
:10FC300085E08093810082E08093C80088E1809312
:10FC4000C90081E88093CC0086E08093CA008EE0F2
:10FC5000EFD0259A84E02CE33BEF91E030938500D0
:10FC60002093840096BBB09BFECF1D9AA89540912F
:10FC7000C80047FD02C0815089F7CED0813479F4A5
:10FC8000CBD0C82FDBD0C23811F480E004C088E0AC
:10FC9000C13809F083E0B9D080E1B7D0EECF82342B
:10FCA00019F484E1D3D0F8CF853411F485E0FACF8C
:10FCB000853581F4B1D0E82EAFD0F82E87FF07C08C
:10FCC0008BB781608BBFEE0CFF1CB8D0E5CF8BB734
:10FCD0008E7FF8CF863579F49FD08D3451F49CD047
:10FCE000CBB79AD0C170880F8C2B8BBF81E0AED080
:10FCF000CCCF83E0FCCF843609F046C08DD0C82F2E
:10FD0000D0E0DC2FCC2788D0C82B86D0D82E5E013F
:10FD10008EEFB81A00E012E04801EFEF8E1A9E0A4B
:10FD20007BD0F801808384018A149B04A9F786D0D4
:10FD3000F5E410E000E0DF1609F150E040E063E098
:10FD4000C70153D08701C12C92E0D92EF601419111
:10FD500051916F0161E0C80148D00E5F1F4F22979B
:10FD6000A9F750E040E065E0C7013FD095CF608142
:10FD7000C8018E0D9F1D79D00F5F1F4FF801FE5FE8
:10FD8000C017D107A1F788CF843701F545D0C82F18
:10FD9000D0E0DC2FCC2740D0C82B3ED0D82E4ED080
:10FDA0008701F5E4DF120BC0CE0DDF1DC80155D071
:10FDB0002CD00F5F1F4FC017D107C1F76DCFF801CF
:10FDC00087918F0122D02197D1F766CF853739F4FB
:10FDD00035D08EE11AD088E918D082E05CCF813529
:10FDE00009F073CF88E024D070CFFC010A0167BF0F
:10FDF000E895112407B600FCFDCF667029F0452B6D
:10FE000019F481E187BFE89508959091C80095FFA6
:10FE1000FCCF8093CE0008958091C80087FFFCCF6F
:10FE20008091C80084FD01C0A8958091CE000895FE
:10FE3000E0E6F0E098E1908380830895EDDF803282
:10FE400019F088E0F5DFFFCF84E1DFCFCF93C82F33
:10FE5000E3DFC150E9F7CF91F1CFF999FECF92BD21
:10FE600081BDF89A992780B50895262FF999FECF7C
:10FE70001FBA92BD81BD20BD0FB6F894FA9AF99AC7
:06FE80000FBE019608957B
:02FFFE000008F9
:040000033000FC00CD
:00000001FF
|
{
"pile_set_name": "Github"
}
|
damn_JJ
those_DT
trailers_NNS
._.
had_HVD
it_PP
not_XNOT
been_BEN
for_IN
the_DT
advertising_NN
of_IN
this_DT
film_NN
,_,
which_WDT
reveals_VBZ
far_RB
too_RB
much_DT
about_IN
its_PP$
contents_NNS
,_,
i_PP
would_MD
have_HV
been_BEN
glued_VBN
to_IN
`_"
under_IN
the_DT
sand_NN
'_"
._.
as_CS
it_PP
is_BEZ
,_,
the_DT
film_NN
retains_VBZ
some_DT
value_NN
,_,
thanks_NNS
to_IN
an_DT
excellent_JJ
performance_NN
by_IN
charlotte_NP
rampling_VBG
,_,
and_CC
a_DT
more_RBR
mature_JJ
francois_NP
ozon_???
in_CD
the_DT
director_NN
's_POS
chair_NN
._.
marie_NP
(_(
charlotte_NP
rampling_NN
)_)
and_CC
her_PP$
husband_NN
jean_NP
(_(
bruno_???
cremer_DT
)_(
lounge_NN
on_IN
the_DT
beach_NN
._.
she_PP
takes_VBZ
a_DT
nap_NN
while_CS
he_PP
goes_VBZ
for_IN
a_DT
swim_NN
._.
when_CS
marie_NP
wakes_VBZ
up_RP
,_,
jean_NP
is_BEZ
nowhere_RB
to_IN
be_BE
found_VB
._.
she_PP
contacts_NNS
authorities_NNS
,_,
but_CC
they_PP
can't_MD
find_VB
him_PP
either_RB
._.
did_DOD
he_PP
disappear_VB
to_TO
start_VB
a_DT
new_JJ
life_NN
?_?
was_BEDZ
he_PP
killed_VBN
by_IN
accident_NN
?_?
did_DOD
he_PP
commit_VB
suicide_NN
?_?
marie_NP
still_RB
asks_VBZ
herself_PPX
these_DT
questions_NNS
a_DT
year_NN
later_RBR
,_,
and_CC
in_IN
order_NN
to_IN
move_NN
on_IN
with_IN
her_PP$
life_NN
,_,
she_PP
must_MD
find_VB
some_DT
answers_NNS
._.
it_PP
's_BEZ
a_DT
fine_JJ
premise_NN
,_,
and_CC
this_DT
little_JJ
movie_NN
uses_NNS
it_PP
to_TO
the_DT
limit_NN
._.
the_DT
film_NN
moves_VBZ
at_IN
a_DT
leisurely_JJ
pace_NN
,_,
a_DT
bit_NN
slow_JJ
,_,
but_CC
relaxing_JJ
._.
it_PP
's_BEZ
a_DT
very_RB
visual_JJ
story_NN
,_,
and_CC
you_PP
can_MD
pretty_RB
much_RB
just_RB
sit_VB
back_RP
without_IN
reading_NP
the_DT
subtitles_VBZ
._.
this_DT
is_BEZ
mostly_RB
thanks_NNS
to_IN
the_DT
excellent_JJ
camera_NN
work_NN
by_IN
antoine_JJ
heberle_NP
and_CC
jeanne_NP
lapoirie_NP
,_,
who_WP
shot_VBD
the_DT
film_NN
in_IN
a_DT
dreamy_JJ
haze_NN
,_,
and_CC
the_DT
lead_NN
performance_NN
by_IN
rampling_VBG
._.
rampling_VBG
is_BEZ
so_RB
expressive_JJ
in_IN
her_PP$
portrayal_NN
of_IN
marie_NP
,_,
you_PP
connect_VB
with_IN
her_PP$
character_NN
instantly_RB
,_,
despite_IN
that_DT
she_PP
's_BEZ
delusional_JJ
._.
the_DT
scenes_NNS
where_CS
she_PP
interacts_VBZ
with_IN
her_PP$
husband_NN
,_,
who_WP
she_PP
still_RB
believes_VBZ
is_BEZ
alive_JJ
,_,
are_BER
heartbreaking_VBG
._.
she_PP
can't_MD
quite_RB
get_VB
over_IN
him_PP
._.
they've_???
been_BEN
married_JJ
for_IN
twenty-five_CD
years_NNS
._.
the_DT
other_JJ
actors_NNS
,_,
particularly_RB
jacques_NP
nolot_NN
,_,
are_BER
excellent_JJ
too_RB
._.
the_DT
sex_NN
in_IN
the_DT
film_NN
is_BEZ
rather_RB
unneeded_VBN
,_,
but_CC
compared_VBN
to_IN
ozon_???
's_NNS
`_"
criminal_JJ
lovers_NNS
'_"
,_,
it_PP
's_BEZ
the_DT
disney_NP
channel_NN
._.
likely_JJ
to_IN
cause_NN
some_DT
discussion_NN
afterwards_RB
,_,
`_"
under_IN
the_DT
sand_NN
'_"
is_BEZ
a_DT
fine_JJ
movie_NN
going_VBG
experience_NN
._.
while_CS
it_PP
's_BEZ
hard_JJ
to_TO
recommend_VB
as_IN
entertainment_NN
,_,
it_PP
's_BEZ
a_DT
fine_JJ
adult_NN
alternative_NN
about_IN
how_WRB
we_PP
deal_VB
with_IN
loss_NN
._.
ozon_???
seems_VBZ
to_TO
ask_VB
what_WDT
you_PP
would_MD
do_DO
,_,
and_CC
that_CS
's_NNS
certainly_RB
a_DT
hard_JJ
question_NN
to_IN
answer_NN
._.
|
{
"pile_set_name": "Github"
}
|
/*
* /MathJax/jax/output/HTML-CSS/fonts/Latin-Modern/Operators/Regular/Main.js
*
* Copyright (c) 2009-2014 The MathJax Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS.LatinModernMathJax_Operators={directory:"Operators/Regular",family:"LatinModernMathJax_Operators",testString:"\u00A0\u2206\u220A\u220C\u220E\u220F\u2210\u2211\u221F\u222C\u222D\u222E\u222F\u2230\u2231",32:[0,0,332,0,0],160:[0,0,332,0,0],8710:[716,0,833,47,785],8714:[443,-57,498,56,442],8716:[730,230,667,80,587],8718:[554,0,666,56,610],8719:[750,250,944,56,887],8720:[750,250,944,56,887],8721:[750,250,1056,56,999],8735:[679,-13,778,56,722],8748:[805,306,1035,56,979],8749:[805,306,1405,56,1349],8750:[805,306,665,56,609],8751:[805,306,1035,56,979],8752:[805,306,1405,56,1349],8753:[805,306,695,56,667],8754:[805,306,700,56,672],8755:[805,306,682,56,644],8758:[422,-78,278,86,192],8759:[422,-78,516,86,430],8760:[504,-230,778,56,722],8761:[422,-78,906,56,850],8762:[504,4,778,56,722],8763:[536,36,773,56,717],8766:[466,-34,901,56,845],8767:[492,-8,778,56,722],8772:[603,103,778,56,722],8775:[603,103,778,56,722],8777:[603,103,773,56,717],8779:[541,41,773,56,717],8780:[541,-36,778,56,722],8788:[422,-78,906,56,850],8789:[422,-78,906,56,850],8792:[619,-133,778,56,722],8793:[752,-133,778,56,722],8794:[752,-133,778,56,722],8795:[810,-133,778,56,722],8797:[793,-133,778,56,722],8798:[684,-133,778,56,722],8799:[803,-133,778,56,722],8802:[730,230,778,56,722],8803:[561,61,778,56,722],8813:[730,230,778,56,722],8820:[691,191,776,55,719],8821:[691,191,776,55,719],8824:[776,276,778,76,701],8825:[776,276,778,76,701],8836:[730,230,778,85,693],8837:[730,230,778,85,693],8844:[604,20,667,61,607],8845:[604,20,667,61,607],8860:[592,92,796,56,740],8870:[684,0,445,56,389],8871:[684,0,445,56,389],8875:[684,0,653,56,597],8886:[400,-100,1078,56,1022],8887:[400,-100,1078,56,1022],8889:[603,103,818,56,762],8893:[684,17,642,55,585],8894:[679,109,900,56,844],8895:[679,-13,778,56,722],8896:[780,264,833,51,781],8897:[764,280,833,51,781],8898:[772,250,833,50,784],8899:[750,272,833,50,784],8903:[586,86,802,56,745],8917:[750,250,778,56,722],8924:[631,119,778,76,702],8925:[631,119,778,76,702],8930:[730,230,778,76,702],8931:[730,230,778,76,702],8932:[627,211,778,76,702],8933:[627,211,778,76,702],8944:[500,0,613,56,556],10752:[743,243,1111,63,1049],10753:[743,243,1111,63,1049],10754:[743,243,1111,63,1049],10755:[750,272,833,50,784],10756:[750,272,833,50,784],10757:[764,264,833,50,784],10758:[764,264,833,50,784],10761:[740,240,1092,55,1036],10764:[805,306,1775,56,1719],10769:[805,306,695,56,667],10799:[496,-3,778,142,636]};MathJax.Callback.Queue(["initFont",MathJax.OutputJax["HTML-CSS"],"LatinModernMathJax_Operators"],["loadComplete",MathJax.Ajax,MathJax.OutputJax["HTML-CSS"].fontDir+"/Operators/Regular/Main.js"]);
|
{
"pile_set_name": "Github"
}
|
:020000021000EC
:10FC000001C0F2C0112484B790E890936100109273
:10FC10006100882369F0982F9A70923049F081FF33
:10FC200002C097EF94BF282E80E001D10C94000011
:10FC300085E08093810082E08093C80088E1809312
:10FC4000C90087E78093CC0086E08093CA008EE0ED
:10FC5000EED0209A84E02BE93BEF91E030938500D1
:10FC60002093840096BBB09BFECF189AA895409134
:10FC7000C80047FD02C0815089F7CDD0813479F4A6
:10FC8000CAD0C82FDAD0C23811F480E004C088E0AE
:10FC9000C13809F083E0B8D080E1B6D0EECF82342D
:10FCA00019F484E1D2D0F8CF853411F485E0FACF8D
:10FCB000853581F4B0D0E82EAED0F82E87FF07C08E
:10FCC0008BB781608BBFEE0CFF1CB7D0E5CF8BB735
:10FCD0008E7FF8CF863579F49ED08D3451F49BD049
:10FCE000CBB799D0C170880F8C2B8BBF81E0ADD082
:10FCF000CCCF83E0FCCF843609F045C08CD0C82F30
:10FD0000D0E0DC2FCC2787D0C82B85D0D82E5E0141
:10FD1000B39400E011E04801EFEF8E1A9E0A7BD009
:10FD2000F801808384018A149B04A9F786D0F5E446
:10FD300010E000E0DF1609F150E040E063E0C701A9
:10FD400053D08701C12CDD24D394F6014191519108
:10FD50006F0161E0C80148D00E5F1F4F2297A9F7DD
:10FD600050E040E065E0C7013FD096CF6081C80118
:10FD70008E0D9F1D79D00F5F1F4FF801F395C017AF
:10FD8000D107A1F789CF843701F545D0C82FD0E03E
:10FD9000DC2FCC2740D0C82B3ED0D82E4ED08701A8
:10FDA000F5E4DF120BC0CE0DDF1DC80155D02CD0FD
:10FDB0000F5F1F4FC017D107C1F76ECFF8018791B2
:10FDC0008F0122D02197D1F767CF853739F435D00D
:10FDD0008EE11AD087E918D086E05DCF813509F031
:10FDE00074CF88E024D071CFFC010A0167BFE89589
:10FDF000112407B600FCFDCF667029F0452B19F4DD
:10FE000081E187BFE89508959091C80095FFFCCFE8
:10FE10008093CE0008958091C80087FFFCCF809129
:10FE2000C80084FD01C0A8958091CE000895E0E649
:10FE3000F0E098E1908380830895EDDF803219F03F
:10FE400088E0F5DFFFCF84E1DFCFCF93C82FE3DF7A
:10FE5000C150E9F7CF91F1CFF999FECF92BD81BDA5
:10FE6000F89A992780B50895262FF999FECF1FBAE1
:10FE700092BD81BD20BD0FB6F894FA9AF99A0FBED3
:04FE8000019608954A
:02FFFE000008F9
:040000031000FC00ED
:00000001FF
|
{
"pile_set_name": "Github"
}
|
/* linux/drivers/media/video/samsung/tvout/s5p_tvout_v4l2.c
*
* Copyright (c) 2009 Samsung Electronics
* http://www.samsung.com/
*
* V4L2 API file for Samsung TVOOUT driver
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/version.h>
#include <linux/slab.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <linux/videodev2_samsung.h>
#include "s5p_tvout_common_lib.h"
#include "s5p_tvout_ctrl.h"
#include "s5p_tvout_v4l2.h"
#if defined(CONFIG_S5P_SYSMMU_TV)
#include <plat/sysmmu.h>
#endif
#include <plat/cpu.h>
#ifdef CONFIG_UMP_VCM_ALLOC
#include "ump_kernel_interface.h"
#endif
#ifdef CONFIG_VCM
#include <plat/s5p-vcm.h>
#endif
#define MAJOR_VERSION 0
#define MINOR_VERSION 3
#define RELEASE_VERSION 0
#if defined(CONFIG_S5P_SYSMMU_TV)
#ifdef CONFIG_S5P_VMEM
/* temporary used for testing system mmu */
extern void *s5p_getaddress(unsigned int cookie);
#endif
#endif
#define V4L2_STD_ALL_HD ((v4l2_std_id)0xffffffff)
#define S5P_E4210_TVOUT_TVIF_MINOR 14
#define S5P_E4210_TVOUT_VO_MINOR 21
#define S5P_E4X12_TVOUT_TVIF_MINOR 16
#define S5P_E4X12_TVOUT_VO_MINOR 20
#define V4L2_OUTPUT_TYPE_COMPOSITE 5
#define V4L2_OUTPUT_TYPE_HDMI 10
#define V4L2_OUTPUT_TYPE_HDMI_RGB 11
#define V4L2_OUTPUT_TYPE_DVI 12
#define V4L2_STD_PAL_BDGHI (V4L2_STD_PAL_B|\
V4L2_STD_PAL_D| \
V4L2_STD_PAL_G| \
V4L2_STD_PAL_H| \
V4L2_STD_PAL_I)
#define V4L2_STD_480P_60_16_9 ((v4l2_std_id)0x04000000)
#define V4L2_STD_480P_60_4_3 ((v4l2_std_id)0x05000000)
#define V4L2_STD_576P_50_16_9 ((v4l2_std_id)0x06000000)
#define V4L2_STD_576P_50_4_3 ((v4l2_std_id)0x07000000)
#define V4L2_STD_720P_60 ((v4l2_std_id)0x08000000)
#define V4L2_STD_720P_50 ((v4l2_std_id)0x09000000)
#define V4L2_STD_1080P_60 ((v4l2_std_id)0x0a000000)
#define V4L2_STD_1080P_50 ((v4l2_std_id)0x0b000000)
#define V4L2_STD_1080I_60 ((v4l2_std_id)0x0c000000)
#define V4L2_STD_1080I_50 ((v4l2_std_id)0x0d000000)
#define V4L2_STD_480P_59 ((v4l2_std_id)0x0e000000)
#define V4L2_STD_720P_59 ((v4l2_std_id)0x0f000000)
#define V4L2_STD_1080I_59 ((v4l2_std_id)0x10000000)
#define V4L2_STD_1080P_59 ((v4l2_std_id)0x11000000)
#define V4L2_STD_1080P_30 ((v4l2_std_id)0x12000000)
#define V4L2_STD_1080P_24 ((v4l2_std_id)0x18000000)
#ifdef CONFIG_HDMI_14A_3D
#define V4L2_STD_TVOUT_720P_60_SBS_HALF ((v4l2_std_id)0x13000000)
#define V4L2_STD_TVOUT_720P_59_SBS_HALF ((v4l2_std_id)0x14000000)
#define V4L2_STD_TVOUT_720P_50_TB ((v4l2_std_id)0x15000000)
#define V4L2_STD_TVOUT_1080P_24_TB ((v4l2_std_id)0x16000000)
#define V4L2_STD_TVOUT_1080P_23_TB ((v4l2_std_id)0x17000000)
#endif
#define CVBS_S_VIDEO (V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_JP| \
V4L2_STD_PAL | V4L2_STD_PAL_M | V4L2_STD_PAL_N | V4L2_STD_PAL_Nc | \
V4L2_STD_PAL_60 | V4L2_STD_NTSC_443)
struct v4l2_vid_overlay_src {
void *base_y;
void *base_c;
struct v4l2_pix_format pix_fmt;
};
static const struct v4l2_output s5p_tvout_tvif_output[] = {
{
.index = 0,
.name = "Analog COMPOSITE",
.type = V4L2_OUTPUT_TYPE_COMPOSITE,
.audioset = 0,
.modulator = 0,
.std = CVBS_S_VIDEO,
}, {
.index = 1,
.name = "Digital HDMI(YCbCr)",
.type = V4L2_OUTPUT_TYPE_HDMI,
.audioset = 2,
.modulator = 0,
.std = V4L2_STD_480P_60_16_9 |
V4L2_STD_480P_60_16_9 | V4L2_STD_720P_60 |
V4L2_STD_720P_50
| V4L2_STD_1080P_60 | V4L2_STD_1080P_50 |
V4L2_STD_1080I_60 | V4L2_STD_1080I_50 |
V4L2_STD_480P_59 | V4L2_STD_720P_59 |
V4L2_STD_1080I_59 | V4L2_STD_1080P_59 |
V4L2_STD_1080P_30 | V4L2_STD_1080P_24,
}, {
.index = 2,
.name = "Digital HDMI(RGB)",
.type = V4L2_OUTPUT_TYPE_HDMI_RGB,
.audioset = 2,
.modulator = 0,
.std = V4L2_STD_480P_60_16_9 |
V4L2_STD_480P_60_16_9 |
V4L2_STD_720P_60 | V4L2_STD_720P_50
| V4L2_STD_1080P_60 | V4L2_STD_1080P_50 |
V4L2_STD_1080I_60 | V4L2_STD_1080I_50 |
V4L2_STD_480P_59 | V4L2_STD_720P_59 |
V4L2_STD_1080I_59 | V4L2_STD_1080P_59 |
V4L2_STD_1080P_30 | V4L2_STD_1080P_24,
}, {
.index = 3,
.name = "Digital DVI",
.type = V4L2_OUTPUT_TYPE_DVI,
.audioset = 2,
.modulator = 0,
.std = V4L2_STD_480P_60_16_9 |
V4L2_STD_480P_60_16_9 |
V4L2_STD_720P_60 | V4L2_STD_720P_50
| V4L2_STD_1080P_60 | V4L2_STD_1080P_50 |
V4L2_STD_1080I_60 | V4L2_STD_1080I_50 |
V4L2_STD_480P_59 | V4L2_STD_720P_59 |
V4L2_STD_1080I_59 | V4L2_STD_1080P_59 |
V4L2_STD_1080P_30 | V4L2_STD_1080P_24,
}
};
#define S5P_TVOUT_TVIF_NO_OF_OUTPUT ARRAY_SIZE(s5p_tvout_tvif_output)
static const struct v4l2_standard s5p_tvout_tvif_standard[] = {
{
.index = 0,
.id = V4L2_STD_NTSC_M,
.name = "NTSC_M",
}, {
.index = 1,
.id = V4L2_STD_PAL_BDGHI,
.name = "PAL_BDGHI",
}, {
.index = 2,
.id = V4L2_STD_PAL_M,
.name = "PAL_M",
}, {
.index = 3,
.id = V4L2_STD_PAL_N,
.name = "PAL_N",
}, {
.index = 4,
.id = V4L2_STD_PAL_Nc,
.name = "PAL_Nc",
}, {
.index = 5,
.id = V4L2_STD_PAL_60,
.name = "PAL_60",
}, {
.index = 6,
.id = V4L2_STD_NTSC_443,
.name = "NTSC_443",
}, {
.index = 7,
.id = V4L2_STD_480P_60_16_9,
.name = "480P_60_16_9",
}, {
.index = 8,
.id = V4L2_STD_480P_60_4_3,
.name = "480P_60_4_3",
}, {
.index = 9,
.id = V4L2_STD_576P_50_16_9,
.name = "576P_50_16_9",
}, {
.index = 10,
.id = V4L2_STD_576P_50_4_3,
.name = "576P_50_4_3",
}, {
.index = 11,
.id = V4L2_STD_720P_60,
.name = "720P_60",
}, {
.index = 12,
.id = V4L2_STD_720P_50,
.name = "720P_50",
}, {
.index = 13,
.id = V4L2_STD_1080P_60,
.name = "1080P_60",
}, {
.index = 14,
.id = V4L2_STD_1080P_50,
.name = "1080P_50",
}, {
.index = 15,
.id = V4L2_STD_1080I_60,
.name = "1080I_60",
}, {
.index = 16,
.id = V4L2_STD_1080I_50,
.name = "1080I_50",
}, {
.index = 17,
.id = V4L2_STD_480P_59,
.name = "480P_59",
}, {
.index = 18,
.id = V4L2_STD_720P_59,
.name = "720P_59",
}, {
.index = 19,
.id = V4L2_STD_1080I_59,
.name = "1080I_59",
}, {
.index = 20,
.id = V4L2_STD_1080P_59,
.name = "1080I_50",
}, {
.index = 21,
.id = V4L2_STD_1080P_30,
.name = "1080I_30",
},
#ifdef CONFIG_HDMI_14A_3D
{
.index = 22,
.id = V4L2_STD_TVOUT_720P_60_SBS_HALF,
.name = "720P_60_SBS_HALF",
},
{
.index = 23,
.id = V4L2_STD_TVOUT_720P_59_SBS_HALF,
.name = "720P_59_SBS_HALF",
},
{
.index = 24,
.id = V4L2_STD_TVOUT_720P_50_TB,
.name = "720P_50_TB",
},
{
.index = 25,
.id = V4L2_STD_TVOUT_1080P_24_TB,
.name = "1080P_24_TB",
},
{
.index = 26,
.id = V4L2_STD_TVOUT_1080P_23_TB,
.name = "1080P_23_TB",
},
#endif
{
.index = 27,
.id = V4L2_STD_1080P_24,
.name = "1080I_24",
},
};
#define S5P_TVOUT_TVIF_NO_OF_STANDARD ARRAY_SIZE(s5p_tvout_tvif_standard)
static const struct v4l2_fmtdesc s5p_tvout_vo_fmt_desc[] = {
{
.index = 0,
.type = V4L2_BUF_TYPE_PRIVATE,
.pixelformat = V4L2_PIX_FMT_NV12,
.description = "NV12 (Linear YUV420 2 Planes)",
}, {
.index = 1,
.type = V4L2_BUF_TYPE_PRIVATE,
.pixelformat = V4L2_PIX_FMT_NV12T,
.description = "NV12T (Tiled YUV420 2 Planes)",
},
/* This block will be used on EXYNOS4210 */
{
.index = 2,
.type = V4L2_BUF_TYPE_PRIVATE,
.pixelformat = V4L2_PIX_FMT_NV21,
.description = "NV21 (Linear YUV420 2 Planes)",
}, {
.index = 3,
.type = V4L2_BUF_TYPE_PRIVATE,
.pixelformat = V4L2_PIX_FMT_NV21T,
.description = "NV21T (Tiled YUV420 2 Planes)",
},
};
static DEFINE_MUTEX(s5p_tvout_tvif_mutex);
static DEFINE_MUTEX(s5p_tvout_vo_mutex);
struct s5p_tvout_v4l2_private_data {
struct v4l2_vid_overlay_src vo_src_fmt;
struct v4l2_rect vo_src_rect;
struct v4l2_window vo_dst_fmt;
struct v4l2_framebuffer vo_dst_plane;
int tvif_output_index;
v4l2_std_id tvif_standard_id;
atomic_t tvif_use;
atomic_t vo_use;
};
static struct s5p_tvout_v4l2_private_data s5p_tvout_v4l2_private = {
.tvif_output_index = -1,
.tvif_standard_id = 0,
.tvif_use = ATOMIC_INIT(0),
.vo_use = ATOMIC_INIT(0),
};
static void s5p_tvout_v4l2_init_private(void)
{
}
static int s5p_tvout_tvif_querycap(
struct file *file, void *fh, struct v4l2_capability *cap)
{
strcpy(cap->driver, "s5p-tvout-tvif");
strcpy(cap->card, "Samsung TVOUT TV Interface");
cap->capabilities = V4L2_CAP_VIDEO_OUTPUT;
cap->version = KERNEL_VERSION(
MAJOR_VERSION, MINOR_VERSION, RELEASE_VERSION);
return 0;
}
static int s5p_tvout_tvif_g_std(
struct file *file, void *fh, v4l2_std_id *norm)
{
if (s5p_tvout_v4l2_private.tvif_standard_id == 0) {
tvout_err("Standard has not set\n");
return -1;
}
*norm = s5p_tvout_v4l2_private.tvif_standard_id;
return 0;
}
static int s5p_tvout_tvif_s_std(
struct file *file, void *fh, v4l2_std_id *norm)
{
int i;
v4l2_std_id std_id = *norm;
#ifdef CONFIG_HAS_EARLYSUSPEND
s5p_tvout_mutex_lock();
#endif
for (i = 0; i < S5P_TVOUT_TVIF_NO_OF_STANDARD; i++) {
if (s5p_tvout_tvif_standard[i].id == std_id)
break;
}
if (i == S5P_TVOUT_TVIF_NO_OF_STANDARD) {
tvout_err("There is no TV standard(0x%08Lx)\n", std_id);
return -EINVAL;
}
s5p_tvout_v4l2_private.tvif_standard_id = std_id;
tvout_dbg("standard id=0x%X, name=\"%s\"\n",
(u32) std_id, s5p_tvout_tvif_standard[i].name);
#ifdef CONFIG_HAS_EARLYSUSPEND
s5p_tvout_mutex_unlock();
#endif
return 0;
}
static int s5p_tvout_tvif_enum_output(
struct file *file, void *fh, struct v4l2_output *a)
{
unsigned int index = a->index;
if (index >= S5P_TVOUT_TVIF_NO_OF_OUTPUT) {
tvout_err("Invalid index(%d)\n", index);
return -EINVAL;
}
memcpy(a, &s5p_tvout_tvif_output[index], sizeof(struct v4l2_output));
return 0;
}
static int s5p_tvout_tvif_g_output(
struct file *file, void *fh, unsigned int *i)
{
if (s5p_tvout_v4l2_private.tvif_output_index == -1) {
tvout_err("Output has not set\n");
return -EINVAL;
}
*i = s5p_tvout_v4l2_private.tvif_output_index;
return 0;
}
static int s5p_tvout_tvif_s_output(
struct file *file, void *fh, unsigned int i)
{
enum s5p_tvout_disp_mode tv_std;
enum s5p_tvout_o_mode tv_if;
if (i >= S5P_TVOUT_TVIF_NO_OF_OUTPUT) {
tvout_err("Invalid index(%d)\n", i);
return -EINVAL;
}
#ifdef CONFIG_HAS_EARLYSUSPEND
s5p_tvout_mutex_lock();
#endif
on_start_process = true;
s5p_tvout_v4l2_private.tvif_output_index = i;
tvout_dbg("output id=%d, name=\"%s\"\n",
(int) i, s5p_tvout_tvif_output[i].name);
switch (s5p_tvout_tvif_output[i].type) {
case V4L2_OUTPUT_TYPE_COMPOSITE:
tv_if = TVOUT_COMPOSITE;
break;
case V4L2_OUTPUT_TYPE_HDMI:
tv_if = TVOUT_HDMI;
break;
case V4L2_OUTPUT_TYPE_HDMI_RGB:
tv_if = TVOUT_HDMI_RGB;
break;
case V4L2_OUTPUT_TYPE_DVI:
tv_if = TVOUT_DVI;
break;
default:
tvout_err("Invalid output type(%d)\n",
s5p_tvout_tvif_output[i].type);
goto error_on_tvif_s_output;
}
switch (s5p_tvout_v4l2_private.tvif_standard_id) {
case V4L2_STD_NTSC_M:
tv_std = TVOUT_NTSC_M;
break;
case V4L2_STD_PAL_BDGHI:
tv_std = TVOUT_PAL_BDGHI;
break;
case V4L2_STD_PAL_M:
tv_std = TVOUT_PAL_M;
break;
case V4L2_STD_PAL_N:
tv_std = TVOUT_PAL_N;
break;
case V4L2_STD_PAL_Nc:
tv_std = TVOUT_PAL_NC;
break;
case V4L2_STD_PAL_60:
tv_std = TVOUT_PAL_60;
break;
case V4L2_STD_NTSC_443:
tv_std = TVOUT_NTSC_443;
break;
case V4L2_STD_480P_60_16_9:
tv_std = TVOUT_480P_60_16_9;
break;
case V4L2_STD_480P_60_4_3:
tv_std = TVOUT_480P_60_4_3;
break;
case V4L2_STD_480P_59:
tv_std = TVOUT_480P_59;
break;
case V4L2_STD_576P_50_16_9:
tv_std = TVOUT_576P_50_16_9;
break;
case V4L2_STD_576P_50_4_3:
tv_std = TVOUT_576P_50_4_3;
break;
case V4L2_STD_720P_60:
tv_std = TVOUT_720P_60;
break;
case V4L2_STD_720P_59:
tv_std = TVOUT_720P_59;
break;
case V4L2_STD_720P_50:
tv_std = TVOUT_720P_50;
break;
case V4L2_STD_1080I_60:
tv_std = TVOUT_1080I_60;
break;
case V4L2_STD_1080I_59:
tv_std = TVOUT_1080I_59;
break;
case V4L2_STD_1080I_50:
tv_std = TVOUT_1080I_50;
break;
case V4L2_STD_1080P_30:
tv_std = TVOUT_1080P_30;
break;
case V4L2_STD_1080P_24:
tv_std = TVOUT_1080P_24;
break;
case V4L2_STD_1080P_60:
tv_std = TVOUT_1080P_60;
break;
case V4L2_STD_1080P_59:
tv_std = TVOUT_1080P_59;
break;
case V4L2_STD_1080P_50:
tv_std = TVOUT_1080P_50;
break;
#ifdef CONFIG_HDMI_14A_3D
case V4L2_STD_TVOUT_720P_60_SBS_HALF:
tv_std = TVOUT_720P_60_SBS_HALF;
break;
case V4L2_STD_TVOUT_720P_59_SBS_HALF:
tv_std = TVOUT_720P_59_SBS_HALF;
break;
case V4L2_STD_TVOUT_720P_50_TB:
tv_std = TVOUT_720P_50_TB;
break;
case V4L2_STD_TVOUT_1080P_24_TB:
tv_std = TVOUT_1080P_24_TB;
break;
case V4L2_STD_TVOUT_1080P_23_TB:
tv_std = TVOUT_1080P_23_TB;
break;
#endif
default:
tvout_err("Invalid standard id(0x%08Lx)\n",
s5p_tvout_v4l2_private.tvif_standard_id);
goto error_on_tvif_s_output;
}
s5p_tvif_ctrl_start(tv_std, tv_if);
#ifdef CONFIG_HAS_EARLYSUSPEND
s5p_tvout_mutex_unlock();
#endif
return 0;
error_on_tvif_s_output:
#ifdef CONFIG_HAS_EARLYSUSPEND
s5p_tvout_mutex_unlock();
#endif
return -1;
};
static int s5p_tvout_tvif_cropcap(
struct file *file, void *fh, struct v4l2_cropcap *a)
{
enum s5p_tvout_disp_mode std;
enum s5p_tvout_o_mode inf;
struct v4l2_cropcap *cropcap = a;
if (cropcap->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) {
tvout_err("Invalid buf type(%d)\n", cropcap->type);
return -EINVAL;
}
/* below part will be modified and moved to tvif ctrl class */
s5p_tvif_ctrl_get_std_if(&std, &inf);
switch (std) {
case TVOUT_NTSC_M:
case TVOUT_NTSC_443:
case TVOUT_480P_60_16_9:
case TVOUT_480P_60_4_3:
case TVOUT_480P_59:
cropcap->bounds.top = 0;
cropcap->bounds.left = 0;
cropcap->bounds.width = 720;
cropcap->bounds.height = 480;
cropcap->defrect.top = 0;
cropcap->defrect.left = 0;
cropcap->defrect.width = 720;
cropcap->defrect.height = 480;
break;
case TVOUT_PAL_M:
case TVOUT_PAL_BDGHI:
case TVOUT_PAL_N:
case TVOUT_PAL_NC:
case TVOUT_PAL_60:
case TVOUT_576P_50_16_9:
case TVOUT_576P_50_4_3:
cropcap->bounds.top = 0;
cropcap->bounds.left = 0;
cropcap->bounds.width = 720;
cropcap->bounds.height = 576;
cropcap->defrect.top = 0;
cropcap->defrect.left = 0;
cropcap->defrect.width = 720;
cropcap->defrect.height = 576;
break;
case TVOUT_720P_60:
case TVOUT_720P_59:
case TVOUT_720P_50:
cropcap->bounds.top = 0;
cropcap->bounds.left = 0;
cropcap->bounds.width = 1280;
cropcap->bounds.height = 720;
cropcap->defrect.top = 0;
cropcap->defrect.left = 0;
cropcap->defrect.width = 1280;
cropcap->defrect.height = 720;
break;
case TVOUT_1080I_60:
case TVOUT_1080I_59:
case TVOUT_1080I_50:
case TVOUT_1080P_60:
case TVOUT_1080P_59:
case TVOUT_1080P_50:
case TVOUT_1080P_30:
case TVOUT_1080P_24:
cropcap->bounds.top = 0;
cropcap->bounds.left = 0;
cropcap->bounds.width = 1920;
cropcap->bounds.height = 1080;
cropcap->defrect.top = 0;
cropcap->defrect.left = 0;
cropcap->defrect.width = 1920;
cropcap->defrect.height = 1080;
break;
#ifdef CONFIG_HDMI_14A_3D
case TVOUT_720P_60_SBS_HALF:
case TVOUT_720P_59_SBS_HALF:
case TVOUT_720P_50_TB:
cropcap->bounds.top = 0;
cropcap->bounds.left = 0;
cropcap->bounds.width = 1280;
cropcap->bounds.height = 720;
cropcap->defrect.top = 0;
cropcap->defrect.left = 0;
cropcap->defrect.width = 1280;
cropcap->defrect.height = 720;
break;
case TVOUT_1080P_24_TB:
case TVOUT_1080P_23_TB:
cropcap->bounds.top = 0;
cropcap->bounds.left = 0;
cropcap->bounds.width = 1920;
cropcap->bounds.height = 1080;
cropcap->defrect.top = 0;
cropcap->defrect.left = 0;
cropcap->defrect.width = 1920;
cropcap->defrect.height = 1080;
break;
#endif
default:
return -EINVAL;
}
return 0;
}
const struct v4l2_ioctl_ops s5p_tvout_tvif_ioctl_ops = {
.vidioc_querycap = s5p_tvout_tvif_querycap,
.vidioc_g_std = s5p_tvout_tvif_g_std,
.vidioc_s_std = s5p_tvout_tvif_s_std,
.vidioc_enum_output = s5p_tvout_tvif_enum_output,
.vidioc_g_output = s5p_tvout_tvif_g_output,
.vidioc_s_output = s5p_tvout_tvif_s_output,
.vidioc_cropcap = s5p_tvout_tvif_cropcap,
};
#define VIDIOC_HDCP_ENABLE _IOWR('V', 100, unsigned int)
#define VIDIOC_HDCP_STATUS _IOR('V', 101, unsigned int)
#define VIDIOC_HDCP_PROT_STATUS _IOR('V', 102, unsigned int)
#define VIDIOC_INIT_AUDIO _IOR('V', 103, unsigned int)
#define VIDIOC_AV_MUTE _IOR('V', 104, unsigned int)
#define VIDIOC_G_AVMUTE _IOR('V', 105, unsigned int)
#define VIDIOC_S_AUDIO_CHANNEL _IOR('V', 106, unsigned int)
long s5p_tvout_tvif_ioctl(
struct file *file, unsigned int cmd, unsigned long arg)
{
int ret = 0;
#ifdef CONFIG_HAS_EARLYSUSPEND
s5p_tvout_mutex_lock();
#endif
tvout_dbg("\n");
switch (cmd) {
case VIDIOC_INIT_AUDIO:
/* s5ptv_status.hdmi.audio = (unsigned int) arg; */
if (arg)
ret = s5p_tvif_ctrl_set_audio(true);
else
ret = s5p_tvif_ctrl_set_audio(false);
tvout_dbg("VIDIOC_INIT_AUDIO(%d), Ret : %d\n", (int) arg,
ret);
goto end_tvif_ioctl;
case VIDIOC_AV_MUTE:
tvout_dbg("VIDIOC_AV_MUTE(%d)\n", (int) arg);
if (arg)
s5p_tvif_ctrl_set_av_mute(true);
else
s5p_tvif_ctrl_set_av_mute(false);
goto end_tvif_ioctl;
case VIDIOC_G_AVMUTE:
s5p_hdmi_ctrl_get_mute();
goto end_tvif_ioctl;
case VIDIOC_HDCP_ENABLE:
tvout_dbg("VIDIOC_HDCP_ENABLE(%d)\n", (int) arg);
/* s5ptv_status.hdmi.hdcp_en = (unsigned int) arg; */
s5p_hdmi_ctrl_set_hdcp((bool) arg);
goto end_tvif_ioctl;
case VIDIOC_HDCP_STATUS: {
unsigned int *status = (unsigned int *)&arg;
*status = 1;
goto end_tvif_ioctl;
}
case VIDIOC_HDCP_PROT_STATUS: {
unsigned int *prot = (unsigned int *)&arg;
*prot = 1;
goto end_tvif_ioctl;
}
case VIDIOC_ENUMSTD: {
struct v4l2_standard *p = (struct v4l2_standard *)arg;
if (p->index >= S5P_TVOUT_TVIF_NO_OF_STANDARD) {
tvout_dbg("VIDIOC_ENUMSTD: Invalid index(%d)\n",
p->index);
ret = -EINVAL;
goto end_tvif_ioctl;
}
memcpy(p, &s5p_tvout_tvif_standard[p->index],
sizeof(struct v4l2_standard));
goto end_tvif_ioctl;
}
case VIDIOC_S_AUDIO_CHANNEL: {
if (!arg)
s5p_tvif_audio_channel(TVOUT_AUDIO_2CH_VAL);
else
s5p_tvif_audio_channel(TVOUT_AUDIO_5_1CH_VAL);
/* TODO Runtime change
s5p_tvif_ctrl_stop();
if (s5p_tvif_ctrl_start(TVOUT_720P_60, TVOUT_HDMI) < 0)
goto end_tvif_ioctl; */
break;
}
default:
break;
}
#ifdef CONFIG_HAS_EARLYSUSPEND
s5p_tvout_mutex_unlock();
#endif
return video_ioctl2(file, cmd, arg);
end_tvif_ioctl:
#ifdef CONFIG_HAS_EARLYSUSPEND
s5p_tvout_mutex_unlock();
#endif
return ret;
}
static int s5p_tvout_tvif_open(struct file *file)
{
mutex_lock(&s5p_tvout_tvif_mutex);
atomic_inc(&s5p_tvout_v4l2_private.tvif_use);
mutex_unlock(&s5p_tvout_tvif_mutex);
tvout_dbg("count=%d\n", atomic_read(&s5p_tvout_v4l2_private.tvif_use));
return 0;
}
static int s5p_tvout_tvif_release(struct file *file)
{
tvout_dbg("count=%d\n", atomic_read(&s5p_tvout_v4l2_private.tvif_use));
mutex_lock(&s5p_tvout_tvif_mutex);
on_start_process = false;
on_stop_process = true;
tvout_dbg("on_stop_process(%d)\n", on_stop_process);
atomic_dec(&s5p_tvout_v4l2_private.tvif_use);
if (atomic_read(&s5p_tvout_v4l2_private.tvif_use) == 0)
s5p_tvif_ctrl_stop();
on_stop_process = false;
tvout_dbg("on_stop_process(%d)\n", on_stop_process);
mutex_unlock(&s5p_tvout_tvif_mutex);
return 0;
}
static struct v4l2_file_operations s5p_tvout_tvif_fops = {
.owner = THIS_MODULE,
.open = s5p_tvout_tvif_open,
.release = s5p_tvout_tvif_release,
.unlocked_ioctl = s5p_tvout_tvif_ioctl
};
static int s5p_tvout_vo_querycap(
struct file *file, void *fh, struct v4l2_capability *cap)
{
strcpy(cap->driver, "s5p-tvout-vo");
strcpy(cap->card, "Samsung TVOUT Video Overlay");
cap->capabilities = V4L2_CAP_VIDEO_OVERLAY;
cap->version = KERNEL_VERSION(
MAJOR_VERSION, MINOR_VERSION, RELEASE_VERSION);
return 0;
}
static int s5p_tvout_vo_enum_fmt_type_private(
struct file *file, void *fh, struct v4l2_fmtdesc *f)
{
int index = f->index;
if (index >= ARRAY_SIZE(s5p_tvout_vo_fmt_desc)) {
tvout_err("Invalid index(%d)\n", index);
return -EINVAL;
}
memcpy(f, &s5p_tvout_vo_fmt_desc[index], sizeof(struct v4l2_fmtdesc));
return 0;
}
static int s5p_tvout_vo_g_fmt_type_private(
struct file *file, void *fh, struct v4l2_format *a)
{
memcpy(a->fmt.raw_data, &s5p_tvout_v4l2_private.vo_src_fmt,
sizeof(struct v4l2_vid_overlay_src));
return 0;
}
static int s5p_tvout_vo_s_fmt_type_private(
struct file *file, void *fh, struct v4l2_format *a)
{
struct v4l2_vid_overlay_src vparam;
struct v4l2_pix_format *pix_fmt;
enum s5p_vp_src_color color;
enum s5p_vp_field field;
#if defined(CONFIG_S5P_SYSMMU_TV)
unsigned long base_y, base_c;
#endif
memcpy(&vparam, a->fmt.raw_data, sizeof(struct v4l2_vid_overlay_src));
pix_fmt = &vparam.pix_fmt;
tvout_dbg("base_y=0x%X, base_c=0x%X, field=%d\n",
(u32) vparam.base_y, (u32) vparam.base_c,
pix_fmt->field);
#ifdef CONFIG_HAS_EARLYSUSPEND
s5p_tvout_mutex_lock();
#endif
/* check progressive or not */
if (pix_fmt->field == V4L2_FIELD_NONE) {
/* progressive */
switch (pix_fmt->pixelformat) {
case V4L2_PIX_FMT_NV12:
/* linear */
tvout_dbg("pixelformat=V4L2_PIX_FMT_NV12\n");
color = VP_SRC_COLOR_NV12;
break;
case V4L2_PIX_FMT_NV12T:
/* tiled */
tvout_dbg("pixelformat=V4L2_PIX_FMT_NV12T\n");
color = VP_SRC_COLOR_TILE_NV12;
break;
case V4L2_PIX_FMT_NV21:
/* linear */
color = VP_SRC_COLOR_NV21;
break;
case V4L2_PIX_FMT_NV21T:
/* tiled */
color = VP_SRC_COLOR_TILE_NV21;
break;
default:
tvout_err("src img format not supported\n");
goto error_on_s_fmt_type_private;
}
field = VP_TOP_FIELD;
} else if ((pix_fmt->field == V4L2_FIELD_TOP) ||
(pix_fmt->field == V4L2_FIELD_BOTTOM)) {
/* interlaced */
switch (pix_fmt->pixelformat) {
case V4L2_PIX_FMT_NV12:
/* linear */
tvout_dbg("pixelformat=V4L2_PIX_FMT_NV12\n");
color = VP_SRC_COLOR_NV12IW;
break;
case V4L2_PIX_FMT_NV12T:
/* tiled */
tvout_dbg("pixelformat=V4L2_PIX_FMT_NV12T\n");
color = VP_SRC_COLOR_TILE_NV12IW;
break;
case V4L2_PIX_FMT_NV21:
/* linear */
color = VP_SRC_COLOR_NV21IW;
break;
case V4L2_PIX_FMT_NV21T:
/* tiled */
color = VP_SRC_COLOR_TILE_NV21IW;
break;
default:
tvout_err("src img format not supported\n");
goto error_on_s_fmt_type_private;
}
field = (pix_fmt->field == V4L2_FIELD_BOTTOM) ?
VP_BOTTOM_FIELD : VP_TOP_FIELD;
} else {
tvout_err("this field id not supported\n");
goto error_on_s_fmt_type_private;
}
s5p_tvout_v4l2_private.vo_src_fmt = vparam;
#if defined(CONFIG_S5P_SYSMMU_TV) && defined(CONFIG_UMP_VCM_ALLOC)
/*
* For TV system mmu test using UMP and VCMM
* vparam.base_y : secure ID
* vparam.base_c : offset of base_c from base_y
*/
base_y = ump_dd_dev_virtual_get_from_secure_id((unsigned int)
vparam.base_y);
base_c = base_y + (unsigned long)vparam.base_c;
s5p_vp_ctrl_set_src_plane(base_y, base_c, pix_fmt->width,
pix_fmt->height, color, field);
#elif defined(CONFIG_S5P_SYSMMU_TV) && defined(CONFIG_S5P_VMEM)
/*
* For TV system mmu test
* vparam.base_y : cookie
* vparam.base_c : offset of base_c from base_y
*/
base_y = (unsigned long) s5p_getaddress((unsigned int)vparam.base_y);
base_c = base_y + (unsigned long)vparam.base_c;
s5p_vp_ctrl_set_src_plane(base_y, base_c, pix_fmt->width,
pix_fmt->height, color, field);
#else
s5p_vp_ctrl_set_src_plane((u32) vparam.base_y, (u32) vparam.base_c,
pix_fmt->width, pix_fmt->height, color, field);
#endif
#ifdef CONFIG_HAS_EARLYSUSPEND
s5p_tvout_mutex_unlock();
#endif
return 0;
error_on_s_fmt_type_private:
#ifdef CONFIG_HAS_EARLYSUSPEND
s5p_tvout_mutex_unlock();
#endif
return -1;
}
static int s5p_tvout_vo_g_fmt_vid_overlay(
struct file *file, void *fh, struct v4l2_format *a)
{
a->fmt.win = s5p_tvout_v4l2_private.vo_dst_fmt;
return 0;
}
static int s5p_tvout_vo_s_fmt_vid_overlay(
struct file *file, void *fh, struct v4l2_format *a)
{
struct v4l2_rect *rect = &a->fmt.win.w;
tvout_dbg("l=%d, t=%d, w=%d, h=%d, g_alpha_value=%d\n",
rect->left, rect->top, rect->width, rect->height,
a->fmt.win.global_alpha);
#ifdef CONFIG_HAS_EARLYSUSPEND
s5p_tvout_mutex_lock();
#endif
s5p_tvout_v4l2_private.vo_dst_fmt = a->fmt.win;
s5p_vp_ctrl_set_dest_win_alpha_val(a->fmt.win.global_alpha);
s5p_vp_ctrl_set_dest_win(
rect->left, rect->top,
rect->width, rect->height);
#ifdef CONFIG_HAS_EARLYSUSPEND
s5p_tvout_mutex_unlock();
#endif
return 0;
}
static int s5p_tvout_vo_g_crop(
struct file *file, void *fh, struct v4l2_crop *a)
{
switch (a->type) {
case V4L2_BUF_TYPE_PRIVATE:
a->c = s5p_tvout_v4l2_private.vo_src_rect;
break;
default:
tvout_err("Invalid buf type(0x%08x)\n", a->type);
break;
}
return 0;
}
static int s5p_tvout_vo_s_crop(
struct file *file, void *fh, struct v4l2_crop *a)
{
tvout_dbg("\n");
#ifdef CONFIG_HAS_EARLYSUSPEND
s5p_tvout_mutex_lock();
#endif
switch (a->type) {
case V4L2_BUF_TYPE_PRIVATE: {
struct v4l2_rect *rect =
&s5p_tvout_v4l2_private.vo_src_rect;
*rect = a->c;
tvout_dbg("l=%d, t=%d, w=%d, h=%d\n",
rect->left, rect->top,
rect->width, rect->height);
s5p_vp_ctrl_set_src_win(
rect->left, rect->top,
rect->width, rect->height);
break;
}
default:
tvout_err("Invalid buf type(0x%08x)\n", a->type);
break;
}
#ifdef CONFIG_HAS_EARLYSUSPEND
s5p_tvout_mutex_unlock();
#endif
return 0;
}
static int s5p_tvout_vo_g_fbuf(
struct file *file, void *fh, struct v4l2_framebuffer *a)
{
*a = s5p_tvout_v4l2_private.vo_dst_plane;
a->capability = V4L2_FBUF_CAP_GLOBAL_ALPHA;
return 0;
}
static int s5p_tvout_vo_s_fbuf(
struct file *file, void *fh, struct v4l2_framebuffer *a)
{
s5p_tvout_v4l2_private.vo_dst_plane = *a;
tvout_dbg("g_alpha_enable=%d, priority=%d\n",
(a->flags & V4L2_FBUF_FLAG_GLOBAL_ALPHA) ? 1 : 0,
a->fmt.priv);
#ifdef CONFIG_HAS_EARLYSUSPEND
s5p_tvout_mutex_lock();
#endif
s5p_vp_ctrl_set_dest_win_blend(
(a->flags & V4L2_FBUF_FLAG_GLOBAL_ALPHA) ? 1 : 0);
s5p_vp_ctrl_set_dest_win_priority(a->fmt.priv);
#ifdef CONFIG_HAS_EARLYSUSPEND
s5p_tvout_mutex_unlock();
#endif
return 0;
}
static int s5p_tvout_vo_overlay(
struct file *file, void *fh, unsigned int i)
{
tvout_dbg("%s\n", (i) ? "start" : "stop");
#ifdef CONFIG_HAS_EARLYSUSPEND
s5p_tvout_mutex_lock();
#endif
if (i)
s5p_vp_ctrl_start();
else
s5p_vp_ctrl_stop();
#ifdef CONFIG_HAS_EARLYSUSPEND
s5p_tvout_mutex_unlock();
#endif
return 0;
}
const struct v4l2_ioctl_ops s5p_tvout_vo_ioctl_ops = {
.vidioc_querycap = s5p_tvout_vo_querycap,
.vidioc_enum_fmt_type_private = s5p_tvout_vo_enum_fmt_type_private,
.vidioc_g_fmt_type_private = s5p_tvout_vo_g_fmt_type_private,
.vidioc_s_fmt_type_private = s5p_tvout_vo_s_fmt_type_private,
.vidioc_g_fmt_vid_overlay = s5p_tvout_vo_g_fmt_vid_overlay,
.vidioc_s_fmt_vid_overlay = s5p_tvout_vo_s_fmt_vid_overlay,
.vidioc_g_crop = s5p_tvout_vo_g_crop,
.vidioc_s_crop = s5p_tvout_vo_s_crop,
.vidioc_g_fbuf = s5p_tvout_vo_g_fbuf,
.vidioc_s_fbuf = s5p_tvout_vo_s_fbuf,
.vidioc_overlay = s5p_tvout_vo_overlay,
};
static int s5p_tvout_vo_open(struct file *file)
{
int ret = 0;
tvout_dbg("\n");
mutex_lock(&s5p_tvout_vo_mutex);
if (atomic_read(&s5p_tvout_v4l2_private.vo_use)) {
tvout_err("Can't open TVOUT TVIF control\n");
ret = -EBUSY;
} else
atomic_inc(&s5p_tvout_v4l2_private.vo_use);
mutex_unlock(&s5p_tvout_vo_mutex);
return ret;
}
static int s5p_tvout_vo_release(struct file *file)
{
tvout_dbg("\n");
s5p_vp_ctrl_stop();
s5p_mixer_ctrl_disable_layer(MIXER_VIDEO_LAYER);
atomic_dec(&s5p_tvout_v4l2_private.vo_use);
return 0;
}
static struct v4l2_file_operations s5p_tvout_vo_fops = {
.owner = THIS_MODULE,
.open = s5p_tvout_vo_open,
.release = s5p_tvout_vo_release,
.unlocked_ioctl = video_ioctl2
};
/* dummy function for release callback of v4l2 video device */
static void s5p_tvout_video_dev_release(struct video_device *vdev)
{
}
static struct video_device s5p_e4210_tvout_video_dev[] = {
[0] = {
.name = "S5P TVOUT TVIF control",
.fops = &s5p_tvout_tvif_fops,
.ioctl_ops = &s5p_tvout_tvif_ioctl_ops,
.minor = S5P_E4210_TVOUT_TVIF_MINOR,
.release = s5p_tvout_video_dev_release,
.tvnorms = V4L2_STD_ALL_HD,
},
[1] = {
.name = "S5P TVOUT Video Overlay",
.fops = &s5p_tvout_vo_fops,
.ioctl_ops = &s5p_tvout_vo_ioctl_ops,
.release = s5p_tvout_video_dev_release,
.minor = S5P_E4210_TVOUT_VO_MINOR
}
};
static struct video_device s5p_e4x12_tvout_video_dev[] = {
[0] = {
.name = "S5P TVOUT TVIF control",
.fops = &s5p_tvout_tvif_fops,
.ioctl_ops = &s5p_tvout_tvif_ioctl_ops,
.minor = S5P_E4X12_TVOUT_TVIF_MINOR,
.release = s5p_tvout_video_dev_release,
.tvnorms = V4L2_STD_ALL_HD,
},
[1] = {
.name = "S5P TVOUT Video Overlay",
.fops = &s5p_tvout_vo_fops,
.ioctl_ops = &s5p_tvout_vo_ioctl_ops,
.release = s5p_tvout_video_dev_release,
.minor = S5P_E4X12_TVOUT_VO_MINOR
}
};
int s5p_tvout_v4l2_constructor(struct platform_device *pdev)
{
int i;
if(soc_is_exynos4210())
{
/* v4l2 video device registration */
for (i = 0; i < ARRAY_SIZE(s5p_e4210_tvout_video_dev); i++) {
if (video_register_device(
&s5p_e4210_tvout_video_dev[i],
VFL_TYPE_GRABBER,
s5p_e4210_tvout_video_dev[i].minor) != 0) {
tvout_err("Fail to register v4l2 video device\n");
return -1;
}
}
}else{
/* v4l2 video device registration */
for (i = 0; i < ARRAY_SIZE(s5p_e4x12_tvout_video_dev); i++) {
if (video_register_device(
&s5p_e4x12_tvout_video_dev[i],
VFL_TYPE_GRABBER,
s5p_e4x12_tvout_video_dev[i].minor) != 0) {
tvout_err("Fail to register v4l2 video device\n");
return -1;
}
}
}
s5p_tvout_v4l2_init_private();
return 0;
}
void s5p_tvout_v4l2_destructor(void)
{
mutex_destroy(&s5p_tvout_tvif_mutex);
mutex_destroy(&s5p_tvout_vo_mutex);
}
|
{
"pile_set_name": "Github"
}
|
StartChar: X.subs
Encoding: 1114255 -1 1254
Width: 459
VWidth: 0
Flags: HMW
LayerCount: 3
Fore
SplineSet
433 16 m 0
448 12 454 9 454 4 c 0
454 -1 447 -3 436 -3 c 0
421 -3 390 1 363 1 c 0
335 1 295 0 276 0 c 0
265 0 257 2 257 7 c 0
257 12 269 17 278 19 c 0
291 23 307 32 307 47 c 0
307 53 304 60 299 67 c 2
231 157 l 2
225 165 222 165 217 160 c 2
129 56 l 2
125 51 123 46 123 42 c 0
123 31 136 22 153 18 c 0
168 14 174 11 174 6 c 0
174 1 166 -1 155 -1 c 0
141 -1 110 1 86 1 c 0
59 1 36 -3 16 -3 c 0
5 -3 -3 -1 -3 4 c 0
-3 9 4 13 18 17 c 0
40 23 83 42 111 74 c 18
192 168 l 1
201 180 208 189 203 195 c 2
109 317 l 10
87 346 55 367 33 373 c 0
19 377 12 381 12 386 c 0
12 391 20 393 31 393 c 0
51 393 80 390 110 390 c 0
133 390 175 391 188 391 c 0
199 391 207 390 207 385 c 0
207 380 200 377 185 373 c 0
171 370 165 357 165 344 c 0
165 334 168 325 174 317 c 2
233 240 l 2
242 228 244 228 252 238 c 2
322 323 l 2
326 328 328 335 328 342 c 0
328 355 321 369 309 372 c 0
300 374 288 379 288 384 c 0
288 389 296 391 307 391 c 0
323 391 354 390 373 390 c 0
400 390 416 394 434 394 c 0
445 394 452 392 452 387 c 0
452 382 446 379 431 375 c 0
406 369 375 338 346 306 c 18
272 224 l 2
262 213 258 207 263 200 c 2
363 67 l 10
383 40 408 22 433 16 c 0
EndSplineSet
Validated: 1
EndChar
|
{
"pile_set_name": "Github"
}
|
/**
* \defgroup clock Clock interface
*
* The clock interface is the interface between the \ref timer "timer library"
* and the platform specific clock functionality. The clock
* interface must be implemented for each platform that uses the \ref
* timer "timer library".
*
* The clock interface does only one this: it measures time. The clock
* interface provides a macro, CLOCK_SECOND, which corresponds to one
* second of system time.
*
* \sa \ref timer "Timer library"
*
* @{
*/
/*
* Copyright (c) 2004, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: clock.h,v 1.3 2006/06/11 21:46:39 adam Exp $
*/
#ifndef __UIP_CLOCK_H__
#define __UIP_CLOCK_H__
#include "clock-arch.h"
/**
* Initialize the clock library.
*
* This function initializes the clock library and should be called
* from the main() function of the system.
*
*/
void uip_clock_init(void);
/**
* Get the current clock time.
*
* This function returns the current system clock time.
*
* \return The current clock time, measured in system ticks.
*/
clock_time_t clock_time(void);
/**
* A second, measured in system clock time.
*
* \hideinitializer
*/
#ifdef CLOCK_CONF_SECOND
#define CLOCK_SECOND CLOCK_CONF_SECOND
#else
#define CLOCK_SECOND (clock_time_t)32
#endif
#endif /* __CLOCK_H__ */
/** @} */
|
{
"pile_set_name": "Github"
}
|
/****************************************************************//**
*
* @file tftp_opts.h
*
* @author Logan Gunthorpe <logang@deltatee.com>
*
* @brief Trivial File Transfer Protocol (RFC 1350) implementation options
*
* Copyright (c) Deltatee Enterprises Ltd. 2013
* All rights reserved.
*
********************************************************************/
/*
* Redistribution and use in source and binary forms, with or without
* modification,are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Author: Logan Gunthorpe <logang@deltatee.com>
*
*/
#ifndef LWIP_HDR_APPS_TFTP_OPTS_H
#define LWIP_HDR_APPS_TFTP_OPTS_H
#include "lwip/opt.h"
/**
* @defgroup tftp_opts Options
* @ingroup tftp
* @{
*/
/**
* Enable TFTP debug messages
*/
#if !defined TFTP_DEBUG || defined __DOXYGEN__
#define TFTP_DEBUG LWIP_DBG_ON
#endif
/**
* TFTP server port
*/
#if !defined TFTP_PORT || defined __DOXYGEN__
#define TFTP_PORT 69
#endif
/**
* TFTP timeout
*/
#if !defined TFTP_TIMEOUT_MSECS || defined __DOXYGEN__
#define TFTP_TIMEOUT_MSECS 10000
#endif
/**
* Max. number of retries when a file is read from server
*/
#if !defined TFTP_MAX_RETRIES || defined __DOXYGEN__
#define TFTP_MAX_RETRIES 5
#endif
/**
* TFTP timer cyclic interval
*/
#if !defined TFTP_TIMER_MSECS || defined __DOXYGEN__
#define TFTP_TIMER_MSECS 50
#endif
/**
* Max. length of TFTP filename
*/
#if !defined TFTP_MAX_FILENAME_LEN || defined __DOXYGEN__
#define TFTP_MAX_FILENAME_LEN 20
#endif
/**
* Max. length of TFTP mode
*/
#if !defined TFTP_MAX_MODE_LEN || defined __DOXYGEN__
#define TFTP_MAX_MODE_LEN 7
#endif
/**
* @}
*/
#endif /* LWIP_HDR_APPS_TFTP_OPTS_H */
|
{
"pile_set_name": "Github"
}
|
/* $NetBSD: defs.h,v 1.10 2013/10/18 20:19:36 christos Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
* All rights reserved.
*
* Written by Philip A. Nelson for Piermont Information Systems Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of Piermont Information Systems Inc. may not be used to endorse
* or promote products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/* defs.h: definitions needed for the menu system. */
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
#include <stdio.h>
#include "mdb.h"
#ifdef MAIN
#define EXTERN
#define INIT(x) = x
#else
#define EXTERN extern
#define INIT(x)
#endif
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
/* Global variables .. to be defined in main.c, extern elsewhere. */
EXTERN char *prog_name;
EXTERN char *src_name;
EXTERN char *out_name INIT("menu_defs");
EXTERN char *sys_name INIT("menu_sys.def");
EXTERN int do_dynamic INIT(0);
EXTERN int do_msgxlat INIT(0);
EXTERN int line_no INIT(1);
EXTERN int had_errors INIT(FALSE);
EXTERN int max_strlen INIT(1);
EXTERN id_rec *root INIT(NULL);
EXTERN struct menu_info default_info;
EXTERN id_rec default_menu;
EXTERN action error_act INIT({NULL});
/* Prototypes. */
/* From util.c */
void yyerror(const char *, ...)
__attribute__((__format__(__printf__, 1, 2)));
void buff_add_ch(char);
char *buff_copy(void);
/* from scan.l */
int yylex(void);
/* from parse.y */
int yyparse(void);
/* Vars not defined in main.c */
extern FILE *yyin;
/* from avl.c */
id_rec *find_id(id_rec *, char *);
int insert_id(id_rec **, id_rec *);
/* from mdb.c */
id_rec *get_menu(char *);
void check_defined(void);
void write_menu_file(char *);
|
{
"pile_set_name": "Github"
}
|
%% Copyright (c) 2013-2015, Michael Santos <michael.santos@gmail.com>
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provided that the following conditions
%% are met:
%%
%% Redistributions of source code must retain the above copyright
%% notice, this list of conditions and the following disclaimer.
%%
%% Redistributions in binary form must reproduce the above copyright
%% notice, this list of conditions and the following disclaimer in the
%% documentation and/or other materials provided with the distribution.
%%
%% Neither the name of the author nor the names of its contributors
%% may be used to endorse or promote products derived from this software
%% without specific prior written permission.
%%
%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
%% "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
%% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
%% FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
%% COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
%% INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
%% BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
%% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
%% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
%% LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
%% ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
%% POSSIBILITY OF SUCH DAMAGE.
-module(pkt_ipv6_ah).
%% RFC 4302: IP Authentication Header
-include("pkt_ipproto.hrl").
-include("pkt_ipv6.hrl").
-export([codec/1]).
codec(
<<Next:8, Len:8, Res:16, SPI:32, Seq:32, Rest/binary>>
) ->
% the length of AH in 32-bit words (4-byte units), minus "2"
% Next + Len + Res = 32 bits
% SPI = 32 bits
% The length is the 32-bit sequence number + the ICV
%
% XXX for IPv6, must be a multiple of 8-octets
ICVLen = ((Len - 1) * 4),
<<ICV:ICVLen/bytes, Payload/binary>> = Rest,
{#ipv6_ah{
next = Next,
len = Len,
res = Res,
spi = SPI,
seq = Seq,
icv = ICV
}, Payload};
codec(#ipv6_ah{
next = Next,
len = Len,
res = Res,
spi = SPI,
seq = Seq,
icv = ICV
}) ->
<<Next:8, Len:8, Res:16, SPI:32, Seq:32, ICV/binary>>.
|
{
"pile_set_name": "Github"
}
|
:020000023000CC
:10FC000001C0F3C0112484B790E890936100109272
:10FC10006100882369F0982F9A70923049F081FF33
:10FC200002C097EF94BF282E80E002D10C94000010
:10FC300085E08093810082E08093C80088E1809312
:10FC4000C90084E08093CC0086E08093CA008EE0F7
:10FC5000EFD0259A84E02CE33BEF91E030938500D0
:10FC60002093840096BBB09BFECF1D9AA89540912F
:10FC7000C80047FD02C0815089F7CED0813479F4A5
:10FC8000CBD0C82FDBD0C23811F480E004C088E0AC
:10FC9000C13809F083E0B9D080E1B7D0EECF82342B
:10FCA00019F484E1D3D0F8CF853411F485E0FACF8C
:10FCB000853581F4B1D0E82EAFD0F82E87FF07C08C
:10FCC0008BB781608BBFEE0CFF1CB8D0E5CF8BB734
:10FCD0008E7FF8CF863579F49FD08D3451F49CD047
:10FCE000CBB79AD0C170880F8C2B8BBF81E0AED080
:10FCF000CCCF83E0FCCF843609F046C08DD0C82F2E
:10FD0000D0E0DC2FCC2788D0C82B86D0D82E5E013F
:10FD10008EEFB81A00E012E04801EFEF8E1A9E0A4B
:10FD20007BD0F801808384018A149B04A9F786D0D4
:10FD3000F5E410E000E0DF1609F150E040E063E098
:10FD4000C70153D08701C12C92E0D92EF601419111
:10FD500051916F0161E0C80148D00E5F1F4F22979B
:10FD6000A9F750E040E065E0C7013FD095CF608142
:10FD7000C8018E0D9F1D79D00F5F1F4FF801FE5FE8
:10FD8000C017D107A1F788CF843701F545D0C82F18
:10FD9000D0E0DC2FCC2740D0C82B3ED0D82E4ED080
:10FDA0008701F5E4DF120BC0CE0DDF1DC80155D071
:10FDB0002CD00F5F1F4FC017D107C1F76DCFF801CF
:10FDC00087918F0122D02197D1F766CF853739F4FB
:10FDD00035D08EE11AD088E918D082E05CCF813529
:10FDE00009F073CF88E024D070CFFC010A0167BF0F
:10FDF000E895112407B600FCFDCF667029F0452B6D
:10FE000019F481E187BFE89508959091C80095FFA6
:10FE1000FCCF8093CE0008958091C80087FFFCCF6F
:10FE20008091C80084FD01C0A8958091CE000895FE
:10FE3000E0E6F0E098E1908380830895EDDF803282
:10FE400019F088E0F5DFFFCF84E1DFCFCF93C82F33
:10FE5000E3DFC150E9F7CF91F1CFF999FECF92BD21
:10FE600081BDF89A992780B50895262FF999FECF7C
:10FE70001FBA92BD81BD20BD0FB6F894FA9AF99AC7
:06FE80000FBE019608957B
:02FFFE000008F9
:040000033000FC00CD
:00000001FF
|
{
"pile_set_name": "Github"
}
|
:10FC000001C0DDC0112484B790E890936100109288
:10FC10006100882361F0982F9A70923041F081FF43
:10FC200002C097EF94BF282E80E0ECD0E9C185E0B8
:10FC30008093810082E08093C80088E18093C900AE
:10FC400081E08093CC0086E08093CA008EE0DAD019
:10FC5000279A84E02EE33EEF91E0309385002093D5
:10FC6000840096BBB09BFECF1F9AA8954091C80018
:10FC700047FD02C0815089F7B9D0813479F4B6D0FC
:10FC8000C82FC6D0C23811F480E004C088E0C13863
:10FC900009F083E0A4D080E1A2D0EECF823419F441
:10FCA00084E1BED0F8CF853411F485E0FACF8535F4
:10FCB00041F49CD0E82E9AD0F82EEE0CFF1CA8D070
:10FCC000EACF863519F484E0ABD0DECF843609F074
:10FCD00045C08CD0C82FD0E0DC2FCC2787D0C82BD4
:10FCE00085D0D82E5E01B39400E011E04801EFEF1B
:10FCF0008E1A9E0A7BD0F801808384018A149B04AB
:10FD0000A9F786D0F5E410E000E0DF1609F150E035
:10FD100040E063E0C70153D08701C12CDD24D394B8
:10FD2000F601419151916F0161E0C80148D00E5F29
:10FD30001F4F2297A9F750E040E065E0C7013FD090
:10FD4000AACF6081C8018E0D9F1D79D00F5F1F4F14
:10FD5000F801F395C017D107A1F79DCF843701F5BE
:10FD600045D0C82FD0E0DC2FCC2740D0C82B3ED0C8
:10FD7000D82E4ED08701F5E4DF120BC0CE0DDF1D6B
:10FD8000C80155D02CD00F5F1F4FC017D107C1F746
:10FD900082CFF80185918F0122D02197D1F77BCFB7
:10FDA000853739F435D08EE11AD086E918D089E04C
:10FDB00071CF813509F083CF88E024D080CFFC015A
:10FDC0000A0167BFE895112407B600FCFDCF6670F5
:10FDD00029F0452B19F481E187BFE89508959091AA
:10FDE000C80095FFFCCF8093CE0008958091C80095
:10FDF00087FFFCCF8091C80084FD01C0A895809149
:10FE0000CE000895E0E6F0E098E1908380830895C5
:10FE1000EDDF803219F088E0F5DFFFCF84E1DFCF3E
:10FE2000CF93C82FE3DFC150E9F7CF91F1CFF99914
:10FE3000FECF92BD81BDF89A992780B50895262FEF
:10FE4000F999FECF1FBA92BD81BD20BD0FB6F894BF
:0AFE5000FA9AF99A0FBE0196089580
:02FFFE000008F9
:040000030000FC00FD
:00000001FF
|
{
"pile_set_name": "Github"
}
|
{
"name": "Kun the Forgotten King",
"baseManaCost": 10,
"type": "MINION",
"baseAttack": 7,
"baseHp": 7,
"heroClass": "DRUID",
"rarity": "LEGENDARY",
"description": "Choose One - Gain 10 Armor; or Refresh your Mana Crystals.",
"options": [
{
"description": "Gain 10 Armor",
"spell": {
"class": "BuffHeroSpell",
"target": "FRIENDLY_HERO",
"armorBonus": 10
}
},
{
"description": "Refresh Mana",
"spell": {
"class": "GainManaSpell",
"value": {
"class": "AlgebraicValueProvider",
"operation": "SUBTRACT",
"value1": {
"class": "PlayerAttributeValueProvider",
"playerAttribute": "MAX_MANA"
},
"value2": {
"class": "PlayerAttributeValueProvider",
"playerAttribute": "MANA"
}
}
}
}
],
"bothOptions": {
"description": "10 Armor and Refresh",
"spell": {
"class": "MetaSpell",
"spells": [
{
"class": "BuffHeroSpell",
"target": "FRIENDLY_HERO",
"armorBonus": 10
},
{
"class": "GainManaSpell",
"value": {
"class": "AlgebraicValueProvider",
"operation": "SUBTRACT",
"value1": {
"class": "PlayerAttributeValueProvider",
"playerAttribute": "MAX_MANA"
},
"value2": {
"class": "PlayerAttributeValueProvider",
"playerAttribute": "MANA"
}
}
}
]
}
},
"collectible": true,
"set": "MEAN_STREETS_OF_GADGETZAN",
"fileFormatVersion": 1
}
|
{
"pile_set_name": "Github"
}
|
:10FC000001C0DDC0112484B790E890936100109288
:10FC10006100882361F0982F9A70923041F081FF43
:10FC200002C097EF94BF282E80E0ECD0E9C185E0B8
:10FC30008093810082E08093C00088E18093C100BE
:10FC400087E18093C40086E08093C2008EE0DAD022
:10FC5000209A84E02EE33EEF91E0309385002093DC
:10FC6000840096BBB09BFECF189AA8954091C00027
:10FC700047FD02C0815089F7B9D0813479F4B6D0FC
:10FC8000C82FC6D0C23811F480E004C088E0C13863
:10FC900009F083E0A4D080E1A2D0EECF823419F441
:10FCA00084E1BED0F8CF853411F485E0FACF8535F4
:10FCB00041F49CD0E82E9AD0F82EEE0CFF1CA8D070
:10FCC000EACF863519F484E0ABD0DECF843609F074
:10FCD00045C08CD0C82FD0E0DC2FCC2787D0C82BD4
:10FCE00085D0D82E5E01B39400E011E04801EFEF1B
:10FCF0008E1A9E0A7BD0F801808384018A149B04AB
:10FD0000A9F786D0F5E410E000E0DF1609F150E035
:10FD100040E063E0C70153D08701C12CDD24D394B8
:10FD2000F601419151916F0161E0C80148D00E5F29
:10FD30001F4F2297A9F750E040E065E0C7013FD090
:10FD4000AACF6081C8018E0D9F1D79D00F5F1F4F14
:10FD5000F801F395C017D107A1F79DCF843701F5BE
:10FD600045D0C82FD0E0DC2FCC2740D0C82B3ED0C8
:10FD7000D82E4ED08701F5E4DF120BC0CE0DDF1D6B
:10FD8000C80155D02CD00F5F1F4FC017D107C1F746
:10FD900082CFF80185918F0122D02197D1F77BCFB7
:10FDA000853739F435D08EE11AD086E918D089E04C
:10FDB00071CF813509F083CF88E024D080CFFC015A
:10FDC0000A0167BFE895112407B600FCFDCF6670F5
:10FDD00029F0452B19F481E187BFE89508959091AA
:10FDE000C00095FFFCCF8093C60008958091C000AD
:10FDF00087FFFCCF8091C00084FD01C0A895809151
:10FE0000C6000895E0E6F0E098E1908380830895CD
:10FE1000EDDF803219F088E0F5DFFFCF84E1DFCF3E
:10FE2000CF93C82FE3DFC150E9F7CF91F1CFF99914
:10FE3000FECF92BD81BDF89A992780B50895262FEF
:10FE4000F999FECF1FBA92BD81BD20BD0FB6F894BF
:0AFE5000FA9AF99A0FBE0196089580
:02FFFE000008F9
:040000030000FC00FD
:00000001FF
|
{
"pile_set_name": "Github"
}
|
:103E000001C0B7C0112484B790E89093610010926C
:103E10006100882361F0982F9A70923041F081FF01
:103E200002C097EF94BF282E80E0C6D0E9C085E09D
:103E30008093810082E08093C00088E18093C1007C
:103E400083E38093C40086E08093C2008EE0B4D008
:103E5000209A84E020E33CEF91E0309385002093AA
:103E6000840096BBB09BFECF189AA8954091C000E5
:103E700047FD02C0815089F793D0813479F490D006
:103E8000182FA0D0123811F480E004C088E0113857
:103E900009F083E07ED080E17CD0EECF823419F44B
:103EA00084E198D0F8CF853411F485E0FACF8535D8
:103EB00041F476D0C82F74D0D82FCC0FDD1F82D01C
:103EC000EACF863519F484E085D0DECF843691F5CB
:103ED00067D066D0F82E64D0D82E00E011E05801EB
:103EE0008FEFA81AB80A5CD0F80180838501FA1018
:103EF000F6CF68D0F5E4DF1201C0FFCF50E040E01C
:103F000063E0CE0136D08E01E0E0F1E06F0182E0A7
:103F1000C80ED11C4081518161E0C8012AD00E5FDA
:103F20001F4FF601FC10F2CF50E040E065E0CE01FB
:103F300020D0B1CF843771F433D032D0F82E30D0C6
:103F400041D08E01F80185918F0123D0FA94F110B0
:103F5000F9CFA1CF853739F435D08EE11AD084E975
:103F600018D08AE097CF813509F0A9CF88E024D016
:103F7000A6CFFC010A0167BFE895112407B600FC33
:103F8000FDCF667029F0452B19F481E187BFE895D4
:103F900008959091C00095FFFCCF8093C6000895CE
:103FA0008091C00087FFFCCF8091C00084FD01C0DC
:103FB000A8958091C6000895E0E6F0E098E190832E
:103FC00080830895EDDF803219F088E0F5DFFFCFC0
:103FD00084E1DFCFCF93C82FE3DFC150E9F7CF9162
:023FE000F1CF1F
:023FFE000008B9
:0400000300003E00BB
:00000001FF
|
{
"pile_set_name": "Github"
}
|
:103E000001C0B7C0112484B790E89093610010926C
:103E10006100882361F0982F9A70923041F081FF01
:103E200002C097EF94BF282E80E0C6D0E9C085E09D
:103E30008093810082E08093C80088E18093C9006C
:103E400083E08093CC0086E08093CA008EE0B4D0FB
:103E5000279A84E020E93FEF91E03093850020939A
:103E6000840096BBB09BFECF1F9AA8954091C800D6
:103E700047FD02C0815089F793D0813479F490D006
:103E8000182FA0D0123811F480E004C088E0113857
:103E900009F083E07ED080E17CD0EECF823419F44B
:103EA00084E198D0F8CF853411F485E0FACF8535D8
:103EB00041F476D0C82F74D0D82FCC0FDD1F82D01C
:103EC000EACF863519F484E085D0DECF843691F5CB
:103ED00067D066D0F82E64D0D82E00E011E05801EB
:103EE0008FEFA81AB80A5CD0F80180838501FA1018
:103EF000F6CF68D0F5E4DF1201C0FFCF50E040E01C
:103F000063E0CE0136D08E01E0E0F1E06F0182E0A7
:103F1000C80ED11C4081518161E0C8012AD00E5FDA
:103F20001F4FF601FC10F2CF50E040E065E0CE01FB
:103F300020D0B1CF843771F433D032D0F82E30D0C6
:103F400041D08E01F80185918F0123D0FA94F110B0
:103F5000F9CFA1CF853739F435D08EE11AD084E975
:103F600018D08AE097CF813509F0A9CF88E024D016
:103F7000A6CFFC010A0167BFE895112407B600FC33
:103F8000FDCF667029F0452B19F481E187BFE895D4
:103F900008959091C80095FFFCCF8093CE000895BE
:103FA0008091C80087FFFCCF8091C80084FD01C0CC
:103FB000A8958091CE000895E0E6F0E098E1908326
:103FC00080830895EDDF803219F088E0F5DFFFCFC0
:103FD00084E1DFCFCF93C82FE3DFC150E9F7CF9162
:023FE000F1CF1F
:023FFE000008B9
:0400000300003E00BB
:00000001FF
|
{
"pile_set_name": "Github"
}
|
/*
*/
/* -------------------------------------------- */
/* ------------------Reset--------------------- */
a,abbr,acronym,address,applet,article,aside,audio,b,blockquote,big,body,center,canvas,caption,cite,code,command,datalist,dd,del,details,dfn,dl,div,dt,em,embed,fieldset,figcaption,figure,font,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,keygen,label,legend,li,meter,nav,object,ol,output,p,pre,progress,q,s,samp,section,small,span,source,strike,strong,sub,sup,table,tbody,tfoot,thead,th,tr,tdvideo,tt,u,ul,var{background:transparent;border:0 none;font-size:100%;margin:0;padding:0;border:0;outline:0;vertical-align:top;}blockquote, q {quotes:none;}table, table td {padding:0;border:none;border-collapse:collapse;}img {vertical-align:top;}embed {vertical-align:top;}
article, aside, audio, canvas, command, datalist, details, embed, figcaption, figure, footer, header, hgroup, keygen, meter, nav, output, progress, section, source, video {display:block;}
mark, rp, rt, ruby, summary, time {display:inline;}
input, textarea {border:0; padding:0; margin:0; outline: 0;}
iframe {border:0; margin:0; padding:0;}
input, textarea, select {margin:0; padding:0px;}
/* -------------------------------------------- */
/* ------------------Font---------------------- */
@import url(http://fonts.googleapis.com/css?family=Montserrat:400,700|Open+Sans:400,300,600,700);
/* -------------------------------------------- */
/* ------------------Clear--------------------- */
.clear{content: "\0020"; display: block; height: 0; clear: both; visibility: hidden; }
article:after, article:before{clear: both; content: '\0020'; display: block; visibility: hidden; width: 0; height: 0;}
.box:after, .box:before{clear: both; content: '\0020'; display: block; visibility: hidden; width: 0; height: 0;}
/* -------------------------------------------- */
/* ------------------Style--------------------- */
html, body {width:100%; padding:0; margin:0;}
body {background: #F6F5F2;color: #474747; font-family: 'Montserrat', sans-serif; font-size: 16px; line-height: 25px;}
body .wrap-body{}
a{color: #444444;text-decoration: none;}
a:hover {color: #2ECC71; text-decoration: none;}
a.button{cursor: pointer;color: #ffffff;line-height: 14px;font-family: Arial, Helvetica, sans-serif;font-size: 14px;font-weight: bold; background: #2ECC71 ;}
a.button {display: inline-block; text-decoration: none; padding: 6px 12px 6px 12px;}
a.button:hover{}
h1,h2,h3,h4,h5,h6{ font-family: 'Montserrat', sans-serif; text-transform:uppercase; font-weight:700; line-height:1.4em; color: #474747; }
h1{ font-size:30px; }
h2{ font-size:25px; }
h3{ font-size:20px; }
h4{ font-size:18px; }
h5{ font-size:16px; }
h6{ font-size:14px; }
h1 a, h2 a, h3 a, h4 a{color: #474747; text-decoration: none;}
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover{color: #2ECC71; text-decoration: none;}
.copyrights{text-indent:-9999px;height:0;line-height:0;font-size:0;overflow:hidden;}
/* -------------------------------------------- */
/* ------------------Header-------------------- */
header {background:#333333; margin-bottom:30px;}
header .wrap-header{height: 80px;}
header #logo {float: left; margin: 10px;}
/* -------------------------------------------- */
/* ------------------Navigation---------------- */
nav {}
nav .wrap-nav{float: right;}
.menu ul {list-style: none;margin: 0;padding: 0;}
.menu ul li {position: relative;float: left;padding: 28px 15px 21px 15px; background:#2ECC71;}
.menu ul li:hover {background-color:#ffffff;}
.menu ul li a {font-size: 14px; line-height:14px;color: #ffffff;display: block;padding: 6px 10px;margin-bottom: 5px;z-index: 6;position: relative;font-weight:bold; text-transform:uppercase;}
.menu ul li:hover a {color:#000000;}
/* -------------------------------------------- */
/* ------------------Content------------------- */
#content {}
#content .wrap-content{}
.block{}
#main-content{}
#main-content article {margin:10px 0px; background:#ffffff;}
#main-content article .heading{ padding: 30px 40px;}
#main-content article .heading .title{text-transform: uppercase; font-weight: bold;}
#main-content article .heading .title2{font-size: 16px; line-height: 20px;}
#main-content article img{display: inline-block; width: 100%;}
#main-content article .content{padding: 30px 40px;}
#main-content article p{margin-bottom:10px;}
#main-content article .extra{background: #2ECC71; padding: 10px 20px;}
#main-content article .more {float: right;}
#main-content article .info{float: left; color: #ffffff;}
#main-content article .info a{text-decoration: underline; color:#ffffff;}
#sidebar{}
#sidebar .box {margin-bottom:20px; background:#ffffff;}
#sidebar .box .heading { padding:20px; border-bottom:1px solid #EEEEEE;}
#sidebar .box .heading .title{text-transform: uppercase; font-size: 16px; font-weight: bold;}
#sidebar .box .content {padding:20px}
#sidebar .box .content .connect{}
#sidebar .box .content .last{border-bottom: 0px !important;}
#sidebar .box .content ul{ list-style-type:none;}
#sidebar .box .content ul li{border-bottom: 1px solid #EEEEEE; padding: 5px 0;}
#sidebar .box .content .post {padding-bottom: 10px; margin-bottom:10px; border-bottom: 1px solid #EEEEEE;}
#sidebar .box .content .post .title{ font-weight:normal; font-size: 16px; text-transform: none;}
#sidebar .box .content .post img{ float:left; margin:0 10px 10px 0;}
#sidebar .box .content .post p{color:#A3A3A3; font-style:italic;}
/* -------------------------------------------- */
/* ------------------Form------------------- */
#comment{padding: 30px 40px;}
#contact-form {width:500px;}
#contact-form label {
display:block;
height:44px;
}
#contact-form input {
width:100%;
font-size:15px;
line-height:1.2em;
color:#a0a0a0;
padding:8px 15px;
margin:0;
font-family:Arial, Helvetica, sans-serif;
border:1px solid #eeeeee;
background: #ffffff;
outline:none;
}
#contact-form textarea {
height:158px;
overflow:auto;
width:100%;
font-size:15px;
line-height:1.2em;
color:#a0a0a0;
padding:7px 15px;
margin:0;
font-family:Arial, Helvetica, sans-serif;
border:1px solid #eeeeee;
background: #ffffff;
outline:none;
}
.buttons {padding-top:17px; text-align:right}
.buttons a {margin-left:30px}
/* -------------------------------------------- */
/* ------------------Footer-------------------- */
footer {background-color:#333333; margin-top:30px;}
footer .wrap-footer{padding:10px 0px; color:#ffffff;}
footer .box .heading{ padding:5px; border-bottom:1px dotted #ffffff;}
footer .box .heading .title{padding:0 10px; color:#ffffff;}
footer .box .content{padding:20px}
footer .box .content a{ color: #ffffff; text-decoration: underline;}
footer .box .content a:hover {color: #2ECC71; text-decoration: none;}
footer .box .content p{margin-bottom: 10px;}
footer .box .content .gallery {}
footer .box .content .gallery img{}
.copyright{text-align:center; margin-top:20px; background:#000; padding:10px 0px;color:#ffffff; }
.copyright a{text-decoration:underline; color:#ffffff; }
|
{
"pile_set_name": "Github"
}
|
:103E000001C0B7C0112484B790E89093610010926C
:103E10006100882361F0982F9A70923041F081FF01
:103E200002C097EF94BF282E80E0C6D0E9C085E09D
:103E30008093810082E08093C00088E18093C1007C
:103E400087E68093C40086E08093C2008EE0B4D001
:103E5000209A84E020E33CEF91E0309385002093AA
:103E6000840096BBB09BFECF189AA8954091C000E5
:103E700047FD02C0815089F793D0813479F490D006
:103E8000182FA0D0123811F480E004C088E0113857
:103E900009F083E07ED080E17CD0EECF823419F44B
:103EA00084E198D0F8CF853411F485E0FACF8535D8
:103EB00041F476D0C82F74D0D82FCC0FDD1F82D01C
:103EC000EACF863519F484E085D0DECF843691F5CB
:103ED00067D066D0F82E64D0D82E00E011E05801EB
:103EE0008FEFA81AB80A5CD0F80180838501FA1018
:103EF000F6CF68D0F5E4DF1201C0FFCF50E040E01C
:103F000063E0CE0136D08E01E0E0F1E06F0182E0A7
:103F1000C80ED11C4081518161E0C8012AD00E5FDA
:103F20001F4FF601FC10F2CF50E040E065E0CE01FB
:103F300020D0B1CF843771F433D032D0F82E30D0C6
:103F400041D08E01F80185918F0123D0FA94F110B0
:103F5000F9CFA1CF853739F435D08EE11AD084E975
:103F600018D08AE097CF813509F0A9CF88E024D016
:103F7000A6CFFC010A0167BFE895112407B600FC33
:103F8000FDCF667029F0452B19F481E187BFE895D4
:103F900008959091C00095FFFCCF8093C6000895CE
:103FA0008091C00087FFFCCF8091C00084FD01C0DC
:103FB000A8958091C6000895E0E6F0E098E190832E
:103FC00080830895EDDF803219F088E0F5DFFFCFC0
:103FD00084E1DFCFCF93C82FE3DFC150E9F7CF9162
:023FE000F1CF1F
:023FFE000008B9
:0400000300003E00BB
:00000001FF
|
{
"pile_set_name": "Github"
}
|
01
02
03
1
10
11
12
13
14
15
16
17
18
19
1rer
2
20
2tty
3
3com
4
5
6
7
8
9
a
a.auth-ns
a01
a02
a1
a2
abc
about
ac
academico
acceso
access
accounting
accounts
acid
activestat
ad
adam
adkit
admin
administracion
administrador
administrator
administrators
admins
ads
adsense
adserver
adsl
ae
af
affiliate
affiliates
affiliati
afiliados
ag
agenda
agent
ai
aix
ajax
ak
akamai
al
alabama
alaska
albuquerque
alerts
alpha
alterwind
am
amarillo
americas
an
anaheim
analytics
analyzer
announce
announcements
antivirus
ao
ap
apache
api
apollo
app
app01
app1
apple
application
applications
apps
appserver
aq
ar
archie
arcsight
argentina
arizona
arkansas
arlington
as
as400
asia
asterix
at
athena
atlanta
atlas
att
au
auction
austin
auth
auto
av
aw
ayuda
az
b
b.auth-ns
b01
b02
b1
b2
b2b
b2c
ba
back
backend
backup
baker
bakersfield
balance
balancer
baltimore
banking
bayarea
bb
bbdd
bbs
bd
bdc
be
bea
beta
bf
bg
bh
bi
billing
biz
biztalk
bj
black
blackberry
blog
blogs
blue
bm
bn
bnc
bo
bob
bof
boise
bolsa
border
boston
boulder
boy
br
bravo
brazil
britian
broadcast
broker
bronze
brown
bs
bsd
bsd0
bsd01
bsd02
bsd1
bsd2
bt
bug
buggalo
bugs
bugzilla
build
bulletins
burn
burner
buscador
buy
bv
bw
by
bz
c
c.auth-ns
ca
cache
cafe
calendar
california
call
calvin
canada
canal
canon
careers
catalog
cc
cd
cdburner
cdn
cert
certificates
certify
certserv
certsrv
cf
cg
cgi
ch
channel
channels
charlie
charlotte
chat
chats
chatserver
check
checkpoint
chi
chicago
ci
cims
cincinnati
cisco
citrix
ck
cl
class
classes
classifieds
classroom
cleveland
clicktrack
client
clientes
clients
cloud
club
clubs
cluster
clusters
cm
cmail
cms
cn
co
cocoa
code
coldfusion
colombus
colorado
columbus
com
commerce
commerceserver
communigate
community
compaq
compras
comunicare
comunicati
comunicazione
con
concentrator
conf
conference
conferencing
confidential
connect
connecticut
consola
console
consult
consultant
consultants
consulting
consumer
contact
content
contracts
core
core0
core01
corp
corpmail
corporate
correo
correoweb
cortafuegos
counterstrike
courses
cr
cricket
crm
crs
cs
cso
css
ct
cu
cust1
cust10
cust100
cust101
cust102
cust103
cust104
cust105
cust106
cust107
cust108
cust109
cust11
cust110
cust111
cust112
cust113
cust114
cust115
cust116
cust117
cust118
cust119
cust12
cust120
cust121
cust122
cust123
cust124
cust125
cust126
cust13
cust14
cust15
cust16
cust17
cust18
cust19
cust2
cust20
cust21
cust22
cust23
cust24
cust25
cust26
cust27
cust28
cust29
cust3
cust30
cust31
cust32
cust33
cust34
cust35
cust36
cust37
cust38
cust39
cust4
cust40
cust41
cust42
cust43
cust44
cust45
cust46
cust47
cust48
cust49
cust5
cust50
cust51
cust52
cust53
cust54
cust55
cust56
cust57
cust58
cust59
cust6
cust60
cust61
cust62
cust63
cust64
cust65
cust66
cust67
cust68
cust69
cust7
cust70
cust71
cust72
cust73
cust74
cust75
cust76
cust77
cust78
cust79
cust8
cust80
cust81
cust82
cust83
cust84
cust85
cust86
cust87
cust88
cust89
cust9
cust90
cust91
cust92
cust93
cust94
cust95
cust96
cust97
cust98
cust99
customer
customers
cv
cvs
cx
cy
cz
d
dallas
data
database
database01
database02
database1
database2
databases
datastore
datos
david
db
db0
db01
db02
db1
db2
dc
de
dealers
dec
def
default
defiant
delaware
dell
delta
delta1
demo
demonstration
demos
denver
depot
des
desarrollo
descargas
design
designer
detroit
dev
dev0
dev01
dev1
devel
develop
developer
developers
development
device
devserver
devsql
dhcp
dial
dialup
digital
dilbert
dir
direct
directory
disc
discovery
discuss
discussion
discussions
disk
disney
distributer
distributers
dj
dk
dm
dmail
dmz
dnews
dns
dns-2
dns0
dns1
dns2
dns3
do
docs
documentacion
documentos
domain
domains
dominio
domino
dominoweb
doom
download
downloads
downtown
dragon
drupal
dsl
dyn
dynamic
dynip
dz
e
e-com
e-commerce
e0
eagle
earth
east
ec
echo
ecom
ecommerce
edi
edu
education
edward
ee
eg
eh
ejemplo
elpaso
email
employees
empresa
empresas
en
enable
eng
eng01
eng1
engine
engineer
engineering
enterprise
epsilon
er
erp
es
esd
esm
espanol
estadisticas
esx
et
eta
europe
events
exchange
exec
extern
external
extranet
f
f5
falcon
farm
faststats
fax
feedback
feeds
fi
field
file
files
fileserv
fileserver
filestore
filter
find
finger
firewall
fix
fixes
fj
fk
fl
flash
florida
flow
fm
fo
foobar
formacion
foro
foros
fortworth
forum
forums
foto
fotos
foundry
fox
foxtrot
fr
france
frank
fred
freebsd
freebsd0
freebsd01
freebsd02
freebsd1
freebsd2
freeware
fresno
front
frontdesk
fs
fsp
ftp
ftp-
ftp0
ftp2
ftp_
ftpserver
fw
fw-1
fw1
fwsm
fwsm0
fwsm01
fwsm1
g
ga
galeria
galerias
galleries
gallery
games
gamma
gandalf
gate
gatekeeper
gateway
gauss
gd
ge
gemini
general
george
georgia
germany
gf
gg
gh
gi
gl
glendale
gm
gmail
gn
go
gold
goldmine
golf
gopher
gov
govt
govyty
gp
gq
gr
green
group
groups
groupwise
gs
gsx
gt
gu
guest
gw
gw1
gy
h
hal
halflife
hawaii
hello
help
helpdesk
helponline
henry
hermes
hgfgdf
hi
hidden
hk
hm
hn
hobbes
hollywood
home
homebase
homer
honeypot
honolulu
host
host1
host3
host4
host5
hotel
hotjobs
houstin
houston
howto
hp
hpov
hr
ht
http
https
hu
hub
humanresources
i
ia
ias
ibm
ibmdb
id
ida
idaho
ids
ie
iis
il
illinois
im
image
images
imail
imap
imap4
img
img0
img01
img02
in
inbound
inc
include
incoming
india
indiana
indianapolis
info
informix
inside
install
int
intern
internal
international
internet
intl
intranet
invalid
investor
investors
invia
invio
io
iota
iowa
iplanet
ipmonitor
ipsec
ipsec-gw
iq
ir
irc
ircd
ircserver
ireland
iris
irvine
irving
is
isa
isaserv
isaserver
ism
israel
isync
it
italy
ix
j
japan
java
je
jedi
jenkins
jm
jo
jobs
john
jp
jrun
juegos
juliet
juliette
juniper
k
kansas
kansascity
kappa
kb
ke
kentucky
kerberos
keynote
kg
kh
ki
kilo
king
km
kn
knowledgebase
knoxville
koe
korea
kp
kr
ks
kw
ky
kz
l
la
lab
laboratory
labs
lambda
lan
laptop
laserjet
lasvegas
launch
lb
lc
ldap
legal
leo
li
lib
library
lima
lincoln
link
linux
linux0
linux01
linux02
linux1
linux2
lista
lists
listserv
listserver
live
lk
lkjkui
load
loadbalancer
local
localhost
log
log0
log01
log02
log1
log2
logfile
logfiles
logger
logging
loghost
login
logs
london
longbeach
losangeles
lotus
louisiana
lr
ls
lt
lu
luke
lv
ly
lyris
m
ma
mac
mac1
mac10
mac11
mac2
mac3
mac4
mac5
mach
macintosh
madrid
mail
mail1
mail2
mailer
mailgate
mailhost
mailing
maillist
maillists
mailroom
mailserv
mailsite
mailsrv
main
maine
maint
mall
manage
management
manager
manufacturing
map
mapas
maps
marketing
marketplace
mars
marvin
mary
maryland
massachusetts
master
max
mc
mci
md
mdaemon
me
media
member
members
memphis
mercury
merlin
messages
messenger
mg
mgmt
mh
mi
miami
michigan
mickey
midwest
mike
milwaukee
minneapolis
minnesota
mirror
mis
mississippi
missouri
mk
ml
mm
mn
mngt
mo
mobile
mom
monitor
monitoring
montana
moon
moscow
movies
mozart
mp
mp3
mpeg
mpg
mq
mr
mrtg
ms
ms-exchange
ms-sql
msexchange
mssql
mssql0
mssql01
mssql1
mt
mta
mtu
mu
multimedia
music
mv
mw
mx
mx1
my
mysql
mysql0
mysql01
mysql1
mz
n
na
name
names
nameserv
nameserver
nas
nashville
nat
nc
nd
nds
ne
nebraska
neptune
net
netapp
netdata
netgear
netmeeting
netscaler
netscreen
netstats
network
nevada
new
newhampshire
newjersey
newmexico
neworleans
news
newsfeed
newsfeeds
newsgroups
newton
newyork
newzealand
nf
ng
nh
ni
nigeria
nj
nl
nm
nms
nntp
no
node
nokia
nombres
nora
north
northcarolina
northdakota
northeast
northwest
noticias
novell
november
np
nr
ns
ns-
ns0
ns01
ns02
ns1
ns2
ns3
ns4
ns5
ns_
nt
nt4
nt40
ntmail
ntp
ntserver
nu
null
nv
ny
nz
o
oakland
ocean
odin
odoo
office
offices
oh
ohio
ok
oklahoma
oklahomacity
old
om
omaha
omega
omicron
online
ontario
open
openbsd
openview
operations
ops
ops0
ops01
ops02
ops1
ops2
opsware
or
oracle
orange
order
orders
oregon
orion
orlando
oscar
out
outbound
outgoing
outlook
outside
ov
owa
owa01
owa02
owa1
owa2
ows
oxnard
p
pa
page
pager
pages
paginas
papa
paris
parners
partner
partners
patch
patches
paul
payroll
pbx
pc
pc01
pc1
pc10
pc101
pc11
pc12
pc13
pc14
pc15
pc16
pc17
pc18
pc19
pc2
pc20
pc21
pc22
pc23
pc24
pc25
pc26
pc27
pc28
pc29
pc3
pc30
pc31
pc32
pc33
pc34
pc35
pc36
pc37
pc38
pc39
pc4
pc40
pc41
pc42
pc43
pc44
pc45
pc46
pc47
pc48
pc49
pc5
pc50
pc51
pc52
pc53
pc54
pc55
pc56
pc57
pc58
pc59
pc6
pc60
pc7
pc8
pc9
pcmail
pda
pdc
pe
pegasus
pennsylvania
peoplesoft
personal
pf
pg
pgp
ph
phi
philadelphia
phoenix
phoeniz
phone
phones
photos
pi
pics
picture
pictures
pink
pipex-gw
pittsburgh
pix
pk
pki
pl
plano
platinum
pluto
pm
pm1
pn
po
policy
polls
pop
pop3
portal
portals
portfolio
portland
post
posta
posta01
posta02
posta03
postales
postoffice
ppp1
ppp10
ppp11
ppp12
ppp13
ppp14
ppp15
ppp16
ppp17
ppp18
ppp19
ppp2
ppp20
ppp21
ppp3
ppp4
ppp5
ppp6
ppp7
ppp8
ppp9
pptp
pr
prensa
press
priv
privacy
private
problemtracker
products
profiles
project
projects
promo
proxy
prueba
pruebas
ps
psi
pss
pt
pub
public
pubs
purple
pw
py
q
qa
qmail
qotd
quake
quebec
queen
quotes
r
r01
r02
r1
r2
ra
radio
radius
rapidsite
raptor
ras
rc
rcs
rd
re
read
realserver
recruiting
red
redhat
ref
reference
reg
register
registro
registry
regs
relay
rem
remote
remstats
reports
research
reseller
reserved
resumenes
rho
rhodeisland
ri
ris
rmi
ro
robert
romeo
root
rose
route
router
router1
rs
rss
rtelnet
rtr
rtr01
rtr1
ru
rune
rw
rwhois
s
s1
s2
sa
sac
sacramento
sadmin
safe
sales
saltlake
sam
san
sanantonio
sandiego
sanfrancisco
sanjose
saskatchewan
saturn
sb
sbs
sc
scanner
schedules
scotland
scotty
sd
se
search
seattle
sec
secret
secure
secured
securid
security
sendmail
seri
serv
serv2
server
server1
servers
service
services
servicio
servidor
setup
sg
sh
sha2
shared
sharepoint
shareware
shipping
shop
shoppers
shopping
si
siebel
sierra
sigma
signin
signup
silver
sim
sirius
site
sj
sk
skywalker
sl
slackware
slmail
sm
smc
sms
smtp
smtphost
sn
sniffer
snmp
snmpd
snoopy
snort
so
social
software
sol
solaris
solutions
soporte
source
sourcecode
sourcesafe
south
southcarolina
southdakota
southeast
southwest
spain
spam
spider
spiderman
splunk
spock
spokane
springfield
sqa
sql
sql0
sql01
sql1
sql7
sqlserver
squid
sr
ss
ssh
ssl
ssl0
ssl01
ssl1
st
staff
stage
staging
start
stat
static
statistics
stats
stlouis
stock
storage
store
storefront
streaming
stronghold
strongmail
studio
submit
subversion
sun
sun0
sun01
sun02
sun1
sun2
superman
supplier
suppliers
support
sv
sw
sw0
sw01
sw1
sweden
switch
switzerland
sy
sybase
sydney
sysadmin
sysback
syslog
syslogs
system
sz
t
tacoma
taiwan
talk
tampa
tango
tau
tc
tcl
td
team
tech
technology
techsupport
telephone
telephony
telnet
temp
tennessee
terminal
terminalserver
termserv
test
test2k
testbed
testing
testlab
testlinux
testo
testserver
testsite
testsql
testxp
texas
tf
tftp
tg
th
thailand
theta
thor
tienda
tiger
time
titan
tivoli
tj
tk
tm
tn
to
tokyo
toledo
tom
tool
tools
toplayer
toronto
tour
tp
tr
tracker
train
training
transfers
trinidad
trinity
ts
ts1
tt
tucson
tulsa
tumb
tumblr
tunnel
tv
tw
tx
tz
u
ua
uddi
ug
uk
um
uniform
union
unitedkingdom
unitedstates
unix
unixware
update
updates
upload
ups
upsilon
uranus
urchin
us
usa
usenet
user
users
ut
utah
utilities
uy
uz
v
va
vader
vantive
vault
vc
ve
vega
vegas
vend
vendors
venus
vermont
vg
vi
victor
video
videos
viking
violet
vip
virginia
vista
vm
vmserver
vmware
vn
vnc
voice
voicemail
voip
voyager
vpn
vpn0
vpn01
vpn02
vpn1
vpn2
vt
vu
w
w1
w2
w3
wa
wais
wallet
wam
wan
wap
warehouse
washington
wc3
web
webaccess
webadmin
webalizer
webboard
webcache
webcam
webcast
webdev
webdocs
webfarm
webhelp
weblib
weblogic
webmail
webmaster
webproxy
webring
webs
webserv
webserver
webservices
website
websites
websphere
websrv
websrvr
webstats
webstore
websvr
webtrends
welcome
west
westvirginia
wf
whiskey
white
whois
wi
wichita
wiki
wililiam
win
win01
win02
win1
win2
win2000
win2003
win2k
win2k3
windows
windows01
windows02
windows1
windows2
windows2000
windows2003
windowsxp
wingate
winnt
winproxy
wins
winserve
winxp
wire
wireless
wisconsin
wlan
wordpress
work
world
write
ws
ws1
ws10
ws11
ws12
ws13
ws2
ws3
ws4
ws5
ws6
ws7
ws8
ws9
wusage
wv
ww
ww1
ww42
www
www-
www-01
www-02
www-1
www-2
www-int
www0
www01
www02
www1
www2
www3
www_
wwwchat
wwwdev
wwwmail
wy
wyoming
x
x-ray
xi
xlogan
xmail
xml
xp
y
yankee
ye
yellow
young
yt
yu
z
z-log
za
zebra
zera
zeus
zlog
zm
zulu
zw
|
{
"pile_set_name": "Github"
}
|
/*
Fontname: -Misc-Fixed-Medium-R-Normal--8-80-75-75-C-50-ISO10646-1
Copyright: Public domain font. Share and enjoy.
Glyphs: 95/1426
BBX Build Mode: 3
*/
const uint8_t u8x8_font_5x8_r[764] U8X8_FONT_SECTION("u8x8_font_5x8_r") =
" ~\1\1\0\0\0\0\0\0\0\0\0\0^\0\0\0\0\0\0\16\0\16\0\0\0\0\24\177\24\177"
"\24\0\0\0\4*\177*\20\0\0\0\0\26\10\64\0\0\0\0\66I\66@\0\0\0\0\0\0\16\0"
"\0\0\0\0\0<B\0\0\0\0\0\0B<\0\0\0\0\0T\70\70T\0\0\0\0\20\20|\20"
"\20\0\0\0\0\200` \0\0\0\0\20\20\20\20\0\0\0\0\0@\340@\0\0\0\0`\20\10\6"
"\0\0\0\0\0<B<\0\0\0\0\0D~@\0\0\0\0dRRL\0\0\0\0\42JN\62"
"\0\0\0\0\30\24~\20\0\0\0\0.JJ\62\0\0\0\0<JJ\60\0\0\0\0\2b\32\6"
"\0\0\0\0\64JJ\64\0\0\0\0\14RR<\0\0\0\0\0ll\0\0\0\0\0\0\200l,"
"\0\0\0\0\0\30$B\0\0\0\0((((\0\0\0\0\0B$\30\0\0\0\0\0\4R\14"
"\0\0\0\0<B\231\245\36\0\0\0|\22\22|\0\0\0\0~JJ\64\0\0\0\0<BB$"
"\0\0\0\0~BB<\0\0\0\0~JJB\0\0\0\0~\12\12\2\0\0\0\0<BR\64"
"\0\0\0\0~\10\10~\0\0\0\0\0B~B\0\0\0\0 B>\2\0\0\0\0~\10\64B"
"\0\0\0\0~@@@\0\0\0\0~\14\14~\0\0\0\0~\14\70~\0\0\0\0<BB<"
"\0\0\0\0~\22\22\14\0\0\0\0<Rb\274\0\0\0\0~\22\22l\0\0\0\0$JR$"
"\0\0\0\0\0\2~\2\0\0\0\0>@@>\0\0\0\0\36``\36\0\0\0\0~\60\60~"
"\0\0\0\0f\30\30f\0\0\0\0\6\10p\10\6\0\0\0bRJF\0\0\0\0\0~BB"
"\0\0\0\0\6\10\20`\0\0\0\0\0BB~\0\0\0\0\0\4\2\4\0\0\0\0\200\200\200\200"
"\0\0\0\0\0\2\4\0\0\0\0\0\60HHx\0\0\0\0~HH\60\0\0\0\0\0\60HH"
"\0\0\0\0\60HH~\0\0\0\0\60hX\20\0\0\0\0\20|\22\4\0\0\0\0\20\250\250p"
"\0\0\0\0~\10\10p\0\0\0\0\0Hz@\0\0\0\0\0@\200z\0\0\0\0~\20\20h"
"\0\0\0\0\0B~@\0\0\0\0x\10p\10p\0\0\0x\10\10p\0\0\0\0\60HH\60"
"\0\0\0\0\370((\20\0\0\0\0\20((\370\0\0\0\0x\20\10\20\0\0\0\0\0PX("
"\0\0\0\0\10>H \0\0\0\0\70@@x\0\0\0\0\0\70@\70\0\0\0\0\70@\60@"
"\70\0\0\0H\60\60H\0\0\0\0X\240\240x\0\0\0\0HhXH\0\0\0\0\10*UA"
"\0\0\0\0\0\0~\0\0\0\0\0AU*\10\0\0\0\0\4\2\4\2\0\0\0";
|
{
"pile_set_name": "Github"
}
|
:020000021000EC
:10FC000001C0F2C0112484B790E890936100109273
:10FC10006100882369F0982F9A70923049F081FF33
:10FC200002C097EF94BF282E80E001D10C94000011
:10FC300085E08093810082E08093C80088E1809312
:10FC4000C90080E18093CC0086E08093CA008EE0FA
:10FC5000EED0279A84E020E33CEF91E030938500DA
:10FC60002093840096BBB09BFECF1F9AA89540912D
:10FC7000C80047FD02C0815089F7CDD0813479F4A6
:10FC8000CAD0C82FDAD0C23811F480E004C088E0AE
:10FC9000C13809F083E0B8D080E1B6D0EECF82342D
:10FCA00019F484E1D2D0F8CF853411F485E0FACF8D
:10FCB000853581F4B0D0E82EAED0F82E87FF07C08E
:10FCC0008BB781608BBFEE0CFF1CB7D0E5CF8BB735
:10FCD0008E7FF8CF863579F49ED08D3451F49BD049
:10FCE000CBB799D0C170880F8C2B8BBF81E0ADD082
:10FCF000CCCF83E0FCCF843609F045C08CD0C82F30
:10FD0000D0E0DC2FCC2787D0C82B85D0D82E5E0141
:10FD1000B39400E011E04801EFEF8E1A9E0A7BD009
:10FD2000F801808384018A149B04A9F786D0F5E446
:10FD300010E000E0DF1609F150E040E063E0C701A9
:10FD400053D08701C12CDD24D394F6014191519108
:10FD50006F0161E0C80148D00E5F1F4F2297A9F7DD
:10FD600050E040E065E0C7013FD096CF6081C80118
:10FD70008E0D9F1D79D00F5F1F4FF801F395C017AF
:10FD8000D107A1F789CF843701F545D0C82FD0E03E
:10FD9000DC2FCC2740D0C82B3ED0D82E4ED08701A8
:10FDA000F5E4DF120BC0CE0DDF1DC80155D02CD0FD
:10FDB0000F5F1F4FC017D107C1F76ECFF8018791B2
:10FDC0008F0122D02197D1F767CF853739F435D00D
:10FDD0008EE11AD087E918D086E05DCF813509F031
:10FDE00074CF88E024D071CFFC010A0167BFE89589
:10FDF000112407B600FCFDCF667029F0452B19F4DD
:10FE000081E187BFE89508959091C80095FFFCCFE8
:10FE10008093CE0008958091C80087FFFCCF809129
:10FE2000C80084FD01C0A8958091CE000895E0E649
:10FE3000F0E098E1908380830895EDDF803219F03F
:10FE400088E0F5DFFFCF84E1DFCFCF93C82FE3DF7A
:10FE5000C150E9F7CF91F1CFF999FECF92BD81BDA5
:10FE6000F89A992780B50895262FF999FECF1FBAE1
:10FE700092BD81BD20BD0FB6F894FA9AF99A0FBED3
:04FE8000019608954A
:02FFFE000008F9
:040000031000FC00ED
:00000001FF
|
{
"pile_set_name": "Github"
}
|
/******************************************************************************
* Spine Runtimes License Agreement
* Last updated May 1, 2019. Replaces all prior versions.
*
* Copyright (c) 2013-2019, Esoteric Software LLC
*
* Integration of the Spine Runtimes into software or otherwise creating
* derivative works of the Spine Runtimes is permitted under the terms and
* conditions of Section 2 of the Spine Editor License Agreement:
* http://esotericsoftware.com/spine-editor-license
*
* Otherwise, it is permitted to integrate the Spine Runtimes into software
* or otherwise create derivative works of the Spine Runtimes (collectively,
* "Products"), provided that each user of the Products must obtain their own
* Spine Editor license and redistribution of the Products in any form must
* include this license and copyright notice.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS
* INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#ifndef Spine_HashMap_h
#define Spine_HashMap_h
#include <spine/Extension.h>
#include <spine/Vector.h>
#include <spine/SpineObject.h>
// Required for new with line number and file name in MSVC
#ifdef _MSC_VER
#pragma warning(disable:4291)
#endif
namespace spine {
template<typename K, typename V>
class SP_API HashMap : public SpineObject {
private:
class Entry;
public:
class SP_API Pair {
public:
explicit Pair(K &k, V &v) : key(k), value(v) {}
K &key;
V &value;
};
class SP_API Entries {
public:
friend class HashMap;
explicit Entries(Entry *entry) : _entry(NULL), _hasChecked(false) {
_start.next = entry;
_entry = &_start;
}
Pair next() {
assert(_entry);
assert(_hasChecked);
_entry = _entry->next;
Pair pair(_entry->_key, _entry->_value);
_hasChecked = false;
return pair;
}
bool hasNext() {
_hasChecked = true;
return _entry->next;
}
private:
bool _hasChecked;
Entry _start;
Entry *_entry;
};
HashMap() :
_head(NULL),
_size(0) {
}
~HashMap() {
clear();
}
void clear() {
for (Entry *entry = _head; entry != NULL;) {
Entry* next = entry->next;
delete entry;
entry = next;
}
_head = NULL;
_size = 0;
}
size_t size() {
return _size;
}
void put(const K &key, const V &value) {
Entry *entry = find(key);
if (entry) {
entry->_key = key;
entry->_value = value;
} else {
entry = new(__FILE__, __LINE__) Entry();
entry->_key = key;
entry->_value = value;
Entry *oldHead = _head;
if (oldHead) {
_head = entry;
oldHead->prev = entry;
entry->next = oldHead;
} else {
_head = entry;
}
_size++;
}
}
bool containsKey(const K &key) {
return find(key) != NULL;
}
bool remove(const K &key) {
Entry *entry = find(key);
if (!entry) return false;
Entry *prev = entry->prev;
Entry *next = entry->next;
if (prev) prev->next = next;
else _head = next;
if (next) next->prev = entry->prev;
delete entry;
_size--;
return true;
}
V operator[](const K &key) {
Entry *entry = find(key);
if (entry) return entry->_value;
else {
assert(false);
return 0;
}
}
Entries getEntries() const {
return Entries(_head);
}
private:
Entry *find(const K &key) {
for (Entry *entry = _head; entry != NULL; entry = entry->next) {
if (entry->_key == key)
return entry;
}
return NULL;
}
class SP_API Entry : public SpineObject {
public:
K _key;
V _value;
Entry *next;
Entry *prev;
Entry() : next(NULL), prev(NULL) {}
};
Entry *_head;
size_t _size;
};
}
#endif /* Spine_HashMap_h */
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2010 Broadcom Corporation
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _wlc_key_h_
#define _wlc_key_h_
struct scb;
struct wlc_info;
struct wlc_bsscfg;
/* Maximum # of keys that wl driver supports in S/W.
* Keys supported in H/W is less than or equal to WSEC_MAX_KEYS.
*/
#define WSEC_MAX_KEYS 54 /* Max # of keys (50 + 4 default keys) */
#define WLC_DEFAULT_KEYS 4 /* Default # of keys */
#define WSEC_MAX_WOWL_KEYS 5 /* Max keys in WOWL mode (1 + 4 default keys) */
#define WPA2_GTK_MAX 3
/*
* Max # of keys currently supported:
*
* s/w keys if WSEC_SW(wlc->wsec).
* h/w keys otherwise.
*/
#define WLC_MAX_WSEC_KEYS(wlc) WSEC_MAX_KEYS
/* number of 802.11 default (non-paired, group keys) */
#define WSEC_MAX_DEFAULT_KEYS 4 /* # of default keys */
/* Max # of hardware keys supported */
#define WLC_MAX_WSEC_HW_KEYS(wlc) WSEC_MAX_RCMTA_KEYS
/* Max # of hardware TKIP MIC keys supported */
#define WLC_MAX_TKMIC_HW_KEYS(wlc) (WSEC_MAX_TKMIC_ENGINE_KEYS)
#define WSEC_HW_TKMIC_KEY(wlc, key, bsscfg) \
((((wlc)->machwcap & MCAP_TKIPMIC)) && \
(key) && ((key)->algo == CRYPTO_ALGO_TKIP) && \
!WSEC_SOFTKEY(wlc, key, bsscfg) && \
WSEC_KEY_INDEX(wlc, key) >= WLC_DEFAULT_KEYS && \
(WSEC_KEY_INDEX(wlc, key) < WSEC_MAX_TKMIC_ENGINE_KEYS))
/* index of key in key table */
#define WSEC_KEY_INDEX(wlc, key) ((key)->idx)
#define WSEC_SOFTKEY(wlc, key, bsscfg) (WLC_SW_KEYS(wlc, bsscfg) || \
WSEC_KEY_INDEX(wlc, key) >= WLC_MAX_WSEC_HW_KEYS(wlc))
/* get a key, non-NULL only if key allocated and not clear */
#define WSEC_KEY(wlc, i) (((wlc)->wsec_keys[i] && (wlc)->wsec_keys[i]->len) ? \
(wlc)->wsec_keys[i] : NULL)
#define WSEC_SCB_KEY_VALID(scb) (((scb)->key && (scb)->key->len) ? true : false)
/* default key */
#define WSEC_BSS_DEFAULT_KEY(bsscfg) (((bsscfg)->wsec_index == -1) ? \
(struct wsec_key *)NULL:(bsscfg)->bss_def_keys[(bsscfg)->wsec_index])
/* Macros for key management in IBSS mode */
#define WSEC_IBSS_MAX_PEERS 16 /* Max # of IBSS Peers */
#define WSEC_IBSS_RCMTA_INDEX(idx) \
(((idx - WSEC_MAX_DEFAULT_KEYS) % WSEC_IBSS_MAX_PEERS) + WSEC_MAX_DEFAULT_KEYS)
/* contiguous # key slots for infrastructure mode STA */
#define WSEC_BSS_STA_KEY_GROUP_SIZE 5
typedef struct wsec_iv {
u32 hi; /* upper 32 bits of IV */
u16 lo; /* lower 16 bits of IV */
} wsec_iv_t;
#define WLC_NUMRXIVS 16 /* # rx IVs (one per 802.11e TID) */
typedef struct wsec_key {
u8 ea[ETH_ALEN]; /* per station */
u8 idx; /* key index in wsec_keys array */
u8 id; /* key ID [0-3] */
u8 algo; /* CRYPTO_ALGO_AES_CCM, CRYPTO_ALGO_WEP128, etc */
u8 rcmta; /* rcmta entry index, same as idx by default */
u16 flags; /* misc flags */
u8 algo_hw; /* cache for hw register */
u8 aes_mode; /* cache for hw register */
s8 iv_len; /* IV length */
s8 icv_len; /* ICV length */
u32 len; /* key length..don't move this var */
/* data is 4byte aligned */
u8 data[WLAN_MAX_KEY_LEN]; /* key data */
wsec_iv_t rxiv[WLC_NUMRXIVS]; /* Rx IV (one per TID) */
wsec_iv_t txiv; /* Tx IV */
} wsec_key_t;
#define broken_roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
/* For use with wsec_key_t.flags */
#define WSEC_BS_UPDATE (1 << 0) /* Indicates hw needs key update on BS switch */
#define WSEC_PRIMARY_KEY (1 << 1) /* Indicates this key is the primary (ie tx) key */
#define WSEC_TKIP_ERROR (1 << 2) /* Provoke deliberate MIC error */
#define WSEC_REPLAY_ERROR (1 << 3) /* Provoke deliberate replay */
#define WSEC_IBSS_PEER_GROUP_KEY (1 << 7) /* Flag: group key for a IBSS PEER */
#define WSEC_ICV_ERROR (1 << 8) /* Provoke deliberate ICV error */
#define wlc_key_insert(a, b, c, d, e, f, g, h, i, j) (-EBADE)
#define wlc_key_update(a, b, c) do {} while (0)
#define wlc_key_remove(a, b, c) do {} while (0)
#define wlc_key_remove_all(a, b) do {} while (0)
#define wlc_key_delete(a, b, c) do {} while (0)
#define wlc_scb_key_delete(a, b) do {} while (0)
#define wlc_key_lookup(a, b, c, d, e) (NULL)
#define wlc_key_hw_init_all(a) do {} while (0)
#define wlc_key_hw_init(a, b, c) do {} while (0)
#define wlc_key_hw_wowl_init(a, b, c, d) do {} while (0)
#define wlc_key_sw_wowl_update(a, b, c, d, e) do {} while (0)
#define wlc_key_sw_wowl_create(a, b, c) (-EBADE)
#define wlc_key_iv_update(a, b, c, d, e) do {(void)e; } while (0)
#define wlc_key_iv_init(a, b, c) do {} while (0)
#define wlc_key_set_error(a, b, c) (-EBADE)
#define wlc_key_dump_hw(a, b) (-EBADE)
#define wlc_key_dump_sw(a, b) (-EBADE)
#define wlc_key_defkeyflag(a) (0)
#define wlc_rcmta_add_bssid(a, b) do {} while (0)
#define wlc_rcmta_del_bssid(a, b) do {} while (0)
#define wlc_key_scb_delete(a, b) do {} while (0)
#endif /* _wlc_key_h_ */
|
{
"pile_set_name": "Github"
}
|
:10FC000001C0DDC0112484B790E890936100109288
:10FC10006100882361F0982F9A70923041F081FF43
:10FC200002C097EF94BF282E80E0ECD0E9C185E0B8
:10FC30008093810082E08093C00088E18093C100BE
:10FC400081E08093C40086E08093C2008EE0DAD029
:10FC5000259A84E020E93FEF91E0309385002093DE
:10FC6000840096BBB09BFECF1D9AA8954091C00022
:10FC700047FD02C0815089F7B9D0813479F4B6D0FC
:10FC8000C82FC6D0C23811F480E004C088E0C13863
:10FC900009F083E0A4D080E1A2D0EECF823419F441
:10FCA00084E1BED0F8CF853411F485E0FACF8535F4
:10FCB00041F49CD0E82E9AD0F82EEE0CFF1CA8D070
:10FCC000EACF863519F484E0ABD0DECF843609F074
:10FCD00045C08CD0C82FD0E0DC2FCC2787D0C82BD4
:10FCE00085D0D82E5E01B39400E011E04801EFEF1B
:10FCF0008E1A9E0A7BD0F801808384018A149B04AB
:10FD0000A9F786D0F5E410E000E0DF1609F150E035
:10FD100040E063E0C70153D08701C12CDD24D394B8
:10FD2000F601419151916F0161E0C80148D00E5F29
:10FD30001F4F2297A9F750E040E065E0C7013FD090
:10FD4000AACF6081C8018E0D9F1D79D00F5F1F4F14
:10FD5000F801F395C017D107A1F79DCF843701F5BE
:10FD600045D0C82FD0E0DC2FCC2740D0C82B3ED0C8
:10FD7000D82E4ED08701F5E4DF120BC0CE0DDF1D6B
:10FD8000C80155D02CD00F5F1F4FC017D107C1F746
:10FD900082CFF80185918F0122D02197D1F77BCFB7
:10FDA000853739F435D08EE11AD086E918D085E050
:10FDB00071CF813509F083CF88E024D080CFFC015A
:10FDC0000A0167BFE895112407B600FCFDCF6670F5
:10FDD00029F0452B19F481E187BFE89508959091AA
:10FDE000C00095FFFCCF8093C60008958091C000AD
:10FDF00087FFFCCF8091C00084FD01C0A895809151
:10FE0000C6000895E0E6F0E098E1908380830895CD
:10FE1000EDDF803219F088E0F5DFFFCF84E1DFCF3E
:10FE2000CF93C82FE3DFC150E9F7CF91F1CFF99914
:10FE3000FECF92BD81BDF89A992780B50895262FEF
:10FE4000F999FECF92BD81BD20BD0FB6F894FA9A04
:08FE5000F99A0FBE0196089516
:02FFFE000008F9
:040000030000FC00FD
:00000001FF
|
{
"pile_set_name": "Github"
}
|
:10FC000001C0DDC0112484B790E890936100109288
:10FC10006100882361F0982F9A70923041F081FF43
:10FC200002C097EF94BF282E80E0ECD0E9C185E0B8
:10FC30008093810082E08093C80088E18093C900AE
:10FC400087E18093CC0086E08093CA008EE0DAD012
:10FC5000279A84E02AEB3AEF91E0309385002093D5
:10FC6000840096BBB09BFECF1F9AA8954091C80018
:10FC700047FD02C0815089F7B9D0813479F4B6D0FC
:10FC8000C82FC6D0C23811F480E004C088E0C13863
:10FC900009F083E0A4D080E1A2D0EECF823419F441
:10FCA00084E1BED0F8CF853411F485E0FACF8535F4
:10FCB00041F49CD0E82E9AD0F82EEE0CFF1CA8D070
:10FCC000EACF863519F484E0ABD0DECF843609F074
:10FCD00045C08CD0C82FD0E0DC2FCC2787D0C82BD4
:10FCE00085D0D82E5E01B39400E011E04801EFEF1B
:10FCF0008E1A9E0A7BD0F801808384018A149B04AB
:10FD0000A9F786D0F5E410E000E0DF1609F150E035
:10FD100040E063E0C70153D08701C12CDD24D394B8
:10FD2000F601419151916F0161E0C80148D00E5F29
:10FD30001F4F2297A9F750E040E065E0C7013FD090
:10FD4000AACF6081C8018E0D9F1D79D00F5F1F4F14
:10FD5000F801F395C017D107A1F79DCF843701F5BE
:10FD600045D0C82FD0E0DC2FCC2740D0C82B3ED0C8
:10FD7000D82E4ED08701F5E4DF120BC0CE0DDF1D6B
:10FD8000C80155D02CD00F5F1F4FC017D107C1F746
:10FD900082CFF80185918F0122D02197D1F77BCFB7
:10FDA000853739F435D08EE11AD086E918D089E04C
:10FDB00071CF813509F083CF88E024D080CFFC015A
:10FDC0000A0167BFE895112407B600FCFDCF6670F5
:10FDD00029F0452B19F481E187BFE89508959091AA
:10FDE000C80095FFFCCF8093CE0008958091C80095
:10FDF00087FFFCCF8091C80084FD01C0A895809149
:10FE0000CE000895E0E6F0E098E1908380830895C5
:10FE1000EDDF803219F088E0F5DFFFCF84E1DFCF3E
:10FE2000CF93C82FE3DFC150E9F7CF91F1CFF99914
:10FE3000FECF92BD81BDF89A992780B50895262FEF
:10FE4000F999FECF1FBA92BD81BD20BD0FB6F894BF
:0AFE5000FA9AF99A0FBE0196089580
:02FFFE000008F9
:040000030000FC00FD
:00000001FF
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2004-2008 Chelsio, Inc. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* - Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
*
* - Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef T3_CPL_H
#define T3_CPL_H
#if !defined(__LITTLE_ENDIAN_BITFIELD) && !defined(__BIG_ENDIAN_BITFIELD)
# include <asm/byteorder.h>
#endif
enum CPL_opcode {
CPL_PASS_OPEN_REQ = 0x1,
CPL_PASS_ACCEPT_RPL = 0x2,
CPL_ACT_OPEN_REQ = 0x3,
CPL_SET_TCB = 0x4,
CPL_SET_TCB_FIELD = 0x5,
CPL_GET_TCB = 0x6,
CPL_PCMD = 0x7,
CPL_CLOSE_CON_REQ = 0x8,
CPL_CLOSE_LISTSRV_REQ = 0x9,
CPL_ABORT_REQ = 0xA,
CPL_ABORT_RPL = 0xB,
CPL_TX_DATA = 0xC,
CPL_RX_DATA_ACK = 0xD,
CPL_TX_PKT = 0xE,
CPL_RTE_DELETE_REQ = 0xF,
CPL_RTE_WRITE_REQ = 0x10,
CPL_RTE_READ_REQ = 0x11,
CPL_L2T_WRITE_REQ = 0x12,
CPL_L2T_READ_REQ = 0x13,
CPL_SMT_WRITE_REQ = 0x14,
CPL_SMT_READ_REQ = 0x15,
CPL_TX_PKT_LSO = 0x16,
CPL_PCMD_READ = 0x17,
CPL_BARRIER = 0x18,
CPL_TID_RELEASE = 0x1A,
CPL_CLOSE_LISTSRV_RPL = 0x20,
CPL_ERROR = 0x21,
CPL_GET_TCB_RPL = 0x22,
CPL_L2T_WRITE_RPL = 0x23,
CPL_PCMD_READ_RPL = 0x24,
CPL_PCMD_RPL = 0x25,
CPL_PEER_CLOSE = 0x26,
CPL_RTE_DELETE_RPL = 0x27,
CPL_RTE_WRITE_RPL = 0x28,
CPL_RX_DDP_COMPLETE = 0x29,
CPL_RX_PHYS_ADDR = 0x2A,
CPL_RX_PKT = 0x2B,
CPL_RX_URG_NOTIFY = 0x2C,
CPL_SET_TCB_RPL = 0x2D,
CPL_SMT_WRITE_RPL = 0x2E,
CPL_TX_DATA_ACK = 0x2F,
CPL_ABORT_REQ_RSS = 0x30,
CPL_ABORT_RPL_RSS = 0x31,
CPL_CLOSE_CON_RPL = 0x32,
CPL_ISCSI_HDR = 0x33,
CPL_L2T_READ_RPL = 0x34,
CPL_RDMA_CQE = 0x35,
CPL_RDMA_CQE_READ_RSP = 0x36,
CPL_RDMA_CQE_ERR = 0x37,
CPL_RTE_READ_RPL = 0x38,
CPL_RX_DATA = 0x39,
CPL_ACT_OPEN_RPL = 0x40,
CPL_PASS_OPEN_RPL = 0x41,
CPL_RX_DATA_DDP = 0x42,
CPL_SMT_READ_RPL = 0x43,
CPL_ACT_ESTABLISH = 0x50,
CPL_PASS_ESTABLISH = 0x51,
CPL_PASS_ACCEPT_REQ = 0x70,
CPL_ASYNC_NOTIF = 0x80, /* fake opcode for async notifications */
CPL_TX_DMA_ACK = 0xA0,
CPL_RDMA_READ_REQ = 0xA1,
CPL_RDMA_TERMINATE = 0xA2,
CPL_TRACE_PKT = 0xA3,
CPL_RDMA_EC_STATUS = 0xA5,
NUM_CPL_CMDS /* must be last and previous entries must be sorted */
};
enum CPL_error {
CPL_ERR_NONE = 0,
CPL_ERR_TCAM_PARITY = 1,
CPL_ERR_TCAM_FULL = 3,
CPL_ERR_CONN_RESET = 20,
CPL_ERR_CONN_EXIST = 22,
CPL_ERR_ARP_MISS = 23,
CPL_ERR_BAD_SYN = 24,
CPL_ERR_CONN_TIMEDOUT = 30,
CPL_ERR_XMIT_TIMEDOUT = 31,
CPL_ERR_PERSIST_TIMEDOUT = 32,
CPL_ERR_FINWAIT2_TIMEDOUT = 33,
CPL_ERR_KEEPALIVE_TIMEDOUT = 34,
CPL_ERR_RTX_NEG_ADVICE = 35,
CPL_ERR_PERSIST_NEG_ADVICE = 36,
CPL_ERR_ABORT_FAILED = 42,
CPL_ERR_GENERAL = 99
};
enum {
CPL_CONN_POLICY_AUTO = 0,
CPL_CONN_POLICY_ASK = 1,
CPL_CONN_POLICY_DENY = 3
};
enum {
ULP_MODE_NONE = 0,
ULP_MODE_ISCSI = 2,
ULP_MODE_RDMA = 4,
ULP_MODE_TCPDDP = 5
};
enum {
ULP_CRC_HEADER = 1 << 0,
ULP_CRC_DATA = 1 << 1
};
enum {
CPL_PASS_OPEN_ACCEPT,
CPL_PASS_OPEN_REJECT
};
enum {
CPL_ABORT_SEND_RST = 0,
CPL_ABORT_NO_RST,
CPL_ABORT_POST_CLOSE_REQ = 2
};
enum { /* TX_PKT_LSO ethernet types */
CPL_ETH_II,
CPL_ETH_II_VLAN,
CPL_ETH_802_3,
CPL_ETH_802_3_VLAN
};
enum { /* TCP congestion control algorithms */
CONG_ALG_RENO,
CONG_ALG_TAHOE,
CONG_ALG_NEWRENO,
CONG_ALG_HIGHSPEED
};
enum { /* RSS hash type */
RSS_HASH_NONE = 0,
RSS_HASH_2_TUPLE = 1,
RSS_HASH_4_TUPLE = 2,
RSS_HASH_TCPV6 = 3
};
union opcode_tid {
__be32 opcode_tid;
__u8 opcode;
};
#define S_OPCODE 24
#define V_OPCODE(x) ((x) << S_OPCODE)
#define G_OPCODE(x) (((x) >> S_OPCODE) & 0xFF)
#define G_TID(x) ((x) & 0xFFFFFF)
#define S_QNUM 0
#define G_QNUM(x) (((x) >> S_QNUM) & 0xFFFF)
#define S_HASHTYPE 22
#define M_HASHTYPE 0x3
#define G_HASHTYPE(x) (((x) >> S_HASHTYPE) & M_HASHTYPE)
/* tid is assumed to be 24-bits */
#define MK_OPCODE_TID(opcode, tid) (V_OPCODE(opcode) | (tid))
#define OPCODE_TID(cmd) ((cmd)->ot.opcode_tid)
/* extract the TID from a CPL command */
#define GET_TID(cmd) (G_TID(ntohl(OPCODE_TID(cmd))))
struct tcp_options {
__be16 mss;
__u8 wsf;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8:5;
__u8 ecn:1;
__u8 sack:1;
__u8 tstamp:1;
#else
__u8 tstamp:1;
__u8 sack:1;
__u8 ecn:1;
__u8:5;
#endif
};
struct rss_header {
__u8 opcode;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 cpu_idx:6;
__u8 hash_type:2;
#else
__u8 hash_type:2;
__u8 cpu_idx:6;
#endif
__be16 cq_idx;
__be32 rss_hash_val;
};
#ifndef CHELSIO_FW
struct work_request_hdr {
__be32 wr_hi;
__be32 wr_lo;
};
/* wr_hi fields */
#define S_WR_SGE_CREDITS 0
#define M_WR_SGE_CREDITS 0xFF
#define V_WR_SGE_CREDITS(x) ((x) << S_WR_SGE_CREDITS)
#define G_WR_SGE_CREDITS(x) (((x) >> S_WR_SGE_CREDITS) & M_WR_SGE_CREDITS)
#define S_WR_SGLSFLT 8
#define M_WR_SGLSFLT 0xFF
#define V_WR_SGLSFLT(x) ((x) << S_WR_SGLSFLT)
#define G_WR_SGLSFLT(x) (((x) >> S_WR_SGLSFLT) & M_WR_SGLSFLT)
#define S_WR_BCNTLFLT 16
#define M_WR_BCNTLFLT 0xF
#define V_WR_BCNTLFLT(x) ((x) << S_WR_BCNTLFLT)
#define G_WR_BCNTLFLT(x) (((x) >> S_WR_BCNTLFLT) & M_WR_BCNTLFLT)
#define S_WR_DATATYPE 20
#define V_WR_DATATYPE(x) ((x) << S_WR_DATATYPE)
#define F_WR_DATATYPE V_WR_DATATYPE(1U)
#define S_WR_COMPL 21
#define V_WR_COMPL(x) ((x) << S_WR_COMPL)
#define F_WR_COMPL V_WR_COMPL(1U)
#define S_WR_EOP 22
#define V_WR_EOP(x) ((x) << S_WR_EOP)
#define F_WR_EOP V_WR_EOP(1U)
#define S_WR_SOP 23
#define V_WR_SOP(x) ((x) << S_WR_SOP)
#define F_WR_SOP V_WR_SOP(1U)
#define S_WR_OP 24
#define M_WR_OP 0xFF
#define V_WR_OP(x) ((x) << S_WR_OP)
#define G_WR_OP(x) (((x) >> S_WR_OP) & M_WR_OP)
/* wr_lo fields */
#define S_WR_LEN 0
#define M_WR_LEN 0xFF
#define V_WR_LEN(x) ((x) << S_WR_LEN)
#define G_WR_LEN(x) (((x) >> S_WR_LEN) & M_WR_LEN)
#define S_WR_TID 8
#define M_WR_TID 0xFFFFF
#define V_WR_TID(x) ((x) << S_WR_TID)
#define G_WR_TID(x) (((x) >> S_WR_TID) & M_WR_TID)
#define S_WR_CR_FLUSH 30
#define V_WR_CR_FLUSH(x) ((x) << S_WR_CR_FLUSH)
#define F_WR_CR_FLUSH V_WR_CR_FLUSH(1U)
#define S_WR_GEN 31
#define V_WR_GEN(x) ((x) << S_WR_GEN)
#define F_WR_GEN V_WR_GEN(1U)
# define WR_HDR struct work_request_hdr wr
# define RSS_HDR
#else
# define WR_HDR
# define RSS_HDR struct rss_header rss_hdr;
#endif
/* option 0 lower-half fields */
#define S_CPL_STATUS 0
#define M_CPL_STATUS 0xFF
#define V_CPL_STATUS(x) ((x) << S_CPL_STATUS)
#define G_CPL_STATUS(x) (((x) >> S_CPL_STATUS) & M_CPL_STATUS)
#define S_INJECT_TIMER 6
#define V_INJECT_TIMER(x) ((x) << S_INJECT_TIMER)
#define F_INJECT_TIMER V_INJECT_TIMER(1U)
#define S_NO_OFFLOAD 7
#define V_NO_OFFLOAD(x) ((x) << S_NO_OFFLOAD)
#define F_NO_OFFLOAD V_NO_OFFLOAD(1U)
#define S_ULP_MODE 8
#define M_ULP_MODE 0xF
#define V_ULP_MODE(x) ((x) << S_ULP_MODE)
#define G_ULP_MODE(x) (((x) >> S_ULP_MODE) & M_ULP_MODE)
#define S_RCV_BUFSIZ 12
#define M_RCV_BUFSIZ 0x3FFF
#define V_RCV_BUFSIZ(x) ((x) << S_RCV_BUFSIZ)
#define G_RCV_BUFSIZ(x) (((x) >> S_RCV_BUFSIZ) & M_RCV_BUFSIZ)
#define S_TOS 26
#define M_TOS 0x3F
#define V_TOS(x) ((x) << S_TOS)
#define G_TOS(x) (((x) >> S_TOS) & M_TOS)
/* option 0 upper-half fields */
#define S_DELACK 0
#define V_DELACK(x) ((x) << S_DELACK)
#define F_DELACK V_DELACK(1U)
#define S_NO_CONG 1
#define V_NO_CONG(x) ((x) << S_NO_CONG)
#define F_NO_CONG V_NO_CONG(1U)
#define S_SRC_MAC_SEL 2
#define M_SRC_MAC_SEL 0x3
#define V_SRC_MAC_SEL(x) ((x) << S_SRC_MAC_SEL)
#define G_SRC_MAC_SEL(x) (((x) >> S_SRC_MAC_SEL) & M_SRC_MAC_SEL)
#define S_L2T_IDX 4
#define M_L2T_IDX 0x7FF
#define V_L2T_IDX(x) ((x) << S_L2T_IDX)
#define G_L2T_IDX(x) (((x) >> S_L2T_IDX) & M_L2T_IDX)
#define S_TX_CHANNEL 15
#define V_TX_CHANNEL(x) ((x) << S_TX_CHANNEL)
#define F_TX_CHANNEL V_TX_CHANNEL(1U)
#define S_TCAM_BYPASS 16
#define V_TCAM_BYPASS(x) ((x) << S_TCAM_BYPASS)
#define F_TCAM_BYPASS V_TCAM_BYPASS(1U)
#define S_NAGLE 17
#define V_NAGLE(x) ((x) << S_NAGLE)
#define F_NAGLE V_NAGLE(1U)
#define S_WND_SCALE 18
#define M_WND_SCALE 0xF
#define V_WND_SCALE(x) ((x) << S_WND_SCALE)
#define G_WND_SCALE(x) (((x) >> S_WND_SCALE) & M_WND_SCALE)
#define S_KEEP_ALIVE 22
#define V_KEEP_ALIVE(x) ((x) << S_KEEP_ALIVE)
#define F_KEEP_ALIVE V_KEEP_ALIVE(1U)
#define S_MAX_RETRANS 23
#define M_MAX_RETRANS 0xF
#define V_MAX_RETRANS(x) ((x) << S_MAX_RETRANS)
#define G_MAX_RETRANS(x) (((x) >> S_MAX_RETRANS) & M_MAX_RETRANS)
#define S_MAX_RETRANS_OVERRIDE 27
#define V_MAX_RETRANS_OVERRIDE(x) ((x) << S_MAX_RETRANS_OVERRIDE)
#define F_MAX_RETRANS_OVERRIDE V_MAX_RETRANS_OVERRIDE(1U)
#define S_MSS_IDX 28
#define M_MSS_IDX 0xF
#define V_MSS_IDX(x) ((x) << S_MSS_IDX)
#define G_MSS_IDX(x) (((x) >> S_MSS_IDX) & M_MSS_IDX)
/* option 1 fields */
#define S_RSS_ENABLE 0
#define V_RSS_ENABLE(x) ((x) << S_RSS_ENABLE)
#define F_RSS_ENABLE V_RSS_ENABLE(1U)
#define S_RSS_MASK_LEN 1
#define M_RSS_MASK_LEN 0x7
#define V_RSS_MASK_LEN(x) ((x) << S_RSS_MASK_LEN)
#define G_RSS_MASK_LEN(x) (((x) >> S_RSS_MASK_LEN) & M_RSS_MASK_LEN)
#define S_CPU_IDX 4
#define M_CPU_IDX 0x3F
#define V_CPU_IDX(x) ((x) << S_CPU_IDX)
#define G_CPU_IDX(x) (((x) >> S_CPU_IDX) & M_CPU_IDX)
#define S_MAC_MATCH_VALID 18
#define V_MAC_MATCH_VALID(x) ((x) << S_MAC_MATCH_VALID)
#define F_MAC_MATCH_VALID V_MAC_MATCH_VALID(1U)
#define S_CONN_POLICY 19
#define M_CONN_POLICY 0x3
#define V_CONN_POLICY(x) ((x) << S_CONN_POLICY)
#define G_CONN_POLICY(x) (((x) >> S_CONN_POLICY) & M_CONN_POLICY)
#define S_SYN_DEFENSE 21
#define V_SYN_DEFENSE(x) ((x) << S_SYN_DEFENSE)
#define F_SYN_DEFENSE V_SYN_DEFENSE(1U)
#define S_VLAN_PRI 22
#define M_VLAN_PRI 0x3
#define V_VLAN_PRI(x) ((x) << S_VLAN_PRI)
#define G_VLAN_PRI(x) (((x) >> S_VLAN_PRI) & M_VLAN_PRI)
#define S_VLAN_PRI_VALID 24
#define V_VLAN_PRI_VALID(x) ((x) << S_VLAN_PRI_VALID)
#define F_VLAN_PRI_VALID V_VLAN_PRI_VALID(1U)
#define S_PKT_TYPE 25
#define M_PKT_TYPE 0x3
#define V_PKT_TYPE(x) ((x) << S_PKT_TYPE)
#define G_PKT_TYPE(x) (((x) >> S_PKT_TYPE) & M_PKT_TYPE)
#define S_MAC_MATCH 27
#define M_MAC_MATCH 0x1F
#define V_MAC_MATCH(x) ((x) << S_MAC_MATCH)
#define G_MAC_MATCH(x) (((x) >> S_MAC_MATCH) & M_MAC_MATCH)
/* option 2 fields */
#define S_CPU_INDEX 0
#define M_CPU_INDEX 0x7F
#define V_CPU_INDEX(x) ((x) << S_CPU_INDEX)
#define G_CPU_INDEX(x) (((x) >> S_CPU_INDEX) & M_CPU_INDEX)
#define S_CPU_INDEX_VALID 7
#define V_CPU_INDEX_VALID(x) ((x) << S_CPU_INDEX_VALID)
#define F_CPU_INDEX_VALID V_CPU_INDEX_VALID(1U)
#define S_RX_COALESCE 8
#define M_RX_COALESCE 0x3
#define V_RX_COALESCE(x) ((x) << S_RX_COALESCE)
#define G_RX_COALESCE(x) (((x) >> S_RX_COALESCE) & M_RX_COALESCE)
#define S_RX_COALESCE_VALID 10
#define V_RX_COALESCE_VALID(x) ((x) << S_RX_COALESCE_VALID)
#define F_RX_COALESCE_VALID V_RX_COALESCE_VALID(1U)
#define S_CONG_CONTROL_FLAVOR 11
#define M_CONG_CONTROL_FLAVOR 0x3
#define V_CONG_CONTROL_FLAVOR(x) ((x) << S_CONG_CONTROL_FLAVOR)
#define G_CONG_CONTROL_FLAVOR(x) (((x) >> S_CONG_CONTROL_FLAVOR) & M_CONG_CONTROL_FLAVOR)
#define S_PACING_FLAVOR 13
#define M_PACING_FLAVOR 0x3
#define V_PACING_FLAVOR(x) ((x) << S_PACING_FLAVOR)
#define G_PACING_FLAVOR(x) (((x) >> S_PACING_FLAVOR) & M_PACING_FLAVOR)
#define S_FLAVORS_VALID 15
#define V_FLAVORS_VALID(x) ((x) << S_FLAVORS_VALID)
#define F_FLAVORS_VALID V_FLAVORS_VALID(1U)
#define S_RX_FC_DISABLE 16
#define V_RX_FC_DISABLE(x) ((x) << S_RX_FC_DISABLE)
#define F_RX_FC_DISABLE V_RX_FC_DISABLE(1U)
#define S_RX_FC_VALID 17
#define V_RX_FC_VALID(x) ((x) << S_RX_FC_VALID)
#define F_RX_FC_VALID V_RX_FC_VALID(1U)
struct cpl_pass_open_req {
WR_HDR;
union opcode_tid ot;
__be16 local_port;
__be16 peer_port;
__be32 local_ip;
__be32 peer_ip;
__be32 opt0h;
__be32 opt0l;
__be32 peer_netmask;
__be32 opt1;
};
struct cpl_pass_open_rpl {
RSS_HDR union opcode_tid ot;
__be16 local_port;
__be16 peer_port;
__be32 local_ip;
__be32 peer_ip;
__u8 resvd[7];
__u8 status;
};
struct cpl_pass_establish {
RSS_HDR union opcode_tid ot;
__be16 local_port;
__be16 peer_port;
__be32 local_ip;
__be32 peer_ip;
__be32 tos_tid;
__be16 l2t_idx;
__be16 tcp_opt;
__be32 snd_isn;
__be32 rcv_isn;
};
/* cpl_pass_establish.tos_tid fields */
#define S_PASS_OPEN_TID 0
#define M_PASS_OPEN_TID 0xFFFFFF
#define V_PASS_OPEN_TID(x) ((x) << S_PASS_OPEN_TID)
#define G_PASS_OPEN_TID(x) (((x) >> S_PASS_OPEN_TID) & M_PASS_OPEN_TID)
#define S_PASS_OPEN_TOS 24
#define M_PASS_OPEN_TOS 0xFF
#define V_PASS_OPEN_TOS(x) ((x) << S_PASS_OPEN_TOS)
#define G_PASS_OPEN_TOS(x) (((x) >> S_PASS_OPEN_TOS) & M_PASS_OPEN_TOS)
/* cpl_pass_establish.l2t_idx fields */
#define S_L2T_IDX16 5
#define M_L2T_IDX16 0x7FF
#define V_L2T_IDX16(x) ((x) << S_L2T_IDX16)
#define G_L2T_IDX16(x) (((x) >> S_L2T_IDX16) & M_L2T_IDX16)
/* cpl_pass_establish.tcp_opt fields (also applies act_open_establish) */
#define G_TCPOPT_WSCALE_OK(x) (((x) >> 5) & 1)
#define G_TCPOPT_SACK(x) (((x) >> 6) & 1)
#define G_TCPOPT_TSTAMP(x) (((x) >> 7) & 1)
#define G_TCPOPT_SND_WSCALE(x) (((x) >> 8) & 0xf)
#define G_TCPOPT_MSS(x) (((x) >> 12) & 0xf)
struct cpl_pass_accept_req {
RSS_HDR union opcode_tid ot;
__be16 local_port;
__be16 peer_port;
__be32 local_ip;
__be32 peer_ip;
__be32 tos_tid;
struct tcp_options tcp_options;
__u8 dst_mac[6];
__be16 vlan_tag;
__u8 src_mac[6];
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8:3;
__u8 addr_idx:3;
__u8 port_idx:1;
__u8 exact_match:1;
#else
__u8 exact_match:1;
__u8 port_idx:1;
__u8 addr_idx:3;
__u8:3;
#endif
__u8 rsvd;
__be32 rcv_isn;
__be32 rsvd2;
};
struct cpl_pass_accept_rpl {
WR_HDR;
union opcode_tid ot;
__be32 opt2;
__be32 rsvd;
__be32 peer_ip;
__be32 opt0h;
__be32 opt0l_status;
};
struct cpl_act_open_req {
WR_HDR;
union opcode_tid ot;
__be16 local_port;
__be16 peer_port;
__be32 local_ip;
__be32 peer_ip;
__be32 opt0h;
__be32 opt0l;
__be32 params;
__be32 opt2;
};
/* cpl_act_open_req.params fields */
#define S_AOPEN_VLAN_PRI 9
#define M_AOPEN_VLAN_PRI 0x3
#define V_AOPEN_VLAN_PRI(x) ((x) << S_AOPEN_VLAN_PRI)
#define G_AOPEN_VLAN_PRI(x) (((x) >> S_AOPEN_VLAN_PRI) & M_AOPEN_VLAN_PRI)
#define S_AOPEN_VLAN_PRI_VALID 11
#define V_AOPEN_VLAN_PRI_VALID(x) ((x) << S_AOPEN_VLAN_PRI_VALID)
#define F_AOPEN_VLAN_PRI_VALID V_AOPEN_VLAN_PRI_VALID(1U)
#define S_AOPEN_PKT_TYPE 12
#define M_AOPEN_PKT_TYPE 0x3
#define V_AOPEN_PKT_TYPE(x) ((x) << S_AOPEN_PKT_TYPE)
#define G_AOPEN_PKT_TYPE(x) (((x) >> S_AOPEN_PKT_TYPE) & M_AOPEN_PKT_TYPE)
#define S_AOPEN_MAC_MATCH 14
#define M_AOPEN_MAC_MATCH 0x1F
#define V_AOPEN_MAC_MATCH(x) ((x) << S_AOPEN_MAC_MATCH)
#define G_AOPEN_MAC_MATCH(x) (((x) >> S_AOPEN_MAC_MATCH) & M_AOPEN_MAC_MATCH)
#define S_AOPEN_MAC_MATCH_VALID 19
#define V_AOPEN_MAC_MATCH_VALID(x) ((x) << S_AOPEN_MAC_MATCH_VALID)
#define F_AOPEN_MAC_MATCH_VALID V_AOPEN_MAC_MATCH_VALID(1U)
#define S_AOPEN_IFF_VLAN 20
#define M_AOPEN_IFF_VLAN 0xFFF
#define V_AOPEN_IFF_VLAN(x) ((x) << S_AOPEN_IFF_VLAN)
#define G_AOPEN_IFF_VLAN(x) (((x) >> S_AOPEN_IFF_VLAN) & M_AOPEN_IFF_VLAN)
struct cpl_act_open_rpl {
RSS_HDR union opcode_tid ot;
__be16 local_port;
__be16 peer_port;
__be32 local_ip;
__be32 peer_ip;
__be32 atid;
__u8 rsvd[3];
__u8 status;
};
struct cpl_act_establish {
RSS_HDR union opcode_tid ot;
__be16 local_port;
__be16 peer_port;
__be32 local_ip;
__be32 peer_ip;
__be32 tos_tid;
__be16 l2t_idx;
__be16 tcp_opt;
__be32 snd_isn;
__be32 rcv_isn;
};
struct cpl_get_tcb {
WR_HDR;
union opcode_tid ot;
__be16 cpuno;
__be16 rsvd;
};
struct cpl_get_tcb_rpl {
RSS_HDR union opcode_tid ot;
__u8 rsvd;
__u8 status;
__be16 len;
};
struct cpl_set_tcb {
WR_HDR;
union opcode_tid ot;
__u8 reply;
__u8 cpu_idx;
__be16 len;
};
/* cpl_set_tcb.reply fields */
#define S_NO_REPLY 7
#define V_NO_REPLY(x) ((x) << S_NO_REPLY)
#define F_NO_REPLY V_NO_REPLY(1U)
struct cpl_set_tcb_field {
WR_HDR;
union opcode_tid ot;
__u8 reply;
__u8 cpu_idx;
__be16 word;
__be64 mask;
__be64 val;
};
struct cpl_set_tcb_rpl {
RSS_HDR union opcode_tid ot;
__u8 rsvd[3];
__u8 status;
};
struct cpl_pcmd {
WR_HDR;
union opcode_tid ot;
__u8 rsvd[3];
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 src:1;
__u8 bundle:1;
__u8 channel:1;
__u8:5;
#else
__u8:5;
__u8 channel:1;
__u8 bundle:1;
__u8 src:1;
#endif
__be32 pcmd_parm[2];
};
struct cpl_pcmd_reply {
RSS_HDR union opcode_tid ot;
__u8 status;
__u8 rsvd;
__be16 len;
};
struct cpl_close_con_req {
WR_HDR;
union opcode_tid ot;
__be32 rsvd;
};
struct cpl_close_con_rpl {
RSS_HDR union opcode_tid ot;
__u8 rsvd[3];
__u8 status;
__be32 snd_nxt;
__be32 rcv_nxt;
};
struct cpl_close_listserv_req {
WR_HDR;
union opcode_tid ot;
__u8 rsvd0;
__u8 cpu_idx;
__be16 rsvd1;
};
struct cpl_close_listserv_rpl {
RSS_HDR union opcode_tid ot;
__u8 rsvd[3];
__u8 status;
};
struct cpl_abort_req_rss {
RSS_HDR union opcode_tid ot;
__be32 rsvd0;
__u8 rsvd1;
__u8 status;
__u8 rsvd2[6];
};
struct cpl_abort_req {
WR_HDR;
union opcode_tid ot;
__be32 rsvd0;
__u8 rsvd1;
__u8 cmd;
__u8 rsvd2[6];
};
struct cpl_abort_rpl_rss {
RSS_HDR union opcode_tid ot;
__be32 rsvd0;
__u8 rsvd1;
__u8 status;
__u8 rsvd2[6];
};
struct cpl_abort_rpl {
WR_HDR;
union opcode_tid ot;
__be32 rsvd0;
__u8 rsvd1;
__u8 cmd;
__u8 rsvd2[6];
};
struct cpl_peer_close {
RSS_HDR union opcode_tid ot;
__be32 rcv_nxt;
};
struct tx_data_wr {
__be32 wr_hi;
__be32 wr_lo;
__be32 len;
__be32 flags;
__be32 sndseq;
__be32 param;
};
/* tx_data_wr.flags fields */
#define S_TX_ACK_PAGES 21
#define M_TX_ACK_PAGES 0x7
#define V_TX_ACK_PAGES(x) ((x) << S_TX_ACK_PAGES)
#define G_TX_ACK_PAGES(x) (((x) >> S_TX_ACK_PAGES) & M_TX_ACK_PAGES)
/* tx_data_wr.param fields */
#define S_TX_PORT 0
#define M_TX_PORT 0x7
#define V_TX_PORT(x) ((x) << S_TX_PORT)
#define G_TX_PORT(x) (((x) >> S_TX_PORT) & M_TX_PORT)
#define S_TX_MSS 4
#define M_TX_MSS 0xF
#define V_TX_MSS(x) ((x) << S_TX_MSS)
#define G_TX_MSS(x) (((x) >> S_TX_MSS) & M_TX_MSS)
#define S_TX_QOS 8
#define M_TX_QOS 0xFF
#define V_TX_QOS(x) ((x) << S_TX_QOS)
#define G_TX_QOS(x) (((x) >> S_TX_QOS) & M_TX_QOS)
#define S_TX_SNDBUF 16
#define M_TX_SNDBUF 0xFFFF
#define V_TX_SNDBUF(x) ((x) << S_TX_SNDBUF)
#define G_TX_SNDBUF(x) (((x) >> S_TX_SNDBUF) & M_TX_SNDBUF)
struct cpl_tx_data {
union opcode_tid ot;
__be32 len;
__be32 rsvd;
__be16 urg;
__be16 flags;
};
/* cpl_tx_data.flags fields */
#define S_TX_ULP_SUBMODE 6
#define M_TX_ULP_SUBMODE 0xF
#define V_TX_ULP_SUBMODE(x) ((x) << S_TX_ULP_SUBMODE)
#define G_TX_ULP_SUBMODE(x) (((x) >> S_TX_ULP_SUBMODE) & M_TX_ULP_SUBMODE)
#define S_TX_ULP_MODE 10
#define M_TX_ULP_MODE 0xF
#define V_TX_ULP_MODE(x) ((x) << S_TX_ULP_MODE)
#define G_TX_ULP_MODE(x) (((x) >> S_TX_ULP_MODE) & M_TX_ULP_MODE)
#define S_TX_SHOVE 14
#define V_TX_SHOVE(x) ((x) << S_TX_SHOVE)
#define F_TX_SHOVE V_TX_SHOVE(1U)
#define S_TX_MORE 15
#define V_TX_MORE(x) ((x) << S_TX_MORE)
#define F_TX_MORE V_TX_MORE(1U)
/* additional tx_data_wr.flags fields */
#define S_TX_CPU_IDX 0
#define M_TX_CPU_IDX 0x3F
#define V_TX_CPU_IDX(x) ((x) << S_TX_CPU_IDX)
#define G_TX_CPU_IDX(x) (((x) >> S_TX_CPU_IDX) & M_TX_CPU_IDX)
#define S_TX_URG 16
#define V_TX_URG(x) ((x) << S_TX_URG)
#define F_TX_URG V_TX_URG(1U)
#define S_TX_CLOSE 17
#define V_TX_CLOSE(x) ((x) << S_TX_CLOSE)
#define F_TX_CLOSE V_TX_CLOSE(1U)
#define S_TX_INIT 18
#define V_TX_INIT(x) ((x) << S_TX_INIT)
#define F_TX_INIT V_TX_INIT(1U)
#define S_TX_IMM_ACK 19
#define V_TX_IMM_ACK(x) ((x) << S_TX_IMM_ACK)
#define F_TX_IMM_ACK V_TX_IMM_ACK(1U)
#define S_TX_IMM_DMA 20
#define V_TX_IMM_DMA(x) ((x) << S_TX_IMM_DMA)
#define F_TX_IMM_DMA V_TX_IMM_DMA(1U)
struct cpl_tx_data_ack {
RSS_HDR union opcode_tid ot;
__be32 ack_seq;
};
struct cpl_wr_ack {
RSS_HDR union opcode_tid ot;
__be16 credits;
__be16 rsvd;
__be32 snd_nxt;
__be32 snd_una;
};
struct cpl_rdma_ec_status {
RSS_HDR union opcode_tid ot;
__u8 rsvd[3];
__u8 status;
};
struct mngt_pktsched_wr {
__be32 wr_hi;
__be32 wr_lo;
__u8 mngt_opcode;
__u8 rsvd[7];
__u8 sched;
__u8 idx;
__u8 min;
__u8 max;
__u8 binding;
__u8 rsvd1[3];
};
struct cpl_iscsi_hdr {
RSS_HDR union opcode_tid ot;
__be16 pdu_len_ddp;
__be16 len;
__be32 seq;
__be16 urg;
__u8 rsvd;
__u8 status;
};
/* cpl_iscsi_hdr.pdu_len_ddp fields */
#define S_ISCSI_PDU_LEN 0
#define M_ISCSI_PDU_LEN 0x7FFF
#define V_ISCSI_PDU_LEN(x) ((x) << S_ISCSI_PDU_LEN)
#define G_ISCSI_PDU_LEN(x) (((x) >> S_ISCSI_PDU_LEN) & M_ISCSI_PDU_LEN)
#define S_ISCSI_DDP 15
#define V_ISCSI_DDP(x) ((x) << S_ISCSI_DDP)
#define F_ISCSI_DDP V_ISCSI_DDP(1U)
struct cpl_rx_data {
RSS_HDR union opcode_tid ot;
__be16 rsvd;
__be16 len;
__be32 seq;
__be16 urg;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 dack_mode:2;
__u8 psh:1;
__u8 heartbeat:1;
__u8:4;
#else
__u8:4;
__u8 heartbeat:1;
__u8 psh:1;
__u8 dack_mode:2;
#endif
__u8 status;
};
struct cpl_rx_data_ack {
WR_HDR;
union opcode_tid ot;
__be32 credit_dack;
};
/* cpl_rx_data_ack.ack_seq fields */
#define S_RX_CREDITS 0
#define M_RX_CREDITS 0x7FFFFFF
#define V_RX_CREDITS(x) ((x) << S_RX_CREDITS)
#define G_RX_CREDITS(x) (((x) >> S_RX_CREDITS) & M_RX_CREDITS)
#define S_RX_MODULATE 27
#define V_RX_MODULATE(x) ((x) << S_RX_MODULATE)
#define F_RX_MODULATE V_RX_MODULATE(1U)
#define S_RX_FORCE_ACK 28
#define V_RX_FORCE_ACK(x) ((x) << S_RX_FORCE_ACK)
#define F_RX_FORCE_ACK V_RX_FORCE_ACK(1U)
#define S_RX_DACK_MODE 29
#define M_RX_DACK_MODE 0x3
#define V_RX_DACK_MODE(x) ((x) << S_RX_DACK_MODE)
#define G_RX_DACK_MODE(x) (((x) >> S_RX_DACK_MODE) & M_RX_DACK_MODE)
#define S_RX_DACK_CHANGE 31
#define V_RX_DACK_CHANGE(x) ((x) << S_RX_DACK_CHANGE)
#define F_RX_DACK_CHANGE V_RX_DACK_CHANGE(1U)
struct cpl_rx_urg_notify {
RSS_HDR union opcode_tid ot;
__be32 seq;
};
struct cpl_rx_ddp_complete {
RSS_HDR union opcode_tid ot;
__be32 ddp_report;
};
struct cpl_rx_data_ddp {
RSS_HDR union opcode_tid ot;
__be16 urg;
__be16 len;
__be32 seq;
union {
__be32 nxt_seq;
__be32 ddp_report;
};
__be32 ulp_crc;
__be32 ddpvld_status;
};
/* cpl_rx_data_ddp.ddpvld_status fields */
#define S_DDP_STATUS 0
#define M_DDP_STATUS 0xFF
#define V_DDP_STATUS(x) ((x) << S_DDP_STATUS)
#define G_DDP_STATUS(x) (((x) >> S_DDP_STATUS) & M_DDP_STATUS)
#define S_DDP_VALID 15
#define M_DDP_VALID 0x1FFFF
#define V_DDP_VALID(x) ((x) << S_DDP_VALID)
#define G_DDP_VALID(x) (((x) >> S_DDP_VALID) & M_DDP_VALID)
#define S_DDP_PPOD_MISMATCH 15
#define V_DDP_PPOD_MISMATCH(x) ((x) << S_DDP_PPOD_MISMATCH)
#define F_DDP_PPOD_MISMATCH V_DDP_PPOD_MISMATCH(1U)
#define S_DDP_PDU 16
#define V_DDP_PDU(x) ((x) << S_DDP_PDU)
#define F_DDP_PDU V_DDP_PDU(1U)
#define S_DDP_LLIMIT_ERR 17
#define V_DDP_LLIMIT_ERR(x) ((x) << S_DDP_LLIMIT_ERR)
#define F_DDP_LLIMIT_ERR V_DDP_LLIMIT_ERR(1U)
#define S_DDP_PPOD_PARITY_ERR 18
#define V_DDP_PPOD_PARITY_ERR(x) ((x) << S_DDP_PPOD_PARITY_ERR)
#define F_DDP_PPOD_PARITY_ERR V_DDP_PPOD_PARITY_ERR(1U)
#define S_DDP_PADDING_ERR 19
#define V_DDP_PADDING_ERR(x) ((x) << S_DDP_PADDING_ERR)
#define F_DDP_PADDING_ERR V_DDP_PADDING_ERR(1U)
#define S_DDP_HDRCRC_ERR 20
#define V_DDP_HDRCRC_ERR(x) ((x) << S_DDP_HDRCRC_ERR)
#define F_DDP_HDRCRC_ERR V_DDP_HDRCRC_ERR(1U)
#define S_DDP_DATACRC_ERR 21
#define V_DDP_DATACRC_ERR(x) ((x) << S_DDP_DATACRC_ERR)
#define F_DDP_DATACRC_ERR V_DDP_DATACRC_ERR(1U)
#define S_DDP_INVALID_TAG 22
#define V_DDP_INVALID_TAG(x) ((x) << S_DDP_INVALID_TAG)
#define F_DDP_INVALID_TAG V_DDP_INVALID_TAG(1U)
#define S_DDP_ULIMIT_ERR 23
#define V_DDP_ULIMIT_ERR(x) ((x) << S_DDP_ULIMIT_ERR)
#define F_DDP_ULIMIT_ERR V_DDP_ULIMIT_ERR(1U)
#define S_DDP_OFFSET_ERR 24
#define V_DDP_OFFSET_ERR(x) ((x) << S_DDP_OFFSET_ERR)
#define F_DDP_OFFSET_ERR V_DDP_OFFSET_ERR(1U)
#define S_DDP_COLOR_ERR 25
#define V_DDP_COLOR_ERR(x) ((x) << S_DDP_COLOR_ERR)
#define F_DDP_COLOR_ERR V_DDP_COLOR_ERR(1U)
#define S_DDP_TID_MISMATCH 26
#define V_DDP_TID_MISMATCH(x) ((x) << S_DDP_TID_MISMATCH)
#define F_DDP_TID_MISMATCH V_DDP_TID_MISMATCH(1U)
#define S_DDP_INVALID_PPOD 27
#define V_DDP_INVALID_PPOD(x) ((x) << S_DDP_INVALID_PPOD)
#define F_DDP_INVALID_PPOD V_DDP_INVALID_PPOD(1U)
#define S_DDP_ULP_MODE 28
#define M_DDP_ULP_MODE 0xF
#define V_DDP_ULP_MODE(x) ((x) << S_DDP_ULP_MODE)
#define G_DDP_ULP_MODE(x) (((x) >> S_DDP_ULP_MODE) & M_DDP_ULP_MODE)
/* cpl_rx_data_ddp.ddp_report fields */
#define S_DDP_OFFSET 0
#define M_DDP_OFFSET 0x3FFFFF
#define V_DDP_OFFSET(x) ((x) << S_DDP_OFFSET)
#define G_DDP_OFFSET(x) (((x) >> S_DDP_OFFSET) & M_DDP_OFFSET)
#define S_DDP_URG 24
#define V_DDP_URG(x) ((x) << S_DDP_URG)
#define F_DDP_URG V_DDP_URG(1U)
#define S_DDP_PSH 25
#define V_DDP_PSH(x) ((x) << S_DDP_PSH)
#define F_DDP_PSH V_DDP_PSH(1U)
#define S_DDP_BUF_COMPLETE 26
#define V_DDP_BUF_COMPLETE(x) ((x) << S_DDP_BUF_COMPLETE)
#define F_DDP_BUF_COMPLETE V_DDP_BUF_COMPLETE(1U)
#define S_DDP_BUF_TIMED_OUT 27
#define V_DDP_BUF_TIMED_OUT(x) ((x) << S_DDP_BUF_TIMED_OUT)
#define F_DDP_BUF_TIMED_OUT V_DDP_BUF_TIMED_OUT(1U)
#define S_DDP_BUF_IDX 28
#define V_DDP_BUF_IDX(x) ((x) << S_DDP_BUF_IDX)
#define F_DDP_BUF_IDX V_DDP_BUF_IDX(1U)
struct cpl_tx_pkt {
WR_HDR;
__be32 cntrl;
__be32 len;
};
struct cpl_tx_pkt_lso {
WR_HDR;
__be32 cntrl;
__be32 len;
__be32 rsvd;
__be32 lso_info;
};
/* cpl_tx_pkt*.cntrl fields */
#define S_TXPKT_VLAN 0
#define M_TXPKT_VLAN 0xFFFF
#define V_TXPKT_VLAN(x) ((x) << S_TXPKT_VLAN)
#define G_TXPKT_VLAN(x) (((x) >> S_TXPKT_VLAN) & M_TXPKT_VLAN)
#define S_TXPKT_INTF 16
#define M_TXPKT_INTF 0xF
#define V_TXPKT_INTF(x) ((x) << S_TXPKT_INTF)
#define G_TXPKT_INTF(x) (((x) >> S_TXPKT_INTF) & M_TXPKT_INTF)
#define S_TXPKT_IPCSUM_DIS 20
#define V_TXPKT_IPCSUM_DIS(x) ((x) << S_TXPKT_IPCSUM_DIS)
#define F_TXPKT_IPCSUM_DIS V_TXPKT_IPCSUM_DIS(1U)
#define S_TXPKT_L4CSUM_DIS 21
#define V_TXPKT_L4CSUM_DIS(x) ((x) << S_TXPKT_L4CSUM_DIS)
#define F_TXPKT_L4CSUM_DIS V_TXPKT_L4CSUM_DIS(1U)
#define S_TXPKT_VLAN_VLD 22
#define V_TXPKT_VLAN_VLD(x) ((x) << S_TXPKT_VLAN_VLD)
#define F_TXPKT_VLAN_VLD V_TXPKT_VLAN_VLD(1U)
#define S_TXPKT_LOOPBACK 23
#define V_TXPKT_LOOPBACK(x) ((x) << S_TXPKT_LOOPBACK)
#define F_TXPKT_LOOPBACK V_TXPKT_LOOPBACK(1U)
#define S_TXPKT_OPCODE 24
#define M_TXPKT_OPCODE 0xFF
#define V_TXPKT_OPCODE(x) ((x) << S_TXPKT_OPCODE)
#define G_TXPKT_OPCODE(x) (((x) >> S_TXPKT_OPCODE) & M_TXPKT_OPCODE)
/* cpl_tx_pkt_lso.lso_info fields */
#define S_LSO_MSS 0
#define M_LSO_MSS 0x3FFF
#define V_LSO_MSS(x) ((x) << S_LSO_MSS)
#define G_LSO_MSS(x) (((x) >> S_LSO_MSS) & M_LSO_MSS)
#define S_LSO_ETH_TYPE 14
#define M_LSO_ETH_TYPE 0x3
#define V_LSO_ETH_TYPE(x) ((x) << S_LSO_ETH_TYPE)
#define G_LSO_ETH_TYPE(x) (((x) >> S_LSO_ETH_TYPE) & M_LSO_ETH_TYPE)
#define S_LSO_TCPHDR_WORDS 16
#define M_LSO_TCPHDR_WORDS 0xF
#define V_LSO_TCPHDR_WORDS(x) ((x) << S_LSO_TCPHDR_WORDS)
#define G_LSO_TCPHDR_WORDS(x) (((x) >> S_LSO_TCPHDR_WORDS) & M_LSO_TCPHDR_WORDS)
#define S_LSO_IPHDR_WORDS 20
#define M_LSO_IPHDR_WORDS 0xF
#define V_LSO_IPHDR_WORDS(x) ((x) << S_LSO_IPHDR_WORDS)
#define G_LSO_IPHDR_WORDS(x) (((x) >> S_LSO_IPHDR_WORDS) & M_LSO_IPHDR_WORDS)
#define S_LSO_IPV6 24
#define V_LSO_IPV6(x) ((x) << S_LSO_IPV6)
#define F_LSO_IPV6 V_LSO_IPV6(1U)
struct cpl_trace_pkt {
#ifdef CHELSIO_FW
__u8 rss_opcode;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 err:1;
__u8:7;
#else
__u8:7;
__u8 err:1;
#endif
__u8 rsvd0;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 qid:4;
__u8:4;
#else
__u8:4;
__u8 qid:4;
#endif
__be32 tstamp;
#endif /* CHELSIO_FW */
__u8 opcode;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 iff:4;
__u8:4;
#else
__u8:4;
__u8 iff:4;
#endif
__u8 rsvd[4];
__be16 len;
};
struct cpl_rx_pkt {
RSS_HDR __u8 opcode;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 iff:4;
__u8 csum_valid:1;
__u8 ipmi_pkt:1;
__u8 vlan_valid:1;
__u8 fragment:1;
#else
__u8 fragment:1;
__u8 vlan_valid:1;
__u8 ipmi_pkt:1;
__u8 csum_valid:1;
__u8 iff:4;
#endif
__be16 csum;
__be16 vlan;
__be16 len;
};
struct cpl_l2t_write_req {
WR_HDR;
union opcode_tid ot;
__be32 params;
__u8 rsvd[2];
__u8 dst_mac[6];
};
/* cpl_l2t_write_req.params fields */
#define S_L2T_W_IDX 0
#define M_L2T_W_IDX 0x7FF
#define V_L2T_W_IDX(x) ((x) << S_L2T_W_IDX)
#define G_L2T_W_IDX(x) (((x) >> S_L2T_W_IDX) & M_L2T_W_IDX)
#define S_L2T_W_VLAN 11
#define M_L2T_W_VLAN 0xFFF
#define V_L2T_W_VLAN(x) ((x) << S_L2T_W_VLAN)
#define G_L2T_W_VLAN(x) (((x) >> S_L2T_W_VLAN) & M_L2T_W_VLAN)
#define S_L2T_W_IFF 23
#define M_L2T_W_IFF 0xF
#define V_L2T_W_IFF(x) ((x) << S_L2T_W_IFF)
#define G_L2T_W_IFF(x) (((x) >> S_L2T_W_IFF) & M_L2T_W_IFF)
#define S_L2T_W_PRIO 27
#define M_L2T_W_PRIO 0x7
#define V_L2T_W_PRIO(x) ((x) << S_L2T_W_PRIO)
#define G_L2T_W_PRIO(x) (((x) >> S_L2T_W_PRIO) & M_L2T_W_PRIO)
struct cpl_l2t_write_rpl {
RSS_HDR union opcode_tid ot;
__u8 status;
__u8 rsvd[3];
};
struct cpl_l2t_read_req {
WR_HDR;
union opcode_tid ot;
__be16 rsvd;
__be16 l2t_idx;
};
struct cpl_l2t_read_rpl {
RSS_HDR union opcode_tid ot;
__be32 params;
__u8 rsvd[2];
__u8 dst_mac[6];
};
/* cpl_l2t_read_rpl.params fields */
#define S_L2T_R_PRIO 0
#define M_L2T_R_PRIO 0x7
#define V_L2T_R_PRIO(x) ((x) << S_L2T_R_PRIO)
#define G_L2T_R_PRIO(x) (((x) >> S_L2T_R_PRIO) & M_L2T_R_PRIO)
#define S_L2T_R_VLAN 8
#define M_L2T_R_VLAN 0xFFF
#define V_L2T_R_VLAN(x) ((x) << S_L2T_R_VLAN)
#define G_L2T_R_VLAN(x) (((x) >> S_L2T_R_VLAN) & M_L2T_R_VLAN)
#define S_L2T_R_IFF 20
#define M_L2T_R_IFF 0xF
#define V_L2T_R_IFF(x) ((x) << S_L2T_R_IFF)
#define G_L2T_R_IFF(x) (((x) >> S_L2T_R_IFF) & M_L2T_R_IFF)
#define S_L2T_STATUS 24
#define M_L2T_STATUS 0xFF
#define V_L2T_STATUS(x) ((x) << S_L2T_STATUS)
#define G_L2T_STATUS(x) (((x) >> S_L2T_STATUS) & M_L2T_STATUS)
struct cpl_smt_write_req {
WR_HDR;
union opcode_tid ot;
__u8 rsvd0;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 mtu_idx:4;
__u8 iff:4;
#else
__u8 iff:4;
__u8 mtu_idx:4;
#endif
__be16 rsvd2;
__be16 rsvd3;
__u8 src_mac1[6];
__be16 rsvd4;
__u8 src_mac0[6];
};
struct cpl_smt_write_rpl {
RSS_HDR union opcode_tid ot;
__u8 status;
__u8 rsvd[3];
};
struct cpl_smt_read_req {
WR_HDR;
union opcode_tid ot;
__u8 rsvd0;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8:4;
__u8 iff:4;
#else
__u8 iff:4;
__u8:4;
#endif
__be16 rsvd2;
};
struct cpl_smt_read_rpl {
RSS_HDR union opcode_tid ot;
__u8 status;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 mtu_idx:4;
__u8:4;
#else
__u8:4;
__u8 mtu_idx:4;
#endif
__be16 rsvd2;
__be16 rsvd3;
__u8 src_mac1[6];
__be16 rsvd4;
__u8 src_mac0[6];
};
struct cpl_rte_delete_req {
WR_HDR;
union opcode_tid ot;
__be32 params;
};
/* { cpl_rte_delete_req, cpl_rte_read_req }.params fields */
#define S_RTE_REQ_LUT_IX 8
#define M_RTE_REQ_LUT_IX 0x7FF
#define V_RTE_REQ_LUT_IX(x) ((x) << S_RTE_REQ_LUT_IX)
#define G_RTE_REQ_LUT_IX(x) (((x) >> S_RTE_REQ_LUT_IX) & M_RTE_REQ_LUT_IX)
#define S_RTE_REQ_LUT_BASE 19
#define M_RTE_REQ_LUT_BASE 0x7FF
#define V_RTE_REQ_LUT_BASE(x) ((x) << S_RTE_REQ_LUT_BASE)
#define G_RTE_REQ_LUT_BASE(x) (((x) >> S_RTE_REQ_LUT_BASE) & M_RTE_REQ_LUT_BASE)
#define S_RTE_READ_REQ_SELECT 31
#define V_RTE_READ_REQ_SELECT(x) ((x) << S_RTE_READ_REQ_SELECT)
#define F_RTE_READ_REQ_SELECT V_RTE_READ_REQ_SELECT(1U)
struct cpl_rte_delete_rpl {
RSS_HDR union opcode_tid ot;
__u8 status;
__u8 rsvd[3];
};
struct cpl_rte_write_req {
WR_HDR;
union opcode_tid ot;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8:6;
__u8 write_tcam:1;
__u8 write_l2t_lut:1;
#else
__u8 write_l2t_lut:1;
__u8 write_tcam:1;
__u8:6;
#endif
__u8 rsvd[3];
__be32 lut_params;
__be16 rsvd2;
__be16 l2t_idx;
__be32 netmask;
__be32 faddr;
};
/* cpl_rte_write_req.lut_params fields */
#define S_RTE_WRITE_REQ_LUT_IX 10
#define M_RTE_WRITE_REQ_LUT_IX 0x7FF
#define V_RTE_WRITE_REQ_LUT_IX(x) ((x) << S_RTE_WRITE_REQ_LUT_IX)
#define G_RTE_WRITE_REQ_LUT_IX(x) (((x) >> S_RTE_WRITE_REQ_LUT_IX) & M_RTE_WRITE_REQ_LUT_IX)
#define S_RTE_WRITE_REQ_LUT_BASE 21
#define M_RTE_WRITE_REQ_LUT_BASE 0x7FF
#define V_RTE_WRITE_REQ_LUT_BASE(x) ((x) << S_RTE_WRITE_REQ_LUT_BASE)
#define G_RTE_WRITE_REQ_LUT_BASE(x) (((x) >> S_RTE_WRITE_REQ_LUT_BASE) & M_RTE_WRITE_REQ_LUT_BASE)
struct cpl_rte_write_rpl {
RSS_HDR union opcode_tid ot;
__u8 status;
__u8 rsvd[3];
};
struct cpl_rte_read_req {
WR_HDR;
union opcode_tid ot;
__be32 params;
};
struct cpl_rte_read_rpl {
RSS_HDR union opcode_tid ot;
__u8 status;
__u8 rsvd0;
__be16 l2t_idx;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8:7;
__u8 select:1;
#else
__u8 select:1;
__u8:7;
#endif
__u8 rsvd2[3];
__be32 addr;
};
struct cpl_tid_release {
WR_HDR;
union opcode_tid ot;
__be32 rsvd;
};
struct cpl_barrier {
WR_HDR;
__u8 opcode;
__u8 rsvd[7];
};
struct cpl_rdma_read_req {
__u8 opcode;
__u8 rsvd[15];
};
struct cpl_rdma_terminate {
#ifdef CHELSIO_FW
__u8 opcode;
__u8 rsvd[2];
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 rspq:3;
__u8:5;
#else
__u8:5;
__u8 rspq:3;
#endif
__be32 tid_len;
#endif
__be32 msn;
__be32 mo;
__u8 data[0];
};
/* cpl_rdma_terminate.tid_len fields */
#define S_FLIT_CNT 0
#define M_FLIT_CNT 0xFF
#define V_FLIT_CNT(x) ((x) << S_FLIT_CNT)
#define G_FLIT_CNT(x) (((x) >> S_FLIT_CNT) & M_FLIT_CNT)
#define S_TERM_TID 8
#define M_TERM_TID 0xFFFFF
#define V_TERM_TID(x) ((x) << S_TERM_TID)
#define G_TERM_TID(x) (((x) >> S_TERM_TID) & M_TERM_TID)
/* ULP_TX opcodes */
enum { ULP_MEM_READ = 2, ULP_MEM_WRITE = 3, ULP_TXPKT = 4 };
#define S_ULPTX_CMD 28
#define M_ULPTX_CMD 0xF
#define V_ULPTX_CMD(x) ((x) << S_ULPTX_CMD)
#define S_ULPTX_NFLITS 0
#define M_ULPTX_NFLITS 0xFF
#define V_ULPTX_NFLITS(x) ((x) << S_ULPTX_NFLITS)
struct ulp_mem_io {
WR_HDR;
__be32 cmd_lock_addr;
__be32 len;
};
/* ulp_mem_io.cmd_lock_addr fields */
#define S_ULP_MEMIO_ADDR 0
#define M_ULP_MEMIO_ADDR 0x7FFFFFF
#define V_ULP_MEMIO_ADDR(x) ((x) << S_ULP_MEMIO_ADDR)
#define S_ULP_MEMIO_LOCK 27
#define V_ULP_MEMIO_LOCK(x) ((x) << S_ULP_MEMIO_LOCK)
#define F_ULP_MEMIO_LOCK V_ULP_MEMIO_LOCK(1U)
/* ulp_mem_io.len fields */
#define S_ULP_MEMIO_DATA_LEN 28
#define M_ULP_MEMIO_DATA_LEN 0xF
#define V_ULP_MEMIO_DATA_LEN(x) ((x) << S_ULP_MEMIO_DATA_LEN)
#endif /* T3_CPL_H */
|
{
"pile_set_name": "Github"
}
|
Inputs: 0:Qbit, 1:Qbit, 2:Qbit, 3:Qbit, 4:Qbit, 5:Qbit, 6:Qbit, 7:Qbit, 8:Qbit, 9:Qbit, 10:Qbit, 11:Qbit, 12:Qbit, 13:Qbit, 14:Qbit, 15:Qbit, 16:Qbit, 17:Qbit, 18:Qbit, 19:Qbit, 20:Qbit, 21:Qbit, 22:Qbit, 23:Qbit, 24:Qbit, 25:Qbit, 26:Qbit, 27:Qbit, 28:Qbit, 29:Qbit
Subroutine(x11157792)["S2", shape "([Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q],())"] (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29) -> (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29)
Outputs: 0:Qbit, 1:Qbit, 2:Qbit, 3:Qbit, 4:Qbit, 5:Qbit, 6:Qbit, 7:Qbit, 8:Qbit, 9:Qbit, 10:Qbit, 11:Qbit, 12:Qbit, 13:Qbit, 14:Qbit, 15:Qbit, 16:Qbit, 17:Qbit, 18:Qbit, 19:Qbit, 20:Qbit, 21:Qbit, 22:Qbit, 23:Qbit, 24:Qbit, 25:Qbit, 26:Qbit, 27:Qbit, 28:Qbit, 29:Qbit
Subroutine: "S2"
Shape: "([Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q],())"
Controllable: yes
Inputs: 0:Qbit, 1:Qbit, 2:Qbit, 3:Qbit, 4:Qbit, 5:Qbit, 6:Qbit, 7:Qbit, 8:Qbit, 9:Qbit, 10:Qbit, 11:Qbit, 12:Qbit, 13:Qbit, 14:Qbit, 15:Qbit, 16:Qbit, 17:Qbit, 18:Qbit, 19:Qbit, 20:Qbit, 21:Qbit, 22:Qbit, 23:Qbit, 24:Qbit, 25:Qbit, 26:Qbit, 27:Qbit, 28:Qbit, 29:Qbit
QGate["H"](0) with nocontrol
QGate["H"](1) with nocontrol
QGate["not"](0) with controls=[+1] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](0)
QGate["not"](0) with controls=[+1] with nocontrol
QGate["H"](1) with nocontrol
QGate["H"](0) with nocontrol
QGate["H"](1) with nocontrol
QGate["H"](2) with nocontrol
QGate["not"](1) with controls=[+2] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](1)
QGate["not"](1) with controls=[+2] with nocontrol
QGate["H"](2) with nocontrol
QGate["H"](1) with nocontrol
QGate["H"](2) with nocontrol
QGate["H"](3) with nocontrol
QGate["not"](2) with controls=[+3] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](2)
QGate["not"](2) with controls=[+3] with nocontrol
QGate["H"](3) with nocontrol
QGate["H"](2) with nocontrol
QGate["H"](3) with nocontrol
QGate["H"](4) with nocontrol
QGate["not"](3) with controls=[+4] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](3)
QGate["not"](3) with controls=[+4] with nocontrol
QGate["H"](4) with nocontrol
QGate["H"](3) with nocontrol
QGate["H"](4) with nocontrol
QGate["H"](5) with nocontrol
QGate["not"](4) with controls=[+5] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](4)
QGate["not"](4) with controls=[+5] with nocontrol
QGate["H"](5) with nocontrol
QGate["H"](4) with nocontrol
QGate["H"](5) with nocontrol
QGate["H"](6) with nocontrol
QGate["not"](5) with controls=[+6] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](5)
QGate["not"](5) with controls=[+6] with nocontrol
QGate["H"](6) with nocontrol
QGate["H"](5) with nocontrol
QGate["H"](6) with nocontrol
QGate["H"](7) with nocontrol
QGate["not"](6) with controls=[+7] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](6)
QGate["not"](6) with controls=[+7] with nocontrol
QGate["H"](7) with nocontrol
QGate["H"](6) with nocontrol
QGate["H"](7) with nocontrol
QGate["H"](8) with nocontrol
QGate["not"](7) with controls=[+8] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](7)
QGate["not"](7) with controls=[+8] with nocontrol
QGate["H"](8) with nocontrol
QGate["H"](7) with nocontrol
QGate["H"](8) with nocontrol
QGate["H"](9) with nocontrol
QGate["not"](8) with controls=[+9] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](8)
QGate["not"](8) with controls=[+9] with nocontrol
QGate["H"](9) with nocontrol
QGate["H"](8) with nocontrol
QGate["H"](9) with nocontrol
QGate["H"](10) with nocontrol
QGate["not"](9) with controls=[+10] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](9)
QGate["not"](9) with controls=[+10] with nocontrol
QGate["H"](10) with nocontrol
QGate["H"](9) with nocontrol
QGate["H"](10) with nocontrol
QGate["H"](11) with nocontrol
QGate["not"](10) with controls=[+11] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](10)
QGate["not"](10) with controls=[+11] with nocontrol
QGate["H"](11) with nocontrol
QGate["H"](10) with nocontrol
QGate["H"](11) with nocontrol
QGate["H"](12) with nocontrol
QGate["not"](11) with controls=[+12] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](11)
QGate["not"](11) with controls=[+12] with nocontrol
QGate["H"](12) with nocontrol
QGate["H"](11) with nocontrol
QGate["H"](12) with nocontrol
QGate["H"](13) with nocontrol
QGate["not"](12) with controls=[+13] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](12)
QGate["not"](12) with controls=[+13] with nocontrol
QGate["H"](13) with nocontrol
QGate["H"](12) with nocontrol
QGate["H"](13) with nocontrol
QGate["H"](14) with nocontrol
QGate["not"](13) with controls=[+14] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](13)
QGate["not"](13) with controls=[+14] with nocontrol
QGate["H"](14) with nocontrol
QGate["H"](13) with nocontrol
QGate["H"](14) with nocontrol
QGate["H"](15) with nocontrol
QGate["not"](14) with controls=[+15] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](14)
QGate["not"](14) with controls=[+15] with nocontrol
QGate["H"](15) with nocontrol
QGate["H"](14) with nocontrol
QGate["H"](15) with nocontrol
QGate["H"](16) with nocontrol
QGate["not"](15) with controls=[+16] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](15)
QGate["not"](15) with controls=[+16] with nocontrol
QGate["H"](16) with nocontrol
QGate["H"](15) with nocontrol
QGate["H"](16) with nocontrol
QGate["H"](17) with nocontrol
QGate["not"](16) with controls=[+17] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](16)
QGate["not"](16) with controls=[+17] with nocontrol
QGate["H"](17) with nocontrol
QGate["H"](16) with nocontrol
QGate["H"](17) with nocontrol
QGate["H"](18) with nocontrol
QGate["not"](17) with controls=[+18] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](17)
QGate["not"](17) with controls=[+18] with nocontrol
QGate["H"](18) with nocontrol
QGate["H"](17) with nocontrol
QGate["H"](18) with nocontrol
QGate["H"](19) with nocontrol
QGate["not"](18) with controls=[+19] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](18)
QGate["not"](18) with controls=[+19] with nocontrol
QGate["H"](19) with nocontrol
QGate["H"](18) with nocontrol
QGate["H"](19) with nocontrol
QGate["H"](20) with nocontrol
QGate["not"](19) with controls=[+20] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](19)
QGate["not"](19) with controls=[+20] with nocontrol
QGate["H"](20) with nocontrol
QGate["H"](19) with nocontrol
QGate["H"](20) with nocontrol
QGate["H"](21) with nocontrol
QGate["not"](20) with controls=[+21] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](20)
QGate["not"](20) with controls=[+21] with nocontrol
QGate["H"](21) with nocontrol
QGate["H"](20) with nocontrol
QGate["H"](21) with nocontrol
QGate["H"](22) with nocontrol
QGate["not"](21) with controls=[+22] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](21)
QGate["not"](21) with controls=[+22] with nocontrol
QGate["H"](22) with nocontrol
QGate["H"](21) with nocontrol
QGate["H"](22) with nocontrol
QGate["H"](23) with nocontrol
QGate["not"](22) with controls=[+23] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](22)
QGate["not"](22) with controls=[+23] with nocontrol
QGate["H"](23) with nocontrol
QGate["H"](22) with nocontrol
QGate["H"](23) with nocontrol
QGate["H"](24) with nocontrol
QGate["not"](23) with controls=[+24] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](23)
QGate["not"](23) with controls=[+24] with nocontrol
QGate["H"](24) with nocontrol
QGate["H"](23) with nocontrol
QGate["H"](24) with nocontrol
QGate["H"](25) with nocontrol
QGate["not"](24) with controls=[+25] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](24)
QGate["not"](24) with controls=[+25] with nocontrol
QGate["H"](25) with nocontrol
QGate["H"](24) with nocontrol
QGate["H"](25) with nocontrol
QGate["H"](26) with nocontrol
QGate["not"](25) with controls=[+26] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](25)
QGate["not"](25) with controls=[+26] with nocontrol
QGate["H"](26) with nocontrol
QGate["H"](25) with nocontrol
QGate["H"](26) with nocontrol
QGate["H"](27) with nocontrol
QGate["not"](26) with controls=[+27] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](26)
QGate["not"](26) with controls=[+27] with nocontrol
QGate["H"](27) with nocontrol
QGate["H"](26) with nocontrol
QGate["H"](27) with nocontrol
QGate["H"](28) with nocontrol
QGate["not"](27) with controls=[+28] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](27)
QGate["not"](27) with controls=[+28] with nocontrol
QGate["H"](28) with nocontrol
QGate["H"](27) with nocontrol
QGate["H"](28) with nocontrol
QGate["H"](29) with nocontrol
QGate["not"](28) with controls=[+29] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](28)
QGate["not"](28) with controls=[+29] with nocontrol
QGate["H"](29) with nocontrol
QGate["H"](28) with nocontrol
QGate["H"](0) with nocontrol
QGate["H"](29) with nocontrol
QGate["not"](0) with controls=[+29] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](0)
QGate["not"](0) with controls=[+29] with nocontrol
QGate["H"](29) with nocontrol
QGate["H"](0) with nocontrol
QGate["S"]*(0) with nocontrol
QGate["H"](0) with nocontrol
QGate["S"]*(0) with nocontrol
QGate["S"]*(1) with nocontrol
QGate["H"](1) with nocontrol
QGate["S"]*(1) with nocontrol
QGate["not"](0) with controls=[+1] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](0)
QGate["not"](0) with controls=[+1] with nocontrol
QGate["S"](1) with nocontrol
QGate["H"](1) with nocontrol
QGate["S"](1) with nocontrol
QGate["S"](0) with nocontrol
QGate["H"](0) with nocontrol
QGate["S"](0) with nocontrol
QGate["S"]*(1) with nocontrol
QGate["H"](1) with nocontrol
QGate["S"]*(1) with nocontrol
QGate["S"]*(2) with nocontrol
QGate["H"](2) with nocontrol
QGate["S"]*(2) with nocontrol
QGate["not"](1) with controls=[+2] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](1)
QGate["not"](1) with controls=[+2] with nocontrol
QGate["S"](2) with nocontrol
QGate["H"](2) with nocontrol
QGate["S"](2) with nocontrol
QGate["S"](1) with nocontrol
QGate["H"](1) with nocontrol
QGate["S"](1) with nocontrol
QGate["S"]*(2) with nocontrol
QGate["H"](2) with nocontrol
QGate["S"]*(2) with nocontrol
QGate["S"]*(3) with nocontrol
QGate["H"](3) with nocontrol
QGate["S"]*(3) with nocontrol
QGate["not"](2) with controls=[+3] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](2)
QGate["not"](2) with controls=[+3] with nocontrol
QGate["S"](3) with nocontrol
QGate["H"](3) with nocontrol
QGate["S"](3) with nocontrol
QGate["S"](2) with nocontrol
QGate["H"](2) with nocontrol
QGate["S"](2) with nocontrol
QGate["S"]*(3) with nocontrol
QGate["H"](3) with nocontrol
QGate["S"]*(3) with nocontrol
QGate["S"]*(4) with nocontrol
QGate["H"](4) with nocontrol
QGate["S"]*(4) with nocontrol
QGate["not"](3) with controls=[+4] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](3)
QGate["not"](3) with controls=[+4] with nocontrol
QGate["S"](4) with nocontrol
QGate["H"](4) with nocontrol
QGate["S"](4) with nocontrol
QGate["S"](3) with nocontrol
QGate["H"](3) with nocontrol
QGate["S"](3) with nocontrol
QGate["S"]*(4) with nocontrol
QGate["H"](4) with nocontrol
QGate["S"]*(4) with nocontrol
QGate["S"]*(5) with nocontrol
QGate["H"](5) with nocontrol
QGate["S"]*(5) with nocontrol
QGate["not"](4) with controls=[+5] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](4)
QGate["not"](4) with controls=[+5] with nocontrol
QGate["S"](5) with nocontrol
QGate["H"](5) with nocontrol
QGate["S"](5) with nocontrol
QGate["S"](4) with nocontrol
QGate["H"](4) with nocontrol
QGate["S"](4) with nocontrol
QGate["S"]*(5) with nocontrol
QGate["H"](5) with nocontrol
QGate["S"]*(5) with nocontrol
QGate["S"]*(6) with nocontrol
QGate["H"](6) with nocontrol
QGate["S"]*(6) with nocontrol
QGate["not"](5) with controls=[+6] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](5)
QGate["not"](5) with controls=[+6] with nocontrol
QGate["S"](6) with nocontrol
QGate["H"](6) with nocontrol
QGate["S"](6) with nocontrol
QGate["S"](5) with nocontrol
QGate["H"](5) with nocontrol
QGate["S"](5) with nocontrol
QGate["S"]*(6) with nocontrol
QGate["H"](6) with nocontrol
QGate["S"]*(6) with nocontrol
QGate["S"]*(7) with nocontrol
QGate["H"](7) with nocontrol
QGate["S"]*(7) with nocontrol
QGate["not"](6) with controls=[+7] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](6)
QGate["not"](6) with controls=[+7] with nocontrol
QGate["S"](7) with nocontrol
QGate["H"](7) with nocontrol
QGate["S"](7) with nocontrol
QGate["S"](6) with nocontrol
QGate["H"](6) with nocontrol
QGate["S"](6) with nocontrol
QGate["S"]*(7) with nocontrol
QGate["H"](7) with nocontrol
QGate["S"]*(7) with nocontrol
QGate["S"]*(8) with nocontrol
QGate["H"](8) with nocontrol
QGate["S"]*(8) with nocontrol
QGate["not"](7) with controls=[+8] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](7)
QGate["not"](7) with controls=[+8] with nocontrol
QGate["S"](8) with nocontrol
QGate["H"](8) with nocontrol
QGate["S"](8) with nocontrol
QGate["S"](7) with nocontrol
QGate["H"](7) with nocontrol
QGate["S"](7) with nocontrol
QGate["S"]*(8) with nocontrol
QGate["H"](8) with nocontrol
QGate["S"]*(8) with nocontrol
QGate["S"]*(9) with nocontrol
QGate["H"](9) with nocontrol
QGate["S"]*(9) with nocontrol
QGate["not"](8) with controls=[+9] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](8)
QGate["not"](8) with controls=[+9] with nocontrol
QGate["S"](9) with nocontrol
QGate["H"](9) with nocontrol
QGate["S"](9) with nocontrol
QGate["S"](8) with nocontrol
QGate["H"](8) with nocontrol
QGate["S"](8) with nocontrol
QGate["S"]*(9) with nocontrol
QGate["H"](9) with nocontrol
QGate["S"]*(9) with nocontrol
QGate["S"]*(10) with nocontrol
QGate["H"](10) with nocontrol
QGate["S"]*(10) with nocontrol
QGate["not"](9) with controls=[+10] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](9)
QGate["not"](9) with controls=[+10] with nocontrol
QGate["S"](10) with nocontrol
QGate["H"](10) with nocontrol
QGate["S"](10) with nocontrol
QGate["S"](9) with nocontrol
QGate["H"](9) with nocontrol
QGate["S"](9) with nocontrol
QGate["S"]*(10) with nocontrol
QGate["H"](10) with nocontrol
QGate["S"]*(10) with nocontrol
QGate["S"]*(11) with nocontrol
QGate["H"](11) with nocontrol
QGate["S"]*(11) with nocontrol
QGate["not"](10) with controls=[+11] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](10)
QGate["not"](10) with controls=[+11] with nocontrol
QGate["S"](11) with nocontrol
QGate["H"](11) with nocontrol
QGate["S"](11) with nocontrol
QGate["S"](10) with nocontrol
QGate["H"](10) with nocontrol
QGate["S"](10) with nocontrol
QGate["S"]*(11) with nocontrol
QGate["H"](11) with nocontrol
QGate["S"]*(11) with nocontrol
QGate["S"]*(12) with nocontrol
QGate["H"](12) with nocontrol
QGate["S"]*(12) with nocontrol
QGate["not"](11) with controls=[+12] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](11)
QGate["not"](11) with controls=[+12] with nocontrol
QGate["S"](12) with nocontrol
QGate["H"](12) with nocontrol
QGate["S"](12) with nocontrol
QGate["S"](11) with nocontrol
QGate["H"](11) with nocontrol
QGate["S"](11) with nocontrol
QGate["S"]*(12) with nocontrol
QGate["H"](12) with nocontrol
QGate["S"]*(12) with nocontrol
QGate["S"]*(13) with nocontrol
QGate["H"](13) with nocontrol
QGate["S"]*(13) with nocontrol
QGate["not"](12) with controls=[+13] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](12)
QGate["not"](12) with controls=[+13] with nocontrol
QGate["S"](13) with nocontrol
QGate["H"](13) with nocontrol
QGate["S"](13) with nocontrol
QGate["S"](12) with nocontrol
QGate["H"](12) with nocontrol
QGate["S"](12) with nocontrol
QGate["S"]*(13) with nocontrol
QGate["H"](13) with nocontrol
QGate["S"]*(13) with nocontrol
QGate["S"]*(14) with nocontrol
QGate["H"](14) with nocontrol
QGate["S"]*(14) with nocontrol
QGate["not"](13) with controls=[+14] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](13)
QGate["not"](13) with controls=[+14] with nocontrol
QGate["S"](14) with nocontrol
QGate["H"](14) with nocontrol
QGate["S"](14) with nocontrol
QGate["S"](13) with nocontrol
QGate["H"](13) with nocontrol
QGate["S"](13) with nocontrol
QGate["S"]*(14) with nocontrol
QGate["H"](14) with nocontrol
QGate["S"]*(14) with nocontrol
QGate["S"]*(15) with nocontrol
QGate["H"](15) with nocontrol
QGate["S"]*(15) with nocontrol
QGate["not"](14) with controls=[+15] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](14)
QGate["not"](14) with controls=[+15] with nocontrol
QGate["S"](15) with nocontrol
QGate["H"](15) with nocontrol
QGate["S"](15) with nocontrol
QGate["S"](14) with nocontrol
QGate["H"](14) with nocontrol
QGate["S"](14) with nocontrol
QGate["S"]*(15) with nocontrol
QGate["H"](15) with nocontrol
QGate["S"]*(15) with nocontrol
QGate["S"]*(16) with nocontrol
QGate["H"](16) with nocontrol
QGate["S"]*(16) with nocontrol
QGate["not"](15) with controls=[+16] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](15)
QGate["not"](15) with controls=[+16] with nocontrol
QGate["S"](16) with nocontrol
QGate["H"](16) with nocontrol
QGate["S"](16) with nocontrol
QGate["S"](15) with nocontrol
QGate["H"](15) with nocontrol
QGate["S"](15) with nocontrol
QGate["S"]*(16) with nocontrol
QGate["H"](16) with nocontrol
QGate["S"]*(16) with nocontrol
QGate["S"]*(17) with nocontrol
QGate["H"](17) with nocontrol
QGate["S"]*(17) with nocontrol
QGate["not"](16) with controls=[+17] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](16)
QGate["not"](16) with controls=[+17] with nocontrol
QGate["S"](17) with nocontrol
QGate["H"](17) with nocontrol
QGate["S"](17) with nocontrol
QGate["S"](16) with nocontrol
QGate["H"](16) with nocontrol
QGate["S"](16) with nocontrol
QGate["S"]*(17) with nocontrol
QGate["H"](17) with nocontrol
QGate["S"]*(17) with nocontrol
QGate["S"]*(18) with nocontrol
QGate["H"](18) with nocontrol
QGate["S"]*(18) with nocontrol
QGate["not"](17) with controls=[+18] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](17)
QGate["not"](17) with controls=[+18] with nocontrol
QGate["S"](18) with nocontrol
QGate["H"](18) with nocontrol
QGate["S"](18) with nocontrol
QGate["S"](17) with nocontrol
QGate["H"](17) with nocontrol
QGate["S"](17) with nocontrol
QGate["S"]*(18) with nocontrol
QGate["H"](18) with nocontrol
QGate["S"]*(18) with nocontrol
QGate["S"]*(19) with nocontrol
QGate["H"](19) with nocontrol
QGate["S"]*(19) with nocontrol
QGate["not"](18) with controls=[+19] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](18)
QGate["not"](18) with controls=[+19] with nocontrol
QGate["S"](19) with nocontrol
QGate["H"](19) with nocontrol
QGate["S"](19) with nocontrol
QGate["S"](18) with nocontrol
QGate["H"](18) with nocontrol
QGate["S"](18) with nocontrol
QGate["S"]*(19) with nocontrol
QGate["H"](19) with nocontrol
QGate["S"]*(19) with nocontrol
QGate["S"]*(20) with nocontrol
QGate["H"](20) with nocontrol
QGate["S"]*(20) with nocontrol
QGate["not"](19) with controls=[+20] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](19)
QGate["not"](19) with controls=[+20] with nocontrol
QGate["S"](20) with nocontrol
QGate["H"](20) with nocontrol
QGate["S"](20) with nocontrol
QGate["S"](19) with nocontrol
QGate["H"](19) with nocontrol
QGate["S"](19) with nocontrol
QGate["S"]*(20) with nocontrol
QGate["H"](20) with nocontrol
QGate["S"]*(20) with nocontrol
QGate["S"]*(21) with nocontrol
QGate["H"](21) with nocontrol
QGate["S"]*(21) with nocontrol
QGate["not"](20) with controls=[+21] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](20)
QGate["not"](20) with controls=[+21] with nocontrol
QGate["S"](21) with nocontrol
QGate["H"](21) with nocontrol
QGate["S"](21) with nocontrol
QGate["S"](20) with nocontrol
QGate["H"](20) with nocontrol
QGate["S"](20) with nocontrol
QGate["S"]*(21) with nocontrol
QGate["H"](21) with nocontrol
QGate["S"]*(21) with nocontrol
QGate["S"]*(22) with nocontrol
QGate["H"](22) with nocontrol
QGate["S"]*(22) with nocontrol
QGate["not"](21) with controls=[+22] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](21)
QGate["not"](21) with controls=[+22] with nocontrol
QGate["S"](22) with nocontrol
QGate["H"](22) with nocontrol
QGate["S"](22) with nocontrol
QGate["S"](21) with nocontrol
QGate["H"](21) with nocontrol
QGate["S"](21) with nocontrol
QGate["S"]*(22) with nocontrol
QGate["H"](22) with nocontrol
QGate["S"]*(22) with nocontrol
QGate["S"]*(23) with nocontrol
QGate["H"](23) with nocontrol
QGate["S"]*(23) with nocontrol
QGate["not"](22) with controls=[+23] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](22)
QGate["not"](22) with controls=[+23] with nocontrol
QGate["S"](23) with nocontrol
QGate["H"](23) with nocontrol
QGate["S"](23) with nocontrol
QGate["S"](22) with nocontrol
QGate["H"](22) with nocontrol
QGate["S"](22) with nocontrol
QGate["S"]*(23) with nocontrol
QGate["H"](23) with nocontrol
QGate["S"]*(23) with nocontrol
QGate["S"]*(24) with nocontrol
QGate["H"](24) with nocontrol
QGate["S"]*(24) with nocontrol
QGate["not"](23) with controls=[+24] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](23)
QGate["not"](23) with controls=[+24] with nocontrol
QGate["S"](24) with nocontrol
QGate["H"](24) with nocontrol
QGate["S"](24) with nocontrol
QGate["S"](23) with nocontrol
QGate["H"](23) with nocontrol
QGate["S"](23) with nocontrol
QGate["S"]*(24) with nocontrol
QGate["H"](24) with nocontrol
QGate["S"]*(24) with nocontrol
QGate["S"]*(25) with nocontrol
QGate["H"](25) with nocontrol
QGate["S"]*(25) with nocontrol
QGate["not"](24) with controls=[+25] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](24)
QGate["not"](24) with controls=[+25] with nocontrol
QGate["S"](25) with nocontrol
QGate["H"](25) with nocontrol
QGate["S"](25) with nocontrol
QGate["S"](24) with nocontrol
QGate["H"](24) with nocontrol
QGate["S"](24) with nocontrol
QGate["S"]*(25) with nocontrol
QGate["H"](25) with nocontrol
QGate["S"]*(25) with nocontrol
QGate["S"]*(26) with nocontrol
QGate["H"](26) with nocontrol
QGate["S"]*(26) with nocontrol
QGate["not"](25) with controls=[+26] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](25)
QGate["not"](25) with controls=[+26] with nocontrol
QGate["S"](26) with nocontrol
QGate["H"](26) with nocontrol
QGate["S"](26) with nocontrol
QGate["S"](25) with nocontrol
QGate["H"](25) with nocontrol
QGate["S"](25) with nocontrol
QGate["S"]*(26) with nocontrol
QGate["H"](26) with nocontrol
QGate["S"]*(26) with nocontrol
QGate["S"]*(27) with nocontrol
QGate["H"](27) with nocontrol
QGate["S"]*(27) with nocontrol
QGate["not"](26) with controls=[+27] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](26)
QGate["not"](26) with controls=[+27] with nocontrol
QGate["S"](27) with nocontrol
QGate["H"](27) with nocontrol
QGate["S"](27) with nocontrol
QGate["S"](26) with nocontrol
QGate["H"](26) with nocontrol
QGate["S"](26) with nocontrol
QGate["S"]*(27) with nocontrol
QGate["H"](27) with nocontrol
QGate["S"]*(27) with nocontrol
QGate["S"]*(28) with nocontrol
QGate["H"](28) with nocontrol
QGate["S"]*(28) with nocontrol
QGate["not"](27) with controls=[+28] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](27)
QGate["not"](27) with controls=[+28] with nocontrol
QGate["S"](28) with nocontrol
QGate["H"](28) with nocontrol
QGate["S"](28) with nocontrol
QGate["S"](27) with nocontrol
QGate["H"](27) with nocontrol
QGate["S"](27) with nocontrol
QGate["S"]*(28) with nocontrol
QGate["H"](28) with nocontrol
QGate["S"]*(28) with nocontrol
QGate["S"]*(29) with nocontrol
QGate["H"](29) with nocontrol
QGate["S"]*(29) with nocontrol
QGate["not"](28) with controls=[+29] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](28)
QGate["not"](28) with controls=[+29] with nocontrol
QGate["S"](29) with nocontrol
QGate["H"](29) with nocontrol
QGate["S"](29) with nocontrol
QGate["S"](28) with nocontrol
QGate["H"](28) with nocontrol
QGate["S"](28) with nocontrol
QGate["S"]*(0) with nocontrol
QGate["H"](0) with nocontrol
QGate["S"]*(0) with nocontrol
QGate["S"]*(29) with nocontrol
QGate["H"](29) with nocontrol
QGate["S"]*(29) with nocontrol
QGate["not"](0) with controls=[+29] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](0)
QGate["not"](0) with controls=[+29] with nocontrol
QGate["S"](29) with nocontrol
QGate["H"](29) with nocontrol
QGate["S"](29) with nocontrol
QGate["S"](0) with nocontrol
QGate["H"](0) with nocontrol
QGate["S"](0) with nocontrol
QGate["not"](0) with controls=[+1] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](0)
QGate["not"](0) with controls=[+1] with nocontrol
QGate["not"](1) with controls=[+2] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](1)
QGate["not"](1) with controls=[+2] with nocontrol
QGate["not"](2) with controls=[+3] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](2)
QGate["not"](2) with controls=[+3] with nocontrol
QGate["not"](3) with controls=[+4] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](3)
QGate["not"](3) with controls=[+4] with nocontrol
QGate["not"](4) with controls=[+5] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](4)
QGate["not"](4) with controls=[+5] with nocontrol
QGate["not"](5) with controls=[+6] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](5)
QGate["not"](5) with controls=[+6] with nocontrol
QGate["not"](6) with controls=[+7] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](6)
QGate["not"](6) with controls=[+7] with nocontrol
QGate["not"](7) with controls=[+8] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](7)
QGate["not"](7) with controls=[+8] with nocontrol
QGate["not"](8) with controls=[+9] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](8)
QGate["not"](8) with controls=[+9] with nocontrol
QGate["not"](9) with controls=[+10] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](9)
QGate["not"](9) with controls=[+10] with nocontrol
QGate["not"](10) with controls=[+11] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](10)
QGate["not"](10) with controls=[+11] with nocontrol
QGate["not"](11) with controls=[+12] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](11)
QGate["not"](11) with controls=[+12] with nocontrol
QGate["not"](12) with controls=[+13] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](12)
QGate["not"](12) with controls=[+13] with nocontrol
QGate["not"](13) with controls=[+14] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](13)
QGate["not"](13) with controls=[+14] with nocontrol
QGate["not"](14) with controls=[+15] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](14)
QGate["not"](14) with controls=[+15] with nocontrol
QGate["not"](15) with controls=[+16] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](15)
QGate["not"](15) with controls=[+16] with nocontrol
QGate["not"](16) with controls=[+17] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](16)
QGate["not"](16) with controls=[+17] with nocontrol
QGate["not"](17) with controls=[+18] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](17)
QGate["not"](17) with controls=[+18] with nocontrol
QGate["not"](18) with controls=[+19] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](18)
QGate["not"](18) with controls=[+19] with nocontrol
QGate["not"](19) with controls=[+20] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](19)
QGate["not"](19) with controls=[+20] with nocontrol
QGate["not"](20) with controls=[+21] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](20)
QGate["not"](20) with controls=[+21] with nocontrol
QGate["not"](21) with controls=[+22] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](21)
QGate["not"](21) with controls=[+22] with nocontrol
QGate["not"](22) with controls=[+23] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](22)
QGate["not"](22) with controls=[+23] with nocontrol
QGate["not"](23) with controls=[+24] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](23)
QGate["not"](23) with controls=[+24] with nocontrol
QGate["not"](24) with controls=[+25] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](24)
QGate["not"](24) with controls=[+25] with nocontrol
QGate["not"](25) with controls=[+26] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](25)
QGate["not"](25) with controls=[+26] with nocontrol
QGate["not"](26) with controls=[+27] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](26)
QGate["not"](26) with controls=[+27] with nocontrol
QGate["not"](27) with controls=[+28] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](27)
QGate["not"](27) with controls=[+28] with nocontrol
QGate["not"](28) with controls=[+29] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](28)
QGate["not"](28) with controls=[+29] with nocontrol
QGate["not"](0) with controls=[+29] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](0)
QGate["not"](0) with controls=[+29] with nocontrol
QRot["exp(-i%Z)",2.0915529277659077e-7](0)
QRot["exp(-i%Z)",2.4195916260457868e-6](1)
QRot["exp(-i%Z)",1.6631926872692771e-6](2)
QRot["exp(-i%Z)",5.615152923157017e-7](3)
QRot["exp(-i%Z)",2.4760529711763244e-6](4)
QRot["exp(-i%Z)",1.4633106725684828e-7](5)
QRot["exp(-i%Z)",2.4126872632359057e-6](6)
QRot["exp(-i%Z)",1.377752259893579e-6](7)
QRot["exp(-i%Z)",6.544585282587483e-7](8)
QRot["exp(-i%Z)",1.1287720861996652e-6](9)
QRot["exp(-i%Z)",1.923087369691547e-6](10)
QRot["exp(-i%Z)",1.2312529054286382e-6](11)
QRot["exp(-i%Z)",2.685447035453398e-6](12)
QRot["exp(-i%Z)",2.463647580846669e-6](13)
QRot["exp(-i%Z)",1.734149059815805e-6](14)
QRot["exp(-i%Z)",1.6997309643018744e-6](15)
QRot["exp(-i%Z)",1.1643340933807613e-6](16)
QRot["exp(-i%Z)",2.2734831013644015e-6](17)
QRot["exp(-i%Z)",1.4779307137605748e-6](18)
QRot["exp(-i%Z)",6.90789375833803e-7](19)
QRot["exp(-i%Z)",2.4335343219498343e-6](20)
QRot["exp(-i%Z)",8.804748386424739e-7](21)
QRot["exp(-i%Z)",1.3102979874702606e-6](22)
QRot["exp(-i%Z)",7.085607970801684e-7](23)
QRot["exp(-i%Z)",5.305265700974239e-7](24)
QRot["exp(-i%Z)",1.2468637771075008e-6](25)
QRot["exp(-i%Z)",1.8373630569395285e-6](26)
QRot["exp(-i%Z)",1.402053999321775e-6](27)
QRot["exp(-i%Z)",1.5059980826563695e-6](28)
QRot["exp(-i%Z)",1.951779741990692e-6](29)
QGate["not"](0) with controls=[+29] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](0)
QGate["not"](0) with controls=[+29] with nocontrol
QGate["not"](28) with controls=[+29] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](28)
QGate["not"](28) with controls=[+29] with nocontrol
QGate["not"](27) with controls=[+28] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](27)
QGate["not"](27) with controls=[+28] with nocontrol
QGate["not"](26) with controls=[+27] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](26)
QGate["not"](26) with controls=[+27] with nocontrol
QGate["not"](25) with controls=[+26] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](25)
QGate["not"](25) with controls=[+26] with nocontrol
QGate["not"](24) with controls=[+25] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](24)
QGate["not"](24) with controls=[+25] with nocontrol
QGate["not"](23) with controls=[+24] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](23)
QGate["not"](23) with controls=[+24] with nocontrol
QGate["not"](22) with controls=[+23] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](22)
QGate["not"](22) with controls=[+23] with nocontrol
QGate["not"](21) with controls=[+22] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](21)
QGate["not"](21) with controls=[+22] with nocontrol
QGate["not"](20) with controls=[+21] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](20)
QGate["not"](20) with controls=[+21] with nocontrol
QGate["not"](19) with controls=[+20] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](19)
QGate["not"](19) with controls=[+20] with nocontrol
QGate["not"](18) with controls=[+19] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](18)
QGate["not"](18) with controls=[+19] with nocontrol
QGate["not"](17) with controls=[+18] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](17)
QGate["not"](17) with controls=[+18] with nocontrol
QGate["not"](16) with controls=[+17] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](16)
QGate["not"](16) with controls=[+17] with nocontrol
QGate["not"](15) with controls=[+16] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](15)
QGate["not"](15) with controls=[+16] with nocontrol
QGate["not"](14) with controls=[+15] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](14)
QGate["not"](14) with controls=[+15] with nocontrol
QGate["not"](13) with controls=[+14] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](13)
QGate["not"](13) with controls=[+14] with nocontrol
QGate["not"](12) with controls=[+13] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](12)
QGate["not"](12) with controls=[+13] with nocontrol
QGate["not"](11) with controls=[+12] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](11)
QGate["not"](11) with controls=[+12] with nocontrol
QGate["not"](10) with controls=[+11] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](10)
QGate["not"](10) with controls=[+11] with nocontrol
QGate["not"](9) with controls=[+10] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](9)
QGate["not"](9) with controls=[+10] with nocontrol
QGate["not"](8) with controls=[+9] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](8)
QGate["not"](8) with controls=[+9] with nocontrol
QGate["not"](7) with controls=[+8] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](7)
QGate["not"](7) with controls=[+8] with nocontrol
QGate["not"](6) with controls=[+7] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](6)
QGate["not"](6) with controls=[+7] with nocontrol
QGate["not"](5) with controls=[+6] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](5)
QGate["not"](5) with controls=[+6] with nocontrol
QGate["not"](4) with controls=[+5] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](4)
QGate["not"](4) with controls=[+5] with nocontrol
QGate["not"](3) with controls=[+4] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](3)
QGate["not"](3) with controls=[+4] with nocontrol
QGate["not"](2) with controls=[+3] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](2)
QGate["not"](2) with controls=[+3] with nocontrol
QGate["not"](1) with controls=[+2] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](1)
QGate["not"](1) with controls=[+2] with nocontrol
QGate["not"](0) with controls=[+1] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](0)
QGate["not"](0) with controls=[+1] with nocontrol
QGate["S"]*(0) with nocontrol
QGate["H"](0) with nocontrol
QGate["S"]*(0) with nocontrol
QGate["S"]*(29) with nocontrol
QGate["H"](29) with nocontrol
QGate["S"]*(29) with nocontrol
QGate["not"](0) with controls=[+29] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](0)
QGate["not"](0) with controls=[+29] with nocontrol
QGate["S"](29) with nocontrol
QGate["H"](29) with nocontrol
QGate["S"](29) with nocontrol
QGate["S"](0) with nocontrol
QGate["H"](0) with nocontrol
QGate["S"](0) with nocontrol
QGate["S"]*(28) with nocontrol
QGate["H"](28) with nocontrol
QGate["S"]*(28) with nocontrol
QGate["S"]*(29) with nocontrol
QGate["H"](29) with nocontrol
QGate["S"]*(29) with nocontrol
QGate["not"](28) with controls=[+29] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](28)
QGate["not"](28) with controls=[+29] with nocontrol
QGate["S"](29) with nocontrol
QGate["H"](29) with nocontrol
QGate["S"](29) with nocontrol
QGate["S"](28) with nocontrol
QGate["H"](28) with nocontrol
QGate["S"](28) with nocontrol
QGate["S"]*(27) with nocontrol
QGate["H"](27) with nocontrol
QGate["S"]*(27) with nocontrol
QGate["S"]*(28) with nocontrol
QGate["H"](28) with nocontrol
QGate["S"]*(28) with nocontrol
QGate["not"](27) with controls=[+28] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](27)
QGate["not"](27) with controls=[+28] with nocontrol
QGate["S"](28) with nocontrol
QGate["H"](28) with nocontrol
QGate["S"](28) with nocontrol
QGate["S"](27) with nocontrol
QGate["H"](27) with nocontrol
QGate["S"](27) with nocontrol
QGate["S"]*(26) with nocontrol
QGate["H"](26) with nocontrol
QGate["S"]*(26) with nocontrol
QGate["S"]*(27) with nocontrol
QGate["H"](27) with nocontrol
QGate["S"]*(27) with nocontrol
QGate["not"](26) with controls=[+27] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](26)
QGate["not"](26) with controls=[+27] with nocontrol
QGate["S"](27) with nocontrol
QGate["H"](27) with nocontrol
QGate["S"](27) with nocontrol
QGate["S"](26) with nocontrol
QGate["H"](26) with nocontrol
QGate["S"](26) with nocontrol
QGate["S"]*(25) with nocontrol
QGate["H"](25) with nocontrol
QGate["S"]*(25) with nocontrol
QGate["S"]*(26) with nocontrol
QGate["H"](26) with nocontrol
QGate["S"]*(26) with nocontrol
QGate["not"](25) with controls=[+26] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](25)
QGate["not"](25) with controls=[+26] with nocontrol
QGate["S"](26) with nocontrol
QGate["H"](26) with nocontrol
QGate["S"](26) with nocontrol
QGate["S"](25) with nocontrol
QGate["H"](25) with nocontrol
QGate["S"](25) with nocontrol
QGate["S"]*(24) with nocontrol
QGate["H"](24) with nocontrol
QGate["S"]*(24) with nocontrol
QGate["S"]*(25) with nocontrol
QGate["H"](25) with nocontrol
QGate["S"]*(25) with nocontrol
QGate["not"](24) with controls=[+25] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](24)
QGate["not"](24) with controls=[+25] with nocontrol
QGate["S"](25) with nocontrol
QGate["H"](25) with nocontrol
QGate["S"](25) with nocontrol
QGate["S"](24) with nocontrol
QGate["H"](24) with nocontrol
QGate["S"](24) with nocontrol
QGate["S"]*(23) with nocontrol
QGate["H"](23) with nocontrol
QGate["S"]*(23) with nocontrol
QGate["S"]*(24) with nocontrol
QGate["H"](24) with nocontrol
QGate["S"]*(24) with nocontrol
QGate["not"](23) with controls=[+24] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](23)
QGate["not"](23) with controls=[+24] with nocontrol
QGate["S"](24) with nocontrol
QGate["H"](24) with nocontrol
QGate["S"](24) with nocontrol
QGate["S"](23) with nocontrol
QGate["H"](23) with nocontrol
QGate["S"](23) with nocontrol
QGate["S"]*(22) with nocontrol
QGate["H"](22) with nocontrol
QGate["S"]*(22) with nocontrol
QGate["S"]*(23) with nocontrol
QGate["H"](23) with nocontrol
QGate["S"]*(23) with nocontrol
QGate["not"](22) with controls=[+23] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](22)
QGate["not"](22) with controls=[+23] with nocontrol
QGate["S"](23) with nocontrol
QGate["H"](23) with nocontrol
QGate["S"](23) with nocontrol
QGate["S"](22) with nocontrol
QGate["H"](22) with nocontrol
QGate["S"](22) with nocontrol
QGate["S"]*(21) with nocontrol
QGate["H"](21) with nocontrol
QGate["S"]*(21) with nocontrol
QGate["S"]*(22) with nocontrol
QGate["H"](22) with nocontrol
QGate["S"]*(22) with nocontrol
QGate["not"](21) with controls=[+22] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](21)
QGate["not"](21) with controls=[+22] with nocontrol
QGate["S"](22) with nocontrol
QGate["H"](22) with nocontrol
QGate["S"](22) with nocontrol
QGate["S"](21) with nocontrol
QGate["H"](21) with nocontrol
QGate["S"](21) with nocontrol
QGate["S"]*(20) with nocontrol
QGate["H"](20) with nocontrol
QGate["S"]*(20) with nocontrol
QGate["S"]*(21) with nocontrol
QGate["H"](21) with nocontrol
QGate["S"]*(21) with nocontrol
QGate["not"](20) with controls=[+21] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](20)
QGate["not"](20) with controls=[+21] with nocontrol
QGate["S"](21) with nocontrol
QGate["H"](21) with nocontrol
QGate["S"](21) with nocontrol
QGate["S"](20) with nocontrol
QGate["H"](20) with nocontrol
QGate["S"](20) with nocontrol
QGate["S"]*(19) with nocontrol
QGate["H"](19) with nocontrol
QGate["S"]*(19) with nocontrol
QGate["S"]*(20) with nocontrol
QGate["H"](20) with nocontrol
QGate["S"]*(20) with nocontrol
QGate["not"](19) with controls=[+20] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](19)
QGate["not"](19) with controls=[+20] with nocontrol
QGate["S"](20) with nocontrol
QGate["H"](20) with nocontrol
QGate["S"](20) with nocontrol
QGate["S"](19) with nocontrol
QGate["H"](19) with nocontrol
QGate["S"](19) with nocontrol
QGate["S"]*(18) with nocontrol
QGate["H"](18) with nocontrol
QGate["S"]*(18) with nocontrol
QGate["S"]*(19) with nocontrol
QGate["H"](19) with nocontrol
QGate["S"]*(19) with nocontrol
QGate["not"](18) with controls=[+19] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](18)
QGate["not"](18) with controls=[+19] with nocontrol
QGate["S"](19) with nocontrol
QGate["H"](19) with nocontrol
QGate["S"](19) with nocontrol
QGate["S"](18) with nocontrol
QGate["H"](18) with nocontrol
QGate["S"](18) with nocontrol
QGate["S"]*(17) with nocontrol
QGate["H"](17) with nocontrol
QGate["S"]*(17) with nocontrol
QGate["S"]*(18) with nocontrol
QGate["H"](18) with nocontrol
QGate["S"]*(18) with nocontrol
QGate["not"](17) with controls=[+18] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](17)
QGate["not"](17) with controls=[+18] with nocontrol
QGate["S"](18) with nocontrol
QGate["H"](18) with nocontrol
QGate["S"](18) with nocontrol
QGate["S"](17) with nocontrol
QGate["H"](17) with nocontrol
QGate["S"](17) with nocontrol
QGate["S"]*(16) with nocontrol
QGate["H"](16) with nocontrol
QGate["S"]*(16) with nocontrol
QGate["S"]*(17) with nocontrol
QGate["H"](17) with nocontrol
QGate["S"]*(17) with nocontrol
QGate["not"](16) with controls=[+17] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](16)
QGate["not"](16) with controls=[+17] with nocontrol
QGate["S"](17) with nocontrol
QGate["H"](17) with nocontrol
QGate["S"](17) with nocontrol
QGate["S"](16) with nocontrol
QGate["H"](16) with nocontrol
QGate["S"](16) with nocontrol
QGate["S"]*(15) with nocontrol
QGate["H"](15) with nocontrol
QGate["S"]*(15) with nocontrol
QGate["S"]*(16) with nocontrol
QGate["H"](16) with nocontrol
QGate["S"]*(16) with nocontrol
QGate["not"](15) with controls=[+16] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](15)
QGate["not"](15) with controls=[+16] with nocontrol
QGate["S"](16) with nocontrol
QGate["H"](16) with nocontrol
QGate["S"](16) with nocontrol
QGate["S"](15) with nocontrol
QGate["H"](15) with nocontrol
QGate["S"](15) with nocontrol
QGate["S"]*(14) with nocontrol
QGate["H"](14) with nocontrol
QGate["S"]*(14) with nocontrol
QGate["S"]*(15) with nocontrol
QGate["H"](15) with nocontrol
QGate["S"]*(15) with nocontrol
QGate["not"](14) with controls=[+15] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](14)
QGate["not"](14) with controls=[+15] with nocontrol
QGate["S"](15) with nocontrol
QGate["H"](15) with nocontrol
QGate["S"](15) with nocontrol
QGate["S"](14) with nocontrol
QGate["H"](14) with nocontrol
QGate["S"](14) with nocontrol
QGate["S"]*(13) with nocontrol
QGate["H"](13) with nocontrol
QGate["S"]*(13) with nocontrol
QGate["S"]*(14) with nocontrol
QGate["H"](14) with nocontrol
QGate["S"]*(14) with nocontrol
QGate["not"](13) with controls=[+14] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](13)
QGate["not"](13) with controls=[+14] with nocontrol
QGate["S"](14) with nocontrol
QGate["H"](14) with nocontrol
QGate["S"](14) with nocontrol
QGate["S"](13) with nocontrol
QGate["H"](13) with nocontrol
QGate["S"](13) with nocontrol
QGate["S"]*(12) with nocontrol
QGate["H"](12) with nocontrol
QGate["S"]*(12) with nocontrol
QGate["S"]*(13) with nocontrol
QGate["H"](13) with nocontrol
QGate["S"]*(13) with nocontrol
QGate["not"](12) with controls=[+13] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](12)
QGate["not"](12) with controls=[+13] with nocontrol
QGate["S"](13) with nocontrol
QGate["H"](13) with nocontrol
QGate["S"](13) with nocontrol
QGate["S"](12) with nocontrol
QGate["H"](12) with nocontrol
QGate["S"](12) with nocontrol
QGate["S"]*(11) with nocontrol
QGate["H"](11) with nocontrol
QGate["S"]*(11) with nocontrol
QGate["S"]*(12) with nocontrol
QGate["H"](12) with nocontrol
QGate["S"]*(12) with nocontrol
QGate["not"](11) with controls=[+12] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](11)
QGate["not"](11) with controls=[+12] with nocontrol
QGate["S"](12) with nocontrol
QGate["H"](12) with nocontrol
QGate["S"](12) with nocontrol
QGate["S"](11) with nocontrol
QGate["H"](11) with nocontrol
QGate["S"](11) with nocontrol
QGate["S"]*(10) with nocontrol
QGate["H"](10) with nocontrol
QGate["S"]*(10) with nocontrol
QGate["S"]*(11) with nocontrol
QGate["H"](11) with nocontrol
QGate["S"]*(11) with nocontrol
QGate["not"](10) with controls=[+11] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](10)
QGate["not"](10) with controls=[+11] with nocontrol
QGate["S"](11) with nocontrol
QGate["H"](11) with nocontrol
QGate["S"](11) with nocontrol
QGate["S"](10) with nocontrol
QGate["H"](10) with nocontrol
QGate["S"](10) with nocontrol
QGate["S"]*(9) with nocontrol
QGate["H"](9) with nocontrol
QGate["S"]*(9) with nocontrol
QGate["S"]*(10) with nocontrol
QGate["H"](10) with nocontrol
QGate["S"]*(10) with nocontrol
QGate["not"](9) with controls=[+10] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](9)
QGate["not"](9) with controls=[+10] with nocontrol
QGate["S"](10) with nocontrol
QGate["H"](10) with nocontrol
QGate["S"](10) with nocontrol
QGate["S"](9) with nocontrol
QGate["H"](9) with nocontrol
QGate["S"](9) with nocontrol
QGate["S"]*(8) with nocontrol
QGate["H"](8) with nocontrol
QGate["S"]*(8) with nocontrol
QGate["S"]*(9) with nocontrol
QGate["H"](9) with nocontrol
QGate["S"]*(9) with nocontrol
QGate["not"](8) with controls=[+9] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](8)
QGate["not"](8) with controls=[+9] with nocontrol
QGate["S"](9) with nocontrol
QGate["H"](9) with nocontrol
QGate["S"](9) with nocontrol
QGate["S"](8) with nocontrol
QGate["H"](8) with nocontrol
QGate["S"](8) with nocontrol
QGate["S"]*(7) with nocontrol
QGate["H"](7) with nocontrol
QGate["S"]*(7) with nocontrol
QGate["S"]*(8) with nocontrol
QGate["H"](8) with nocontrol
QGate["S"]*(8) with nocontrol
QGate["not"](7) with controls=[+8] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](7)
QGate["not"](7) with controls=[+8] with nocontrol
QGate["S"](8) with nocontrol
QGate["H"](8) with nocontrol
QGate["S"](8) with nocontrol
QGate["S"](7) with nocontrol
QGate["H"](7) with nocontrol
QGate["S"](7) with nocontrol
QGate["S"]*(6) with nocontrol
QGate["H"](6) with nocontrol
QGate["S"]*(6) with nocontrol
QGate["S"]*(7) with nocontrol
QGate["H"](7) with nocontrol
QGate["S"]*(7) with nocontrol
QGate["not"](6) with controls=[+7] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](6)
QGate["not"](6) with controls=[+7] with nocontrol
QGate["S"](7) with nocontrol
QGate["H"](7) with nocontrol
QGate["S"](7) with nocontrol
QGate["S"](6) with nocontrol
QGate["H"](6) with nocontrol
QGate["S"](6) with nocontrol
QGate["S"]*(5) with nocontrol
QGate["H"](5) with nocontrol
QGate["S"]*(5) with nocontrol
QGate["S"]*(6) with nocontrol
QGate["H"](6) with nocontrol
QGate["S"]*(6) with nocontrol
QGate["not"](5) with controls=[+6] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](5)
QGate["not"](5) with controls=[+6] with nocontrol
QGate["S"](6) with nocontrol
QGate["H"](6) with nocontrol
QGate["S"](6) with nocontrol
QGate["S"](5) with nocontrol
QGate["H"](5) with nocontrol
QGate["S"](5) with nocontrol
QGate["S"]*(4) with nocontrol
QGate["H"](4) with nocontrol
QGate["S"]*(4) with nocontrol
QGate["S"]*(5) with nocontrol
QGate["H"](5) with nocontrol
QGate["S"]*(5) with nocontrol
QGate["not"](4) with controls=[+5] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](4)
QGate["not"](4) with controls=[+5] with nocontrol
QGate["S"](5) with nocontrol
QGate["H"](5) with nocontrol
QGate["S"](5) with nocontrol
QGate["S"](4) with nocontrol
QGate["H"](4) with nocontrol
QGate["S"](4) with nocontrol
QGate["S"]*(3) with nocontrol
QGate["H"](3) with nocontrol
QGate["S"]*(3) with nocontrol
QGate["S"]*(4) with nocontrol
QGate["H"](4) with nocontrol
QGate["S"]*(4) with nocontrol
QGate["not"](3) with controls=[+4] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](3)
QGate["not"](3) with controls=[+4] with nocontrol
QGate["S"](4) with nocontrol
QGate["H"](4) with nocontrol
QGate["S"](4) with nocontrol
QGate["S"](3) with nocontrol
QGate["H"](3) with nocontrol
QGate["S"](3) with nocontrol
QGate["S"]*(2) with nocontrol
QGate["H"](2) with nocontrol
QGate["S"]*(2) with nocontrol
QGate["S"]*(3) with nocontrol
QGate["H"](3) with nocontrol
QGate["S"]*(3) with nocontrol
QGate["not"](2) with controls=[+3] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](2)
QGate["not"](2) with controls=[+3] with nocontrol
QGate["S"](3) with nocontrol
QGate["H"](3) with nocontrol
QGate["S"](3) with nocontrol
QGate["S"](2) with nocontrol
QGate["H"](2) with nocontrol
QGate["S"](2) with nocontrol
QGate["S"]*(1) with nocontrol
QGate["H"](1) with nocontrol
QGate["S"]*(1) with nocontrol
QGate["S"]*(2) with nocontrol
QGate["H"](2) with nocontrol
QGate["S"]*(2) with nocontrol
QGate["not"](1) with controls=[+2] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](1)
QGate["not"](1) with controls=[+2] with nocontrol
QGate["S"](2) with nocontrol
QGate["H"](2) with nocontrol
QGate["S"](2) with nocontrol
QGate["S"](1) with nocontrol
QGate["H"](1) with nocontrol
QGate["S"](1) with nocontrol
QGate["S"]*(0) with nocontrol
QGate["H"](0) with nocontrol
QGate["S"]*(0) with nocontrol
QGate["S"]*(1) with nocontrol
QGate["H"](1) with nocontrol
QGate["S"]*(1) with nocontrol
QGate["not"](0) with controls=[+1] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](0)
QGate["not"](0) with controls=[+1] with nocontrol
QGate["S"](1) with nocontrol
QGate["H"](1) with nocontrol
QGate["S"](1) with nocontrol
QGate["S"](0) with nocontrol
QGate["H"](0) with nocontrol
QGate["S"](0) with nocontrol
QGate["H"](0) with nocontrol
QGate["H"](29) with nocontrol
QGate["not"](0) with controls=[+29] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](0)
QGate["not"](0) with controls=[+29] with nocontrol
QGate["H"](29) with nocontrol
QGate["H"](0) with nocontrol
QGate["H"](28) with nocontrol
QGate["H"](29) with nocontrol
QGate["not"](28) with controls=[+29] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](28)
QGate["not"](28) with controls=[+29] with nocontrol
QGate["H"](29) with nocontrol
QGate["H"](28) with nocontrol
QGate["H"](27) with nocontrol
QGate["H"](28) with nocontrol
QGate["not"](27) with controls=[+28] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](27)
QGate["not"](27) with controls=[+28] with nocontrol
QGate["H"](28) with nocontrol
QGate["H"](27) with nocontrol
QGate["H"](26) with nocontrol
QGate["H"](27) with nocontrol
QGate["not"](26) with controls=[+27] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](26)
QGate["not"](26) with controls=[+27] with nocontrol
QGate["H"](27) with nocontrol
QGate["H"](26) with nocontrol
QGate["H"](25) with nocontrol
QGate["H"](26) with nocontrol
QGate["not"](25) with controls=[+26] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](25)
QGate["not"](25) with controls=[+26] with nocontrol
QGate["H"](26) with nocontrol
QGate["H"](25) with nocontrol
QGate["H"](24) with nocontrol
QGate["H"](25) with nocontrol
QGate["not"](24) with controls=[+25] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](24)
QGate["not"](24) with controls=[+25] with nocontrol
QGate["H"](25) with nocontrol
QGate["H"](24) with nocontrol
QGate["H"](23) with nocontrol
QGate["H"](24) with nocontrol
QGate["not"](23) with controls=[+24] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](23)
QGate["not"](23) with controls=[+24] with nocontrol
QGate["H"](24) with nocontrol
QGate["H"](23) with nocontrol
QGate["H"](22) with nocontrol
QGate["H"](23) with nocontrol
QGate["not"](22) with controls=[+23] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](22)
QGate["not"](22) with controls=[+23] with nocontrol
QGate["H"](23) with nocontrol
QGate["H"](22) with nocontrol
QGate["H"](21) with nocontrol
QGate["H"](22) with nocontrol
QGate["not"](21) with controls=[+22] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](21)
QGate["not"](21) with controls=[+22] with nocontrol
QGate["H"](22) with nocontrol
QGate["H"](21) with nocontrol
QGate["H"](20) with nocontrol
QGate["H"](21) with nocontrol
QGate["not"](20) with controls=[+21] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](20)
QGate["not"](20) with controls=[+21] with nocontrol
QGate["H"](21) with nocontrol
QGate["H"](20) with nocontrol
QGate["H"](19) with nocontrol
QGate["H"](20) with nocontrol
QGate["not"](19) with controls=[+20] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](19)
QGate["not"](19) with controls=[+20] with nocontrol
QGate["H"](20) with nocontrol
QGate["H"](19) with nocontrol
QGate["H"](18) with nocontrol
QGate["H"](19) with nocontrol
QGate["not"](18) with controls=[+19] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](18)
QGate["not"](18) with controls=[+19] with nocontrol
QGate["H"](19) with nocontrol
QGate["H"](18) with nocontrol
QGate["H"](17) with nocontrol
QGate["H"](18) with nocontrol
QGate["not"](17) with controls=[+18] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](17)
QGate["not"](17) with controls=[+18] with nocontrol
QGate["H"](18) with nocontrol
QGate["H"](17) with nocontrol
QGate["H"](16) with nocontrol
QGate["H"](17) with nocontrol
QGate["not"](16) with controls=[+17] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](16)
QGate["not"](16) with controls=[+17] with nocontrol
QGate["H"](17) with nocontrol
QGate["H"](16) with nocontrol
QGate["H"](15) with nocontrol
QGate["H"](16) with nocontrol
QGate["not"](15) with controls=[+16] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](15)
QGate["not"](15) with controls=[+16] with nocontrol
QGate["H"](16) with nocontrol
QGate["H"](15) with nocontrol
QGate["H"](14) with nocontrol
QGate["H"](15) with nocontrol
QGate["not"](14) with controls=[+15] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](14)
QGate["not"](14) with controls=[+15] with nocontrol
QGate["H"](15) with nocontrol
QGate["H"](14) with nocontrol
QGate["H"](13) with nocontrol
QGate["H"](14) with nocontrol
QGate["not"](13) with controls=[+14] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](13)
QGate["not"](13) with controls=[+14] with nocontrol
QGate["H"](14) with nocontrol
QGate["H"](13) with nocontrol
QGate["H"](12) with nocontrol
QGate["H"](13) with nocontrol
QGate["not"](12) with controls=[+13] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](12)
QGate["not"](12) with controls=[+13] with nocontrol
QGate["H"](13) with nocontrol
QGate["H"](12) with nocontrol
QGate["H"](11) with nocontrol
QGate["H"](12) with nocontrol
QGate["not"](11) with controls=[+12] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](11)
QGate["not"](11) with controls=[+12] with nocontrol
QGate["H"](12) with nocontrol
QGate["H"](11) with nocontrol
QGate["H"](10) with nocontrol
QGate["H"](11) with nocontrol
QGate["not"](10) with controls=[+11] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](10)
QGate["not"](10) with controls=[+11] with nocontrol
QGate["H"](11) with nocontrol
QGate["H"](10) with nocontrol
QGate["H"](9) with nocontrol
QGate["H"](10) with nocontrol
QGate["not"](9) with controls=[+10] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](9)
QGate["not"](9) with controls=[+10] with nocontrol
QGate["H"](10) with nocontrol
QGate["H"](9) with nocontrol
QGate["H"](8) with nocontrol
QGate["H"](9) with nocontrol
QGate["not"](8) with controls=[+9] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](8)
QGate["not"](8) with controls=[+9] with nocontrol
QGate["H"](9) with nocontrol
QGate["H"](8) with nocontrol
QGate["H"](7) with nocontrol
QGate["H"](8) with nocontrol
QGate["not"](7) with controls=[+8] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](7)
QGate["not"](7) with controls=[+8] with nocontrol
QGate["H"](8) with nocontrol
QGate["H"](7) with nocontrol
QGate["H"](6) with nocontrol
QGate["H"](7) with nocontrol
QGate["not"](6) with controls=[+7] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](6)
QGate["not"](6) with controls=[+7] with nocontrol
QGate["H"](7) with nocontrol
QGate["H"](6) with nocontrol
QGate["H"](5) with nocontrol
QGate["H"](6) with nocontrol
QGate["not"](5) with controls=[+6] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](5)
QGate["not"](5) with controls=[+6] with nocontrol
QGate["H"](6) with nocontrol
QGate["H"](5) with nocontrol
QGate["H"](4) with nocontrol
QGate["H"](5) with nocontrol
QGate["not"](4) with controls=[+5] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](4)
QGate["not"](4) with controls=[+5] with nocontrol
QGate["H"](5) with nocontrol
QGate["H"](4) with nocontrol
QGate["H"](3) with nocontrol
QGate["H"](4) with nocontrol
QGate["not"](3) with controls=[+4] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](3)
QGate["not"](3) with controls=[+4] with nocontrol
QGate["H"](4) with nocontrol
QGate["H"](3) with nocontrol
QGate["H"](2) with nocontrol
QGate["H"](3) with nocontrol
QGate["not"](2) with controls=[+3] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](2)
QGate["not"](2) with controls=[+3] with nocontrol
QGate["H"](3) with nocontrol
QGate["H"](2) with nocontrol
QGate["H"](1) with nocontrol
QGate["H"](2) with nocontrol
QGate["not"](1) with controls=[+2] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](1)
QGate["not"](1) with controls=[+2] with nocontrol
QGate["H"](2) with nocontrol
QGate["H"](1) with nocontrol
QGate["H"](0) with nocontrol
QGate["H"](1) with nocontrol
QGate["not"](0) with controls=[+1] with nocontrol
QRot["exp(-i%Z)",1.34435200082597e-6](0)
QGate["not"](0) with controls=[+1] with nocontrol
QGate["H"](1) with nocontrol
QGate["H"](0) with nocontrol
Outputs: 0:Qbit, 1:Qbit, 2:Qbit, 3:Qbit, 4:Qbit, 5:Qbit, 6:Qbit, 7:Qbit, 8:Qbit, 9:Qbit, 10:Qbit, 11:Qbit, 12:Qbit, 13:Qbit, 14:Qbit, 15:Qbit, 16:Qbit, 17:Qbit, 18:Qbit, 19:Qbit, 20:Qbit, 21:Qbit, 22:Qbit, 23:Qbit, 24:Qbit, 25:Qbit, 26:Qbit, 27:Qbit, 28:Qbit, 29:Qbit
|
{
"pile_set_name": "Github"
}
|
/***********************license start************************************
* Copyright (c) 2003-2017 Cavium, Inc.
* All rights reserved.
*
* License: one of 'Cavium License' or 'GNU General Public License Version 2'
*
* This file is provided under the terms of the Cavium License (see below)
* or under the terms of GNU General Public License, Version 2, as
* published by the Free Software Foundation. When using or redistributing
* this file, you may do so under either license.
*
* Cavium License: Redistribution and use in source and binary forms, with
* or without modification, are permitted provided that the following
* conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* * Neither the name of Cavium Inc. nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* This Software, including technical data, may be subject to U.S. export
* control laws, including the U.S. Export Administration Act and its
* associated regulations, and may be subject to export or import
* regulations in other countries.
*
* TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
* AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS
* OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH
* RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY
* REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT
* DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY)
* WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A
* PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET
* ENJOYMENT, QUIET POSSESSION OR CORRESPONDENCE TO DESCRIPTION. THE
* ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE LIES
* WITH YOU.
***********************license end**************************************/
#ifndef __ZIP_DEFLATE_H__
#define __ZIP_DEFLATE_H__
/**
* zip_deflate - API to offload deflate operation to hardware
* @zip_ops: Pointer to zip operation structure
* @s: Pointer to the structure representing zip state
* @zip_dev: Pointer to the structure representing zip device
*
* This function prepares the zip deflate command and submits it to the zip
* engine by ringing the doorbell.
*
* Return: 0 if successful or error code
*/
int zip_deflate(struct zip_operation *zip_ops, struct zip_state *s,
struct zip_device *zip_dev);
#endif
|
{
"pile_set_name": "Github"
}
|
:107E000001C0B7C0112484B790E89093610010922C
:107E10006100882361F0982F9A70923041F081FFC1
:107E200002C097EF94BF282E80E0C6D0E9C085E05D
:107E30008093810082E08093C00088E18093C1003C
:107E400083E08093C40086E08093C2008EE0B4D0CB
:107E5000259A84E028E13EEF91E03093850020935D
:107E6000840096BBB09BFECF1D9AA8954091C000A0
:107E700047FD02C0815089F793D0813479F490D0C6
:107E8000182FA0D0123811F480E004C088E0113817
:107E900009F083E07ED080E17CD0EECF823419F40B
:107EA00084E198D0F8CF853411F485E0FACF853598
:107EB00041F476D0C82F74D0D82FCC0FDD1F82D0DC
:107EC000EACF863519F484E085D0DECF843691F58B
:107ED00067D066D0F82E64D0D82E00E011E05801AB
:107EE0008FEFA81AB80A5CD0F80180838501FA10D8
:107EF000F6CF68D0F5E4DF1201C0FFCF50E040E0DC
:107F000063E0CE0136D08E01E0E0F1E06F0182E067
:107F1000C80ED11C4081518161E0C8012AD00E5F9A
:107F20001F4FF601FC10F2CF50E040E065E0CE01BB
:107F300020D0B1CF843771F433D032D0F82E30D086
:107F400041D08E01F80185918F0123D0FA94F11070
:107F5000F9CFA1CF853739F435D08EE11AD085E934
:107F600018D084E097CF813509F0A9CF88E024D0DC
:107F7000A6CFFC010A0167BFE895112407B600FCF3
:107F8000FDCF667029F0452B19F481E187BFE89594
:107F900008959091C00095FFFCCF8093C60008958E
:107FA0008091C00087FFFCCF8091C00084FD01C09C
:107FB000A8958091C6000895E0E6F0E098E19083EE
:107FC00080830895EDDF803219F088E0F5DFFFCF80
:107FD00084E1DFCFCF93C82FE3DFC150E9F7CF9122
:027FE000F1CFDF
:027FFE00000879
:0400000300007E007B
:00000001FF
|
{
"pile_set_name": "Github"
}
|
/**
* \file
*
* \brief Instance description for SERCOM4
*
* Copyright (c) 2014 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
#ifndef _SAMD20_SERCOM4_INSTANCE_
#define _SAMD20_SERCOM4_INSTANCE_
/* ========== Register definition for SERCOM4 peripheral ========== */
#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
#define REG_SERCOM4_I2CM_CTRLA (0x42001800U) /**< \brief (SERCOM4) I2CM Control A */
#define REG_SERCOM4_I2CM_CTRLB (0x42001804U) /**< \brief (SERCOM4) I2CM Control B */
#define REG_SERCOM4_I2CM_DBGCTRL (0x42001808U) /**< \brief (SERCOM4) I2CM Debug Control */
#define REG_SERCOM4_I2CM_BAUD (0x4200180AU) /**< \brief (SERCOM4) I2CM Baud Rate */
#define REG_SERCOM4_I2CM_INTENCLR (0x4200180CU) /**< \brief (SERCOM4) I2CM Interrupt Enable Clear */
#define REG_SERCOM4_I2CM_INTENSET (0x4200180DU) /**< \brief (SERCOM4) I2CM Interrupt Enable Set */
#define REG_SERCOM4_I2CM_INTFLAG (0x4200180EU) /**< \brief (SERCOM4) I2CM Interrupt Flag Status and Clear */
#define REG_SERCOM4_I2CM_STATUS (0x42001810U) /**< \brief (SERCOM4) I2CM Status */
#define REG_SERCOM4_I2CM_ADDR (0x42001814U) /**< \brief (SERCOM4) I2CM Address */
#define REG_SERCOM4_I2CM_DATA (0x42001818U) /**< \brief (SERCOM4) I2CM Data */
#define REG_SERCOM4_I2CS_CTRLA (0x42001800U) /**< \brief (SERCOM4) I2CS Control A */
#define REG_SERCOM4_I2CS_CTRLB (0x42001804U) /**< \brief (SERCOM4) I2CS Control B */
#define REG_SERCOM4_I2CS_INTENCLR (0x4200180CU) /**< \brief (SERCOM4) I2CS Interrupt Enable Clear */
#define REG_SERCOM4_I2CS_INTENSET (0x4200180DU) /**< \brief (SERCOM4) I2CS Interrupt Enable Set */
#define REG_SERCOM4_I2CS_INTFLAG (0x4200180EU) /**< \brief (SERCOM4) I2CS Interrupt Flag Status and Clear */
#define REG_SERCOM4_I2CS_STATUS (0x42001810U) /**< \brief (SERCOM4) I2CS Status */
#define REG_SERCOM4_I2CS_ADDR (0x42001814U) /**< \brief (SERCOM4) I2CS Address */
#define REG_SERCOM4_I2CS_DATA (0x42001818U) /**< \brief (SERCOM4) I2CS Data */
#define REG_SERCOM4_SPI_CTRLA (0x42001800U) /**< \brief (SERCOM4) SPI Control A */
#define REG_SERCOM4_SPI_CTRLB (0x42001804U) /**< \brief (SERCOM4) SPI Control B */
#define REG_SERCOM4_SPI_DBGCTRL (0x42001808U) /**< \brief (SERCOM4) SPI Debug Control */
#define REG_SERCOM4_SPI_BAUD (0x4200180AU) /**< \brief (SERCOM4) SPI Baud Rate */
#define REG_SERCOM4_SPI_INTENCLR (0x4200180CU) /**< \brief (SERCOM4) SPI Interrupt Enable Clear */
#define REG_SERCOM4_SPI_INTENSET (0x4200180DU) /**< \brief (SERCOM4) SPI Interrupt Enable Set */
#define REG_SERCOM4_SPI_INTFLAG (0x4200180EU) /**< \brief (SERCOM4) SPI Interrupt Flag Status and Clear */
#define REG_SERCOM4_SPI_STATUS (0x42001810U) /**< \brief (SERCOM4) SPI Status */
#define REG_SERCOM4_SPI_ADDR (0x42001814U) /**< \brief (SERCOM4) SPI Address */
#define REG_SERCOM4_SPI_DATA (0x42001818U) /**< \brief (SERCOM4) SPI Data */
#define REG_SERCOM4_USART_CTRLA (0x42001800U) /**< \brief (SERCOM4) USART Control A */
#define REG_SERCOM4_USART_CTRLB (0x42001804U) /**< \brief (SERCOM4) USART Control B */
#define REG_SERCOM4_USART_DBGCTRL (0x42001808U) /**< \brief (SERCOM4) USART Debug Control */
#define REG_SERCOM4_USART_BAUD (0x4200180AU) /**< \brief (SERCOM4) USART Baud */
#define REG_SERCOM4_USART_INTENCLR (0x4200180CU) /**< \brief (SERCOM4) USART Interrupt Enable Clear */
#define REG_SERCOM4_USART_INTENSET (0x4200180DU) /**< \brief (SERCOM4) USART Interrupt Enable Set */
#define REG_SERCOM4_USART_INTFLAG (0x4200180EU) /**< \brief (SERCOM4) USART Interrupt Flag Status and Clear */
#define REG_SERCOM4_USART_STATUS (0x42001810U) /**< \brief (SERCOM4) USART Status */
#define REG_SERCOM4_USART_DATA (0x42001818U) /**< \brief (SERCOM4) USART Data */
#else
#define REG_SERCOM4_I2CM_CTRLA (*(RwReg *)0x42001800U) /**< \brief (SERCOM4) I2CM Control A */
#define REG_SERCOM4_I2CM_CTRLB (*(RwReg *)0x42001804U) /**< \brief (SERCOM4) I2CM Control B */
#define REG_SERCOM4_I2CM_DBGCTRL (*(RwReg8 *)0x42001808U) /**< \brief (SERCOM4) I2CM Debug Control */
#define REG_SERCOM4_I2CM_BAUD (*(RwReg16*)0x4200180AU) /**< \brief (SERCOM4) I2CM Baud Rate */
#define REG_SERCOM4_I2CM_INTENCLR (*(RwReg8 *)0x4200180CU) /**< \brief (SERCOM4) I2CM Interrupt Enable Clear */
#define REG_SERCOM4_I2CM_INTENSET (*(RwReg8 *)0x4200180DU) /**< \brief (SERCOM4) I2CM Interrupt Enable Set */
#define REG_SERCOM4_I2CM_INTFLAG (*(RwReg8 *)0x4200180EU) /**< \brief (SERCOM4) I2CM Interrupt Flag Status and Clear */
#define REG_SERCOM4_I2CM_STATUS (*(RwReg16*)0x42001810U) /**< \brief (SERCOM4) I2CM Status */
#define REG_SERCOM4_I2CM_ADDR (*(RwReg8 *)0x42001814U) /**< \brief (SERCOM4) I2CM Address */
#define REG_SERCOM4_I2CM_DATA (*(RwReg8 *)0x42001818U) /**< \brief (SERCOM4) I2CM Data */
#define REG_SERCOM4_I2CS_CTRLA (*(RwReg *)0x42001800U) /**< \brief (SERCOM4) I2CS Control A */
#define REG_SERCOM4_I2CS_CTRLB (*(RwReg *)0x42001804U) /**< \brief (SERCOM4) I2CS Control B */
#define REG_SERCOM4_I2CS_INTENCLR (*(RwReg8 *)0x4200180CU) /**< \brief (SERCOM4) I2CS Interrupt Enable Clear */
#define REG_SERCOM4_I2CS_INTENSET (*(RwReg8 *)0x4200180DU) /**< \brief (SERCOM4) I2CS Interrupt Enable Set */
#define REG_SERCOM4_I2CS_INTFLAG (*(RwReg8 *)0x4200180EU) /**< \brief (SERCOM4) I2CS Interrupt Flag Status and Clear */
#define REG_SERCOM4_I2CS_STATUS (*(RwReg16*)0x42001810U) /**< \brief (SERCOM4) I2CS Status */
#define REG_SERCOM4_I2CS_ADDR (*(RwReg *)0x42001814U) /**< \brief (SERCOM4) I2CS Address */
#define REG_SERCOM4_I2CS_DATA (*(RwReg8 *)0x42001818U) /**< \brief (SERCOM4) I2CS Data */
#define REG_SERCOM4_SPI_CTRLA (*(RwReg *)0x42001800U) /**< \brief (SERCOM4) SPI Control A */
#define REG_SERCOM4_SPI_CTRLB (*(RwReg *)0x42001804U) /**< \brief (SERCOM4) SPI Control B */
#define REG_SERCOM4_SPI_DBGCTRL (*(RwReg8 *)0x42001808U) /**< \brief (SERCOM4) SPI Debug Control */
#define REG_SERCOM4_SPI_BAUD (*(RwReg8 *)0x4200180AU) /**< \brief (SERCOM4) SPI Baud Rate */
#define REG_SERCOM4_SPI_INTENCLR (*(RwReg8 *)0x4200180CU) /**< \brief (SERCOM4) SPI Interrupt Enable Clear */
#define REG_SERCOM4_SPI_INTENSET (*(RwReg8 *)0x4200180DU) /**< \brief (SERCOM4) SPI Interrupt Enable Set */
#define REG_SERCOM4_SPI_INTFLAG (*(RwReg8 *)0x4200180EU) /**< \brief (SERCOM4) SPI Interrupt Flag Status and Clear */
#define REG_SERCOM4_SPI_STATUS (*(RwReg16*)0x42001810U) /**< \brief (SERCOM4) SPI Status */
#define REG_SERCOM4_SPI_ADDR (*(RwReg *)0x42001814U) /**< \brief (SERCOM4) SPI Address */
#define REG_SERCOM4_SPI_DATA (*(RwReg16*)0x42001818U) /**< \brief (SERCOM4) SPI Data */
#define REG_SERCOM4_USART_CTRLA (*(RwReg *)0x42001800U) /**< \brief (SERCOM4) USART Control A */
#define REG_SERCOM4_USART_CTRLB (*(RwReg *)0x42001804U) /**< \brief (SERCOM4) USART Control B */
#define REG_SERCOM4_USART_DBGCTRL (*(RwReg8 *)0x42001808U) /**< \brief (SERCOM4) USART Debug Control */
#define REG_SERCOM4_USART_BAUD (*(RwReg16*)0x4200180AU) /**< \brief (SERCOM4) USART Baud */
#define REG_SERCOM4_USART_INTENCLR (*(RwReg8 *)0x4200180CU) /**< \brief (SERCOM4) USART Interrupt Enable Clear */
#define REG_SERCOM4_USART_INTENSET (*(RwReg8 *)0x4200180DU) /**< \brief (SERCOM4) USART Interrupt Enable Set */
#define REG_SERCOM4_USART_INTFLAG (*(RwReg8 *)0x4200180EU) /**< \brief (SERCOM4) USART Interrupt Flag Status and Clear */
#define REG_SERCOM4_USART_STATUS (*(RwReg16*)0x42001810U) /**< \brief (SERCOM4) USART Status */
#define REG_SERCOM4_USART_DATA (*(RwReg16*)0x42001818U) /**< \brief (SERCOM4) USART Data */
#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
/* ========== Instance parameters for SERCOM4 peripheral ========== */
#define SERCOM4_GCLK_ID_CORE 17
#define SERCOM4_GCLK_ID_SLOW 12
#define SERCOM4_INT_MSB 3
#define SERCOM4_PMSB 3
#endif /* _SAMD20_SERCOM4_INSTANCE_ */
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.