summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2012-02-11 23:00:42 +0800
committerVic Yang <victoryang@chromium.org>2012-02-16 05:42:08 +0800
commit502613771e5239e5494f9f06ffecc6f61c711f1c (patch)
tree2ca74f36b00eb04534c149df17bd927e0cedefd8 /include
parentc160dae1d45ea1a02e17b5de75e75a396b160627 (diff)
downloadchrome-ec-502613771e5239e5494f9f06ffecc6f61c711f1c.tar.gz
FPU control
Implement enable_fpu() and disable_fpu(). enable_fpu() disables interrupt and then enables FPU. disable_fpu() disables FPU and enables interrupt. Also added a CONFIG_FPU flag. BUG=chrome-os-partner:7920 TEST=none Change-Id: I2d71f396d9c7d7ac4a6a2d525f3d86f8aae87521 Signed-off-by: Vic Yang <victoryang@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/fpu.h17
-rw-r--r--include/task.h7
2 files changed, 24 insertions, 0 deletions
diff --git a/include/fpu.h b/include/fpu.h
new file mode 100644
index 0000000000..1e398c7a67
--- /dev/null
+++ b/include/fpu.h
@@ -0,0 +1,17 @@
+/* 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.
+ */
+
+/* FPU module for Chrome EC operating system */
+
+#ifndef __EC_FPU_H
+#define __EC_FPU_H
+
+/* Enables FPU. Note that this function also disables interrupt. */
+void enable_fpu(void);
+
+/* Disables FPU. This function also enables interrupt. */
+void disable_fpu(void);
+
+#endif /* __EC_FPU_H */
diff --git a/include/task.h b/include/task.h
index 17a83def98..83c1d73555 100644
--- a/include/task.h
+++ b/include/task.h
@@ -11,6 +11,13 @@
#include "common.h"
#include "task_id.h"
+/* Disables CPU interrupt bit. This might break the system so think really hard
+ * before using these. There are usually better ways of accomplishing this. */
+void interrupt_disable(void);
+
+/* Enables CPU interrupt */
+void interrupt_enable(void);
+
/**
* Return true if we are in interrupt context
*/