int kputs(const char *str) { int pos, i, len = strlen(str); if (early_print != NO_EARLY_PRINT) spinlock_irqsave_lock(&olock); for(i=0; i<len; i++) { pos = atomic_int32_inc(&kmsg_counter); kmessages[pos % KMSG_SIZE] = str[i]; #ifdef CONFIG_VGA if (early_print & VGA_EARLY_PRINT) vga_putchar(str[i]); #endif #ifdef CONFIG_UART if (early_print & UART_EARLY_PRINT) uart_putchar(str[i]); #endif } if (early_print != NO_EARLY_PRINT) spinlock_irqsave_unlock(&olock); return len; }
int smp_start(void) { int32_t core_id = atomic_int32_read(¤t_boot_id); LOG_INFO("Try to initialize processor (local id %d)\n", core_id); cpu_detection(); atomic_int32_inc(&cpu_online); irq_enable(); return smp_main(); }
int kputchar(int c) { /* add place holder for end of string */ if (BUILTIN_EXPECT(!c, 0)) c = '?'; if (is_single_kernel()) { uart_putchar(c); } else { int pos = atomic_int32_inc(&kmsg_counter); kmessages[pos % KMSG_SIZE] = (unsigned char) c; } return 1; }
int kputs(const char *str) { int len; spinlock_irqsave_lock(&stdio_lock); if (is_single_kernel()) { len = uart_puts(str); } else { int pos; len = strlen(str); for(int i=0; i<len; i++) { pos = atomic_int32_inc(&kmsg_counter); kmessages[pos % KMSG_SIZE] = str[i]; } } spinlock_irqsave_unlock(&stdio_lock); return len; }
int kputchar(int c) { int pos; if (early_print != NO_EARLY_PRINT) spinlock_irqsave_lock(&olock); pos = atomic_int32_inc(&kmsg_counter); kmessages[pos % KMSG_SIZE] = (unsigned char) c; #ifdef CONFIG_VGA if (early_print & VGA_EARLY_PRINT) vga_putchar(c); #endif #ifdef CONFIG_UART if (early_print & UART_EARLY_PRINT) uart_putchar(c); #endif if (early_print != NO_EARLY_PRINT) spinlock_irqsave_unlock(&olock); return 1; }