Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Unified Diff: developer_switch.h

Issue 3530001: first cut: establishes base helper classes and main (Closed) Base URL: http://git.chromium.org/git/cros_boot_mode.git
Patch Set: truncation is bad, m'kay. . . Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « common.mk ('k') | developer_switch.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: developer_switch.h
diff --git a/developer_switch.h b/developer_switch.h
new file mode 100644
index 0000000000000000000000000000000000000000..6ec90436bff9a58b1e5d3b34b007bc1fd397ae82
--- /dev/null
+++ b/developer_switch.h
@@ -0,0 +1,35 @@
+// Copyright (c) 2010 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.
+//
+// Concrete class for DeveloperSwitch. This class represents the physical
+// developer mode switch on the Chrome OS device and maps its value to
+// kEnabled, kDisabled, and kUnsupported as per PlatformSwitch.
+//
+// The developer mode switch shares a file in /sys which is provided by
+// chromeos_acpi for the x86 plaform (ARM TBD). The file contains an integer
+// in ASCII format (-1, 0, 544, whatever) with one bit representing a
+// platform switch value. The developer switch is allocated the 6th
+// bit (0x20). The file in use (CHSW) indicates the boot-time position
+// of the switch and not a current measurement (available in GPIO.* files).
+#ifndef CROS_BOOT_MODE_DEVELOPER_SWITCH_H_
+#define CROS_BOOT_MODE_DEVELOPER_SWITCH_H_
+
+#include "platform_switch.h"
+
+namespace cros_boot_mode {
+
+class DeveloperSwitch : public PlatformSwitch {
+ public:
+ DeveloperSwitch();
+ virtual ~DeveloperSwitch();
+ virtual const char *name() const {
+ return "developer";
+ }
+ virtual unsigned int bitmask() const {
+ return 0x00000020; // specified in the firmware spec.
+ }
+};
+
+} // namespace cros_boot_mode
+#endif // CROS_BOOT_MODE_DEVELOPER_SWITCH_H_
« no previous file with comments | « common.mk ('k') | developer_switch.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698