+
+/*!
+ * \def SIZEOF_CHAR SIZEOF_SHORT SIZEOF_INT SIZEOF_LONG SIZEOF_PTR
+ * \def BITS_PER_CHAR BITS_PER_SHORT BITS_PER_INT BITS_PER_LONG BITS_PER_PTR
+ *
+ * \brief Default type sizes
+ *
+ * These defaults are reasonable for most 16/32bit machines.
+ * Some of these macros may be overridden by CPU-specific code above.
+ *
+ * ANSI C specifies that the following equations must be true:
+ * \code
+ * sizeof(char) <= sizeof(short) <= sizeof(int) <= sizeof(long)
+ * sizeof(float) <= sizeof(double)
+ * BITS_PER_CHAR >= 8
+ * BITS_PER_SHORT >= 8
+ * BITS_PER_INT >= 16
+ * BITS_PER_LONG >= 32
+ * \end code
+ * \{
+ */
+#ifndef SIZEOF_CHAR
+#define SIZEOF_CHAR 1
+#endif
+
+#ifndef SIZEOF_SHORT
+#define SIZEOF_SHORT 2
+#endif
+
+#ifndef SIZEOF_INT
+#if CPU_REG_BITS < 32
+ #define SIZEOF_INT 2
+#else
+ #define SIZEOF_INT 4
+#endif
+#endif /* !SIZEOF_INT */
+
+#ifndef SIZEOF_LONG
+#define SIZEOF_LONG 4
+#endif
+
+#ifndef SIZEOF_PTR
+#define SIZEOF_PTR SIZEOF_INT
+#endif
+
+#ifndef BITS_PER_CHAR
+#define BITS_PER_CHAR (SIZEOF_CHAR * 8)
+#endif
+
+#ifndef BITS_PER_SHORT
+#define BITS_PER_SHORT (SIZEOF_SHORT * BITS_PER_CHAR)
+#endif
+
+#ifndef BITS_PER_INT
+#define BITS_PER_INT (SIZEOF_INT * BITS_PER_CHAR)
+#endif
+
+#ifndef BITS_PER_LONG
+#define BITS_PER_LONG (SIZEOF_LONG * BITS_PER_CHAR)
+#endif
+
+#ifndef BITS_PER_PTR
+#define BITS_PER_PTR (SIZEOF_PTR * BITS_PER_CHAR)
+#endif
+/*\}*/
+
+
+/*!
+ * \def SCHEDULER_IDLE
+ *
+ * \brief Invoked by the scheduler to stop the CPU when idle.
+ *
+ * This hook can be redefined to put the CPU in low-power mode, or to
+ * profile system load with an external strobe, or to save CPU cycles
+ * in hosted environments such as emulators.
+ */
+#ifndef SCHEDULER_IDLE
+ #if defined(ARCH_EMUL) && (ARCH & ARCH_EMUL)
+ /* This emulator hook should yield the CPU to the host. */
+ EXTERN_C_BEGIN
+ void SchedulerIdle(void);
+ EXTERN_C_END
+ #define SCHEDULER_IDLE SchedulerIdle()
+ #else /* !ARCH_EMUL */
+ #define SCHEDULER_IDLE do { /* nothing */ } while (0)
+ #endif /* !ARCH_EMUL */
+#endif /* !SCHEDULER_IDLE */
+
+#endif /* DEVLIB_CPU_H */