arch/sparc/prom/printf.c

Source file repositories/reference/linux-study-clean/arch/sparc/prom/printf.c

File Facts

System
Linux kernel
Corpus path
arch/sparc/prom/printf.c
Extension
.c
Size
1764 bytes
Lines
71
Domain
Architecture Layer
Bucket
arch/sparc
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

if (ch == '\n') {
			*dest++ = '\r';
			dest_len++;
		}
		*dest++ = ch;
		dest_len++;
		if (dest_len >= CONSOLE_WRITE_BUF_SIZE - 1) {
			prom_console_write_buf(console_write_buf, dest_len);
			dest = console_write_buf;
			dest_len = 0;
		}
	}
	if (dest_len)
		prom_console_write_buf(console_write_buf, dest_len);

	raw_spin_unlock_irqrestore(&console_write_lock, flags);
}

void notrace prom_printf(const char *fmt, ...)
{
	va_list args;
	int i;

	va_start(args, fmt);
	i = vscnprintf(ppbuf, sizeof(ppbuf), fmt, args);
	va_end(args);

	prom_write(ppbuf, i);
}

Annotation

Implementation Notes