kdb.h revision 157448
155714Skris/*-
255714Skris * Copyright (c) 2004 Marcel Moolenaar
355714Skris * All rights reserved.
455714Skris *
555714Skris * Redistribution and use in source and binary forms, with or without
655714Skris * modification, are permitted provided that the following conditions
755714Skris * are met:
8296341Sdelphij *
955714Skris * 1. Redistributions of source code must retain the above copyright
1055714Skris *    notice, this list of conditions and the following disclaimer.
1155714Skris * 2. Redistributions in binary form must reproduce the above copyright
1255714Skris *    notice, this list of conditions and the following disclaimer in the
1355714Skris *    documentation and/or other materials provided with the distribution.
1455714Skris *
15296341Sdelphij * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1655714Skris * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1755714Skris * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1855714Skris * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1955714Skris * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2055714Skris * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2155714Skris * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22296341Sdelphij * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2355714Skris * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2455714Skris * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2555714Skris *
2655714Skris * $FreeBSD: head/sys/i386/include/kdb.h 157448 2006-04-03 22:51:47Z marcel $
2755714Skris */
2855714Skris
2955714Skris#ifndef _MACHINE_KDB_H_
3055714Skris#define _MACHINE_KDB_H_
3155714Skris
3255714Skris#include <machine/frame.h>
3355714Skris#include <machine/psl.h>
3455714Skris
3555714Skris#define	KDB_STOPPEDPCB(pc)	&stoppcbs[pc->pc_cpuid]
3655714Skris
37296341Sdelphijstatic __inline void
3855714Skriskdb_cpu_clear_singlestep(void)
3955714Skris{
40296341Sdelphij	kdb_frame->tf_eflags &= ~PSL_T;
4155714Skris}
4255714Skris
4355714Skrisstatic __inline void
4455714Skriskdb_cpu_set_singlestep(void)
4555714Skris{
4655714Skris	kdb_frame->tf_eflags |= PSL_T;
4755714Skris}
4855714Skris
4955714Skrisstatic __inline void
5055714Skriskdb_cpu_trap(int type, int code)
5155714Skris{
52296341Sdelphij}
5355714Skris
5455714Skris#endif /* _MACHINE_KDB_H_ */
5555714Skris