From owner-freebsd-current@FreeBSD.ORG Sat Dec 22 16:51:48 2007 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 4A80316A41A for ; Sat, 22 Dec 2007 16:51:48 +0000 (UTC) (envelope-from dunstan@freebsd.czest.pl) Received: from freebsd.czest.pl (freebsd.czest.pl [80.48.250.4]) by mx1.freebsd.org (Postfix) with ESMTP id DBC5613C461 for ; Sat, 22 Dec 2007 16:51:47 +0000 (UTC) (envelope-from dunstan@freebsd.czest.pl) Received: from freebsd.czest.pl (freebsd.czest.pl [80.48.250.4]) by freebsd.czest.pl (8.13.4/8.12.9) with ESMTP id lBMHf9nD030635 for ; Sat, 22 Dec 2007 17:41:09 GMT (envelope-from dunstan@freebsd.czest.pl) Received: (from dunstan@localhost) by freebsd.czest.pl (8.13.4/8.12.9/Submit) id lBMHf944030630 for freebsd-current@freebsd.org; Sat, 22 Dec 2007 17:41:09 GMT (envelope-from dunstan) Date: Sat, 22 Dec 2007 17:41:08 +0000 From: "Wojciech A. Koszek" To: freebsd-current@freebsd.org Message-ID: <20071222174108.GA27354@FreeBSD.czest.pl> Mail-Followup-To: "Wojciech A. Koszek" , freebsd-current@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-2.0.2 (freebsd.czest.pl [80.48.250.4]); Sat, 22 Dec 2007 17:41:09 +0000 (UTC) Subject: [RFC, PATCH] Getting rid of direct calls to video's methods via vidsw[] array 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: Sat, 22 Dec 2007 16:51:48 -0000 Hello, This is very similar patch to my kbdsw[] conversion patch, but directed to the video output path. In the kernel, video adapter is represented by "video_adapter" structure. Video adapter code declares itself as being the video adapter driver with VIDEO_DRIVER() macro. It makes it appear in vidsw[] array. For now, we indexed this array directly. I want this behaviour to be improved. My proposal is here: http://people.freebsd.org/~wkoszek/patches/tty/vidcleanup.patch With this patch, instead of calling: (*vidsw[adp->va_index]->)(args...) You call: vidd_(agp, args..); Just like in kbdsw[] patch, I defined missing macros with their respective convention. My intention was to provide full set of macros for all "struct video_switch" function pointers. Comments and suggestions are welcome, Thanks, -- Wojciech A. Koszek wkoszek@FreeBSD.org http://FreeBSD.czest.pl/dunstan/