当前位置: 首页>>代码示例>>C++>>正文


C++ rtems_status_text函数代码示例

本文整理汇总了C++中rtems_status_text函数的典型用法代码示例。如果您正苦于以下问题:C++ rtems_status_text函数的具体用法?C++ rtems_status_text怎么用?C++ rtems_status_text使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了rtems_status_text函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: bdbuf_test_print_sc

/**
 * Print the status code description and return true if true.
 *
 * @param sc The RTEMS status code.
 * @retval true The status code is successful.
 * @retval false The status code is not successful.
 */
static bool
bdbuf_test_print_sc (rtems_status_code sc, bool newline)
{
  if (newline)
    fprintf (stdout, "%s\n", rtems_status_text (sc));
  else
    fprintf (stdout, "%s", rtems_status_text (sc));
  return sc == RTEMS_SUCCESSFUL;
}
开发者ID:lanzhongheng,项目名称:rtems,代码行数:16,代码来源:init.c

示例2: rtems_rfs_buffer_bdbuf_release

int
rtems_rfs_buffer_bdbuf_release (rtems_rfs_buffer* buffer,
                                bool              modified)
{
  rtems_status_code sc;
  int               rc = 0;

  if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_RELEASE))
    printf ("rtems-rfs: bdbuf-release: block=%" PRIuPTR " bdbuf=%" PRIu32 " %s\n",
            ((intptr_t) buffer->user),
            buffer->block, modified ? "(modified)" : "");

  if (modified)
    sc = rtems_bdbuf_release_modified (buffer);
  else
    sc = rtems_bdbuf_release (buffer);

  if (sc != RTEMS_SUCCESSFUL)
  {
#if RTEMS_RFS_BUFFER_ERRORS
    printf ("rtems-rfs: buffer-release: bdbuf-%s: %s(%d)\n",
            modified ? "modified" : "not-modified",
            rtems_status_text (sc), sc);
#endif
    rc = EIO;
  }

  return rc;
}
开发者ID:AlexShiLucky,项目名称:rtems,代码行数:29,代码来源:rtems-rfs-buffer-bdbuf.c

示例3: test_untar_from_memory

void test_untar_from_memory(void)
{
  rtems_status_code sc;
  rtems_printer     printer;

  rtems_print_printer_printf(&printer);

  printf("Untaring from memory - ");
  sc = Untar_FromMemory_Print((void *)TARFILE_START, TARFILE_SIZE, &printer);
  if (sc != RTEMS_SUCCESSFUL) {
    printf ("error: untar failed: %s\n", rtems_status_text (sc));
    exit(1);
  }
  printf ("successful\n");

  /******************/
  printf( "========= /home/test_file =========\n" );
  test_cat( "/home/test_file", 0, 0 );

  /******************/
  printf( "========= /home/test_script =========\n" );
  test_cat( "/home/test_script", 0, 0 );
  test_untar_check_mode("/home/test_script", 0755);

  /******************/
  printf( "========= /symlink =========\n" );
  test_cat( "/symlink", 0, 0 );

}
开发者ID:greenmeent,项目名称:rtems,代码行数:29,代码来源:init.c

示例4: epicsThreadCreate

/*
 * Create and start a new thread
 */
epicsThreadId
epicsThreadCreate (const char *name,
    unsigned int priority, unsigned int stackSize,
    EPICSTHREADFUNC funptr,void *parm)
{
    rtems_id tid;
    rtems_status_code sc;
    char c[4];

    if (!initialized) epicsThreadInit();
    if (stackSize < RTEMS_MINIMUM_STACK_SIZE) {
        errlogPrintf ("Warning: epicsThreadCreate %s illegal stackSize %d\n",name,stackSize);
        stackSize = RTEMS_MINIMUM_STACK_SIZE;
    }
    strncpy (c, name, sizeof c);
    sc = rtems_task_create (rtems_build_name (c[0], c[1], c[2], c[3]),
         epicsThreadGetOssPriorityValue (priority),
         stackSize,
         RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0),
         RTEMS_FLOATING_POINT|RTEMS_LOCAL,
         &tid);
    if (sc !=  RTEMS_SUCCESSFUL) {
        errlogPrintf ("epicsThreadCreate create failure for %s: %s\n",name, rtems_status_text (sc));
        return 0;
    }
    setThreadInfo (tid, name, funptr,parm);
    return (epicsThreadId)tid;
}
开发者ID:ukaea,项目名称:epics,代码行数:31,代码来源:osdThread.c

示例5: setThreadInfo

static void
setThreadInfo (rtems_id tid, const char *name, EPICSTHREADFUNC funptr,void *parm)
{
    struct taskVar *v;
    uint32_t note;
    rtems_status_code sc;

    v = mallocMustSucceed (sizeof *v, "epicsThreadCreate_vars");
    v->name = epicsStrDup(name);
    v->id = tid;
    v->funptr = funptr;
    v->parm = parm;
    v->threadVariableCapacity = 0;
    v->threadVariables = NULL;
    note = (uint32_t)v;
    rtems_task_set_note (tid, RTEMS_NOTEPAD_TASKVAR, note);
    taskVarLock ();
    v->forw = taskVarHead;
    v->back = NULL;
    if (v->forw)
        v->forw->back = v;
    taskVarHead = v;
    taskVarUnlock ();
    if (funptr) {
        sc = rtems_task_start (tid, threadWrapper, (rtems_task_argument)v);
        if (sc !=  RTEMS_SUCCESSFUL)
            errlogPrintf ("setThreadInfo:  Can't start  %s: %s\n",name, rtems_status_text (sc));
    }
}
开发者ID:ukaea,项目名称:epics,代码行数:29,代码来源:osdThread.c

示例6: rtems_gxx_mutex_init

/*
 * MUTEX support
 */
void rtems_gxx_mutex_init (__gthread_mutex_t *mutex)
{
  rtems_status_code status;

  #ifdef DEBUG_GXX_WRAPPERS
    printk( "gxx_wrappers: mutex init =%X\n", *mutex );
  #endif

  status = rtems_semaphore_create(
    rtems_build_name ('G', 'C', 'C', '2'),
    1,
    RTEMS_PRIORITY|RTEMS_BINARY_SEMAPHORE|
      RTEMS_INHERIT_PRIORITY|RTEMS_NO_PRIORITY_CEILING|RTEMS_LOCAL,
    0,
    (rtems_id *)mutex
  );
  if ( status != RTEMS_SUCCESSFUL ) {
    #ifdef DEBUG_GXX_WRAPPERS
      printk(
        "gxx_wrappers: mutex init failed %s (%d)\n",
        rtems_status_text(status),
        status
      );
    #endif
    _Internal_error_Occurred(
      INTERNAL_ERROR_CORE,
      true,
      INTERNAL_ERROR_GXX_MUTEX_INIT_FAILED
    );
  }
  #ifdef DEBUG_GXX_WRAPPERS
    printk( "gxx_wrappers: mutex init complete =%X\n", *mutex );
  #endif
}
开发者ID:0871087123,项目名称:rtems,代码行数:37,代码来源:gxx_wrappers.c

示例7: rtems_rfs_buffer_bdbuf_request

int
rtems_rfs_buffer_bdbuf_request (rtems_rfs_file_system*   fs,
                                rtems_rfs_buffer_block   block,
                                bool                     read,
                                rtems_rfs_buffer**       buffer)
{
  rtems_status_code sc;
  int               rc = 0;

  if (read)
    sc = rtems_bdbuf_read (rtems_rfs_fs_device (fs), block, buffer);
  else
    sc = rtems_bdbuf_get (rtems_rfs_fs_device (fs), block, buffer);

  if (sc != RTEMS_SUCCESSFUL)
  {
#if RTEMS_RFS_BUFFER_ERRORS
    printf ("rtems-rfs: buffer-bdbuf-request: block=%lu: bdbuf-%s: %d: %s\n",
            block, read ? "read" : "get", sc, rtems_status_text (sc));
#endif
    rc = EIO;
  }

  return rc;
}
开发者ID:AlexShiLucky,项目名称:rtems,代码行数:25,代码来源:rtems-rfs-buffer-bdbuf.c

示例8: rtems_rfs_buffer_sync

int
rtems_rfs_buffer_sync (rtems_rfs_file_system* fs)
{
  int result = 0;
#if RTEMS_RFS_USE_LIBBLOCK
  rtems_status_code sc;
#endif

  if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
    printf ("rtems-rfs: buffer-sync: syncing\n");

  /*
   * @todo Split in the separate files for each type.
   */
#if RTEMS_RFS_USE_LIBBLOCK
  sc = rtems_bdbuf_syncdev (rtems_rfs_fs_device (fs));
  if (sc != RTEMS_SUCCESSFUL)
  {
    if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
      printf ("rtems-rfs: buffer-sync: device sync failed: %s\n",
              rtems_status_text (sc));
    result = EIO;
  }
  rtems_disk_release (fs->disk);
#else
  if (fsync (fs->device) < 0)
  {
    result = errno;
    if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CLOSE))
      printf ("rtems-rfs: buffer-sync: file sync failed: %d: %s\n",
              result, strerror (result));
  }
#endif
  return result;
}
开发者ID:AndroidMarv,项目名称:rtems,代码行数:35,代码来源:rtems-rfs-buffer.c

示例9: shell_start

/**
 * Start the RTEMS Shell.
 */
void shell_start ()
{
  rtems_status_code sc;
  printf ("Starting shell....\n\n");
  sc = rtems_shell_init ("fstst", 60 * 1024, 150, "/dev/console", 0, 1, NULL);
  if (sc != RTEMS_SUCCESSFUL)
    printf ("error: starting shell: %s (%d)\n", rtems_status_text (sc), sc);
}
开发者ID:Sambeet161616,项目名称:examples-v2,代码行数:11,代码来源:init.c

示例10: destroyTimer

static void destroyTimer(rtems_id timerID) {
	rtems_status_code rc;
	
	rc = rtems_timer_delete(timerID);
	if(rc != RTEMS_SUCCESSFUL) {
		syslog(LOG_INFO, "rtems_timer_delete(): %s\n", rtems_status_text(rc));
	}
}
开发者ID:dchabot,项目名称:cls-orbitcontrol,代码行数:8,代码来源:findTscFreq.c

示例11: spawnTask

/*
 * Spawn a task
 */
static void spawnTask(rtems_task_entry entryPoint, rtems_task_priority priority, rtems_task_argument arg)
{
    rtems_status_code sc;
    rtems_id tid;

    sc = rtems_task_create(rtems_build_name('t','a','s','k'),
                           priority,
                           RTEMS_MINIMUM_STACK_SIZE+(8*1024),
                           RTEMS_PREEMPT|RTEMS_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0),
                           RTEMS_FLOATING_POINT|RTEMS_LOCAL,
                           &tid);
    if (sc != RTEMS_SUCCESSFUL)
        rtems_panic("Can't create task: %s", rtems_status_text(sc));
    sc = rtems_task_start(tid, entryPoint, arg);
    if (sc != RTEMS_SUCCESSFUL)
        rtems_panic("Can't start task: %s", rtems_status_text(sc));
}
开发者ID:vecnatechnologies,项目名称:rtems,代码行数:20,代码来源:init.c

示例12: epicsThreadSuspendSelf

void
epicsThreadSuspendSelf (void)
{
    rtems_status_code sc;

    sc = rtems_task_suspend (RTEMS_SELF);
    if(sc != RTEMS_SUCCESSFUL)
        errlogPrintf("epicsThreadSuspendSelf failed: %s\n", rtems_status_text (sc));
}
开发者ID:ukaea,项目名称:epics,代码行数:9,代码来源:osdThread.c

示例13: epicsThreadResume

void epicsThreadResume(epicsThreadId id)
{
    rtems_id tid = (rtems_id)id;
    rtems_status_code sc;

    sc = rtems_task_resume (tid);
    if(sc != RTEMS_SUCCESSFUL)
        errlogPrintf("epicsThreadResume failed: %s\n", rtems_status_text (sc));
}
开发者ID:ukaea,项目名称:epics,代码行数:9,代码来源:osdThread.c

示例14: epicsEventDestroy

void
epicsEventDestroy(epicsEventId id)
{
    rtems_id sid = (rtems_id)id;
    rtems_status_code sc;
    
    sc = rtems_semaphore_delete (sid);
    if (sc != RTEMS_SUCCESSFUL)
        errlogPrintf ("Can't destroy semaphore: %s\n", rtems_status_text (sc));
}
开发者ID:epicsdeb,项目名称:epics-base,代码行数:10,代码来源:osdEvent.c

示例15: shell_init_script

/**
 * Run the /shell-init script.
 */
void shell_init_script(void)
{
  rtems_status_code sc;
  printf("Running /shell-init....\n\n");
  sc = rtems_shell_script("fstst", 60 * 1024, 160, "/shell-init", "stdout",
                           0, 1, 1);
  if (sc != RTEMS_SUCCESSFUL)
    printf("error: running shell script: %s (%d)\n",
             rtems_status_text (sc), sc);
}
开发者ID:Sambeet161616,项目名称:examples-v2,代码行数:13,代码来源:init.c


注:本文中的rtems_status_text函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。