From owner-freebsd-drivers@FreeBSD.ORG Mon Oct 13 12:50:47 2014 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 164ADA07 for ; Mon, 13 Oct 2014 12:50:47 +0000 (UTC) Received: from mail-qa0-x229.google.com (mail-qa0-x229.google.com [IPv6:2607:f8b0:400d:c00::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDEC3E85 for ; Mon, 13 Oct 2014 12:50:46 +0000 (UTC) Received: by mail-qa0-f41.google.com with SMTP id n8so4406224qaq.28 for ; Mon, 13 Oct 2014 05:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=dCCOmxupvpW0whK5n+YHGnX1vZqRdqYq3d/g2VxoCJU=; b=QTKVfhJDmxCbcgfLSIMdPtUI0h36RZ7VRyF0Ld4+wgM/5qxyVHHi4oFN8fR2Mwjmm1 m47S+3uF+NEylFGAG7sLdO60H46zHgPXtGoDR+S8HF9TbPK0WY7OaMo99kgjYrpXWFGP 9LmLvuQh5RI5otxyXz7ptiwsX29K8Uvw14Yn1I4CsquJ5FUNIDkMEEuIqjN3JquJL3K6 EVIPgybIv/DoNpNo8u0jP4CbmcnUbGuS/cC05PdNtlvrznmXLSoM03xtbdg++CuqFKql GUNKLM+ecAkqIIWOBteuSzhP9PfenQYaN6hBKD7K+7mG5Hw12X61MXZIpelGG0snd51/ jeOw== MIME-Version: 1.0 X-Received: by 10.224.136.72 with SMTP id q8mr41306485qat.31.1413204645133; Mon, 13 Oct 2014 05:50:45 -0700 (PDT) Received: by 10.140.27.234 with HTTP; Mon, 13 Oct 2014 05:50:45 -0700 (PDT) Date: Mon, 13 Oct 2014 09:50:45 -0300 Message-ID: Subject: How the FreeBSD developers solve problems that are not resolved by Assembly? From: =?UTF-8?Q?fran=C3=A7ai_s?= To: freebsd-drivers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2014 12:50:47 -0000 I think that the only case where you have to resort to writing binary code manually is when the assembler cannot output the desired code for some reason. If I recall correctly, there is only one such case in the HelenOS sources: http://trac.helenos.org/browser/mainline/kernel/arch/mips32/include/debug.h?rev=mainline%2C1446.3.1 Here they manually encode the opcodes of five special debugging instructions for the MSIM MIPS simulator (these instructions are not part of the standard MIPS ISA, thus the assembler does not know them). But the developers of FreeBSD not write binary code manually. How the FreeBSD developers solve problems that are not resolved by Assembly?