Annotation of sys/arch/m88k/include/cmmu.h, Revision 1.1
1.1 ! nbrk 1: /* $OpenBSD: cmmu.h,v 1.17 2007/02/11 12:49:35 miod Exp $ */
! 2: /*
! 3: * Mach Operating System
! 4: * Copyright (c) 1993-1992 Carnegie Mellon University
! 5: * All Rights Reserved.
! 6: *
! 7: * Permission to use, copy, modify and distribute this software and its
! 8: * documentation is hereby granted, provided that both the copyright
! 9: * notice and this permission notice appear in all copies of the
! 10: * software, derivative works or modified versions, and any portions
! 11: * thereof, and that both notices appear in supporting documentation.
! 12: *
! 13: * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
! 14: * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
! 15: * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
! 16: *
! 17: * Carnegie Mellon requests users of this software to return to
! 18: *
! 19: * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
! 20: * School of Computer Science
! 21: * Carnegie Mellon University
! 22: * Pittsburgh PA 15213-3890
! 23: *
! 24: * any improvements or extensions that they make and grant Carnegie Mellon
! 25: * the rights to redistribute these changes.
! 26: */
! 27:
! 28: #ifndef _M88K_CMMU_H_
! 29: #define _M88K_CMMU_H_
! 30:
! 31: /*
! 32: * Prototypes and stuff for cmmu.c.
! 33: */
! 34: #if defined(_KERNEL) && !defined(_LOCORE)
! 35:
! 36: #ifdef MULTIPROCESSOR
! 37: /*
! 38: * This lock protects the cmmu SAR and SCR's; other ports
! 39: * can be accessed without locking it.
! 40: *
! 41: * May be used from "db_interface.c".
! 42: */
! 43: extern __cpu_simple_lock_t cmmu_cpu_lock;
! 44:
! 45: #define CMMU_LOCK __cpu_simple_lock(&cmmu_cpu_lock)
! 46: #define CMMU_UNLOCK __cpu_simple_unlock(&cmmu_cpu_lock)
! 47:
! 48: #else
! 49:
! 50: #define CMMU_LOCK do { /* nothing */ } while (0)
! 51: #define CMMU_UNLOCK do { /* nothing */ } while (0)
! 52:
! 53: #endif /* MULTIPROCESSOR */
! 54:
! 55: /* machine dependent cmmu function pointer structure */
! 56: struct cmmu_p {
! 57: cpuid_t (*init)(void);
! 58: void (*setup_board_config)(void);
! 59: void (*cpu_configuration_print)(int);
! 60: void (*shutdown)(void);
! 61: cpuid_t (*cpu_number)(void);
! 62: void (*set_sapr)(cpuid_t, apr_t);
! 63: void (*set_uapr)(apr_t);
! 64: void (*flush_tlb)(cpuid_t, u_int, vaddr_t, u_int);
! 65: void (*flush_cache)(cpuid_t, paddr_t, psize_t);
! 66: void (*flush_inst_cache)(cpuid_t, paddr_t, psize_t);
! 67: void (*flush_data_page)(cpuid_t, paddr_t);
! 68: void (*dma_cachectl)(pmap_t, vaddr_t, vsize_t, int);
! 69: void (*dma_cachectl_pa)(paddr_t, psize_t, int);
! 70: #ifdef MULTIPROCESSOR
! 71: void (*initialize_cpu)(cpuid_t);
! 72: #endif
! 73: };
! 74:
! 75: extern struct cmmu_p *cmmu;
! 76:
! 77: #define cmmu_init (cmmu->init)
! 78: #define setup_board_config (cmmu->setup_board_config)
! 79: #define cpu_configuration_print(a) (cmmu->cpu_configuration_print)(a)
! 80: #define cmmu_shutdown (cmmu->shutdown)
! 81: #define cmmu_cpu_number (cmmu->cpu_number)
! 82: #define cmmu_set_sapr(a, b) (cmmu->set_sapr)(a, b)
! 83: #define cmmu_set_uapr(a) (cmmu->set_uapr)(a)
! 84: #define cmmu_flush_tlb(a, b, c, d) (cmmu->flush_tlb)(a, b, c, d)
! 85: #define cmmu_flush_cache(a, b, c) (cmmu->flush_cache)(a, b, c)
! 86: #define cmmu_flush_inst_cache(a, b, c) (cmmu->flush_inst_cache)(a, b, c)
! 87: #define cmmu_flush_data_page(a, b) (cmmu->flush_data_page)(a, b)
! 88: #define dma_cachectl(a, b, c, d) (cmmu->dma_cachectl)(a, b, c, d)
! 89: #define dma_cachectl_pa(a, b, c) (cmmu->dma_cachectl_pa)(a, b, c)
! 90: #define cmmu_initialize_cpu(a) (cmmu->initialize_cpu)(a)
! 91:
! 92: /*
! 93: * dma_cachectl() modes
! 94: */
! 95: #define DMA_CACHE_SYNC 0
! 96: #define DMA_CACHE_SYNC_INVAL 1
! 97: #define DMA_CACHE_INV 2
! 98:
! 99: #endif /* _KERNEL && !_LOCORE */
! 100:
! 101: #endif /* _M88K_CMMU_H_ */
CVSweb