From owner-freebsd-current@FreeBSD.ORG Fri Dec 9 00:37:00 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA0CE1065670; Fri, 9 Dec 2011 00:37:00 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id F14E58FC08; Fri, 9 Dec 2011 00:36:59 +0000 (UTC) Received: by ggnp1 with SMTP id p1so3669628ggn.13 for ; Thu, 08 Dec 2011 16:36:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=Poo/dpGbokGuY7IaQqIis95T+lisaPQdOGzdw78OGvE=; b=wSxSN4TRaU5RJ0q+6Hr4vZeDdlWy8uIM/YuHo8OrqmaDaHI6h8EG2j3QyZEzjphm+D YFHUeF3qImM/ceqI880oqKpScvj84MXs6UG3l8zsJoG/dJBRFeG7YWaLXFQx58xPc9iS RG/M++R3kc7yv9QjwT2wpzV4+l8vluN76rXAw= MIME-Version: 1.0 Received: by 10.182.37.71 with SMTP id w7mr9obj.41.1323391019048; Thu, 08 Dec 2011 16:36:59 -0800 (PST) Received: by 10.182.74.198 with HTTP; Thu, 8 Dec 2011 16:36:58 -0800 (PST) Date: Thu, 8 Dec 2011 16:36:58 -0800 Message-ID: From: Matthew Fleming To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Mailman-Approved-At: Fri, 09 Dec 2011 00:42:36 +0000 Cc: jfv@freebsd.org, Zack Kirsch Subject: Adding bool, true, and false to the kernel X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2011 00:37:00 -0000 Hello -current! Recently on -arch@, we discussed adding the C99 keywords bool, true, and false to the kernel. I now have patches to do this as well as fix up some build issues. The original thread was here: http://lists.freebsd.org/pipermail/freebsd-arch/2011-November/011937.html I split the patches in three: http://people.freebsd.org/~mdf/0001-e1000-ixgbe-fix-code-to-not-define-bool-true-false-w.patch fixes up the e1000 and ixgbe code. Jack, can you please let me know if there are any issues. This should work to build whether or not sys/types.h has the new defines; I am testing make universe right now. http://people.freebsd.org/~mdf/0002-Fix-code-to-not-define-bool-true-false-when-already-.patch fixes the other code in the sys/ directory that gives build conflicts. Since I wasn't sure of the origin of the drivers, I conservatively left all their defines alone to allow the same driver code to build on both CURRENT and 9.0. If some of the drivers are wholly-owned by FreeBSD (unlike e1000 and ixgbe) and are not expected to be built on older releases, then the use of the old defines can be removed. If anyone knows the provenance of these files, please advise. http://people.freebsd.org/~mdf/0003-Define-bool-true-and-false-in-types.h-for-_KERNEL-co.patch actually defines bool, true, and false, and adds some extra paranoia in for anyone who has hacked their local build system and project repo to include in a kernel file. I also bumped __FreeBSD_version, though this is probably not necessary since __bool_true_false_are_defined is a better check than the __FreeBSD_version. This code should be MFC-able to stable/9 after 9.0 is released. Thanks, matthew