Date: Thu, 5 Aug 1999 23:35:54 -0700 From: Arun Sharma <adsharma@home.com> To: freebsd-hackers@freebsd.org Subject: Excessive assembly code ? Message-ID: <19990805233554.A1698@home.com>
next in thread | raw e-mail | index | archive | help
Taking a quick look at /usr/src/sys/i386: find . -name *.s | xargs wc -l 44 ./svr4/svr4_locore.s 216 ./apm/apm_setup.s 24 ./linux/linux_locore.s 461 ./isa/apic_ipl.s 1057 ./isa/apic_vector.s 168 ./isa/icu_ipl.s 224 ./isa/icu_vector.s 387 ./isa/ipl.s 113 ./isa/vector.s 59 ./i386/bioscall.s 340 ./i386/exception.s 192 ./i386/globals.s 1000 ./i386/locore.s 319 ./i386/mpboot.s 555 ./i386/mplock.s 310 ./i386/simplelock.s 1636 ./i386/support.s 833 ./i386/swtch.s 190 ./i386/vm86bios.s 8128 total 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. 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 ? -Arun To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990805233554.A1698>