From c1370f443576aba36d29c4892e5bdf9cff0e9363 Mon Sep 17 00:00:00 2001 From: scottr Date: Mon, 10 Feb 1997 22:06:20 +0000 Subject: [PATCH] Add console bell callback support --- sys/arch/mac68k/mac68k/machdep.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/sys/arch/mac68k/mac68k/machdep.c b/sys/arch/mac68k/mac68k/machdep.c index 89a4c94bd0a5..2511092b9aab 100644 --- a/sys/arch/mac68k/mac68k/machdep.c +++ b/sys/arch/mac68k/mac68k/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.130 1997/02/03 17:32:57 scottr Exp $ */ +/* $NetBSD: machdep.c,v 1.131 1997/02/10 22:06:20 scottr Exp $ */ /* * Copyright (c) 1996 Jason R. Thorpe. All rights reserved. @@ -169,6 +169,10 @@ u_int32_t mac68k_vidlog; /* logical addr */ u_int32_t mac68k_vidphys; /* physical addr */ u_int32_t mac68k_vidlen; /* mem length */ +/* Callback and cookie to run bell */ +int (*mac68k_bell_callback) __P((void *, int, int, int)); +caddr_t mac68k_bell_cookie; + vm_map_t buffer_map; /* @@ -2860,6 +2864,30 @@ printstar(void) movl sp@+,a0"); } +void +mac68k_set_bell_callback(callback, cookie) + int (*callback) __P((void *, int, int, int)); + void *cookie; +{ + mac68k_bell_callback = callback; + mac68k_bell_cookie = (caddr_t) cookie; +} + +int +mac68k_ring_bell(freq, length, volume) + int freq, length, volume; +{ + if (mac68k_bell_callback) + return ((*mac68k_bell_callback)(mac68k_bell_cookie, + freq, length, volume)); + else + return (ENXIO); +} + +/* + * bus.h implementation + */ + int bus_space_map(t, bpa, size, cacheable, bshp) bus_space_tag_t t;