本文整理汇总了C++中dispatch函数的典型用法代码示例。如果您正苦于以下问题:C++ dispatch函数的具体用法?C++ dispatch怎么用?C++ dispatch使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dispatch函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: dispatch
Future<Option<Entry>> InMemoryStorage::get(const string& name)
{
return dispatch(process, &InMemoryStorageProcess::get, name);
}
开发者ID:EronWright,项目名称:mesos,代码行数:4,代码来源:in_memory.cpp
示例2: cons_close
long
cons_close(long dev)
{
return dispatch(CCB_CLOSE, dev);
}
开发者ID:wbx-github,项目名称:openadk,代码行数:5,代码来源:cons.c
示例3: cons_close_console
void cons_close_console(void)
{
dispatch(CCB_CLOSE_CONSOLE);
}
开发者ID:wbx-github,项目名称:openadk,代码行数:4,代码来源:cons.c
示例4: dispatch
void Dialog::updateDialog() const
{
dispatch(FuncRequest(LFUN_DIALOG_UPDATE, fromqstr(name_)));
}
开发者ID:315234,项目名称:lyx-retina,代码行数:4,代码来源:Dialog.cpp
示例5: dispatch
void Output::pause()
{
pause_ = !pause_;
PlayerUtils::State state = pause_ ? PlayerUtils::Paused : PlayerUtils::Playing;
dispatch(state);
}
开发者ID:chenhbzl,项目名称:BooxApp,代码行数:6,代码来源:output.cpp
示例6: handle_user_page_fault
/*
* Try to find out what address generated page fault, and then tell the dispatcher what
* happened. Some faults will not be recoverable (e.g. stack faults), because the
* context has already been lost
*/
void handle_user_page_fault(arch_registers_state_t* save_area)
{
lvaddr_t fault_address;//not passed as argument, because there is not just one place to look
/*
//print out registers for debugging
printf("page fault. registers:\n");
for(uint32_t i = 0; i<NUM_REGS; i++){
printf("0x%x\n", save_area->regs[i]);
}
uint32_t regval;
__asm volatile ("mrs %[regval], xpsr" : [regval] "=r"(regval));
printf("current XPSR register: 0x%x\n", regval);
printf("M3 MMU address: 0x%x\n", *((uint32_t*) &mmu));
printf("M3 MMU_FAULT_AD register: 0x%x\n", omap44xx_mmu_fault_ad_rd(&mmu));
printf("M3 MMU_FAULT_STATUS register: 0x%x\n", omap44xx_mmu_fault_status_rd(&mmu));
printf("M3 MMU_FAULT_PC register: 0x%x\n", omap44xx_mmu_fault_pc_rd(&mmu));
printf("M3 MMU_IRQSTATUS register: 0x%x\n", omap44xx_mmu_irqstatus_rd(&mmu));
printf("ICTR: 0x%x\n", omap44xx_cortex_m3_nvic_ICTR_rd(&nvic));
printf("CPUID_BASE: 0x%x\n", omap44xx_cortex_m3_nvic_CPUID_BASE_rd(&nvic));
printf("ICSR: 0x%x\n", omap44xx_cortex_m3_nvic_ICSR_rd(&nvic));
printf("VTOR: 0x%x\n", omap44xx_cortex_m3_nvic_VTOR_rd(&nvic));
printf("AIRCR: 0x%x\n", omap44xx_cortex_m3_nvic_AIRCR_rd(&nvic));
printf("CCR: 0x%x\n", omap44xx_cortex_m3_nvic_CCR_rd(&nvic));
printf("SHCSR: 0x%x\n", omap44xx_cortex_m3_nvic_SHCSR_rd(&nvic));
printf("CFSR: 0x%x\n", omap44xx_cortex_m3_nvic_CFSR_rd(&nvic));
printf("BFAR: 0x%x\n", omap44xx_cortex_m3_nvic_BFAR_rd(&nvic));
printf("SYSTICK_CTRL: 0x%x\n", omap44xx_cortex_m3_nvic_SYSTICK_CTRL_rd(&nvic));
printf("SYSTICK_CALV: 0x%x\n", omap44xx_cortex_m3_nvic_SYSTICK_CALV_rd(&nvic));
*/
if (omap44xx_cortex_m3_nvic_SHCSR_busfaultact_rdf(&nvic)){
//triggered by bus fault
if (omap44xx_mmu_irqstatus_rd(&mmu)){
//L2 MMU triggered fault: either no valid mapping, or two mappings in TLB
//XXX: cachemarker: once we have chaching enabled, this is the place to
//look at table entry for special permission bits.
//XXX: MMU_FAULT_ADDR register seems to just contain the last address that was
//requested. By this time this is probably just a kernelspace address.
//I am not sure if the M3 can actually find out what the faulting address really was
fault_address = omap44xx_mmu_fault_ad_rd(&mmu);
}
else{
//"regular" bus fault -> look in NVIC entries
if (omap44xx_cortex_m3_nvic_CFSR_bfarvalid_rdf(&nvic)){
//bus fault address register valid
fault_address = omap44xx_cortex_m3_nvic_BFAR_rd(&nvic);
}
else{
//one of the bus faults that do not write the BFAR -> faulting address
//literally unknown to system
printk(LOG_WARN, "user bus fault with unknown faulting address\n");
fault_address = (lvaddr_t) NULL;
}
}
}
else{
//memory management fault (probably access violation)
if (omap44xx_cortex_m3_nvic_CFSR_mmarvalid_rdf(&nvic)){
//MMAR contains faulting address
fault_address = omap44xx_cortex_m3_nvic_MMAR_rd(&nvic);
}
else{
//MMAR not written. probably executing in noexecute region
assert(omap44xx_cortex_m3_nvic_CFSR_iaccviol_rdf(&nvic));
//so we can assume the pc caused the fault
fault_address = save_area->named.pc;
}
}
lvaddr_t handler;
struct dispatcher_shared_arm *disp = get_dispatcher_shared_arm(dcb_current->disp);
uintptr_t saved_pc = save_area->named.pc;
disp->d.disabled = dispatcher_is_disabled_ip(dcb_current->disp, saved_pc);
bool disabled = (disp->d.disabled != 0);
assert(dcb_current->disp_cte.cap.type == ObjType_Frame);
printk(LOG_WARN, "user page fault%s in '%.*s': addr %"PRIxLVADDR
" IP %"PRIxPTR"\n",
disabled ? " WHILE DISABLED" : "", DISP_NAME_LEN,
disp->d.name, fault_address, saved_pc);
if (disabled) {
assert(save_area == &disp->trap_save_area);
handler = disp->d.dispatcher_pagefault_disabled;
dcb_current->faults_taken++;
}
else {
assert(save_area == &disp->enabled_save_area);
handler = disp->d.dispatcher_pagefault;
}
//.........这里部分代码省略.........
开发者ID:Karamax,项目名称:arrakis,代码行数:101,代码来源:exn.c
示例7: setAndSendState
void
setAndSendState(EntityStates state)
{
m_state = state;
dispatch(m_states[m_state]);
}
开发者ID:henrypc6,项目名称:dune,代码行数:6,代码来源:Task.cpp
示例8: type_dir___inode
void type_dir___inode (char *command_line)
{
dispatch ("settype ext2_inode");
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:6,代码来源:dir_com.c
示例9: publish
void publish(const proton::message &m) {
messages.push_back(m);
dispatch(0);
}
开发者ID:Karm,项目名称:qpid-proton,代码行数:4,代码来源:broker.cpp
示例10: consume
void
consume(const IMC::SimulatedState* msg)
{
if (m_args.activation_control)
{
if (!isActive())
return;
}
if (!isActive())
{
m_vel[0] = msg->u;
m_vel[1] = msg->v;
m_vel[2] = msg->w;
requestActivation();
}
// Compute time delta.
double tstep = m_delta.getDelta();
// Check if we have a valid time delta.
if (tstep <= 0)
return;
// Define Euler Angles variables and add gaussian noise component.
if (m_args.euler)
{
m_euler.phi = Angles::normalizeRadian(msg->phi + m_prng->gaussian() * Angles::radians(m_args.stdev_euler));
m_euler.theta = Angles::normalizeRadian(msg->theta + m_prng->gaussian() * Angles::radians(m_args.stdev_euler));
m_euler.psi_magnetic = Angles::normalizeRadian(msg->psi + m_prng->gaussian() * Angles::radians(m_args.stdev_euler));
m_euler.psi = Angles::normalizeRadian(m_euler.psi_magnetic + m_heading_offset);
// Heading offset will increment through time according with gyro rate bias.
m_heading_offset += Angles::radians(m_args.gyro_bias / 3600) * tstep;
m_euler.setTimeStamp(msg->getTimeStamp());
dispatch(m_euler, DF_KEEP_TIME);
}
// Define Angular Velocity variables and add gaussian noise component.
m_agvel.x = Angles::normalizeRadian(msg->p + m_prng->gaussian() * Angles::radians(m_args.stdev_agvel));
m_agvel.y = Angles::normalizeRadian(msg->q + m_prng->gaussian() * Angles::radians(m_args.stdev_agvel));
m_agvel.z = Angles::normalizeRadian(msg->r + m_prng->gaussian() * Angles::radians(m_args.stdev_agvel));
// Compute acceleration values using simulated state velocity fields.
m_accel.x = (msg->u - m_vel[0]) / tstep;
m_accel.y = (msg->v - m_vel[1]) / tstep;
m_accel.z = (msg->w - m_vel[2]) / tstep;
double macc = DUNE::Navigation::c_max_accel;
m_accel.x = DUNE::Math::trimValue(m_accel.x, -macc, macc);
m_accel.y = DUNE::Math::trimValue(m_accel.y, -macc, macc);
m_accel.z = DUNE::Math::trimValue(m_accel.z, -macc, macc);
// Store velocity for next iteration.
m_vel[0] = msg->u;
m_vel[1] = msg->v;
m_vel[2] = msg->w;
// Define messages timestamp and dispatch them to the bus.
m_agvel.setTimeStamp(msg->getTimeStamp());
m_accel.setTimeStamp(msg->getTimeStamp());
dispatch(m_agvel, DF_KEEP_TIME);
dispatch(m_accel, DF_KEEP_TIME);
setEntityState(IMC::EntityState::ESTA_NORMAL, Status::CODE_ACTIVE);
}
开发者ID:AndreGCGuerra,项目名称:dune,代码行数:67,代码来源:Task.cpp
示例11: type_dir___cd
void type_dir___cd (char *command_line)
{
int status;
char *ptr,full_dir_name [500],dir_name [500],temp [500],temp2 [500];
struct struct_file_info info;
struct ext2_dir_entry_2 *dir_entry_ptr;
dir_entry_ptr=(struct ext2_dir_entry_2 *) (file_info.buffer+file_info.dir_entry_offset);
ptr=parse_word (command_line,dir_name);
if (*ptr==0) { /* cd alone will enter the highlighted directory */
strncpy (full_dir_name,dir_entry_ptr->name,dir_entry_ptr->name_len);
full_dir_name [dir_entry_ptr->name_len]=0;
}
else
ptr=parse_word (ptr,full_dir_name);
ptr=strchr (full_dir_name,'/');
if (ptr==full_dir_name) { /* Pathname is from root - Let the general cd do the job */
sprintf (temp,"cd %s",full_dir_name);type_ext2___cd (temp);return;
}
if (ptr==NULL) {
strcpy (dir_name,full_dir_name);
full_dir_name [0]=0;
}
else {
strncpy (dir_name,full_dir_name,ptr-full_dir_name);
dir_name [ptr-full_dir_name]=0;
strcpy (full_dir_name,++ptr);
}
/* dir_name contains the current entry, while */
/* full_dir_name contains the rest */
strcpy (name_search,dir_name); /* name_search is used to hold the required entry name */
if (dir_entry_ptr->name_len != strlen (dir_name) ||
strncmp (dir_name,dir_entry_ptr->name,dir_entry_ptr->name_len)!=0)
info=search_dir_entries (&action_name,&status); /* Search for the entry. Answer in info. */
else {
status=FOUND;info=file_info;
}
if (status==FOUND) { /* If found */
file_info=info; /* Switch to it, by setting the global file_info */
dispatch ("remember internal_variable"); /* Move the inode into the objects memory */
dispatch ("followinode"); /* Go to the inode pointed by this directory entry */
if (S_ISLNK (type_data.u.t_ext2_inode.i_mode)) {/* Symbolic link ? */
if (type_data.u.t_ext2_inode.i_size > 60) { /* I'm lazy, I guess :-) */
wprintw (command_win,"Error - Sorry, Only fast symbolic link following is currently supported\n");
refresh_command_win ();
return;
}
/* Get the pointed name and append the previous path */
strcpy (temp2,(unsigned char *) &type_data.u.t_ext2_inode.i_block);
strcat (temp2,"/");
strcat (temp2,full_dir_name);
dispatch ("recall internal_variable"); /* Return to the original inode */
dispatch ("dir"); /* and to the directory */
sprintf (temp,"cd %s",temp2); /* And continue from there by dispatching a cd command */
dispatch (temp); /* (which can call ourself or the general cd) */
return;
}
if (S_ISDIR (type_data.u.t_ext2_inode.i_mode)) { /* Is it an inode of a directory ? */
dispatch ("dir"); /* Yes - Pass to the pointed directory */
if (full_dir_name [0] != 0) { /* And call ourself with the rest of the pathname */
sprintf (temp,"cd %s",full_dir_name);
dispatch (temp);
}
return;
}
else { /* If we can't continue from here, we'll just stop */
wprintw (command_win,"Can\'t continue - Stopping at last inode\n");refresh_command_win ();
return;
}
}
wprintw (command_win,"Error - Directory entry %s not found.\n",dir_name); /* Hmm, an invalid path somewhere */
refresh_command_win ();
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:97,代码来源:dir_com.c
示例12: autorun
//------------------------------------------------------------------------------
int autorun(int argc, char** argv)
{
// Parse command line arguments.
struct option options[] = {
{ "help", no_argument, nullptr, 'h' },
{ "allusers", no_argument, nullptr, 'a' },
{}
};
str<MAX_PATH> clink_path;
int i;
int ret = 0;
while ((i = getopt_long(argc, argv, "ha", options, nullptr)) != -1)
{
switch (i)
{
case 'a':
g_all_users = 1;
break;
case 'h':
print_help();
return 0;
default:
return 0;
}
}
dispatch_func_t* function = nullptr;
// Find out what to do by parsing the verb.
if (optind < argc)
{
if (!strcmp(argv[optind], "install"))
function = install_autorun;
else if (!strcmp(argv[optind], "uninstall"))
function = uninstall_autorun;
else if (!strcmp(argv[optind], "set"))
function = set_autorun_value;
else if (!strcmp(argv[optind], "show"))
return show_autorun();
}
// Get path where clink is installed (assumed to be where this executable is)
if (function == install_autorun)
{
clink_path << _pgmptr;
clink_path.truncate(clink_path.last_of('\\'));
}
// Collect the remainder of the command line.
if (function == install_autorun || function == set_autorun_value)
{
for (i = optind + 1; i < argc; ++i)
{
g_clink_args << argv[i];
if (i < argc - 1)
g_clink_args << " ";
}
}
// If we can't continue any further then warn the user.
if (function == nullptr)
{
puts("ERROR: Invalid arguments. Run 'clink autorun --help' for info.");
return 0;
}
// Do the magic.
if (!check_registry_access())
{
puts("You must have administator rights to access cmd.exe's autorun");
return 0;
}
const char* arg = clink_path.c_str();
arg = *arg ? arg : g_clink_args.c_str();
ret = dispatch(function, arg);
// Provide the user with some feedback.
if (ret == 1)
{
const char* msg = nullptr;
if (function == install_autorun)
msg = "Clink successfully installed to run when cmd.exe starts";
else if (function == uninstall_autorun)
msg = "Clink's autorun entry has been removed";
else if (function == set_autorun_value)
msg = "Cmd.exe's AutoRun registry key set successfully";
if (msg != nullptr)
success_message(msg);
}
return ret;
}
开发者ID:Maximus5,项目名称:clink,代码行数:100,代码来源:autorun.cpp
示例13: env
void server::handle_request(const http::request& req, http::reply& rep)
{
string action;
try
{
xml::element* response;
if (req.method == "POST") // must be a SOAP call
{
xml::document doc;
doc.read(req.payload);
envelope env(doc);
xml::element* request = env.request();
action = request->name();
log() << action << ' ';
response = make_envelope(dispatch(action, env.request()));
}
else if (req.method == "GET")
{
// start by sanitizing the request's URI
string uri = req.uri;
// strip off the http part including hostname and such
if (ba::starts_with(uri, "http://"))
{
string::size_type s = uri.find_first_of('/', 7);
if (s != string::npos)
uri.erase(0, s);
}
// now make the path relative to the root
while (uri.length() > 0 and uri[0] == '/')
uri.erase(uri.begin());
fs::path path(uri);
fs::path::iterator p = path.begin();
if (p == path.end())
throw http::bad_request;
string root = (*p++).string();
if (root == "rest")
{
action = (*p++).string();
xml::element* request(new xml::element(action));
while (p != path.end())
{
string name = http::decode_url((*p++).string());
if (p == path.end())
break;
xml::element* param(new xml::element(name));
string value = http::decode_url((*p++).string());
param->content(value);
request->append(param);
}
log() << action << ' ';
response = make_envelope(dispatch(action, request));
}
else if (root == "wsdl")
{
log() << "wsdl";
response = make_wsdl(m_location);
}
else
{
log() << req.uri;
throw http::not_found;
}
}
else
throw http::bad_request;
rep.set_content(response);
}
catch (std::exception& e)
{
rep.set_content(make_fault(e));
}
catch (http::status_type& s)
{
rep = http::reply::stock_reply(s);
}
}
开发者ID:BackupTheBerlios,项目名称:libzeep-svn,代码行数:88,代码来源:soap-server.cpp
示例14: spin1_start
uint spin1_start (sync_bool sync)
{
sark_cpu_state (CPU_STATE_RUN);
// Initialise hardware
configure_communications_controller();
configure_dma_controller();
configure_timer1 (timer_tick);
configure_vic();
#if (API_WARN == TRUE) || (API_DIAGNOSTICS == TRUE)
warnings = NO_ERROR;
dfull = 0;
fullq = 0;
pfull = 0;
#if USE_WRITE_BUFFER == TRUE
wberrors = 0;
#endif
#endif
// synchronise with other application cores
if (sync == SYNC_WAIT)
event_wait ();
// initialise counter and ticks for simulation
// 32-bit, periodic counter, interrupts enabled
if (timer_tick)
tc[T1_CONTROL] = 0xe2;
ticks = 0;
run = 1;
// simulate!
dispatch ();
// simulation finished - clean up before returning to c_main
clean_up ();
// re-enable interrupts for sark
// only CPU_INT enabled in the VIC
spin1_int_enable ();
// provide diagnostics data to application
#if (API_DIAGNOSTICS == TRUE)
diagnostics.exit_code = exit_val;
diagnostics.warnings = warnings;
diagnostics.total_mc_packets = rtr[RTR_DGC0] + rtr[RTR_DGC1];
diagnostics.dumped_mc_packets = rtr[RTR_DGC8];
diagnostics.discarded_mc_packets = thrown;
diagnostics.dma_transfers = dma_id - 1;
diagnostics.dma_bursts = dma[DMA_STAT0];
diagnostics.dma_queue_full = dfull;
diagnostics.task_queue_full = fullq;
diagnostics.tx_packet_queue_full = pfull;
#if USE_WRITE_BUFFER == TRUE
diagnostics.writeBack_errors = wberrors;
#endif
#endif
// report problems if requested!
#if (API_DEBUG == TRUE) || (API_WARN == TRUE)
// avoid sending output at the same time as other chips!
io_delay (10000 * my_chip);
#if API_DEBUG == TRUE // report debug information
report_debug();
#endif
#if API_WARN == TRUE // report warnings
report_warns ();
#endif
#endif
return exit_val;
}
开发者ID:BRML,项目名称:HBP-spinnaker-cerebellum,代码行数:78,代码来源:spin1_api.c
示例15: throw
void UserConnection::on(BufferedSocketListener::Line, const string& aLine) throw () {
if(aLine.length() < 2)
return;
if(aLine[0] == 'C' && !isSet(FLAG_NMDC)) {
dispatch(aLine);
return;
} else if(aLine[0] == '$') {
setFlag(FLAG_NMDC);
} else {
// We shouldn't be here?
dcdebug("Unknown UserConnection command: %.50s\n", aLine.c_str());
return;
}
string cmd;
string param;
string::size_type x;
if( (x = aLine.find(' ')) == string::npos) {
cmd = aLine;
} else {
cmd = aLine.substr(0, x);
param = aLine.substr(x+1);
}
if(cmd == "$MyNick") {
if(!param.empty())
fire(UserConnectionListener::MyNick(), this, Text::acpToUtf8(param));
} else if(cmd == "$Direction") {
x = param.find(" ");
if(x != string::npos) {
fire(UserConnectionListener::Direction(), this, param.substr(0, x), param.substr(x+1));
}
} else if(cmd == "$Error") {
if(Util::stricmp(param.c_str(), FILE_NOT_AVAILABLE) == 0 ||
param.rfind(/*path/file*/" no more exists") != string::npos) {
fire(UserConnectionListener::FileNotAvailable(), this);
} else {
fire(UserConnectionListener::Failed(), this, param);
}
} else if(cmd == "$FileLength") {
if(!param.empty())
fire(UserConnectionListener::FileLength(), this, Util::toInt64(param));
} else if(cmd == "$GetListLen") {
fire(UserConnectionListener::GetListLength(), this);
} else if(cmd == "$Get") {
notSupported();
disconnect();
StringMap params;
params["user"] = getUser()->getNick();
params["hub"] = getUser()->getClientUrl();
params["ip"] = getRemoteIp();
string tmp = Util::formatParams(STRING(OLD_CLIENT), params, false);
LogManager::getInstance()->message(tmp);
} else if(cmd == "$GetZBlock" || cmd == "$UGetZBlock" || cmd == "$UGetBlock") {
notSupported();
disconnect();
StringMap params;
params["user"] = getUser()->getNick();
params["hub"] = getUser()->getClientUrl();
params["ip"] = getRemoteIp();
string tmp = Util::formatParams(STRING(OLD_CLIENT), params, false);
LogManager::getInstance()->message(tmp);
} else if(cmd == "$Key") {
if(!param.empty())
fire(UserConnectionListener::Key(), this, param);
} else if(cmd == "$Lock") {
if(!param.empty()) {
x = param.find(" Pk=");
if(x != string::npos) {
fire(UserConnectionListener::CLock(), this, param.substr(0, x), param.substr(x + 4));
} else {
// Workaround for faulty linux clients...
x = param.find(' ');
if(x != string::npos) {
setFlag(FLAG_INVALIDKEY);
fire(UserConnectionListener::CLock(), this, param.substr(0, x), Util::emptyString);
} else {
fire(UserConnectionListener::CLock(), this, param, Util::emptyString);
}
}
}
} else if(cmd == "$Send") {
fire(UserConnectionListener::Send(), this);
} else if(cmd == "$Sending") {
int64_t bytes = -1;
if(!param.empty())
bytes = Util::toInt64(param);
fire(UserConnectionListener::Sending(), this, bytes);
} else if(cmd == "$MaxedOut") {
fire(UserConnectionListener::MaxedOut(), this);
} else if(cmd == "$Supports") {
if(!param.empty()) {
fire(UserConnectionListener::Supports(), this, StringTokenizer<string>(param, ' ').getTokens());
}
} else if(cmd.compare(0, 4, "$ADC") == 0) {
dispatch(aLine, true);
} else {
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:fuldc-svn,代码行数:101,代码来源:UserConnection.cpp
示例16: handle_irq
/*
* \brief handler pretty much any usermode IRQ except system calls
*/
void handle_irq(uint32_t irq, arch_registers_state_t* save_area)
{
/*
printf("handle_irq: registers:\n");//dump content for debugging reasons
for(uint32_t i = 0; i<NUM_REGS; i++){
printf("0x%x\n", save_area->regs[i]);
}*/
/*
uint32_t regval;
__asm volatile ("mrs %[regval], xpsr" : [regval] "=r"(regval));
printf("current XPSR register: 0x%x\n", regval);
printf("M3 MMU address: 0x%x\n", *((uint32_t*) &mmu));
printf("M3 MMU_FAULT_AD register: 0x%x\n", omap44xx_mmu_fault_ad_rd(&mmu));
printf("M3 MMU_FAULT_STATUS register: 0x%x\n", omap44xx_mmu_fault_status_rd(&mmu));
printf("M3 MMU_FAULT_PC register: 0x%x\n", omap44xx_mmu_fault_pc_rd(&mmu));
printf("M3 MMU_IRQSTATUS register: 0x%x\n", omap44xx_mmu_irqstatus_rd(&mmu));
printf("ICTR: 0x%x\n", omap44xx_cortex_m3_nvic_ICTR_rd(&nvic));
printf("CPUID_BASE: 0x%x\n", omap44xx_cortex_m3_nvic_CPUID_BASE_rd(&nvic));
printf("ICSR: 0x%x\n", omap44xx_cortex_m3_nvic_ICSR_rd(&nvic));
printf("VTOR: 0x%x\n", omap44xx_cortex_m3_nvic_VTOR_rd(&nvic));
printf("AIRCR: 0x%x\n", omap44xx_cortex_m3_nvic_AIRCR_rd(&nvic));
printf("CCR: 0x%x\n", omap44xx_cortex_m3_nvic_CCR_rd(&nvic));
printf("SHCSR: 0x%x\n", omap44xx_cortex_m3_nvic_SHCSR_rd(&nvic));
printf("CFSR: 0x%x\n", omap44xx_cortex_m3_nvic_CFSR_rd(&nvic));
printf("BFAR: 0x%x\n", omap44xx_cortex_m3_nvic_BFAR_rd(&nvic));
printf("SYSTICK_CTRL: 0x%x\n", omap44xx_cortex_m3_nvic_SYSTICK_CTRL_rd(&nvic));
printf("SYSTICK_CALV: 0x%x\n", omap44xx_cortex_m3_nvic_SYSTICK_CALV_rd(&nvic));
*/
uintptr_t fault_pc = save_area->named.pc;//read faulting pc from pushed context
debug(SUBSYS_DISPATCH, "IRQ %"PRIu32" while %s\n", irq,
dcb_current ? (dcb_current->disabled ? "disabled": "enabled") : "in kernel");
if (dcb_current != NULL) {
dispatcher_handle_t handle = dcb_current->disp;
if (save_area == dispatcher_get_disabled_save_area(handle)) {
assert(dispatcher_is_disabled_ip(handle, fault_pc));
dcb_current->disabled = true;
} else {
/* debug(SUBSYS_DISPATCH,
"save_area=%p, dispatcher_get_enabled_save_are(handle)=%p\n",
save_area, dispatcher_get_enabled_save_area(handle));
*/
assert(save_area == dispatcher_get_enabled_save_area(handle));
assert(!dispatcher_is_disabled_ip(handle, fault_pc));
dcb_current->disabled = false;
}
}
//TODO: heteropanda: make a case distinction on the type of interrupt, and
//actually handle it
if (irq == ARM_7M_EVECTOR_SYSTICK) {
// Timer interrupt
assert(kernel_ticks_enabled);
kernel_now += kernel_timeslice;
wakeup_check(kernel_now);
printf(".");//to see how many we get & their distribution, without spamming lines
dispatch(schedule());
}
else {
// send_user_interrupt(irq);
panic("Unhandled IRQ %"PRIu32"\n", irq);
}
}
开发者ID:Karamax,项目名称:arrakis,代码行数:73,代码来源:exn.c
示例17: main
int main(){
struct Handler *handler_p, *next_handler;
unsigned hid;
unsigned oep;
// This is NOT THE PROPER WAY!!!
unsigned siginfo[512];
unsigned baseaddr, memsize;
enum __ptrace_request pr, pr2;
//struct user_regs_struct regs;
//char inst_str[128];
// Test
const char *prog = "./try";
//char indirect = 0;
//char manual = 0;
//char plt = 1;
//int pop = 0;
//ban = 0x0804841b;
int wait_status;
struct user_regs_struct regs;
init();
pid_t pid = fork();
if (pid == 0){
Ptrace(PTRACE_TRACEME, 0, NULL, NULL);
execl(prog, prog, NULL);
}else if (pid > 0){
oep = get_entry_point(prog);
// On loaded
wait(&wait_status);
if (WIFSTOPPED(wait_status)){
// Test, wrong
memsize = get_memsize(prog);
baseaddr = get_baseaddr(prog);
add_module(&whitelist, baseaddr, memsize);
get_handler(pid, oep, get_trace_option(fopen("/tmp/trace","w"), whitelist));
get_handler(pid, 0x8048380, get_disable_option(API_TYPE_PLT));
Ptrace(PTRACE_CONT, pid, NULL, NULL);
}
wait(&wait_status);
// Withdraw control from plugins
while (WIFSTOPPED(wait_status)){
Ptrace(PTRACE_GETSIGINFO, pid, NULL, &siginfo);
// Caused by breakpoint
if (siginfo[2] == 0x80){
// Discard the 0xcc int 3 instruction
// So move the eip upper by 1
Ptrace(PTRACE_GETREGS, pid, NULL, ®s);
regs.eip --;
Ptrace(PTRACE_SETREGS, pid ,NULL, ®s);
}
// PTRACE_CONT by default because it has the lowest priority
pr = PTRACE_CONT;
hid = GETID(regs.eip);
for (handler_p=global_handler;handler_p;handler_p=next_handler){
next_handler = handler_p->next_handler;
pr2 = dispatch(pid, handler_p);
pr = PRIORITY(pr, pr2);
pr2 = global_expire(pid, handler_p, &next_handler);
pr = PRIORITY(pr, pr2);
}
for (handler_p=handlers[hid];handler_p;handler_p=next_handler){
next_handler = handler_p->next_handler;
pr2 = dispatch(pid, handler_p);
pr = PRIORITY(pr, pr2);
pr2 = expire(pid, handler_p, hid, &next_handler);
pr = PRIORITY(pr, pr2);
}
Ptrace(pr, pid, NULL, NULL);
wait(&wait_status);
}
}else{
perror("Folk failed: ");
exit(-1);
}
finalize();
return 0;
}
开发者ID:wuyihao14,项目名称:bintools,代码行数:81,代码来源:linux32_sandbox.c
示例18: onReportEntityState
void
onReportEntityState(void)
{
dispatch(m_states[m_state]);
}
开发者ID:henrypc6,项目名称:dune,代码行数:5,代码来源:Task.cpp
示例19: query
//.........这里部分代码省略.........
{
m_firstExec = true;
m_positive = false;
m_firstTap = TAP_IN;
m_oldState = m_link->getState();
if (m_isDetector)
doDispatch = true;
}
bool doQuery = false;
if (m_firstExec || (++m_tick > m_freq) || m_pulse == PM_IDLE)
{
doQuery = true;
m_tick = 0;
}
if (doQuery)
{
// Sensor detection.
bool lp = m_positive;
if (m_listener)
{
if (m_listener->m_mode == gkLogicBrick::Listener::OVERIDE)
m_positive = m_listener->executeEvent(this);
else
m_positive = m_listener->executeEvent(this) && query();
}
else
m_positive = query();
// Sensor Pulse.
if (m_pulse == PM_IDLE)
doDispatch = lp != m_positive;
else
{
if (m_pulse & PM_TRUE)
{
if (!m_invert)
doDispatch = (lp != m_positive) || m_positive;
else
doDispatch = (lp != m_positive) || !m_positive;
}
if (m_pulse & PM_FALSE)
{
if (!m_invert)
doDispatch = (lp != m_positive) || !m_positive;
else
doDispatch = (lp != m_positive) || m_positive;
}
}
// Tap mode (Switch On->Switch Off)
if (m_tap && !(m_pulse & PM_TRUE))
{
doQuery = m_positive;
if (m_invert)
doQuery = !doQuery;
doDispatch = false;
m_pulseState = BM_OFF;
if (m_firstTap == TAP_IN && doQuery)
{
doDispatch = true;
m_positive = true;
m_pulseState = BM_ON;
m_firstTap = TAP_OUT;
m_lastTap = TAP_IN;
}
else if (m_lastTap == TAP_IN)
{
m_positive = false;
doDispatch = true;
m_lastTap = TAP_OUT;
}
else
{
m_positive = false;
if (!doQuery)
m_firstTap = TAP_IN;
}
}
else m_pulseState = isPositive() ? BM_ON : BM_OFF;
if (m_firstExec)
{
m_firstExec = false;
if (m_invert && !doDispatch)
doDispatch = true;
}
if (!doDispatch)
doDispatch = detDispatch;
// Dispatch results
if (doDispatch) dispatch();
}
}
开发者ID:Ali-il,项目名称:gamekit,代码行数:101,代码来源:gkLogicSensor.cpp
示例20: mutex
void Output::run()
{
mutex()->lock ();
if (!bytes_per_millisecond_)
{
qWarning("Output: invalid audio parameters");
mutex()->unlock ();
return;
}
mutex()->unlock ();
bool done = false;
Buffer *b = 0;
qint64 l, m = 0;
dispatch(PlayerUtils::Playing);
while (!done)
{
mutex()->lock();
recycler()->mutex()->lock();
done = user_stop_;
while (!done && (recycler()->empty() || pause_))
{
mutex()->unlock();
recycler()->cond()->wakeOne();
recycler()->cond()->wait(recycler()->mutex());
mutex()->lock ();
done = user_stop_;
}
status();
if (!b)
{
b = recycler()->next();
if (b && b->rate)
{
kbps_ = b->rate;
}
}
recycler()->cond()->wakeOne();
recycler()->mutex()->unlock();
mutex()->unlock();
if (b)
{
changeVolume(b->data, b->nbytes, channels_);
l = 0;
m = 0;
if (is_seeking_)
{
enable(b->seeking_finished);
is_seeking_ = !b->seeking_finished;
}
while (l < b->nbytes)
{
m = writeAudio(b->data + l, b->nbytes - l);
if(m >= 0)
{
total_written_ += m;
l+= m;
}
else
{
break;
}
}
if(m < 0)
{
break;
}
}
mutex()->lock();
//force buffer change
recycler()->mutex()->lock ();
recycler()->done();
recycler()->mutex()->unlock();
b = 0;
mutex()->unlock();
}
mutex()->lock ();
//write remaining data
if(finish_)
{
flush();
qDebug("Output: total written %lld", total_written_);
}
dispatch(PlayerUtils::Stopped);
mutex()->unlock();
}
开发者ID:chenhbzl,项目名称:BooxApp,代码行数:91,代码来源:output.cpp
注:本文中的dispatch函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论