kdb.h revision 170473
1139790Simp/*- 2131903Smarcel * Copyright (c) 2004 Marcel Moolenaar 3131903Smarcel * All rights reserved. 4131903Smarcel * 5131903Smarcel * Redistribution and use in source and binary forms, with or without 6131903Smarcel * modification, are permitted provided that the following conditions 7131903Smarcel * are met: 8131903Smarcel * 9131903Smarcel * 1. Redistributions of source code must retain the above copyright 10131903Smarcel * notice, this list of conditions and the following disclaimer. 11131903Smarcel * 2. Redistributions in binary form must reproduce the above copyright 12131903Smarcel * notice, this list of conditions and the following disclaimer in the 13131903Smarcel * documentation and/or other materials provided with the distribution. 14131903Smarcel * 15131903Smarcel * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16131903Smarcel * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17131903Smarcel * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18131903Smarcel * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19131903Smarcel * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20131903Smarcel * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21131903Smarcel * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22131903Smarcel * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23131903Smarcel * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24131903Smarcel * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25131903Smarcel * 26131903Smarcel * $FreeBSD: head/sys/i386/include/kdb.h 170473 2007-06-09 21:55:17Z marcel $ 27131903Smarcel */ 28131903Smarcel 29131903Smarcel#ifndef _MACHINE_KDB_H_ 30131903Smarcel#define _MACHINE_KDB_H_ 31131903Smarcel 32131903Smarcel#include <machine/frame.h> 33131903Smarcel#include <machine/psl.h> 34131903Smarcel 35157448Smarcel#define KDB_STOPPEDPCB(pc) &stoppcbs[pc->pc_cpuid] 36157448Smarcel 37131903Smarcelstatic __inline void 38131903Smarcelkdb_cpu_clear_singlestep(void) 39131903Smarcel{ 40131903Smarcel kdb_frame->tf_eflags &= ~PSL_T; 41131903Smarcel} 42131903Smarcel 43131903Smarcelstatic __inline void 44131903Smarcelkdb_cpu_set_singlestep(void) 45131903Smarcel{ 46131903Smarcel kdb_frame->tf_eflags |= PSL_T; 47131903Smarcel} 48131903Smarcel 49131903Smarcelstatic __inline void 50170473Smarcelkdb_cpu_sync_icache(unsigned char *addr, size_t size) 51170473Smarcel{ 52170473Smarcel} 53170473Smarcel 54170473Smarcelstatic __inline void 55131903Smarcelkdb_cpu_trap(int type, int code) 56131903Smarcel{ 57131903Smarcel} 58131903Smarcel 59131903Smarcel#endif /* _MACHINE_KDB_H_ */ 60