本文整理汇总了C++中set_control函数的典型用法代码示例。如果您正苦于以下问题:C++ set_control函数的具体用法?C++ set_control怎么用?C++ set_control使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_control函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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));
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
}
示例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);
}
示例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
}