From owner-freebsd-arch@FreeBSD.ORG Sat May 5 15:17:53 2007 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AF63016A401 for ; Sat, 5 May 2007 15:17:53 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe09.swip.net [212.247.155.1]) by mx1.freebsd.org (Postfix) with ESMTP id 53FE713C45B for ; Sat, 5 May 2007 15:17:53 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [81.191.58.152] (account mc467741@c2i.net HELO [192.168.1.123]) by mailfe09.swip.net (CommuniGate Pro SMTP 5.1.7) with ESMTPA id 312461662 for freebsd-arch@freebsd.org; Sat, 05 May 2007 16:17:50 +0200 From: Hans Petter Selasky To: freebsd-arch@freebsd.org Date: Sat, 5 May 2007 16:17:34 +0200 User-Agent: KMail/1.9.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200705051617.34162.hselasky@c2i.net> Subject: Missing LIST_PREV() ? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 May 2007 15:17:53 -0000 Hi, Why should LISTs only be forward traversable? The following piece of code make lists backward traversable: /sys/sys/queue.h: +#define LIST_PREV(head,elm,field) \ + (((elm) == LIST_FIRST(head)) ? ((__typeof(elm))0) : \ + ((__typeof(elm))(((uint8_t *)((elm)->field.le_prev)) - \ + ((uint8_t *)&LIST_NEXT((__typeof(elm))0,field))))) Any comments? --HPS