Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/broadcom Adapt to changed 64bit vchiq interface.



details:   https://anonhg.NetBSD.org/src/rev/8ad265419d0f
branches:  trunk
changeset: 1006665:8ad265419d0f
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Wed Jan 22 21:21:24 2020 +0000

description:
Adapt to changed 64bit vchiq interface.

diffstat:

 sys/arch/arm/broadcom/bcm2835_vcaudio.c    |  17 +++++++----------
 sys/arch/arm/broadcom/bcm2835_vcaudioreg.h |  10 ++++++----
 2 files changed, 13 insertions(+), 14 deletions(-)

diffs (93 lines):

diff -r 669faa2534a5 -r 8ad265419d0f sys/arch/arm/broadcom/bcm2835_vcaudio.c
--- a/sys/arch/arm/broadcom/bcm2835_vcaudio.c   Wed Jan 22 21:07:56 2020 +0000
+++ b/sys/arch/arm/broadcom/bcm2835_vcaudio.c   Wed Jan 22 21:21:24 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm2835_vcaudio.c,v 1.14 2019/05/08 13:40:14 isaki Exp $ */
+/* $NetBSD: bcm2835_vcaudio.c,v 1.15 2020/01/22 21:21:24 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2013 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_vcaudio.c,v 1.14 2019/05/08 13:40:14 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_vcaudio.c,v 1.15 2020/01/22 21:21:24 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -371,8 +371,6 @@
        VC_AUDIO_MSG_T msg;
        int32_t msglen = 0;
        int error;
-       void (*intr)(void *) = NULL;
-       void *intrarg = NULL;
 
        if (sc == NULL || reason != VCHI_CALLBACK_MSG_AVAILABLE)
                return;
@@ -396,9 +394,8 @@
                break;
 
        case VC_AUDIO_MSG_TYPE_COMPLETE:
-               intr = msg.u.complete.callback;
-               intrarg = msg.u.complete.cookie;
-               if (intr && intrarg) {
+               if (msg.u.complete.cookie1 == VC_AUDIO_WRITE_COOKIE1 &&
+                   msg.u.complete.cookie2 == VC_AUDIO_WRITE_COOKIE2) {
                        int count = msg.u.complete.count & 0xffff;
                        int perr = (msg.u.complete.count & __BIT(30)) != 0;
                        bool sched = false;
@@ -420,7 +417,7 @@
                        }
 
                        if (sched && sc->sc_pint) {
-                               intr(intrarg);
+                               sc->sc_pint(sc->sc_pintarg);
                                sc->sc_abytes += sc->sc_pblksize;
                                cv_signal(&sc->sc_datacv);
                        }
@@ -465,8 +462,8 @@
                msg.type = VC_AUDIO_MSG_TYPE_WRITE;
                msg.u.write.max_packet = VCAUDIO_MSGSIZE;
                msg.u.write.count = count;
-               msg.u.write.callback = intr;
-               msg.u.write.cookie = intrarg;
+               msg.u.write.cookie1 = VC_AUDIO_WRITE_COOKIE1;
+               msg.u.write.cookie2 = VC_AUDIO_WRITE_COOKIE2;
                msg.u.write.silence = 0;
 
                block = (uint8_t *)sc->sc_pstart + sc->sc_ppos;
diff -r 669faa2534a5 -r 8ad265419d0f sys/arch/arm/broadcom/bcm2835_vcaudioreg.h
--- a/sys/arch/arm/broadcom/bcm2835_vcaudioreg.h        Wed Jan 22 21:07:56 2020 +0000
+++ b/sys/arch/arm/broadcom/bcm2835_vcaudioreg.h        Wed Jan 22 21:21:24 2020 +0000
@@ -33,6 +33,8 @@
 
 // FourCC code used for VCHI connection
 #define VC_AUDIO_SERVER_NAME  MAKE_FOURCC("AUDS")
+#define VC_AUDIO_WRITE_COOKIE1  MAKE_FOURCC("BCMA")
+#define VC_AUDIO_WRITE_COOKIE2  MAKE_FOURCC("DATA")
 
 // Maximum message length
 #define VC_AUDIO_MAX_MSG_LEN  (sizeof( VC_AUDIO_MSG_T ))
@@ -115,8 +117,8 @@
 typedef struct
 {
    uint32_t count; // in bytes
-   void *callback;
-   void *cookie;
+   uint32_t cookie1;
+   uint32_t cookie2;
    uint16_t silence;
    uint16_t max_packet;
 } VC_AUDIO_WRITE_T;
@@ -132,8 +134,8 @@
 typedef struct
 {
    int32_t count;  // Success value
-   void *callback;
-   void *cookie;
+   uint32_t cookie1;
+   uint32_t cookie2;
 } VC_AUDIO_COMPLETE_T;
 
 // Message header for all messages in HOST->VC direction



Home | Main Index | Thread Index | Old Index