feeder.c (107237) | feeder.c (109623) |
---|---|
1/* 2 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <dev/sound/pcm/sound.h> 28 29#include "feeder_if.h" 30 | 1/* 2 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <dev/sound/pcm/sound.h> 28 29#include "feeder_if.h" 30 |
31SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pcm/feeder.c 107237 2002-11-25 17:17:43Z cg $"); | 31SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pcm/feeder.c 109623 2003-01-21 08:56:16Z alfred $"); |
32 33MALLOC_DEFINE(M_FEEDER, "feeder", "pcm feeder"); 34 35#define MAXFEEDERS 256 36#undef FEEDER_DEBUG 37 38struct feedertab_entry { 39 SLIST_ENTRY(feedertab_entry) link; --- 14 unchanged lines hidden (view full) --- 54 struct feeder_class *fc = p; 55 struct feedertab_entry *fte; 56 int i; 57 58 if (feedercnt == 0) { 59 KASSERT(fc->desc == NULL, ("first feeder not root: %s", fc->name)); 60 61 SLIST_INIT(&feedertab); | 32 33MALLOC_DEFINE(M_FEEDER, "feeder", "pcm feeder"); 34 35#define MAXFEEDERS 256 36#undef FEEDER_DEBUG 37 38struct feedertab_entry { 39 SLIST_ENTRY(feedertab_entry) link; --- 14 unchanged lines hidden (view full) --- 54 struct feeder_class *fc = p; 55 struct feedertab_entry *fte; 56 int i; 57 58 if (feedercnt == 0) { 59 KASSERT(fc->desc == NULL, ("first feeder not root: %s", fc->name)); 60 61 SLIST_INIT(&feedertab); |
62 fte = malloc(sizeof(*fte), M_FEEDER, M_WAITOK | M_ZERO); | 62 fte = malloc(sizeof(*fte), M_FEEDER, M_ZERO); |
63 if (fte == NULL) { 64 printf("can't allocate memory for root feeder: %s\n", 65 fc->name); 66 67 return; 68 } 69 fte->feederclass = fc; 70 fte->desc = NULL; --- 8 unchanged lines hidden (view full) --- 79 } 80 81 KASSERT(fc->desc != NULL, ("feeder '%s' has no descriptor", fc->name)); 82 83 /* beyond this point failure is non-fatal but may result in some translations being unavailable */ 84 i = 0; 85 while ((feedercnt < MAXFEEDERS) && (fc->desc[i].type > 0)) { 86 /* printf("adding feeder %s, %x -> %x\n", fc->name, fc->desc[i].in, fc->desc[i].out); */ | 63 if (fte == NULL) { 64 printf("can't allocate memory for root feeder: %s\n", 65 fc->name); 66 67 return; 68 } 69 fte->feederclass = fc; 70 fte->desc = NULL; --- 8 unchanged lines hidden (view full) --- 79 } 80 81 KASSERT(fc->desc != NULL, ("feeder '%s' has no descriptor", fc->name)); 82 83 /* beyond this point failure is non-fatal but may result in some translations being unavailable */ 84 i = 0; 85 while ((feedercnt < MAXFEEDERS) && (fc->desc[i].type > 0)) { 86 /* printf("adding feeder %s, %x -> %x\n", fc->name, fc->desc[i].in, fc->desc[i].out); */ |
87 fte = malloc(sizeof(*fte), M_FEEDER, M_WAITOK | M_ZERO); | 87 fte = malloc(sizeof(*fte), M_FEEDER, M_ZERO); |
88 if (fte == NULL) { 89 printf("can't allocate memory for feeder '%s', %x -> %x\n", fc->name, fc->desc[i].in, fc->desc[i].out); 90 91 return; 92 } 93 fte->feederclass = fc; 94 fte->desc = &fc->desc[i]; 95 fte->idx = feedercnt; --- 326 unchanged lines hidden --- | 88 if (fte == NULL) { 89 printf("can't allocate memory for feeder '%s', %x -> %x\n", fc->name, fc->desc[i].in, fc->desc[i].out); 90 91 return; 92 } 93 fte->feederclass = fc; 94 fte->desc = &fc->desc[i]; 95 fte->idx = feedercnt; --- 326 unchanged lines hidden --- |