From patchwork Mon Dec 21 10:26:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Erlbeck X-Patchwork-Id: 559477 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.osmocom.org (tmp.osmocom.org [144.76.43.76]) by ozlabs.org (Postfix) with ESMTP id E971B140313 for ; Mon, 21 Dec 2015 21:26:52 +1100 (AEDT) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id 7E101AE0B; Mon, 21 Dec 2015 10:26:50 +0000 (UTC) X-Original-To: openbsc@lists.osmocom.org Delivered-To: openbsc@lists.osmocom.org Received: from mail.sysmocom.de (mail.sysmocom.de [IPv6:2a01:4f8:191:444c::2:4]) by lists.osmocom.org (Postfix) with ESMTP id A59E5ADED for ; Mon, 21 Dec 2015 10:26:48 +0000 (UTC) Received: from sysmocom-tmp.am93.sysmocom.de (ip5b418565.dynamic.kabel-deutschland.de [91.65.133.101]) by mail.sysmocom.de (Postfix) with ESMTPSA id 4416C1E0982; Mon, 21 Dec 2015 10:26:44 +0000 (UTC) From: Jacob Erlbeck To: openbsc@lists.osmocom.org Subject: [PATCH 2/2] bitvec: Add comment about bit ordering Date: Mon, 21 Dec 2015 11:26:28 +0100 Message-Id: <1450693588-21461-2-git-send-email-jerlbeck@sysmocom.de> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1450693588-21461-1-git-send-email-jerlbeck@sysmocom.de> References: <1450693588-21461-1-git-send-email-jerlbeck@sysmocom.de> X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Development of the OpenBSC GSM base station controller List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openbsc-bounces@lists.osmocom.org Sender: "OpenBSC" The bitvec implementation expects an MSB first encoded bitstream, which is not mentioned anywhere explicitly. This commits adds a comment to the bitvec header file. Sponsored-by: On-Waves ehf --- include/osmocom/core/bitvec.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 445730e..89eb784 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -28,6 +28,14 @@ /*! \file bitvec.h * \brief Osmocom bit vector abstraction + * + * These functions assume a MSB (most significant bit) first layout of the + * bits, so that for instance the 5 bit number abcde (a is MSB) can be + * embedded into a byte sequence like in xxxxxxab cdexxxxx. The bit count + * starts with the MSB, so the bits in a byte are numbered (MSB) 01234567 (LSB). + * Note that there are other incompatible encodings, like it is used + * for the EGPRS RLC data block headers (there the bits are numbered from LSB + * to MSB). */ #include