summaryrefslogtreecommitdiff
path: root/core/host/host_task.h
blob: 82b33f96c5039696b8785d8868a0ef3c1f602c0e (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
/* Copyright 2014 The ChromiumOS Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

/* Emulator task scheduling module */

#ifndef __CROS_EC_HOST_TASK_H
#define __CROS_EC_HOST_TASK_H

#include <pthread.h>

#include "task.h"

/**
 * Returns the thread corresponding to the task.
 */
pthread_t task_get_thread(task_id_t tskid);

/**
 * Returns the ID of the active task, regardless of current thread
 * context.
 */
task_id_t task_get_running(void);

/**
 * Initializes the interrupt semaphore and associates a signal handler with
 * SIGNAL_INTERRUPT.
 */
void task_register_interrupt(void);

/**
 * Returns the process ID of the calling process.
 */
pid_t getpid(void);

#endif /* __CROS_EC_HOST_TASK_H */