git: 9front

Download patch

ref: fc35df27e7eec75cf10f0fed687fd97e5430d093
parent: a503d729e08c8a11eaaae72146ba6bf8a9b0d708
author: cinap_lenrek <cinap_lenrek@localhost>
date: Mon May 16 18:31:27 EDT 2011

remove audio.h, put stuff in port^(dat fns).h

--- a/sys/src/9/pc/audioac97.c
+++ b/sys/src/9/pc/audioac97.c
@@ -5,7 +5,6 @@
 #include "fns.h"
 #include "io.h"
 #include "../port/error.h"
-#include "../port/audio.h"
 
 typedef struct Hwdesc Hwdesc;
 typedef struct Ctlr Ctlr;
@@ -140,6 +139,11 @@
 #define csr8w(c, r, b)	(outb((c)->port+(r), (int)(b)))
 #define csr16w(c, r, w)	(outs((c)->port+(r), (ushort)(w)))
 #define csr32w(c, r, w)	(outl((c)->port+(r), (ulong)(w)))
+
+/* audioac97mix */
+extern int ac97hardrate(Audio *, int);
+extern void ac97mixreset(Audio *, void (*wr)(Audio*,int,ushort), 
+	ushort (*rr)(Audio*,int));
 
 static void
 ac97waitcodec(Audio *adev)
--- a/sys/src/9/pc/audioac97mix.c
+++ b/sys/src/9/pc/audioac97mix.c
@@ -5,7 +5,6 @@
 #include "fns.h"
 #include "io.h"
 #include "../port/error.h"
-#include "../port/audio.h"
 
 typedef ushort (*ac97rdfn)(Audio *, int);
 typedef void (*ac97wrfn)(Audio *, int, ushort);
--- a/sys/src/9/pc/audiosb16.c
+++ b/sys/src/9/pc/audiosb16.c
@@ -8,7 +8,6 @@
 #include "fns.h"
 #include "io.h"
 #include "../port/error.h"
-#include "../port/audio.h"
 
 typedef struct	AQueue	AQueue;
 typedef struct	Buf	Buf;
--- a/sys/src/9/port/audio.h
+++ /dev/null
@@ -1,22 +1,0 @@
-
-typedef struct Audio Audio;
-struct Audio {
-	Audio *next;
-	char *name;
-	void *ctlr;
-	void *mixer;
-	void (*attach)(Audio *);
-	long (*read)(Audio *, void *, long, vlong);
-	long (*write)(Audio *, void *, long, vlong);
-	long (*volread)(Audio *, void *, long, vlong);
-	long (*volwrite)(Audio *, void *, long, vlong);
-	void (*close)(Audio *);
-	long (*ctl)(Audio *, void *, long, vlong);
-	long (*status)(Audio *, void *, long, vlong);
-	long (*buffered)(Audio *);
-	int ctlrno;
-};
-
-void addaudiocard(char *name, int (*probefn)(Audio *));
-void ac97mixreset(Audio *, void (*wr)(Audio*,int,ushort), ushort (*rr)(Audio*,int));
-int ac97hardrate(Audio *adev, int rate);
--- a/sys/src/9/port/devaudio.c
+++ b/sys/src/9/port/devaudio.c
@@ -5,7 +5,6 @@
 #include	"fns.h"
 #include	"io.h"
 #include	"../port/error.h"
-#include	"../port/audio.h"
 
 typedef struct Audioprobe Audioprobe;
 struct Audioprobe {
--- a/sys/src/9/port/portdat.h
+++ b/sys/src/9/port/portdat.h
@@ -1,4 +1,5 @@
 typedef struct Alarms	Alarms;
+typedef struct Audio	Audio;
 typedef struct Block	Block;
 typedef struct Chan	Chan;
 typedef struct Cmdbuf	Cmdbuf;
@@ -917,6 +918,23 @@
 };
 
 extern	Uart*	consuart;
+
+struct Audio {
+	Audio *next;
+	char *name;
+	void *ctlr;
+	void *mixer;
+	void (*attach)(Audio *);
+	long (*read)(Audio *, void *, long, vlong);
+	long (*write)(Audio *, void *, long, vlong);
+	long (*volread)(Audio *, void *, long, vlong);
+	long (*volwrite)(Audio *, void *, long, vlong);
+	void (*close)(Audio *);
+	long (*ctl)(Audio *, void *, long, vlong);
+	long (*status)(Audio *, void *, long, vlong);
+	long (*buffered)(Audio *);
+	int ctlrno;
+};
 
 /*
  *  performance timers, all units in perfticks
--- a/sys/src/9/port/portfns.h
+++ b/sys/src/9/port/portfns.h
@@ -4,6 +4,7 @@
 int		addphysseg(Physseg*);
 void		addbootfile(char*, uchar*, ulong);
 void		addwatchdog(Watchdog*);
+void		addaudiocard(char *, int (*)(Audio *));
 Block*		adjustblock(Block*, int);
 void		alarmkproc(void*);
 Block*		allocb(int);
--