From owner-freebsd-hackers Thu Aug 5 22:56:46 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from janus.syracuse.net (janus.syracuse.net [205.232.47.15]) by hub.freebsd.org (Postfix) with ESMTP id 6585B14FBB for ; Thu, 5 Aug 1999 22:56:41 -0700 (PDT) (envelope-from green@FreeBSD.org) Received: from localhost (green@localhost) by janus.syracuse.net (8.9.3/8.8.7) with ESMTP id BAA90013; Fri, 6 Aug 1999 01:56:32 -0400 (EDT) X-Authentication-Warning: janus.syracuse.net: green owned process doing -bs Date: Fri, 6 Aug 1999 01:56:32 -0400 (EDT) From: "Brian F. Feldman" X-Sender: green@janus.syracuse.net To: Arun Sharma Cc: freebsd-hackers@FreeBSD.org Subject: Re: Excessive assembly code ? In-Reply-To: <19990805233554.A1698@home.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 5 Aug 1999, Arun Sharma wrote: > I wonder if so much assembly code is really necessary for FreeBSD. One > argument for minimal usage of assembly code is that it is easier to code > non trivial algorithms in C. No, so much isn't really necessary. > > One such example is the scheduler. Since the decision about which process > is going to run next is decided in assembly code, it is restricted to a > relatively dumb algorithm of scanning the runqs and picking one. If the > mechanism (i.e nuts and bolts of the context switch) is coded in assembly > and the policy (which process to pick next) is done in C, the code would > be much more maintainable, IMO. > > How do people feel about it here ? I feel that very low-level things need to be implemented in terms of in-line assembly in machdep files or headers, like inb/outb/etc. Coding much in assembly should be a very last resort. There really should not be any of those assembly files. They should all be C with whatever inline assembler is necessary or a call to the machine-dependent routines. Various things like, say, i586_bzero are assembly for good reason, but shouldn't be in assembly file format, IMHO. The scheduling code should DEFINITELY not be in assembly, but only have machine dependent calls for specific actions that need to be done manually in assembly. > > -Arun > Brian Fundakowski Feldman _ __ ___ ____ ___ ___ ___ green@FreeBSD.org _ __ ___ | _ ) __| \ FreeBSD: The Power to Serve! _ __ | _ \._ \ |) | http://www.FreeBSD.org/ _ |___/___/___/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message