xref: /freebsd/sys/powerpc/include/kdb.h (revision 95ee2897)
160727d8bSWarner Losh /*-
24d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
371e3c308SPedro F. Giffuni  *
4f4ec5aecSPeter Grehan  * Copyright (c) 2004 Marcel Moolenaar
5f4ec5aecSPeter Grehan  * All rights reserved.
6f4ec5aecSPeter Grehan  *
7f4ec5aecSPeter Grehan  * Redistribution and use in source and binary forms, with or without
8f4ec5aecSPeter Grehan  * modification, are permitted provided that the following conditions
9f4ec5aecSPeter Grehan  * are met:
10f4ec5aecSPeter Grehan  *
11f4ec5aecSPeter Grehan  * 1. Redistributions of source code must retain the above copyright
12f4ec5aecSPeter Grehan  *    notice, this list of conditions and the following disclaimer.
13f4ec5aecSPeter Grehan  * 2. Redistributions in binary form must reproduce the above copyright
14f4ec5aecSPeter Grehan  *    notice, this list of conditions and the following disclaimer in the
15f4ec5aecSPeter Grehan  *    documentation and/or other materials provided with the distribution.
16f4ec5aecSPeter Grehan  *
17f4ec5aecSPeter Grehan  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18f4ec5aecSPeter Grehan  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19f4ec5aecSPeter Grehan  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20f4ec5aecSPeter Grehan  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21f4ec5aecSPeter Grehan  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22f4ec5aecSPeter Grehan  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23f4ec5aecSPeter Grehan  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24f4ec5aecSPeter Grehan  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25f4ec5aecSPeter Grehan  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26f4ec5aecSPeter Grehan  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27f4ec5aecSPeter Grehan  */
28f4ec5aecSPeter Grehan 
29f4ec5aecSPeter Grehan #ifndef _MACHINE_KDB_H_
30f4ec5aecSPeter Grehan #define _MACHINE_KDB_H_
31f4ec5aecSPeter Grehan 
32f4ec5aecSPeter Grehan #include <machine/cpufunc.h>
33e60a36f5SPeter Grehan #include <machine/frame.h>
3401bd17ccSMarcel Moolenaar #include <machine/md_var.h>
35e60a36f5SPeter Grehan #include <machine/psl.h>
36786e4a1bSRafal Jaworowski #include <machine/spr.h>
37f4ec5aecSPeter Grehan 
38786e4a1bSRafal Jaworowski void kdb_cpu_clear_singlestep(void);
39786e4a1bSRafal Jaworowski void kdb_cpu_set_singlestep(void);
40f4ec5aecSPeter Grehan 
41f4ec5aecSPeter Grehan static __inline void
kdb_cpu_sync_icache(unsigned char * addr,size_t size)4201bd17ccSMarcel Moolenaar kdb_cpu_sync_icache(unsigned char *addr, size_t size)
4301bd17ccSMarcel Moolenaar {
44786e4a1bSRafal Jaworowski 
4501bd17ccSMarcel Moolenaar 	__syncicache(addr, size);
4601bd17ccSMarcel Moolenaar }
4701bd17ccSMarcel Moolenaar 
4801bd17ccSMarcel Moolenaar static __inline void
kdb_cpu_trap(int vector,int _)49f4ec5aecSPeter Grehan kdb_cpu_trap(int vector, int _)
50f4ec5aecSPeter Grehan {
51f4ec5aecSPeter Grehan }
52f4ec5aecSPeter Grehan 
53763107f2SMitchell Horne static __inline int
kdb_cpu_set_watchpoint(vm_offset_t addr,vm_size_t size,int access)54763107f2SMitchell Horne kdb_cpu_set_watchpoint(vm_offset_t addr, vm_size_t size, int access)
55763107f2SMitchell Horne {
56763107f2SMitchell Horne 
57763107f2SMitchell Horne 	return (ENXIO);
58763107f2SMitchell Horne }
59763107f2SMitchell Horne 
60763107f2SMitchell Horne static __inline int
kdb_cpu_clr_watchpoint(vm_offset_t addr,vm_size_t size)61763107f2SMitchell Horne kdb_cpu_clr_watchpoint(vm_offset_t addr, vm_size_t size)
62763107f2SMitchell Horne {
63763107f2SMitchell Horne 
64763107f2SMitchell Horne 	return (0);
65763107f2SMitchell Horne }
66763107f2SMitchell Horne 
67f4ec5aecSPeter Grehan #endif /* _MACHINE_KDB_H_ */
68