OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [itron/] [src/] [rot_rdq.c] - Blame information for rev 609

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  COPYRIGHT (c) 1989-1999.
3
 *  On-Line Applications Research Corporation (OAR).
4
 *
5
 *  The license and distribution terms for this file may be
6
 *  found in the file LICENSE in this distribution or at
7
 *  http://www.OARcorp.com/rtems/license.html.
8
 *
9
 *  $Id: rot_rdq.c,v 1.2 2001-09-27 11:59:13 chris Exp $
10
 */
11
 
12
#include <itron.h>
13
 
14
#include <rtems/score/thread.h>
15
#include <rtems/score/userext.h>
16
#include <rtems/score/wkspace.h>
17
#include <rtems/score/apiext.h>
18
#include <rtems/score/sysstate.h>
19
 
20
#include <rtems/itron/task.h>
21
 
22
/*
23
 *  rot_rdq - Rotate Tasks on the Ready Queue
24
 */
25
 
26
ER rot_rdq(
27
  PRI tskpri
28
)
29
{
30
  PRI priority;
31
 
32
 
33
  if (( tskpri <= 0 ) || ( tskpri >= 256 ))
34
    return E_PAR;
35
 
36
  _Thread_Disable_dispatch();
37
 
38
  /*
39
   * Yield of processor will rotate the queue for this processor.
40
   */
41
 
42
  priority = _ITRON_Task_Core_to_Priority(_Thread_Executing->current_priority);
43
  if ( priority == tskpri )
44
    _Thread_Yield_processor();
45
  else {
46
    _Thread_Rotate_Ready_Queue( _ITRON_Task_Core_to_Priority( tskpri ) );
47
  }
48
  _Thread_Enable_dispatch();
49
 
50
  return E_OK;
51
}
52
 
53
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.