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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [posix/] [inline/] [rtems/] [posix/] [priority.inl] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  $Id: priority.inl,v 1.2 2001-09-27 11:59:14 chris Exp $
3
 */
4
 
5
#ifndef __RTEMS_POSIX_PRIORITY_inl
6
#define __RTEMS_POSIX_PRIORITY_inl
7
 
8
/*
9
 *  1003.1b-1993,2.2.2.80 definition of priority, p. 19
10
 *
11
 *  "Numericallly higher values represent higher priorities."
12
 *
13
 *  Thus, RTEMS Core has priorities run in the opposite sense of the POSIX API.
14
 */
15
 
16
RTEMS_INLINE_ROUTINE boolean _POSIX_Priority_Is_valid(
17
  int priority
18
)
19
{
20
  return (boolean) (priority >= 1 && priority <= 254);
21
}
22
 
23
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
24
  int priority
25
)
26
{
27
  return (Priority_Control) (255 - priority);
28
}
29
 
30
RTEMS_INLINE_ROUTINE int _POSIX_Priority_From_core(
31
  Priority_Control priority
32
)
33
{
34
  return 255 - priority;
35
}
36
 
37
#endif

powered by: WebSVN 2.1.0

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