mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-28 02:35:28 +00:00
Since the interrupt generator is now spawned right after the hooks task and the generator can generate interrupts whenever it wants, it's possible for an interrupt to fire before task switching is enabled. When this happens, the main thread needs to be suspended so that the IRQ can be serviced. BRANCH=None BUG=None TEST="make clobber && make -j buildall tests" several times." Change-Id: I5fb4f17666e3db9c670c4352bb36b84e4606dfa0 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/285634 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Trybot-Ready: Aseda Aboagye <aaboagye@chromium.org>
38 lines
799 B
C
38 lines
799 B
C
/* Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
|
|
* 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 */
|