File: kernel-wait-info.hh

package info (click to toggle)
freehdl 0.0.8-2.2
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 8,632 kB
  • ctags: 10,443
  • sloc: cpp: 45,275; sh: 11,405; yacc: 4,206; ansic: 2,026; lex: 486; perl: 430; makefile: 390; tcl: 100
file content (42 lines) | stat: -rw-r--r-- 1,007 bytes parent folder | download | duplicates (5)
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
42
#ifndef FREEHDL_KERNEL_WAIT_INFO_H
#define FREEHDL_KERNEL_WAIT_INFO_H

#include <freehdl/kernel-sig-info.hh>
#include <freehdl/kernel-sigacl-list.hh>
#include <freehdl/kernel-process-base.hh>

#define PROCESS_STOP SHRT_MAX
#define PRIORITY_PROCESS SHRT_MIN


class wait_info {
 public:
  // Id of the wait info instance
  short wait_id;
  // Process this wait_info object belongs to
  process_base *process;
  // Setup a wait_info instance
  int init(const sigacl_list &salist, process_base *proc);
  wait_info() {};
  wait_info(int id, process_base *proc);
};


/******************************************************
 * Some definitions which are used by the kernel only 
 ******************************************************/
#ifdef KERNEL

inline bool
is_equal(const wait_info &a, const wait_info &b) {
  return (a.wait_id == b.wait_id) && (a.process == b.process);
}

inline unsigned long
get_hash(const wait_info &w) {
  return (unsigned long)w.wait_id + (unsigned long)w.process;
}

#endif

#endif