#include <kern/kalloc.h>
#include <kern/thread.h>
#include <kern/cpu_data.h>
+#include <libkern/section_keywords.h>
static void _serial_putc(int, int, int);
-struct console_ops cons_ops[] = {
+SECURITY_READ_ONLY_EARLY(struct console_ops) cons_ops[] = {
{
.putc = _serial_putc, .getc = _serial_getc,
},
},
};
-uint32_t nconsops = (sizeof cons_ops / sizeof cons_ops[0]);
+SECURITY_READ_ONLY_EARLY(uint32_t) nconsops = (sizeof cons_ops / sizeof cons_ops[0]);
uint32_t cons_ops_index = VC_CONS_OPS;
/* The console device output routines are assumed to be
* non-reentrant.
*/
+#ifdef __x86_64__
+ uint32_t lock_timeout_ticks = UINT32_MAX;
+#else
+ uint32_t lock_timeout_ticks = LockTimeOut;
+#endif
+
mp_disable_preemption();
- if (!hw_lock_to(&cnputc_lock, LockTimeOut)) {
+ if (!hw_lock_to(&cnputc_lock, lock_timeout_ticks)) {
/* If we timed out on the lock, and we're in the debugger,
* copy lock data for debugging and break the lock.
*/
return 0;
}
-/* So we can re-write the serial device functions at boot-time */
-void
-console_set_serial_ops(struct console_ops * newops)
-{
- cons_ops[SERIAL_CONS_OPS] = *newops;
-}
-