home *** CD-ROM | disk | FTP | other *** search
- /*
- * djgcc.c -- device dependent stuff for DJGCC compiler (DOS)
- *
- * (c) 1994 Shawn McHorse <Shawn_McHorse@fcircus.sat.tx.us>
- *
- * 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;
- *
- * 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, write to the Free Software Foundation, Inc.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
- #include "ray.h"
- #include "proto.h"
- #include "extern.h"
- #include <go32.h>
- #include <dpmi.h>
- #include <time.h>
-
- PUBLIC void
- check_abort(void)
- {
- if (keyboard_exit)
- if (_go32_was_ctrl_break_hit())
- abort_trace(0);
- else
- return;
- }
-
- PRIVATE time_t t0;
-
- PUBLIC void
- timer_start(void)
- {
- time(&t0); /* Get starting time. */
- }
-
- PUBLIC long
- timer_stop(void)
- {
- time_t t1;
-
- time(&t1); /* Get ending time. */
- return (long) 10 *difftime(t1, t0); /* Return time difference, in
- * tenths of seconds. */
- }
-
- PUBLIC void
- install_handlers(void)
- {
- return;
- }
-
- PUBLIC void
- init_machine(void)
- {
- _go32_want_ctrl_break(1); /* Tell GO32 to trap Ctrl-Break */
- }
-
- #ifdef UNDEFINED
- PUBLIC unsigned long
- memory_left(void)
- {
- return (_go32_dpmi_remaining_physical_memory() +
- _go32_dpmi_remaining_virtual_memory());
- }
-
- #endif
-