to the kernel.
irq_hook_t calib_clk;
- BOOT_VERBOSE(kprintf("Calibrating clock\n"));
+ BOOT_VERBOSE(printf("Calibrating clock\n"));
/*
* Set Initial count register to the highest value so it does not
* underflow during the testing period
tsc_delta = sub64(tsc1, tsc0);
lapic_bus_freq[cpuid] = system_hz * lapic_delta / (PROBE_TICKS - 1);
- BOOT_VERBOSE(kprintf("APIC bus freq %lu MHz\n",
+ BOOT_VERBOSE(printf("APIC bus freq %lu MHz\n",
lapic_bus_freq[cpuid] / 1000000));
cpu_freq = div64u(tsc_delta, PROBE_TICKS - 1) * system_hz;
- BOOT_VERBOSE(kprintf("CPU %d freq %lu MHz\n", cpuid,
+ BOOT_VERBOSE(printf("CPU %d freq %lu MHz\n", cpuid,
cpu_freq / 1000000));
cpu_set_freq(cpuid, cpu_freq);
addr = (msr.lo >> 12) | ((msr.hi & 0xf) << 20);
if (phys2vir(addr) != (lapic_addr >> 12)) {
if (msr.hi & 0xf) {
- kprintf("ERROR : APIC address needs more then 32 bits\n");
+ printf("ERROR : APIC address needs more then 32 bits\n");
return 0;
}
lapic_addr = phys2vir(msr.lo & ~((1 << 12) - 1));
cpu_has_tsc = _cpufeature(_CPUF_I386_TSC);
if (!cpu_has_tsc) {
- kprintf("CPU lacks timestamp counter, "
+ printf("CPU lacks timestamp counter, "
"cannot calibrate LAPIC timer\n");
return 0;
}
*((u32_t *)lapic_eoi_addr) = 0;
apic_calibrate_clocks();
- BOOT_VERBOSE(kprintf("APIC timer calibrated\n"));
+ BOOT_VERBOSE(printf("APIC timer calibrated\n"));
return 1;
}
PRIVATE void apic_spurios_intr(void)
{
- kprintf("WARNING spurious interrupt\n");
+ printf("WARNING spurious interrupt\n");
for(;;);
}
#ifdef CONFIG_APIC_DEBUG
if (cpu_is_bsp(cpuid))
- kprintf("APIC debugging is enabled\n");
+ printf("APIC debugging is enabled\n");
lapic_set_dummy_handlers();
#endif
/* configure the timer interupt handler */
if (cpu_is_bsp(cpuid)) {
local_timer_intr_handler = (vir_bytes) lapic_bsp_timer_int_handler;
- BOOT_VERBOSE(kprintf("Initiating BSP timer handler\n"));
+ BOOT_VERBOSE(printf("Initiating BSP timer handler\n"));
} else {
local_timer_intr_handler = (vir_bytes) lapic_ap_timer_int_handler;
- BOOT_VERBOSE(kprintf("Initiating AP timer handler\n"));
+ BOOT_VERBOSE(printf("Initiating AP timer handler\n"));
}
/* register the timer interrupt handler for this CPU */
#define lapic_intr_dummy_handler(vect) \
pushl $vect; \
push $lapic_intr_dummy_handler_msg; \
- call kprintf; \
+ call printf; \
1: jmp 1b; /* never return */
#define LAPIC_INTR_DUMMY_HANDLER(vect) \
- kprintf("arch_do_vmctl: strange param %d\n", m_ptr->SVMCTL_PARAM);
+ printf("arch_do_vmctl: strange param %d\n", m_ptr->SVMCTL_PARAM);
return EINVAL;
}
lapic_set_timer_periodic(freq);
} else
{
- BOOT_VERBOSE(kprintf("Initiating legacy i8253 timer\n"));
+ BOOT_VERBOSE(printf("Initiating legacy i8253 timer\n"));
#else
{
#endif
#ifdef CONFIG_APIC
if (lapic_addr) {
/* Using APIC, it is configured in apic_idt_init() */
- BOOT_VERBOSE(kprintf("Using LAPIC timer as tick source\n"));
+ BOOT_VERBOSE(printf("Using LAPIC timer as tick source\n"));
} else
#endif
{
if (first)
{
first= 0;
- kprintf("do_sdevio: for %d, req %d\n",
+ printf("do_sdevio: for %d, req %d\n",
m_ptr->m_source, m_ptr->DIO_REQUEST);
}
}
} else {
if(proc_nr != _ENDPOINT_P(caller->p_endpoint))
{
- kprintf("do_sdevio: unsafe sdevio by %d in %d denied\n",
+ printf("do_sdevio: unsafe sdevio by %d in %d denied\n",
caller->p_endpoint, proc_nr_e);
return EPERM;
}
}
if (i >= nr_io_range)
{
- kprintf(
+ printf(
"do_sdevio: I/O port check failed for proc %d, port 0x%x\n",
m_ptr->m_source, port);
retval = EPERM;
if (port & (size-1))
{
- kprintf("do_devio: unaligned port 0x%x (size %d)\n", port, size);
+ printf("do_devio: unaligned port 0x%x (size %d)\n", port, size);
retval = EPERM;
goto return_error;
}
/* Page fault we can't / don't want to
* handle.
*/
- kprintf("pagefault for process %d ('%s'), pc = 0x%x, addr = 0x%x, flags = 0x%x, is_nested %d\n",
+ printf("pagefault for process %d ('%s'), pc = 0x%x, addr = 0x%x, flags = 0x%x, is_nested %d\n",
pr->p_endpoint, pr->p_name, pr->p_reg.pc,
pagefaultcr2, frame->errcode, is_nested);
proc_stacktrace(pr);
if(pr->p_endpoint != SYSTEM) {
proc_stacktrace(proc_addr(SYSTEM));
}
- kprintf("pc of pagefault: 0x%lx\n", frame->eip);
+ printf("pc of pagefault: 0x%lx\n", frame->eip);
minix_panic("page fault in system process", pr->p_endpoint);
return;
ep = &ex_data[frame->vector];
if (frame->vector == 2) { /* spurious NMI on some machines */
- kprintf("got spurious NMI\n");
+ printf("got spurious NMI\n");
return;
}
#if 0
{
- kprintf(
+ printf(
"vec_nr= %d, trap_errno= 0x%lx, eip= 0x%lx, cs= 0x%x, eflags= 0x%lx\n",
frame->vector, (unsigned long)frame->errcode,
(unsigned long)frame->eip, frame->cs,
/* Exception in system code. This is not supposed to happen. */
if (ep->msg == NIL_PTR || machine.processor < ep->minprocessor)
- kprintf("\nIntel-reserved exception %d\n", frame->vector);
+ printf("\nIntel-reserved exception %d\n", frame->vector);
else
- kprintf("\n%s\n", ep->msg);
- kprintf("is_nested = %d ", is_nested);
+ printf("\n%s\n", ep->msg);
+ printf("is_nested = %d ", is_nested);
- kprintf("vec_nr= %d, trap_errno= 0x%x, eip= 0x%x, cs= 0x%x, eflags= 0x%x trap_esp 0x%08x\n",
+ printf("vec_nr= %d, trap_errno= 0x%x, eip= 0x%x, cs= 0x%x, eflags= 0x%x trap_esp 0x%08x\n",
frame->vector, frame->errcode, frame->eip, frame->cs, frame->eflags, frame);
/* TODO should we enable this only when compiled for some debug mode? */
if (saved_proc) {
- kprintf("scheduled was: process %d (%s), ", proc_nr(saved_proc), saved_proc->p_name);
- kprintf("pc = %u:0x%x\n", (unsigned) saved_proc->p_reg.cs,
+ printf("scheduled was: process %d (%s), ", proc_nr(saved_proc), saved_proc->p_name);
+ printf("pc = %u:0x%x\n", (unsigned) saved_proc->p_reg.cs,
(unsigned) saved_proc->p_reg.pc);
proc_stacktrace(saved_proc);
iskernel = iskernelp(whichproc);
- kprintf("%-8.8s %6d 0x%lx ",
+ printf("%-8.8s %6d 0x%lx ",
whichproc->p_name, whichproc->p_endpoint, whichproc->p_reg.pc);
while(v_bp) {
data_copy(pr->p_endpoint, pv, KERNEL, (vir_bytes) (v), n))
if(PRCOPY(whichproc, v_bp, &v_hbp, sizeof(v_hbp)) != OK) {
- kprintf("(v_bp 0x%lx ?)", v_bp);
+ printf("(v_bp 0x%lx ?)", v_bp);
break;
}
if(PRCOPY(whichproc, v_bp + sizeof(v_pc), &v_pc, sizeof(v_pc)) != OK) {
- kprintf("(v_pc 0x%lx ?)", v_bp + sizeof(v_pc));
+ printf("(v_pc 0x%lx ?)", v_bp + sizeof(v_pc));
break;
}
- kprintf("0x%lx ", (unsigned long) v_pc);
+ printf("0x%lx ", (unsigned long) v_pc);
if(v_hbp != 0 && v_hbp <= v_bp) {
- kprintf("(hbp %lx ?)", v_hbp);
+ printf("(hbp %lx ?)", v_hbp);
break;
}
v_bp = v_hbp;
}
- kprintf("\n");
+ printf("\n");
}
}
if(!(linear = umap_local(rp, seg, vir_addr, bytes))) {
- kprintf("SYSTEM:umap_virtual: umap_local failed\n");
+ printf("SYSTEM:umap_virtual: umap_local failed\n");
phys = 0;
} else {
if(vm_lookup(rp, linear, &phys, NULL) != OK) {
- kprintf("SYSTEM:umap_virtual: vm_lookup of %s: seg 0x%lx: 0x%lx failed\n", rp->p_name, seg, vir_addr);
+ printf("SYSTEM:umap_virtual: vm_lookup of %s: seg 0x%lx: 0x%lx failed\n", rp->p_name, seg, vir_addr);
phys = 0;
}
if(phys == 0)
if(phys == 0) {
- kprintf("SYSTEM:umap_virtual: lookup failed\n");
+ printf("SYSTEM:umap_virtual: lookup failed\n");
return 0;
}
* so that the umap makes sense.
*/
if(bytes > 0 && !vm_contiguous(rp, linear, bytes)) {
- kprintf("umap_virtual: %s: %d at 0x%lx (vir 0x%lx) not contiguous\n",
+ printf("umap_virtual: %s: %d at 0x%lx (vir 0x%lx) not contiguous\n",
rp->p_name, bytes, linear, vir_addr);
return 0;
}
u32_t phys;
if((r=vm_lookup(targetproc, vir_buf, &phys, NULL)) != OK) {
- kprintf("vm_contiguous: vm_lookup failed, %d\n", r);
- kprintf("kernel stack: ");
+ printf("vm_contiguous: vm_lookup failed, %d\n", r);
+ printf("kernel stack: ");
util_stacktrace();
return 0;
}
if(!first) {
if(prev_phys+I386_PAGE_SIZE != phys) {
- kprintf("vm_contiguous: no (0x%lx, 0x%lx)\n",
+ printf("vm_contiguous: no (0x%lx, 0x%lx)\n",
prev_phys, phys);
- kprintf("kernel stack: ");
+ printf("kernel stack: ");
util_stacktrace();
return 0;
}
if(!(pte_v & I386_VM_PRESENT))
continue;
pfa = I386_VM_PFA(pte_v);
- kprintf("%4d:%08lx:%08lx %2s ",
+ printf("%4d:%08lx:%08lx %2s ",
pte, v + I386_PAGE_SIZE*pte, pfa,
(pte_v & I386_VM_WRITE) ? "rw":"RO");
col++;
- if(col == 3) { kprintf("\n"); col = 0; }
+ if(col == 3) { printf("\n"); col = 0; }
}
- if(col > 0) kprintf("\n");
+ if(col > 0) printf("\n");
return;
}
if(!(pde_v & I386_VM_PRESENT))
continue;
if(pde_v & I386_VM_BIGPAGE) {
- kprintf("%4d: 0x%lx, flags %s\n",
+ printf("%4d: 0x%lx, flags %s\n",
pde, I386_VM_PFA(pde_v), flagstr(pde_v, 1));
} else {
pte_a = (u32_t *) I386_VM_PFA(pde_v);
- kprintf("%4d: pt %08lx %s\n",
+ printf("%4d: pt %08lx %s\n",
pde, pte_a, flagstr(pde_v, 1));
vm_pt_print(pte_a, pde * I386_VM_PT_ENTRIES * I386_PAGE_SIZE);
- kprintf("\n");
+ printf("\n");
}
}
phys_addr[i] = umap_virtual(p, seg_index,
vir_addr[i]->offset, bytes);
if(phys_addr[i] == 0) {
- kprintf("virtual_copy: map 0x%x failed for %s seg %d, "
+ printf("virtual_copy: map 0x%x failed for %s seg %d, "
"offset %lx, len %d, i %d\n",
type, p->p_name, seg_index, vir_addr[i]->offset,
bytes, i);
phys_addr[i] = vir_addr[i]->offset;
break;
default:
- kprintf("virtual_copy: strange type 0x%x\n", type);
+ printf("virtual_copy: strange type 0x%x\n", type);
NOREC_RETURN(virtualcopy, EINVAL);
}
/* Check if mapping succeeded. */
if (phys_addr[i] <= 0 && vir_addr[i]->segment != PHYS_SEG) {
- kprintf("virtual_copy EFAULT\n");
+ printf("virtual_copy EFAULT\n");
NOREC_RETURN(virtualcopy, EFAULT);
}
}
/* can't copy to/from process with PT without VM */
#define NOPT(p) (!(p) || !HASPT(p))
if(!NOPT(procs[_SRC_])) {
- kprintf("ignoring page table src: %s / %d at 0x%lx\n",
+ printf("ignoring page table src: %s / %d at 0x%lx\n",
procs[_SRC_]->p_name, procs[_SRC_]->p_endpoint, procs[_SRC_]->p_seg.p_cr3);
}
if(!NOPT(procs[_DST_])) {
- kprintf("ignoring page table dst: %s / %d at 0x%lx\n",
+ printf("ignoring page table dst: %s / %d at 0x%lx\n",
procs[_DST_]->p_name, procs[_DST_]->p_endpoint,
procs[_DST_]->p_seg.p_cr3);
}
u32_t base, limit, index, dpl;
struct segdesc_s *desc;
- if(banner) { kprintf("%s", banner); }
+ if(banner) { printf("%s", banner); }
index = selector >> 3;
- kprintf("RPL %d, ind %d of ",
+ printf("RPL %d, ind %d of ",
(selector & RPL_MASK), index);
if(selector & TI) {
- kprintf("LDT");
+ printf("LDT");
if(index >= LDT_SIZE) {
- kprintf("invalid index in ldt\n");
+ printf("invalid index in ldt\n");
return;
}
if(!pr) {
- kprintf("local selector but unknown process\n");
+ printf("local selector but unknown process\n");
return;
}
desc = &pr->p_seg.p_ldt[index];
} else {
- kprintf("GDT");
+ printf("GDT");
if(index >= GDT_SIZE) {
- kprintf("invalid index in gdt\n");
+ printf("invalid index in gdt\n");
return;
}
desc = &gdt[index];
((u32_t) desc->base_middle << BASE_MIDDLE_SHIFT) |
((u32_t) desc->base_high << BASE_HIGH_SHIFT);
- kprintf(" -> base 0x%08lx size 0x%08lx ", base, limit+1);
+ printf(" -> base 0x%08lx size 0x%08lx ", base, limit+1);
if(iscs) {
if(!(desc->granularity & BIG))
- kprintf("16bit ");
+ printf("16bit ");
} else {
if(!(desc->granularity & BIG))
- kprintf("not big ");
+ printf("not big ");
}
if(desc->granularity & 0x20) { /* reserved */
}
if(!(desc->access & PRESENT))
- kprintf("notpresent ");
+ printf("notpresent ");
if(!(desc->access & SEGMENT))
- kprintf("system ");
+ printf("system ");
if(desc->access & EXECUTABLE) {
- kprintf(" exec ");
- if(desc->access & CONFORMING) kprintf("conforming ");
- if(!(desc->access & READABLE)) kprintf("non-readable ");
+ printf(" exec ");
+ if(desc->access & CONFORMING) printf("conforming ");
+ if(!(desc->access & READABLE)) printf("non-readable ");
} else {
- kprintf("nonexec ");
- if(desc->access & EXPAND_DOWN) kprintf("non-expand-down ");
- if(!(desc->access & WRITEABLE)) kprintf("non-writable ");
+ printf("nonexec ");
+ if(desc->access & EXPAND_DOWN) printf("non-expand-down ");
+ if(!(desc->access & WRITEABLE)) printf("non-writable ");
}
if(!(desc->access & ACCESSED)) {
- kprintf("nonacc ");
+ printf("nonacc ");
}
dpl = ((u32_t) desc->access & DPL) >> DPL_SHIFT;
- kprintf("DPL %d\n", dpl);
+ printf("DPL %d\n", dpl);
return;
}
int incr_clicks;
if(limit <= kinfo.data_base) {
- kprintf("prot_set_kern_seg_limit: limit bogus\n");
+ printf("prot_set_kern_seg_limit: limit bogus\n");
return EINVAL;
}
#if defined(CONFIG_APIC) && !defined(CONFIG_SMP)
if (config_no_apic) {
- BOOT_VERBOSE(kprintf("APIC disabled, using legacy PIC\n"));
+ BOOT_VERBOSE(printf("APIC disabled, using legacy PIC\n"));
}
else if (!apic_single_cpu_init()) {
- BOOT_VERBOSE(kprintf("APIC not present, using legacy PIC\n"));
+ BOOT_VERBOSE(printf("APIC not present, using legacy PIC\n"));
}
#endif
{
if (isemptyp(pp))
continue;
- kprintf("%d: %s ep %d\n", proc_nr(pp), pp->p_name, pp->p_endpoint);
+ printf("%d: %s ep %d\n", proc_nr(pp), pp->p_name, pp->p_endpoint);
printseg("cs: ", 1, pp, pp->p_reg.cs);
printseg("ds: ", 0, pp, pp->p_reg.ds);
if(pp->p_reg.ss != pp->p_reg.ds) {
#define COL { int i; for(i = 0; i < level; i++) printf("> "); }
if(level >= NR_PROCS) {
- kprintf("loop??\n");
+ printf("loop??\n");
return;
}
COL
- kprintf("%d: %s %d prio %d/%d time %d/%d cycles 0x%x%08x cr3 0x%lx rts %s misc %s",
+ printf("%d: %s %d prio %d/%d time %d/%d cycles 0x%x%08x cr3 0x%lx rts %s misc %s",
proc_nr(pp), pp->p_name, pp->p_endpoint,
pp->p_priority, pp->p_max_priority, pp->p_user_time,
pp->p_sys_time, pp->p_cycles.hi, pp->p_cycles.lo, pp->p_seg.p_cr3,
rtsflagstr(pp->p_rts_flags), miscflagstr(pp->p_misc_flags));
if((dep = P_BLOCKEDON(pp)) != NONE) {
- kprintf(" blocked on: ");
+ printf(" blocked on: ");
if(dep == ANY) {
- kprintf(" ANY\n");
+ printf(" ANY\n");
} else {
int procno;
if(!isokendpt(dep, &procno)) {
- kprintf(" ??? %d\n", dep);
+ printf(" ??? %d\n", dep);
} else {
depproc = proc_addr(procno);
if(isemptyp(depproc)) {
- kprintf(" empty slot %d???\n", procno);
+ printf(" empty slot %d???\n", procno);
depproc = NULL;
} else {
- kprintf(" %s\n", depproc->p_name);
+ printf(" %s\n", depproc->p_name);
}
}
}
} else {
- kprintf("\n");
+ printf("\n");
}
COL
void arch_watchdog_lockup(struct nmi_frame * frame)
{
- kprintf("KERNEL LOCK UP\n"
+ printf("KERNEL LOCK UP\n"
"eax 0x%08x\n"
"ecx 0x%08x\n"
"edx 0x%08x\n"
{
if (watchdog_enabled) {
if (arch_watchdog_init()) {
- kprintf("WARNING watchdog initialization "
+ printf("WARNING watchdog initialization "
"failed! Disabled\n");
watchdog_enabled = 0;
}
else
- BOOT_VERBOSE(kprintf("Watchdog enabled\n"););
+ BOOT_VERBOSE(printf("Watchdog enabled\n"););
}
}
FIXME("check_runqueues being done");
#define MYPANIC(msg) { \
- kprintf("check_runqueues:%s:%d: %s\n", file, line, msg); \
+ printf("check_runqueues:%s:%d: %s\n", file, line, msg); \
minix_panic("check_runqueues failed", NO_NUM); \
}
for (q=l=0; q < NR_SCHED_QUEUES; q++) {
if (rdy_head[q] && !rdy_tail[q]) {
- kprintf("head but no tail in %d\n", q);
+ printf("head but no tail in %d\n", q);
MYPANIC("scheduling error");
}
if (!rdy_head[q] && rdy_tail[q]) {
- kprintf("tail but no head in %d\n", q);
+ printf("tail but no head in %d\n", q);
MYPANIC("scheduling error");
}
if (rdy_tail[q] && rdy_tail[q]->p_nextready != NIL_PROC) {
- kprintf("tail and tail->next not null in %d\n", q);
+ printf("tail and tail->next not null in %d\n", q);
MYPANIC("scheduling error");
}
for(xp = rdy_head[q]; xp != NIL_PROC; xp = xp->p_nextready) {
MYPANIC("magic wrong in xp");
}
if (RTS_ISSET(xp, RTS_SLOT_FREE)) {
- kprintf("scheduling error: dead proc q %d %d\n",
+ printf("scheduling error: dead proc q %d %d\n",
q, xp->p_endpoint);
MYPANIC("dead proc on run queue");
}
if (!xp->p_ready) {
- kprintf("scheduling error: unready on runq %d proc %d\n",
+ printf("scheduling error: unready on runq %d proc %d\n",
q, xp->p_nr);
MYPANIC("found unready process on run queue");
}
if (xp->p_priority != q) {
- kprintf("scheduling error: wrong priority q %d proc %d ep %d name %s\n",
+ printf("scheduling error: wrong priority q %d proc %d ep %d name %s\n",
q, xp->p_nr, xp->p_endpoint, xp->p_name);
MYPANIC("wrong priority");
}
if (xp->p_found) {
- kprintf("scheduling error: double sched q %d proc %d\n",
+ printf("scheduling error: double sched q %d proc %d\n",
q, xp->p_nr);
MYPANIC("proc more than once on scheduling queue");
}
xp->p_found = 1;
if (xp->p_nextready == NIL_PROC && rdy_tail[q] != xp) {
- kprintf("sched err: last element not tail q %d proc %d\n",
+ printf("sched err: last element not tail q %d proc %d\n",
q, xp->p_nr);
MYPANIC("scheduling error");
}
if (isemptyp(xp))
continue;
if(xp->p_ready && ! xp->p_found) {
- kprintf("sched error: ready proc %d not on queue\n", xp->p_nr);
+ printf("sched error: ready proc %d not on queue\n", xp->p_nr);
MYPANIC("ready proc not on scheduling queue");
if (l++ > MAX_LOOP) { MYPANIC("loop in debug.c?"); }
}
#endif
#define NOT_REACHABLE do { \
- kprintf("NOT_REACHABLE at %s:%d\n", __FILE__, __LINE__); \
+ printf("NOT_REACHABLE at %s:%d\n", __FILE__, __LINE__); \
minix_panic("execution at an unexpected location\n", NO_NUM); \
for(;;); \
} while(0)
#define NOT_IMPLEMENTED do { \
- kprintf("NOT_IMPLEMENTED at %s:%d\n", __FILE__, __LINE__); \
+ printf("NOT_IMPLEMENTED at %s:%d\n", __FILE__, __LINE__); \
minix_panic("NOT_IMPLEMENTED", NO_NUM); \
} while(0)
#ifdef _SYSTEM
#define DEBUG_PRINT(params, level) do { \
- if (verboseboot >= (level)) kprintf params; } while (0)
+ if (verboseboot >= (level)) printf params; } while (0)
#define DEBUGBASIC(params) DEBUG_PRINT(params, VERBOSEBOOT_BASIC)
#define DEBUGMAX(params) DEBUG_PRINT(params, VERBOSEBOOT_MAX)
#endif
PRIVATE void announce(void)
{
/* Display the MINIX startup banner. */
- kprintf("\nMINIX %s.%s. "
+ printf("\nMINIX %s.%s. "
#ifdef _SVN_REVISION
"(" _SVN_REVISION ")\n"
#endif
"Copyright 2010, Vrije Universiteit, Amsterdam, The Netherlands\n",
OS_RELEASE, OS_VERSION);
- kprintf("MINIX is open source software, see http://www.minix3.org\n");
+ printf("MINIX is open source software, see http://www.minix3.org\n");
}
/*===========================================================================*
* do shutdown work. Set a watchog timer to call shutdown(). The timer
* argument passes the shutdown status.
*/
- kprintf("MINIX will now be shut down ...\n");
+ printf("MINIX will now be shut down ...\n");
tmr_arg(&shutdown_timer)->ta_int = how;
set_timer(&shutdown_timer, get_uptime() + system_hz, minix_shutdown);
}
#if DEBUG_SCHED_CHECK
if(caller_ptr->p_misc_flags & MF_DELIVERMSG) {
- kprintf("sys_call: MF_DELIVERMSG on for %s / %d\n",
+ printf("sys_call: MF_DELIVERMSG on for %s / %d\n",
caller_ptr->p_name, caller_ptr->p_endpoint);
minix_panic("MF_DELIVERMSG on", NO_NUM);
}
if(src_dst_e != 4 && src_dst_e != 5 &&
caller_ptr->p_endpoint != 4 && caller_ptr->p_endpoint != 5) {
if(call_nr == SEND)
- kprintf("(%d SEND to %d) ", caller_ptr->p_endpoint, src_dst_e);
+ printf("(%d SEND to %d) ", caller_ptr->p_endpoint, src_dst_e);
else if(call_nr == RECEIVE)
- kprintf("(%d RECEIVE from %d) ", caller_ptr->p_endpoint, src_dst_e);
+ printf("(%d RECEIVE from %d) ", caller_ptr->p_endpoint, src_dst_e);
else if(call_nr == SENDREC)
- kprintf("(%d SENDREC to %d) ", caller_ptr->p_endpoint, src_dst_e);
+ printf("(%d SENDREC to %d) ", caller_ptr->p_endpoint, src_dst_e);
else
- kprintf("(%d %d to/from %d) ", caller_ptr->p_endpoint, call_nr, src_dst_e);
+ printf("(%d %d to/from %d) ", caller_ptr->p_endpoint, call_nr, src_dst_e);
}
#endif
#if DEBUG_SCHED_CHECK
if (RTS_ISSET(caller_ptr, RTS_SLOT_FREE))
{
- kprintf("called by the dead?!?\n");
+ printf("called by the dead?!?\n");
return EINVAL;
}
#endif
if (call_nr != RECEIVE)
{
#if 0
- kprintf("sys_call: trap %d by %d with bad endpoint %d\n",
+ printf("sys_call: trap %d by %d with bad endpoint %d\n",
call_nr, proc_nr(caller_ptr), src_dst_e);
#endif
return EINVAL;
/* Require a valid source and/or destination process. */
if(!isokendpt(src_dst_e, &src_dst_p)) {
#if 0
- kprintf("sys_call: trap %d by %d with bad endpoint %d\n",
+ printf("sys_call: trap %d by %d with bad endpoint %d\n",
call_nr, proc_nr(caller_ptr), src_dst_e);
#endif
return EDEADSRCDST;
{
if (!may_send_to(caller_ptr, src_dst_p)) {
#if DEBUG_ENABLE_IPC_WARNINGS
- kprintf(
+ printf(
"sys_call: ipc mask denied trap %d from %d to %d\n",
call_nr, caller_ptr->p_endpoint, src_dst_e);
#endif
if (call_nr < 0 || call_nr >= 32)
{
#if DEBUG_ENABLE_IPC_WARNINGS
- kprintf("sys_call: trap %d not allowed, caller %d, src_dst %d\n",
+ printf("sys_call: trap %d not allowed, caller %d, src_dst %d\n",
call_nr, proc_nr(caller_ptr), src_dst_p);
#endif
return(ETRAPDENIED); /* trap denied by mask or kernel */
*/
if (!(priv(caller_ptr)->s_trap_mask & (1 << call_nr))) {
#if DEBUG_ENABLE_IPC_WARNINGS
- kprintf("sys_call: trap %d not allowed, caller %d, src_dst %d\n",
+ printf("sys_call: trap %d not allowed, caller %d, src_dst %d\n",
call_nr, proc_nr(caller_ptr), src_dst_p);
#endif
return(ETRAPDENIED); /* trap denied by mask or kernel */
if (call_nr != SENDREC && call_nr != RECEIVE && call_nr != SENDA &&
iskerneln(src_dst_p)) {
#if DEBUG_ENABLE_IPC_WARNINGS
- kprintf("sys_call: trap %d not allowed, caller %d, src_dst %d\n",
+ printf("sys_call: trap %d not allowed, caller %d, src_dst %d\n",
call_nr, proc_nr(caller_ptr), src_dst_e);
#endif
return(ETRAPDENIED); /* trap denied by mask or kernel */
#if DEBUG_ENABLE_IPC_WARNINGS
{
int i;
- kprintf("deadlock between these processes:\n");
+ printf("deadlock between these processes:\n");
for(i = 0; i < group_size; i++) {
- kprintf(" %10s ", processes[i]->p_name);
+ printf(" %10s ", processes[i]->p_name);
proc_stacktrace(processes[i]);
}
}
src_proc_nr = id_to_nr(src_id); /* get source proc */
#if DEBUG_ENABLE_IPC_WARNINGS
if(src_proc_nr == NONE) {
- kprintf("mini_receive: sending notify from NONE\n");
+ printf("mini_receive: sending notify from NONE\n");
}
#endif
if (src_e!=ANY && src_p != src_proc_nr) continue;/* source not ok */
#if DEBUG_SCHED_CHECK
if (RTS_ISSET(*xpp, RTS_SLOT_FREE) || RTS_ISSET(*xpp, RTS_NO_ENDPOINT))
{
- kprintf("%d: receive from %d; found dead %d (%s)?\n",
+ printf("%d: receive from %d; found dead %d (%s)?\n",
caller_ptr->p_endpoint, src_e, (*xpp)->p_endpoint,
(*xpp)->p_name);
return EINVAL;
if (!isokendpt(dst_e, &dst_p)) {
util_stacktrace();
- kprintf("mini_notify: bogus endpoint %d\n", dst_e);
+ printf("mini_notify: bogus endpoint %d\n", dst_e);
return EDEADSRCDST;
}
}
#define ASCOMPLAIN(caller, entry, field) \
- kprintf("kernel:%s:%d: asyn failed for %s in %s " \
+ printf("kernel:%s:%d: asyn failed for %s in %s " \
"(%d/%d, tab 0x%lx)\n",__FILE__,__LINE__, \
field, caller->p_name, entry, priv(caller)->s_asynsize, priv(caller)->s_asyntab)
privp= priv(caller_ptr);
if (!(privp->s_flags & SYS_PROC))
{
- kprintf(
+ printf(
"mini_senda: warning caller has no privilege structure\n");
return EPERM;
}
}
#if 0
- kprintf("mini_senda: entry[%d]: flags 0x%x dst %d/%d\n",
+ printf("mini_senda: entry[%d]: flags 0x%x dst %d/%d\n",
i, tabent.flags, tabent.dst, dst_p);
#endif
}
}
if (do_notify)
- kprintf("mini_senda: should notify caller\n");
+ printf("mini_senda: should notify caller\n");
if (!done)
{
privp->s_asyntab= (vir_bytes)table;
if (flags & ~(AMF_VALID|AMF_DONE|AMF_NOTIFY|AMF_NOREPLY) ||
!(flags & AMF_VALID))
{
- kprintf("try_one: bad bits in table\n");
+ printf("try_one: bad bits in table\n");
privp->s_asynsize= 0;
return EINVAL;
}
if (flags & AMF_NOTIFY)
{
- kprintf("try_one: should notify caller\n");
+ printf("try_one: should notify caller\n");
}
return OK;
}
*p = _ENDPOINT_P(e);
if(!isokprocn(*p)) {
#if DEBUG_ENABLE_IPC_WARNINGS
- kprintf("kernel:%s:%d: bad endpoint %d: proc %d out of range\n",
+ printf("kernel:%s:%d: bad endpoint %d: proc %d out of range\n",
file, line, e, *p);
#endif
} else if(isemptyn(*p)) {
#if 0
- kprintf("kernel:%s:%d: bad endpoint %d: proc %d empty\n", file, line, e, *p);
+ printf("kernel:%s:%d: bad endpoint %d: proc %d empty\n", file, line, e, *p);
#endif
} else if(proc_addr(*p)->p_endpoint != e) {
#if DEBUG_ENABLE_IPC_WARNINGS
- kprintf("kernel:%s:%d: bad endpoint %d: proc %d has ept %d (generation %d vs. %d)\n", file, line,
+ printf("kernel:%s:%d: bad endpoint %d: proc %d has ept %d (generation %d vs. %d)\n", file, line,
e, *p, proc_addr(*p)->p_endpoint,
_ENDPOINT_G(e), _ENDPOINT_G(proc_addr(*p)->p_endpoint));
#endif
_PROTOTYPE( void minix_shutdown, (struct timer *tp) );
/* utility.c */
-_PROTOTYPE( int kprintf, (const char *fmt, ...) );
_PROTOTYPE( void minix_panic, (char *s, int n) );
/* proc.c */
msg->m_type = result; /* report status of call */
if (copy_msg_to_user(caller, msg,
(message *)caller->p_delivermsg_vir)) {
- kprintf("WARNING wrong user pointer 0x%08x from "
+ printf("WARNING wrong user pointer 0x%08x from "
"process %s / %d\n",
caller->p_delivermsg_vir,
caller->p_name,
/* See if the caller made a valid request and try to handle it. */
if (call_nr < 0 || call_nr >= NR_SYS_CALLS) { /* check call number */
- kprintf("SYSTEM: illegal request %d from %d.\n",
+ printf("SYSTEM: illegal request %d from %d.\n",
call_nr,msg->m_source);
result = EBADREQUEST; /* illegal message type */
}
result = kernel_call_dispatch(caller, &msg);
}
else {
- kprintf("WARNING wrong user pointer 0x%08x from process %s / %d\n",
+ printf("WARNING wrong user pointer 0x%08x from process %s / %d\n",
m_user, caller->p_name, caller->p_endpoint);
result = EBADREQUEST;
}
else if (vir_addr >= BASE_MEM_TOP && vir_addr + bytes <= UPPER_MEM_END)
return (phys_bytes) vir_addr;
- kprintf("Warning, error in umap_bios, virtual address 0x%x\n", vir_addr);
+ printf("Warning, error in umap_bios, virtual address 0x%x\n", vir_addr);
return 0;
}
#endif
*/
if(verify_grant(rp->p_endpoint, ANY, grant, bytes, 0, 0,
&offset, &granter) != OK) {
- kprintf("SYSTEM: umap_grant: verify_grant failed\n");
+ printf("SYSTEM: umap_grant: verify_grant failed\n");
return 0;
}
if(!isokendpt(granter, &proc_nr)) {
- kprintf("SYSTEM: umap_grant: isokendpt failed\n");
+ printf("SYSTEM: umap_grant: isokendpt failed\n");
return 0;
}
/* Do the mapping from virtual to physical. */
ret = umap_virtual(proc_addr(proc_nr), D, offset, bytes);
if(!ret) {
- kprintf("SYSTEM:umap_grant:umap_virtual failed; grant %s:%d -> %s: vir 0x%lx\n",
+ printf("SYSTEM:umap_grant:umap_virtual failed; grant %s:%d -> %s: vir 0x%lx\n",
rp->p_name, grant,
proc_addr(proc_nr)->p_name, offset);
}
/* This test is great for debugging system processes dying,
* but as this happens normally on reboot, not good permanent code.
*/
- kprintf("died: ");
+ printf("died: ");
proc_stacktrace(rc);
minix_panic("system process died", rc->p_endpoint);
}
{
if (priv(rc)->s_asynsize) {
#if 0
- kprintf("clear_endpoint: clearing s_asynsize of %s / %d\n",
+ printf("clear_endpoint: clearing s_asynsize of %s / %d\n",
rc->p_name, rc->p_endpoint);
proc_stacktrace(rc);
#endif
if (*xpp == rc) { /* process is on the queue */
*xpp = (*xpp)->p_q_link; /* replace by next process */
#if DEBUG_ENABLE_IPC_WARNINGS
- kprintf("endpoint %d / %s removed from queue at %d\n",
+ printf("endpoint %d / %s removed from queue at %d\n",
rc->p_endpoint, rc->p_name, rc->p_sendto_e);
#endif
break; /* can only be queued once */
if (P_BLOCKEDON(rp) == rc->p_endpoint) {
rp->p_reg.retreg = EDEADSRCDST; /* report source died */
RTS_UNSET(rp, (RTS_RECEIVING|RTS_SENDING)); /* no longer blocking */
-#if DEBUG_ENABLE_IPC_WARNINGS
- kprintf("endpoint %d / %s blocked on dead src ep %d / %s\n",
+ printf("endpoint %d / %s blocked on dead src ep %d / %s\n",
rp->p_endpoint, rp->p_name, rc->p_endpoint, rc->p_name);
-#endif
}
}
}
if (first)
{
first= 0;
- kprintf(
+ printf(
"do_copy: got request from %d (source %d, seg %d, destination %d, seg %d)\n",
m_ptr->m_source,
m_ptr->CP_SRC_ENDPT,
vir_addr[i].proc_nr_e = m_ptr->m_source;
if (vir_addr[i].segment != PHYS_SEG) {
if(! isokendpt(vir_addr[i].proc_nr_e, &p)) {
- kprintf("do_copy: %d: seg 0x%x, %d not ok endpoint\n",
+ printf("do_copy: %d: seg 0x%x, %d not ok endpoint\n",
i, vir_addr[i].segment, vir_addr[i].proc_nr_e);
return(EINVAL);
}
cprof_ctl_inst.reset = 1;
- kprintf("CPROFILE notice: resetting tables:");
+ printf("CPROFILE notice: resetting tables:");
for (i=0; i<cprof_procs_no; i++) {
- kprintf(" %s", cprof_proc_info[i].name);
+ printf(" %s", cprof_proc_info[i].name);
/* Test whether proc still alive. */
if (!isokendpt(cprof_proc_info[i].endpt, &proc_nr)) {
- kprintf("endpt not valid %u (%s)\n",
+ printf("endpt not valid %u (%s)\n",
cprof_proc_info[i].endpt, cprof_proc_info[i].name);
continue;
}
cprof_proc_info[i].endpt, cprof_proc_info[i].ctl_v,
sizeof(cprof_ctl_inst.reset));
}
- kprintf("\n");
+ printf("\n");
return OK;
cprof_mem_size = m_ptr->PROF_MEM_SIZE;
- kprintf("CPROFILE notice: getting tables:");
+ printf("CPROFILE notice: getting tables:");
/* Copy control structs of profiled processes to calculate total
* nr of bytes to be copied to user program and find out if any
for (i=0; i<cprof_procs_no; i++) {
- kprintf(" %s", cprof_proc_info[i].name);
+ printf(" %s", cprof_proc_info[i].name);
/* Test whether proc still alive. */
if (!isokendpt(cprof_proc_info[i].endpt, &proc_nr)) {
- kprintf("endpt not valid %u (%s)\n",
+ printf("endpt not valid %u (%s)\n",
cprof_proc_info[i].endpt, cprof_proc_info[i].name);
continue;
}
/* Collect errors. */
cprof_info.err |= cprof_ctl_inst.err;
}
- kprintf("\n");
+ printf("\n");
/* Do we have the space available? */
if (cprof_mem_size < cprof_info.mem_used) cprof_info.mem_used = -1;
privp= priv(caller);
if (!privp)
{
- kprintf("no priv structure!\n");
+ printf("no priv structure!\n");
goto doit;
}
if (privp->s_flags & CHECK_IO_PORT)
}
if (i >= nr_io_range)
{
- kprintf("do_devio: port 0x%x (size %d) not allowed\n",
+ printf("do_devio: port 0x%x (size %d) not allowed\n",
m_ptr->DIO_PORT, size);
return EPERM;
}
doit:
if (m_ptr->DIO_PORT & (size-1))
{
- kprintf("do_devio: unaligned port 0x%x (size %d)\n",
+ printf("do_devio: unaligned port 0x%x (size %d)\n",
m_ptr->DIO_PORT, size);
return EPERM;
}
int bin = m_ptr->I_VAL_LEN2_E;
if(bin < 0 || bin >= RANDOM_SOURCES) {
- kprintf("SYSTEM: GET_RANDOMNESS_BIN: %d out of range\n", bin);
+ printf("SYSTEM: GET_RANDOMNESS_BIN: %d out of range\n", bin);
return EINVAL;
}
}
default:
- kprintf("do_getinfo: invalid request %d\n", m_ptr->I_REQUEST);
+ printf("do_getinfo: invalid request %d\n", m_ptr->I_REQUEST);
return(EINVAL);
}
privp= priv(caller);
if (!privp)
{
- kprintf("do_irqctl: no priv structure!\n");
+ printf("do_irqctl: no priv structure!\n");
return EPERM;
}
if (privp->s_flags & CHECK_IRQ)
}
if (i >= privp->s_nr_irq)
{
- kprintf(
+ printf(
"do_irqctl: IRQ check failed for proc %d, IRQ %d\n",
m_ptr->m_source, irq_vec);
return EPERM;
/* Fetch the memory map. */
if((r=data_copy(caller->p_endpoint, (vir_bytes) map_ptr,
KERNEL, (vir_bytes) rp->p_memmap, sizeof(rp->p_memmap))) != OK) {
- kprintf("newmap: data_copy failed! (%d)\n", r);
+ printf("newmap: data_copy failed! (%d)\n", r);
return r;
}
*/
if ((i=get_priv(rp, priv_id)) != OK)
{
- kprintf("do_privctl: unable to allocate priv_id %d: %d\n",
+ printf("do_privctl: unable to allocate priv_id %d: %d\n",
priv_id, i);
return(i);
}
{
priv(rp)->s_irq_tab[i]= priv.s_irq_tab[i];
#if 0
- kprintf("do_privctl: adding IRQ %d for %d\n",
+ printf("do_privctl: adding IRQ %d for %d\n",
priv(rp)->s_irq_tab[i], rp->p_endpoint);
#endif
}
{
priv(rp)->s_io_tab[i]= priv.s_io_tab[i];
#if 0
- kprintf("do_privctl: adding I/O range [%x..%x] for %d\n",
+ printf("do_privctl: adding I/O range [%x..%x] for %d\n",
priv(rp)->s_io_tab[i].ior_base,
priv(rp)->s_io_tab[i].ior_limit,
rp->p_endpoint);
{
priv(rp)->s_mem_tab[i]= priv.s_mem_tab[i];
#if 0
- kprintf("do_privctl: adding mem range [%x..%x] for %d\n",
+ printf("do_privctl: adding mem range [%x..%x] for %d\n",
priv(rp)->s_mem_tab[i].mr_base,
priv(rp)->s_mem_tab[i].mr_limit,
rp->p_endpoint);
if (strcmp(rp->p_name, "fxp") == 0 ||
strcmp(rp->p_name, "rtl8139") == 0)
{
- kprintf("setting ipc_stats_target to %d\n", rp->p_endpoint);
+ printf("setting ipc_stats_target to %d\n", rp->p_endpoint);
ipc_stats_target= rp->p_endpoint;
}
#endif
return EPERM;
}
default:
- kprintf("do_privctl: bad request %d\n", m_ptr->CTL_REQUEST);
+ printf("do_privctl: bad request %d\n", m_ptr->CTL_REQUEST);
return EINVAL;
}
}
* grant id.
*/
if(!isokendpt(granter, &proc_nr) ) {
- kprintf(
+ printf(
"grant verify failed: invalid granter %d\n", (int) granter);
return(EINVAL);
}
if(!GRANT_VALID(grant)) {
- kprintf(
+ printf(
"grant verify failed: invalid grant %d\n", (int) grant);
return(EINVAL);
}
if(!HASGRANTTABLE(granter_proc)) return EPERM;
if(priv(granter_proc)->s_grant_entries <= grant) {
- kprintf(
+ printf(
"verify_grant: grant verify failed in ep %d "
"proc %d: grant %d out of range "
"for table size %d\n",
if((r=data_copy(granter,
priv(granter_proc)->s_grant_table + sizeof(g)*grant,
KERNEL, (vir_bytes) &g, sizeof(g))) != OK) {
- kprintf(
+ printf(
"verify_grant: grant verify: data_copy failed\n");
return EPERM;
}
/* Check validity. */
if((g.cp_flags & (CPF_USED | CPF_VALID)) !=
(CPF_USED | CPF_VALID)) {
- kprintf(
+ printf(
"verify_grant: grant failed: invalid (%d flags 0x%lx)\n",
grant, g.cp_flags);
return EPERM;
if((g.cp_flags & CPF_INDIRECT)) {
/* Stop after a few iterations. There may be a loop. */
if (depth == MAX_INDIRECT_DEPTH) {
- kprintf(
+ printf(
"verify grant: indirect grant verify "
"failed: exceeded maximum depth\n");
return ELOOP;
if(g.cp_u.cp_indirect.cp_who_to != grantee &&
grantee != ANY &&
g.cp_u.cp_indirect.cp_who_to != ANY) {
- kprintf(
+ printf(
"verify_grant: indirect grant verify "
"failed: bad grantee\n");
return EPERM;
/* Check access of grant. */
if(((g.cp_flags & access) != access)) {
- kprintf(
+ printf(
"verify_grant: grant verify failed: access invalid; want 0x%x, have 0x%x\n",
access, g.cp_flags);
return EPERM;
*/
if(MEM_TOP - g.cp_u.cp_direct.cp_len <
g.cp_u.cp_direct.cp_start - 1) {
- kprintf(
+ printf(
"verify_grant: direct grant verify failed: len too long\n");
return EPERM;
}
/* Verify actual grantee. */
if(g.cp_u.cp_direct.cp_who_to != grantee && grantee != ANY
&& g.cp_u.cp_direct.cp_who_to != ANY) {
- kprintf(
+ printf(
"verify_grant: direct grant verify failed: bad grantee\n");
return EPERM;
}
/* Verify actual copy range. */
if((offset_in+bytes < offset_in) ||
offset_in+bytes > g.cp_u.cp_direct.cp_len) {
- kprintf(
+ printf(
"verify_grant: direct grant verify failed: bad size or range. "
"granted %d bytes @ 0x%lx; wanted %d bytes @ 0x%lx\n",
g.cp_u.cp_direct.cp_len,
* magic grants.
*/
if(granter != FS_PROC_NR) {
- kprintf(
+ printf(
"verify_grant: magic grant verify failed: granter (%d) "
"is not FS (%d)\n", granter, FS_PROC_NR);
return EPERM;
/* Verify actual grantee. */
if(g.cp_u.cp_magic.cp_who_to != grantee && grantee != ANY
&& g.cp_u.cp_direct.cp_who_to != ANY) {
- kprintf(
+ printf(
"verify_grant: magic grant verify failed: bad grantee\n");
return EPERM;
}
/* Verify actual copy range. */
if((offset_in+bytes < offset_in) ||
offset_in+bytes > g.cp_u.cp_magic.cp_len) {
- kprintf(
+ printf(
"verify_grant: magic grant verify failed: bad size or range. "
"granted %d bytes @ 0x%lx; wanted %d bytes @ 0x%lx\n",
g.cp_u.cp_magic.cp_len,
*offset_result = g.cp_u.cp_magic.cp_start + offset_in;
*e_granter = g.cp_u.cp_magic.cp_who_from;
} else {
- kprintf(
+ printf(
"verify_grant: grant verify failed: unknown grant type\n");
return EPERM;
}
/* Verify permission exists. */
if((r=verify_grant(granter, grantee, grantid, bytes, access,
g_offset, &v_offset, &new_granter)) != OK) {
- kprintf(
+ printf(
"grant %d verify to copy %d->%d by %d failed: err %d\n",
grantid, *src, *dst, grantee, r);
return r;
access = CPF_READ;
granter = vec[i].v_from;
} else {
- kprintf("vsafecopy: %d: element %d/%d: no SELF found\n",
+ printf("vsafecopy: %d: element %d/%d: no SELF found\n",
caller->p_endpoint, i, els);
return EINVAL;
}
lin_src = umap_local(src, seg_s, off_s, size);
lin_dst = umap_local(dst, seg_d, off_d, size);
if(lin_src == 0 || lin_dst == 0) {
- kprintf("map_invoke_vm: error in umap_local.\n");
+ printf("map_invoke_vm: error in umap_local.\n");
return EINVAL;
}
/* Make sure the linear addresses are both page aligned. */
if(lin_src % CLICK_SIZE != 0
|| lin_dst % CLICK_SIZE != 0) {
- kprintf("map_invoke_vm: linear addresses not page aligned.\n");
+ printf("map_invoke_vm: linear addresses not page aligned.\n");
return EINVAL;
}
r = verify_grant(grantor, caller->p_endpoint, gid, bytes, access,
offset, &offset_result, &new_grantor);
if(r != OK) {
- kprintf("verify_grant for gid %d from %d to %d failed: %d\n",
+ printf("verify_grant for gid %d from %d to %d failed: %d\n",
gid, grantor, caller->p_endpoint, r);
return r;
}
r = verify_grant(p->grantor, p->grantee, p->gid, p->bytes,
CPF_MAP, p->offset, &offset_result, &new_grantor);
if(r != OK) {
- kprintf("safeunmap: error in verify_grant.\n");
+ printf("safeunmap: error in verify_grant.\n");
return r;
}
p->bytes, 0);
clear_info(p);
if(r != OK) {
- kprintf("safeunmap: error in map_invoke_vm.\n");
+ printf("safeunmap: error in map_invoke_vm.\n");
return r;
}
return OK;
rp->p_misc_flags &= ~MF_FPU_INITIALIZED;
if(!RTS_ISSET(rp, RTS_PROC_STOP)) {
- kprintf("system: warning: sigsend a running process\n");
- kprintf("caller stack: ");
+ printf("system: warning: sigsend a running process\n");
+ printf("caller stack: ");
proc_stacktrace(caller);
}
* Turn on profiling.
*/
if (sprofiling) {
- kprintf("SYSTEM: start s-profiling: already started\n");
+ printf("SYSTEM: start s-profiling: already started\n");
return EBUSY;
}
* Stop CMOS timer. Copy info struct to user process.
*/
if (!sprofiling) {
- kprintf("SYSTEM: stop s-profiling: not started\n");
+ printf("SYSTEM: stop s-profiling: not started\n");
return EBUSY;
}
buf = (vir_bytes) m_ptr->SYSCTL_ARG1;
len = (vir_bytes) m_ptr->SYSCTL_ARG2;
if(len < 1 || len > DIAG_BUFSIZE) {
- kprintf("do_sysctl: diag for %d: len %d out of range\n",
+ printf("do_sysctl: diag for %d: len %d out of range\n",
caller->p_endpoint, len);
return EINVAL;
}
if((s=data_copy_vmcheck(caller, caller->p_endpoint, buf, KERNEL,
(vir_bytes) mybuf, len)) != OK) {
- kprintf("do_sysctl: diag for %d: len %d: copy failed: %d\n",
+ printf("do_sysctl: diag for %d: len %d: copy failed: %d\n",
caller->p_endpoint, len, s);
return s;
}
proc_stacktrace(proc_addr(proc_nr));
return OK;
default:
- kprintf("do_sysctl: invalid request %d\n", m_ptr->SYSCTL_CODE);
+ printf("do_sysctl: invalid request %d\n", m_ptr->SYSCTL_CODE);
return(EINVAL);
}
if(verify_grant(targetpr->p_endpoint, ANY, grant, count, 0, 0,
&newoffset, &newep) != OK) {
- kprintf("SYSTEM: do_umap: verify_grant in %s, grant %d, bytes 0x%lx, failed, caller %s\n",
- targetpr->p_name, (int) grant, count, caller->p_name);
+ printf("SYSTEM: do_umap: verify_grant in %s, grant %d, bytes 0x%lx, failed, caller %s\n", targetpr->p_name, offset, count, caller->p_name);
proc_stacktrace(caller);
return EFAULT;
}
if(!isokendpt(newep, &new_proc_nr)) {
- kprintf("SYSTEM: do_umap: isokendpt failed\n");
+ printf("SYSTEM: do_umap: isokendpt failed\n");
return EFAULT;
}
if(seg_index == T || seg_index == D || seg_index == S) {
phys_addr = lin_addr = umap_local(targetpr, seg_index, offset, count);
} else {
- kprintf("SYSTEM: bogus seg type 0x%lx\n", seg_index);
+ printf("SYSTEM: bogus seg type 0x%lx\n", seg_index);
return EFAULT;
}
if(!lin_addr) {
- kprintf("SYSTEM:do_umap: umap_local failed\n");
+ printf("SYSTEM:do_umap: umap_local failed\n");
return EFAULT;
}
if(vm_lookup(targetpr, lin_addr, &phys_addr, NULL) != OK) {
- kprintf("SYSTEM:do_umap: vm_lookup failed\n");
+ printf("SYSTEM:do_umap: vm_lookup failed\n");
return EFAULT;
}
if(phys_addr == 0)
}
if(vm_running && !vm_contiguous(targetpr, lin_addr, count)) {
- kprintf("SYSTEM:do_umap: not contiguous\n");
+ printf("SYSTEM:do_umap: not contiguous\n");
return EFAULT;
}
m_ptr->CP_DST_ADDR = phys_addr;
if(naughty || phys_addr == 0) {
- kprintf("kernel: umap 0x%x done by %d / %s, pc 0x%lx, 0x%lx -> 0x%lx\n",
+ printf("kernel: umap 0x%x done by %d / %s, pc 0x%lx, 0x%lx -> 0x%lx\n",
seg_type, caller->p_endpoint, caller->p_name,
caller->p_reg.pc, offset, phys_addr);
- kprintf("caller stack: ");
+ printf("caller stack: ");
proc_stacktrace(caller);
}
return (phys_addr == 0) ? EFAULT: OK;
*===========================================================================*/
PUBLIC int do_unused(struct proc * caller, message * m_ptr)
{
- kprintf("SYSTEM: got unused request %d from %d\n",
+ printf("SYSTEM: got unused request %d from %d\n",
m_ptr->m_type, m_ptr->m_source);
return(EBADREQUEST); /* illegal message type */
}
}
if (j >= nr_io_range)
{
- kprintf(
+ printf(
"do_vdevio: I/O port check failed for proc %d, port 0x%x\n",
m_ptr->m_source, port);
return EPERM;
if(ep == SELF) { ep = m_ptr->m_source; }
if(!isokendpt(ep, &proc_nr)) {
- kprintf("do_vmctl: unexpected endpoint %d from VM\n", ep);
+ printf("do_vmctl: unexpected endpoint %d from VM\n", ep);
return EINVAL;
}
vmassert(p->p_vmrequest.vmresult != VMSUSPEND);
#if DEBUG_VMASSERT
if(p->p_vmrequest.vmresult != OK)
- kprintf("SYSTEM: VM replied %d to mem request\n",
+ printf("SYSTEM: VM replied %d to mem request\n",
p->p_vmrequest.vmresult);
printf("memreq reply: vm request sent by: %s / %d about %d; 0x%lx-0x%lx, wr %d, stack: %s ",
/* This file contains a collection of miscellaneous procedures:
* minix_panic: abort MINIX due to a fatal error
- * kprintf: (from libsys/kprintf.c)
- * kputc: buffered putc used by kernel kprintf
+ * kputc: buffered putc used by kernel printf
*/
#include "kernel.h"
}
if (mess != NULL) {
- kprintf("kernel panic: %s", mess);
+ printf("kernel panic: %s", mess);
if(nr != NO_NUM)
- kprintf(" %d", nr);
- kprintf("\n");
+ printf(" %d", nr);
+ printf("\n");
}
- kprintf("kernel: ");
+ printf("kernel: ");
util_stacktrace();
/* Abort MINIX. */
minix_shutdown(NULL);
}
-
-/* Include system printf() implementation named kprintf() */
-
-#define printf kprintf
-#include "../lib/libsys/kprintf.c"
-
/*===========================================================================*
* kputc *
*===========================================================================*/
if (last_tick_count != watchdog_local_timer_ticks) {
if (no_ticks == 1) {
- kprintf("watchdog : kernel unlocked\n");
+ printf("watchdog : kernel unlocked\n");
no_ticks = 0;
}
/* we are still ticking, everything seems good */
*/
if (++no_ticks < 10) {
if (no_ticks == 1)
- kprintf("WARNING watchdog : possible kernel lockup\n");
+ printf("WARNING watchdog : possible kernel lockup\n");
goto reset_and_continue;
}