summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGerrit <chrome-bot@google.com>2012-04-25 16:56:04 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2012-04-25 16:56:04 -0700
commitfe16e4b3a96d14d18ea0d3475705c96071ec36b4 (patch)
treeb0bd8c0aeab2374a963c3208d676fec56a030884 /include
parent0d53a4cb660e92f2cf5f8792cf5d9b3f60d96acf (diff)
parent1aa57e140e3c8ef02c0140730dde3962d3eb821f (diff)
downloadchrome-ec-fe16e4b3a96d14d18ea0d3475705c96071ec36b4.tar.gz
Merge "Watchdog fixes"
Diffstat (limited to 'include')
-rw-r--r--include/task.h9
-rw-r--r--include/timer.h43
2 files changed, 26 insertions, 26 deletions
diff --git a/include/task.h b/include/task.h
index 79289b1c08..660195460e 100644
--- a/include/task.h
+++ b/include/task.h
@@ -55,6 +55,11 @@ static inline void task_wake(task_id_t tskid)
* When called in interrupt context, returns TASK_ID_INVALID. */
task_id_t task_get_current(void);
+/* Convert an address to the corresponding task ID. The address may be a stack
+ * pointer or the task data for a task. Returns TASK_ID_INVALID if the address
+ * does not correspond to a task. */
+task_id_t task_from_addr(uint32_t addr);
+
/* Return a pointer to the bitmap of events of the task. */
uint32_t *task_get_event_bitmap(task_id_t tsk);
@@ -70,6 +75,10 @@ uint32_t *task_get_event_bitmap(task_id_t tsk);
* Returns the bitmap of received events (and clears it atomically). */
uint32_t task_wait_event(int timeout_us);
+/* Prints the list of tasks using the command output channel. This may be
+ * called from interrupt level. */
+void task_print_list(void);
+
#ifdef CONFIG_TASK_PROFILING
/* Start tracking an interrupt.
*
diff --git a/include/timer.h b/include/timer.h
index b73ac292bb..4e132ebd6f 100644
--- a/include/timer.h
+++ b/include/timer.h
@@ -1,17 +1,17 @@
-/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+/* Copyright (c) 2012 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.
*/
/* Timer module for Chrome EC operating system */
-#ifndef __EC_TIMER_H
-#define __EC_TIMER_H
+#ifndef __CROS_EC_TIMER_H
+#define __CROS_EC_TIMER_H
#include "common.h"
#include "task_id.h"
-/* Micro-second timestamp. */
+/* Microsecond timestamp. */
typedef union {
uint64_t val;
struct {
@@ -23,38 +23,29 @@ typedef union {
/* Initializes the Timer module. */
int timer_init(void);
-/**
- * Launches a one-shot timer.
- *
- * tstamp : timestamp in micro-seconds when the timer expires
- * tskid : identifier of the task owning the timer
- */
+/* Launch a one-shot timer for task <tskid> which expires at timestamp
+ * <tstamp>. */
int timer_arm(timestamp_t tstamp, task_id_t tskid);
-/**
- * Cancels a running timer.
- *
- * tskid : identifier of the task owning the timer
- */
+/* Cancel a running timer for the specified task id. */
int timer_cancel(task_id_t tskid);
-/**
- * Busy wait the selected number of micro-seconds
- */
+/* Busy-wait the selected number of microseconds. Note that calling this
+ * with us>1000 may impact system performance; use usleep for longer delays. */
void udelay(unsigned us);
-/**
- * Sleep during the selected number of micro-seconds
- *
- * The current task will be de-scheduled until the delay expired
+/* Sleep during the selected number of microseconds. The current task will be
+ * de-scheduled until the delay expires.
*
* Note: if an event happens before the end of sleep, the function will return.
*/
void usleep(unsigned us);
-/**
- * Get the current timestamp from the system timer
- */
+/* Get the current timestamp from the system timer. */
timestamp_t get_time(void);
-#endif /* __EC_TIMER_H */
+/* Print the current timer information using the command output channel. This
+ * may be called from interrupt level. */
+void timer_print_info(void);
+
+#endif /* __CROS_EC_TIMER_H */