summaryrefslogtreecommitdiffstats
path: root/pk/ppe42/pk_port_types.h
blob: 1536b77b50848f6cd5e740d874ccb6780892c672 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef __PK_PORT_TYPES_H__
#define __PK_PORT_TYPES_H__
//-----------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2014
// *! All Rights Reserved -- Property of IBM
// *! *** IBM Confidential ***
//-----------------------------------------------------------------------------

/// \file pk_port_types.h
/// \brief Type definitions required by the PK port.
///
/// \todo GCC provides a portable version of cntlzw called __builtin_clz().
/// We should make the PK priority queues portable by using this facility.
///
/// \todo I think that if more of the port-dependent types were moved here, we
/// could break the circular dependencies in some of the header inclusion and
/// simplify the way the PK/port/chip headers are included.

/// An PkIrqId is an integer in the range of valid interrupts defined by the
/// interrupt controller.

typedef uint8_t PkIrqId;

/// PK requires the port to define the type PkThreadQueue, which is a
/// priority queue (where 0 is the highest priority).  This queue must be able
/// to handle PK_THREADS + 1 priorities (the last for the idle thread). The
/// port must also define methods for clearing, insertion, deletion and min
/// (with assumed legal priorities).  The min operation returns PK_THREADS if
/// the queue is empty. (Or a queue could be initialized with the PK_THREADS
/// entry always present - PK code never tries to delete the idle thread from
/// a thread queue).
///
/// These queues are used both for the run queue and the pending queue
/// associated with every semaphore. 
///
/// On PPE42 with 32 threads (implied), this is a job for a uint32_t and
/// cntlzw(). 

typedef uint32_t PkThreadQueue;

#endif  /* __PK_PORT_TYPES_H__ */
OpenPOWER on IntegriCloud