Files
retrobsd/sys/pic32/clock.c
Serge Vakulenko d1f1e614f0 Kernel sources reformated with 4 space indent, no tabs.
Unused file include/trace.h deleted.
2015-06-23 19:00:24 -07:00

22 lines
513 B
C

/*
* Copyright (c) 1986 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
#include "param.h"
#include "machine/pic32mx.h"
/*
* Setup core timer for `hz' timer interrupts per second.
*/
void
clkstart()
{
unsigned count = mips_read_c0_register (C0_COUNT, 0);
mips_write_c0_register (C0_COMPARE, 0,
count + (CPU_KHZ * 1000 / HZ + 1) / 2);
IECSET(0) = 1 << PIC32_IRQ_CT;
}