X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ftimer.h;h=b71e62f6ca2682bd29fbd945f08b91e044a61ae2;hb=bd35c984636a2d5dfdff7a80f8eaa4e388c6899c;hp=7f985d5b8fd2c391ce6d10c578ea09ba6c79472f;hpb=a2f94f569a4c99204de02814a20098a71527e913;p=bootcensus diff --git a/src/timer.h b/src/timer.h index 7f985d5..b71e62f 100644 --- a/src/timer.h +++ b/src/timer.h @@ -1,7 +1,27 @@ +/* +pcboot - bootable PC demo/game kernel +Copyright (C) 2018 John Tsiombikas + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY, without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ #ifndef _TIMER_H_ #define _TIMER_H_ -unsigned long nticks; +#define MSEC_TO_TICKS(ms) ((ms) * TICK_FREQ_HZ / 1000) +#define TICKS_TO_MSEC(tk) ((tk) * 1000 / TICK_FREQ_HZ) + +volatile unsigned long nticks; void init_timer(void);