From patchwork Fri Nov 5 15:13:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ionut Nicu X-Patchwork-Id: 304162 X-Patchwork-Delegate: omar.ramirez@ti.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oA5FEASQ027726 for ; Fri, 5 Nov 2010 15:14:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753196Ab0KEPOJ (ORCPT ); Fri, 5 Nov 2010 11:14:09 -0400 Received: from mail-gw0-f46.google.com ([74.125.83.46]:33152 "EHLO mail-gw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752708Ab0KEPOI (ORCPT ); Fri, 5 Nov 2010 11:14:08 -0400 Received: by gwj21 with SMTP id 21so2210883gwj.19 for ; Fri, 05 Nov 2010 08:14:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=hlyP0N6cCBvLHnx54OrxeVDqs6+CYPhqpjVABYIDSo8=; b=vl7BKrP6eQBi/t0fRURi2W15G79ujraMW8I/D100kU6gidDoMCROhm+4iJGERvwC4y 3GDoEKhX5GdXK5+HlTVkkZCycqpkeC+rWYeicWL5PweWqNiVp9itXH+lRd3fu8cVDagO n35oXHliBed1IWXpOv+B8HBeMCSzinF/5iw2E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=p4qDTGVBPWVpmkuW2+PnqwlRr62rVMY0wR+3I/6ZOnH+H22YUPxmbjuVN7OZKwrCzF hSQpxerq50fvhui1EgkKz0s0p0GfJ+I9e+X0/cHPzhHpN+CBxeey+L8J4s7BKsXggYhU XbwhlHT3wNszN4kJY6wI199uE3YbI8QfITVnU= Received: by 10.204.71.4 with SMTP id f4mr1969528bkj.183.1288970046618; Fri, 05 Nov 2010 08:14:06 -0700 (PDT) Received: from localhost.localdomain (196-98-odb-svnet.titannet.ro [77.81.196.98]) by mx.google.com with ESMTPS id r21sm1072535bkj.22.2010.11.05.08.14.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 05 Nov 2010 08:14:05 -0700 (PDT) From: Ionut Nicu To: Greg Kroah-Hartman , Omar Ramirez Luna Cc: Fernando Guzman Lugo , Felipe Contreras , Andy Shevchenko , Sapiens Rene , linux-omap , Ionut Nicu Subject: [PATCH v2 04/12] staging: tidspbridge: remove gb bitmap implementation Date: Fri, 5 Nov 2010 17:13:08 +0200 Message-Id: <1288969996-22103-5-git-send-email-ionut.nicu@mindbit.ro> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1288969996-22103-1-git-send-email-ionut.nicu@mindbit.ro> References: <1288969996-22103-1-git-send-email-ionut.nicu@mindbit.ro> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 05 Nov 2010 15:14:10 +0000 (UTC) diff --git a/drivers/staging/tidspbridge/Makefile b/drivers/staging/tidspbridge/Makefile index aaf397f..6080e7e 100644 --- a/drivers/staging/tidspbridge/Makefile +++ b/drivers/staging/tidspbridge/Makefile @@ -1,6 +1,6 @@ obj-$(CONFIG_TIDSPBRIDGE) += bridgedriver.o -libgen = gen/gb.o gen/gh.o gen/uuidutil.o +libgen = gen/gh.o gen/uuidutil.o libcore = core/chnl_sm.o core/msg_sm.o core/io_sm.o core/tiomap3430.o \ core/tiomap3430_pwr.o core/tiomap_io.o core/dsp-mmu.o \ core/ue_deh.o core/wdt.o core/dsp-clock.o core/sync.o diff --git a/drivers/staging/tidspbridge/gen/gb.c b/drivers/staging/tidspbridge/gen/gb.c deleted file mode 100644 index 3c0e04c..0000000 --- a/drivers/staging/tidspbridge/gen/gb.c +++ /dev/null @@ -1,165 +0,0 @@ -/* - * gb.c - * - * DSP-BIOS Bridge driver support functions for TI OMAP processors. - * - * Generic bitmap operations. - * - * Copyright (C) 2005-2006 Texas Instruments, Inc. - * - * This package is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* ----------------------------------- DSP/BIOS Bridge */ -#include -/* ----------------------------------- This */ -#include - -struct gb_t_map { - u32 len; - u32 wcnt; - u32 *words; -}; - -/* - * ======== gb_clear ======== - * purpose: - * Clears a bit in the bit map. - */ - -void gb_clear(struct gb_t_map *map, u32 bitn) -{ - u32 mask; - - mask = 1L << (bitn % BITS_PER_LONG); - map->words[bitn / BITS_PER_LONG] &= ~mask; -} - -/* - * ======== gb_create ======== - * purpose: - * Creates a bit map. - */ - -struct gb_t_map *gb_create(u32 len) -{ - struct gb_t_map *map; - u32 i; - map = kzalloc(sizeof(struct gb_t_map), GFP_KERNEL); - if (map != NULL) { - map->len = len; - map->wcnt = len / BITS_PER_LONG + 1; - map->words = kzalloc(map->wcnt * sizeof(u32), GFP_KERNEL); - if (map->words != NULL) { - for (i = 0; i < map->wcnt; i++) - map->words[i] = 0L; - - } else { - kfree(map); - map = NULL; - } - } - - return map; -} - -/* - * ======== gb_delete ======== - * purpose: - * Frees a bit map. - */ - -void gb_delete(struct gb_t_map *map) -{ - kfree(map->words); - kfree(map); -} - -/* - * ======== gb_findandset ======== - * purpose: - * Finds a free bit and sets it. - */ -u32 gb_findandset(struct gb_t_map *map) -{ - u32 bitn; - - bitn = gb_minclear(map); - - if (bitn != GB_NOBITS) - gb_set(map, bitn); - - return bitn; -} - -/* - * ======== gb_minclear ======== - * purpose: - * returns the location of the first unset bit in the bit map. - */ -u32 gb_minclear(struct gb_t_map *map) -{ - u32 bit_location = 0; - u32 bit_acc = 0; - u32 i; - u32 bit; - u32 *word; - - for (word = map->words, i = 0; i < map->wcnt; word++, i++) { - if (~*word) { - for (bit = 0; bit < BITS_PER_LONG; bit++, bit_acc++) { - if (bit_acc == map->len) - return GB_NOBITS; - - if (~*word & (1L << bit)) { - bit_location = i * BITS_PER_LONG + bit; - return bit_location; - } - - } - } else { - bit_acc += BITS_PER_LONG; - } - } - - return GB_NOBITS; -} - -/* - * ======== gb_set ======== - * purpose: - * Sets a bit in the bit map. - */ - -void gb_set(struct gb_t_map *map, u32 bitn) -{ - u32 mask; - - mask = 1L << (bitn % BITS_PER_LONG); - map->words[bitn / BITS_PER_LONG] |= mask; -} - -/* - * ======== gb_test ======== - * purpose: - * Returns true if the bit is set in the specified location. - */ - -bool gb_test(struct gb_t_map *map, u32 bitn) -{ - bool state; - u32 mask; - u32 word; - - mask = 1L << (bitn % BITS_PER_LONG); - word = map->words[bitn / BITS_PER_LONG]; - state = word & mask ? true : false; - - return state; -} diff --git a/drivers/staging/tidspbridge/include/dspbridge/gb.h b/drivers/staging/tidspbridge/include/dspbridge/gb.h deleted file mode 100644 index fda783a..0000000 --- a/drivers/staging/tidspbridge/include/dspbridge/gb.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * gb.h - * - * DSP-BIOS Bridge driver support functions for TI OMAP processors. - * - * Generic bitmap manager. - * - * Copyright (C) 2005-2006 Texas Instruments, Inc. - * - * This package is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifndef GB_ -#define GB_ - -#define GB_NOBITS (~0) -#include - -struct gb_t_map; - -/* - * ======== gb_clear ======== - * Clear the bit in position bitn in the bitmap map. Bit positions are - * zero based. - */ - -extern void gb_clear(struct gb_t_map *map, u32 bitn); - -/* - * ======== gb_create ======== - * Create a bit map with len bits. Initially all bits are cleared. - */ - -extern struct gb_t_map *gb_create(u32 len); - -/* - * ======== gb_delete ======== - * Delete previously created bit map - */ - -extern void gb_delete(struct gb_t_map *map); - -/* - * ======== gb_findandset ======== - * Finds a clear bit, sets it, and returns the position - */ - -extern u32 gb_findandset(struct gb_t_map *map); - -/* - * ======== gb_minclear ======== - * gb_minclear returns the minimum clear bit position. If no bit is - * clear, gb_minclear returns -1. - */ -extern u32 gb_minclear(struct gb_t_map *map); - -/* - * ======== gb_set ======== - * Set the bit in position bitn in the bitmap map. Bit positions are - * zero based. - */ - -extern void gb_set(struct gb_t_map *map, u32 bitn); - -/* - * ======== gb_test ======== - * Returns TRUE if the bit in position bitn is set in map; otherwise - * gb_test returns FALSE. Bit positions are zero based. - */ - -extern bool gb_test(struct gb_t_map *map, u32 bitn); - -#endif /*GB_ */