1139735Simp/*-
2132051Scognet * Copyright (c) 2004 Marcel Moolenaar
3132051Scognet * All rights reserved.
4132051Scognet *
5132051Scognet * Redistribution and use in source and binary forms, with or without
6132051Scognet * modification, are permitted provided that the following conditions
7132051Scognet * are met:
8132051Scognet *
9132051Scognet * 1. Redistributions of source code must retain the above copyright
10132051Scognet *    notice, this list of conditions and the following disclaimer.
11132051Scognet * 2. Redistributions in binary form must reproduce the above copyright
12132051Scognet *    notice, this list of conditions and the following disclaimer in the
13132051Scognet *    documentation and/or other materials provided with the distribution.
14132051Scognet *
15132051Scognet * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16132051Scognet * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17132051Scognet * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18132051Scognet * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19132051Scognet * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20132051Scognet * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21132051Scognet * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22132051Scognet * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23132051Scognet * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24132051Scognet * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25132051Scognet *
26132051Scognet * $FreeBSD$
27132051Scognet */
28132051Scognet
29132051Scognet#ifndef _MACHINE_KDB_H_
30132051Scognet#define _MACHINE_KDB_H_
31132051Scognet
32295319Smmel#include <machine/cpu.h>
33295319Smmel#include <machine/db_machdep.h>
34132051Scognet#include <machine/frame.h>
35132051Scognet#include <machine/psl.h>
36132051Scognet
37253762Scognet#define	KDB_STOPPEDPCB(pc)	&stoppcbs[pc->pc_cpuid]
38253762Scognet
39294740Szbb#if __ARM_ARCH >= 6
40294740Szbbextern void kdb_cpu_clear_singlestep(void);
41294740Szbbextern void kdb_cpu_set_singlestep(void);
42294740Szbbboolean_t kdb_cpu_pc_is_singlestep(db_addr_t);
43294740Szbb#else
44132051Scognetstatic __inline void
45132051Scognetkdb_cpu_clear_singlestep(void)
46132051Scognet{
47132051Scognet}
48132051Scognet
49132051Scognetstatic __inline void
50132051Scognetkdb_cpu_set_singlestep(void)
51132051Scognet{
52132051Scognet}
53294740Szbb#endif
54132051Scognet
55132051Scognetstatic __inline void
56170473Smarcelkdb_cpu_sync_icache(unsigned char *addr, size_t size)
57170473Smarcel{
58236307Sgber
59295319Smmel	icache_sync((vm_offset_t)addr, size);
60170473Smarcel}
61170473Smarcel
62170473Smarcelstatic __inline void
63132051Scognetkdb_cpu_trap(int type, int code)
64132051Scognet{
65132051Scognet}
66132051Scognet
67132051Scognet#endif /* _MACHINE_KDB_H_ */
68