本文整理汇总了C++中set_control函数的典型用法代码示例。如果您正苦于以下问题:C++ set_control函数的具体用法?C++ set_control怎么用?C++ set_control使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_control函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: new
void Parse::emit_guard_for_new(ciInstanceKlass* klass) {
// Emit guarded new
// if (klass->_init_thread != current_thread ||
// klass->_init_state != being_initialized)
// uncommon_trap
Node* cur_thread = _gvn.transform( new (C, 1) ThreadLocalNode() );
Node* merge = new (C, 3) RegionNode(3);
_gvn.set_type(merge, Type::CONTROL);
Node* kls = makecon(TypeKlassPtr::make(klass));
Node* init_thread_offset = _gvn.MakeConX(instanceKlass::init_thread_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes());
Node* adr_node = basic_plus_adr(kls, kls, init_thread_offset);
Node* init_thread = make_load(NULL, adr_node, TypeRawPtr::BOTTOM, T_ADDRESS);
Node *tst = Bool( CmpP( init_thread, cur_thread), BoolTest::eq);
IfNode* iff = create_and_map_if(control(), tst, PROB_ALWAYS, COUNT_UNKNOWN);
set_control(IfTrue(iff));
merge->set_req(1, IfFalse(iff));
Node* init_state_offset = _gvn.MakeConX(instanceKlass::init_state_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes());
adr_node = basic_plus_adr(kls, kls, init_state_offset);
Node* init_state = make_load(NULL, adr_node, TypeInt::INT, T_INT);
Node* being_init = _gvn.intcon(instanceKlass::being_initialized);
tst = Bool( CmpI( init_state, being_init), BoolTest::eq);
iff = create_and_map_if(control(), tst, PROB_ALWAYS, COUNT_UNKNOWN);
set_control(IfTrue(iff));
merge->set_req(2, IfFalse(iff));
PreserveJVMState pjvms(this);
record_for_igvn(merge);
set_control(merge);
uncommon_trap(Deoptimization::Reason_uninitialized,
Deoptimization::Action_reinterpret,
klass);
}
开发者ID:BaHbKaTX,项目名称:openjdk,代码行数:35,代码来源:parseHelper.cpp
示例2: msr
void msr(int i)
{
unsigned int n;
*((int *)(&moveToStatus)) = i;
n=(unsigned int) moveToStatus.rn;
if(Bad_Reg(n))
printf("UNPREDICTABLE instruciton\n");
else{
unsigned sysmTemp=moveToStatus.sysm;
sysmTemp=sysmTemp>>3;
sysmTemp&=0x01F;
if(sysmTemp==0){
if(!(moveToStatus.sysm & 0x04))
set_apsr(get_general_register(moveToStatus.rn)>>27);
}
else if(sysmTemp==1){
if(CurrentModeIsPrivileged()){
if((moveToStatus.sysm & 0x07)==0)
set_msp(get_general_register(moveToStatus.rn));
else if((moveToStatus.sysm & 0x07)==1)
set_psp(get_general_register(moveToStatus.rn));
}
}
else if(sysmTemp==2){
unsigned int temp=(moveToStatus.sysm & 0x07);
if(temp==0 && CurrentModeIsPrivileged()){
set_primask(get_general_register(moveToStatus.rn)&0x01);
}
else if(temp==1 && CurrentModeIsPrivileged()){
set_basepri(get_general_register(moveToStatus.rn)&0xFF);
}
else if(temp==2 && CurrentModeIsPrivileged()){
if((get_general_register(moveToStatus.rn)&0xFF)!=0 && ((get_general_register(moveToStatus.rn)&0xFF)!=0) &&
(((get_general_register(moveToStatus.rn)&0xFF)<get_basepri()) || get_basepri()==0))
set_basepri(get_general_register(moveToStatus.rn)&0xFF);
}
else if(temp==3 && CurrentModeIsPrivileged() && (ExecutionPriority() > -1)){
set_faultmask(get_general_register(moveToStatus.rn)&0x01);
}
else if(temp==4 && CurrentModeIsPrivileged()){
/* when `100`
if CurrentModeIsPrivileged() then
CONTROL<0> = R[n]<1:0>;
If Mode == Thread then CONTROL<1> = R[n]<1>;
*/// question
set_control((get_control()&0xFFFFFFFE)|(get_general_register(moveToStatus.rn)&0x01));
if(GetMode()==THREAD)
set_control((get_control()&0xFFFFFFFD)|(get_general_register(moveToStatus.rn)&0x02));
}
}
}
开发者ID:shangdawei,项目名称:cortex-simulator,代码行数:56,代码来源:branch_misc.c
示例3: hss_open
static int hss_open(int port, void *pdev,
void (*set_carrier_cb)(void *pdev, int carrier))
{
int i, irq;
if (!port)
irq = gpio_irq(GPIO_HSS0_DCD_N);
else
irq = gpio_irq(GPIO_HSS1_DCD_N);
gpio_line_get(port ? GPIO_HSS1_DCD_N : GPIO_HSS0_DCD_N, &i);
set_carrier_cb(pdev, !i);
set_carrier_cb_tab[!!port] = set_carrier_cb;
if ((i = request_irq(irq, hss_dcd_irq, 0, "IXP4xx HSS", pdev)) != 0) {
printk(KERN_ERR "ixp4xx_hss: failed to request IRQ%i (%i)\n",
irq, i);
return i;
}
set_control(port ? CONTROL_HSS1_DTR_N : CONTROL_HSS0_DTR_N, 0);
output_control();
gpio_line_set(port ? GPIO_HSS1_RTS_N : GPIO_HSS0_RTS_N, 0);
return 0;
}
开发者ID:0x0f,项目名称:adam-kernel,代码行数:26,代码来源:goramo_mlr.c
示例4: gen_subtype_check
Node* gen_subtype_check(Node* subklass, Node* superklass) {
MergeMemNode* mem = merged_memory();
Node* ctrl = control();
Node* n = Phase::gen_subtype_check(subklass, superklass, &ctrl, mem, &_gvn);
set_control(ctrl);
return n;
}
开发者ID:gaoxiaojun,项目名称:dync,代码行数:7,代码来源:graphKit.hpp
示例5: i2c_read
static int i2c_read(struct i2c_algo_sgi_data *adap, unsigned char *buf,
unsigned int len)
{
int i;
set_control(SGI_I2C_HOLD_BUS | SGI_I2C_READ | SGI_I2C_NOT_IDLE);
for (i = 0; i < len; i++) {
if (wait_xfer_done(adap))
return -EIO;
buf[i] = read_data();
}
set_control(SGI_I2C_RELEASE_BUS | SGI_I2C_FORCE_IDLE);
return 0;
}
开发者ID:274914765,项目名称:C,代码行数:16,代码来源:i2c-algo-sgi.c
示例6: set_alt
void InputEventWithModifiers::set_modifiers_from_event(const InputEventWithModifiers *event) {
set_alt(event->get_alt());
set_shift(event->get_shift());
set_control(event->get_control());
set_metakey(event->get_metakey());
}
开发者ID:KellyThomas,项目名称:godot,代码行数:7,代码来源:input_event.cpp
示例7: send_command_and_receive_response
CommandResponsePacket send_command_and_receive_response(uvc::device & device, const CommandResponsePacket & command)
{
CommandResponsePacket c = command, r;
set_control(device, lr_xu, static_cast<int>(control::command_response), &c, sizeof(c));
get_control(device, lr_xu, static_cast<int>(control::command_response), &r, sizeof(r));
return r;
}
开发者ID:dorodnic,项目名称:librealsense,代码行数:7,代码来源:ds-private.cpp
示例8: do_address
static int do_address(struct i2c_algo_sgi_data *adap, unsigned int addr,
int rd)
{
if (rd)
set_control(SGI_I2C_NOT_IDLE);
/* Check if bus is idle, eventually force it to do so */
if (get_control() & SGI_I2C_NOT_IDLE)
if (force_idle(adap))
return -EIO;
/* Write out the i2c chip address and specify operation */
set_control(SGI_I2C_HOLD_BUS | SGI_I2C_WRITE | SGI_I2C_NOT_IDLE);
if (rd)
addr |= 1;
write_data(addr);
if (wait_ack(adap))
return -EIO;
return 0;
}
开发者ID:274914765,项目名称:C,代码行数:18,代码来源:i2c-algo-sgi.c
示例9: set_control
void msx_cart_disk_type2::post_load()
{
UINT8 data = m_control;
// To make sure the FDD busy led status gets set correctly
m_control ^= 0x40;
set_control(data);
}
开发者ID:dinkc64,项目名称:mame,代码行数:9,代码来源:disk.c
示例10: set_control
void msx_slot_disk2_device::post_load()
{
UINT8 data = m_control;
// To make sure the FDD busy led status gets set correctly
m_control ^= 0x40;
set_control(data);
}
开发者ID:Eduardop,项目名称:mame,代码行数:9,代码来源:disk.c
示例11: set_control
void msx_cart_disk_type1_device::post_load()
{
uint8_t data = m_control;
// To make sure the FDD busy led status gets set correctly
m_control ^= 0x40;
set_control(data);
}
开发者ID:Tauwasser,项目名称:mame,代码行数:9,代码来源:disk.cpp
示例12: hss_close
static void hss_close(int port, void *pdev)
{
free_irq(port ? gpio_irq(GPIO_HSS1_DCD_N) : gpio_irq(GPIO_HSS0_DCD_N),
pdev);
set_carrier_cb_tab[!!port] = NULL; /* catch bugs */
set_control(port ? CONTROL_HSS1_DTR_N : CONTROL_HSS0_DTR_N, 1);
output_control();
gpio_line_set(port ? GPIO_HSS1_RTS_N : GPIO_HSS0_RTS_N, 1);
}
开发者ID:0x0f,项目名称:adam-kernel,代码行数:10,代码来源:goramo_mlr.c
示例13: hss_set_clock
static int hss_set_clock(int port, unsigned int clock_type)
{
int ctrl_int = port ? CONTROL_HSS1_CLK_INT : CONTROL_HSS0_CLK_INT;
switch (clock_type) {
case CLOCK_DEFAULT:
case CLOCK_EXT:
set_control(ctrl_int, 0);
output_control();
return CLOCK_EXT;
case CLOCK_INT:
set_control(ctrl_int, 1);
output_control();
return CLOCK_INT;
default:
return -EINVAL;
}
}
开发者ID:0x0f,项目名称:adam-kernel,代码行数:20,代码来源:goramo_mlr.c
示例14: process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
char *res, int res_len, int flags)
{
LADSPA_Data value;
unsigned long port;
if (sscanf(cmd, "c%ld", &port) + sscanf(args, "%f", &value) != 2)
return AVERROR(EINVAL);
return set_control(ctx, port, value);
}
开发者ID:Ancaro,项目名称:stepmania,代码行数:11,代码来源:af_ladspa.c
示例15: set_control
void Nunchuk::LoadDefaults(const ControllerInterface& ciface)
{
// ugly macroooo
#define set_control(group, num, str) (group)->controls[num]->control_ref->expression = (str)
// Stick
set_control(m_stick, 0, "W"); // up
set_control(m_stick, 1, "S"); // down
set_control(m_stick, 2, "A"); // left
set_control(m_stick, 3, "D"); // right
// Buttons
#ifdef _WIN32
set_control(m_buttons, 0, "LCONTROL"); // C
set_control(m_buttons, 1, "LSHIFT"); // Z
#elif __APPLE__
set_control(m_buttons, 0, "Left Control"); // C
set_control(m_buttons, 1, "Left Shift"); // Z
#else
set_control(m_buttons, 0, "Control_L"); // C
set_control(m_buttons, 1, "Shift_L"); // Z
#endif
}
开发者ID:Everscent,项目名称:dolphin-emu,代码行数:23,代码来源:Nunchuk.cpp
示例16: force_idle
static int force_idle(struct i2c_algo_sgi_data *adap)
{
int i;
set_control(SGI_I2C_FORCE_IDLE);
for (i = 0; i < adap->xfer_timeout; i++) {
if ((get_control() & SGI_I2C_NOT_IDLE) == 0)
goto out;
udelay(1);
}
return -ETIMEDOUT;
out:
if (get_control() & SGI_I2C_BUS_ERR)
return -EIO;
return 0;
}
开发者ID:274914765,项目名称:C,代码行数:16,代码来源:i2c-algo-sgi.c
示例17: ioctl
int QcomFmIoctlsInterface :: set_band
(
UINT fd, ULINT low, ULINT high
)
{
int ret;
struct v4l2_tuner tuner;
tuner.index = 0;
tuner.signal = 0;
tuner.rangelow = (low * TUNE_MULT);
tuner.rangehigh = (high * TUNE_MULT);
ret = ioctl(fd, VIDIOC_S_TUNER, &tuner);
ret = set_control(fd, V4L2_CID_PRV_REGION, 0);
if(ret != IOCTL_SUCC) {
return FM_FAILURE;
}else {
return FM_SUCCESS;
}
}
开发者ID:xingrz,项目名称:android_tools_leeco_msm8996,代码行数:21,代码来源:QcomFmIoctlsInterface.cpp
示例18: run_secd
cell_t * run_secd(secd_t *secd, cell_t *ctrl) {
cell_t *op, *ret;
TIMING_DECLARATIONS(ts_then, ts_now);
share_cell(secd, ctrl);
set_control(secd, &ctrl);
while (true) {
TIMING_START_OPERATION(ts_then);
op = pop_control(secd);
assert_cell(op, "run: no command");
if (cell_type(op) != CELL_OP) {
errorf("run: not an opcode at [%ld]\n", cell_index(secd, op));
dbg_printc(secd, op);
continue;
}
int opind = op->as.op;
if (about_to_halt(secd, opind, &ret))
return ret;
secd_opfunc_t callee = (secd_opfunc_t) opcode_table[ opind ].fun;
ret = callee(secd);
if (is_error(ret))
if (!handle_exception(secd, ret))
return fatal_exception(secd, ret, opind);
drop_cell(secd, op);
TIMING_END_OPERATION(ts_then, ts_now)
run_postop(secd);
++secd->tick;
}
}
开发者ID:EarlGray,项目名称:SECD,代码行数:38,代码来源:machine.c
示例19: gmlr_init
static void __init gmlr_init(void)
{
u8 __iomem *flash;
int i, devices = 1; /* flash */
ixp4xx_sys_init();
if ((flash = ioremap(IXP4XX_EXP_BUS_BASE_PHYS, 0x80)) == NULL)
printk(KERN_ERR "goramo-mlr: unable to access system"
" configuration data\n");
else {
system_rev = __raw_readl(flash + CFG_REV);
hw_bits = __raw_readl(flash + CFG_HW_BITS);
for (i = 0; i < ETH_ALEN; i++) {
eth_plat[0].hwaddr[i] =
flash_readb(flash, CFG_ETH0_ADDRESS + i);
eth_plat[1].hwaddr[i] =
flash_readb(flash, CFG_ETH1_ADDRESS + i);
}
__raw_writew(FLASH_CMD_READ_ID, flash);
system_serial_high = flash_readw(flash, FLASH_SER_OFF);
system_serial_high <<= 16;
system_serial_high |= flash_readw(flash, FLASH_SER_OFF + 2);
system_serial_low = flash_readw(flash, FLASH_SER_OFF + 4);
system_serial_low <<= 16;
system_serial_low |= flash_readw(flash, FLASH_SER_OFF + 6);
__raw_writew(FLASH_CMD_READ_ARRAY, flash);
iounmap(flash);
}
switch (hw_bits & (CFG_HW_HAS_UART0 | CFG_HW_HAS_UART1)) {
case CFG_HW_HAS_UART0:
memset(&uart_data[1], 0, sizeof(uart_data[1]));
device_uarts.num_resources = 1;
break;
case CFG_HW_HAS_UART1:
device_uarts.dev.platform_data = &uart_data[1];
device_uarts.resource = &uart_resources[1];
device_uarts.num_resources = 1;
break;
}
if (hw_bits & (CFG_HW_HAS_UART0 | CFG_HW_HAS_UART1))
device_tab[devices++] = &device_uarts; /* max index 1 */
if (hw_bits & CFG_HW_HAS_ETH0)
device_tab[devices++] = &device_eth_tab[0]; /* max index 2 */
if (hw_bits & CFG_HW_HAS_ETH1)
device_tab[devices++] = &device_eth_tab[1]; /* max index 3 */
if (hw_bits & CFG_HW_HAS_HSS0)
device_tab[devices++] = &device_hss_tab[0]; /* max index 4 */
if (hw_bits & CFG_HW_HAS_HSS1)
device_tab[devices++] = &device_hss_tab[1]; /* max index 5 */
if (hw_bits & CFG_HW_HAS_EEPROM)
device_tab[devices++] = &device_i2c; /* max index 6 */
gpio_line_config(GPIO_SCL, IXP4XX_GPIO_OUT);
gpio_line_config(GPIO_SDA, IXP4XX_GPIO_OUT);
gpio_line_config(GPIO_STR, IXP4XX_GPIO_OUT);
gpio_line_config(GPIO_HSS0_RTS_N, IXP4XX_GPIO_OUT);
gpio_line_config(GPIO_HSS1_RTS_N, IXP4XX_GPIO_OUT);
gpio_line_config(GPIO_HSS0_DCD_N, IXP4XX_GPIO_IN);
gpio_line_config(GPIO_HSS1_DCD_N, IXP4XX_GPIO_IN);
set_irq_type(gpio_irq(GPIO_HSS0_DCD_N), IRQ_TYPE_EDGE_BOTH);
set_irq_type(gpio_irq(GPIO_HSS1_DCD_N), IRQ_TYPE_EDGE_BOTH);
set_control(CONTROL_HSS0_DTR_N, 1);
set_control(CONTROL_HSS1_DTR_N, 1);
set_control(CONTROL_EEPROM_WC_N, 1);
set_control(CONTROL_PCI_RESET_N, 1);
output_control();
msleep(1); /* Wait for PCI devices to initialize */
flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
platform_add_devices(device_tab, devices);
}
开发者ID:0x0f,项目名称:adam-kernel,代码行数:84,代码来源:goramo_mlr.c
示例20: main
int main(int argc, char *argv[]) {
if (argc >= 1 && NULL != argv[0]) {
size_t n = strlen(argv[0]) + 1;
program_name = allocate(n);
strlcpy(program_name, argv[0], n);
}
static const char short_options[] = "hvd:c:";
static const struct option
long_options[] = {
{ "help", no_argument, NULL, 'h' },
{ "verbose", no_argument, NULL, 'v' },
{ "device", required_argument, NULL, 'd' },
{ "count", required_argument, NULL, 'c' },
{ 0, 0, 0, 0 }
};
device_name = "/dev/video0";
int verbose = 0;
int count = 0;
for (;;) {
int idx;
int c;
c = getopt_long(argc, argv, short_options, long_options, &idx);
if (-1 == c) {
break;
}
switch (c) {
case 0: // getopt_long() flag
break;
case 'v':
++verbose;
break;
case 'd':
device_name = optarg;
break;
case 'c':
errno = 0;
count = strtol(optarg, NULL, 0);
if (0 != errno) {
usage("invalid count '%s': %d, %s", optarg, errno, strerror(errno));
}
break;
case 'h':
usage(NULL);
return 0;
default:
usage("invalid option: %c", c);
}
}
if (count <= 0) {
usage("invalid count: %d", count);
}
int fd = open_device(device_name);
uint32_t default_hue = CHECK(fd, V4L2_CID_HUE);
uint32_t default_contrast = CHECK(fd, V4L2_CID_CONTRAST);
uint32_t default_sharpness = CHECK(fd, V4L2_CID_SHARPNESS);
uint32_t default_brightness = CHECK(fd, V4L2_CID_BRIGHTNESS);
for (int n = 0; n < count; ++n) {
printf("loop: %d\n", n);
for (int32_t value = 1; value < 16; value <<= 1) {
printf(" set: 0x%04x\n", value);
set_leds(fd, value);
usleep(500000);
}
}
// set all off
printf("turn off\n");
set_leds(fd, 0);
set_control(fd, V4L2_CID_HUE, default_hue);
set_control(fd, V4L2_CID_CONTRAST, default_contrast);
set_control(fd, V4L2_CID_SHARPNESS, default_sharpness);
set_control(fd, V4L2_CID_BRIGHTNESS, default_brightness);
// finished
close(fd);
return 0;
}
开发者ID:bitmark-inc,项目名称:physical-hasher,代码行数:99,代码来源:test-leds.c
注:本文中的set_control函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论