From owner-svn-src-all@freebsd.org Tue Oct 15 23:21:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66A48156D05; Tue, 15 Oct 2019 23:21:53 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46tBJx23KQz3yhl; Tue, 15 Oct 2019 23:21:53 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 298F826074; Tue, 15 Oct 2019 23:21:53 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9FNLrfm029861; Tue, 15 Oct 2019 23:21:53 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9FNLqQh029860; Tue, 15 Oct 2019 23:21:52 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201910152321.x9FNLqQh029860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 15 Oct 2019 23:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353600 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 353600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Oct 2019 23:21:53 -0000 Author: kp Date: Tue Oct 15 23:21:52 2019 New Revision: 353600 URL: https://svnweb.freebsd.org/changeset/base/353600 Log: Generalize ARM specific comments in devmap The comments in devmap are very ARM specific, this generalizes them for other architectures. Submitted by: Nicholas O'Brien Reviewed by: manu, philip Sponsored by: Axiado Differential Revision: https://reviews.freebsd.org/D22035 Modified: head/sys/kern/subr_devmap.c head/sys/sys/devmap.h Modified: head/sys/kern/subr_devmap.c ============================================================================== --- head/sys/kern/subr_devmap.c Tue Oct 15 21:56:19 2019 (r353599) +++ head/sys/kern/subr_devmap.c Tue Oct 15 23:21:52 2019 (r353600) @@ -46,7 +46,7 @@ static boolean_t devmap_bootstrap_done = false; * The allocated-kva (akva) devmap table and metadata. Platforms can call * devmap_add_entry() to add static device mappings to this table using * automatically allocated virtual addresses carved out of the top of kva space. - * Allocation begins immediately below the ARM_VECTORS_HIGH address. + * Allocation begins immediately below the max kernel virtual address. */ #define AKVA_DEVMAP_MAX_ENTRIES 32 static struct devmap_entry akva_devmap_entries[AKVA_DEVMAP_MAX_ENTRIES]; @@ -115,8 +115,8 @@ devmap_lastaddr() * physical address and size and a virtual address allocated from the top of * kva. This automatically registers the akva table on the first call, so all a * platform has to do is call this routine to install as many mappings as it - * needs and when initarm() calls devmap_bootstrap() it will pick up all the - * entries in the akva table automatically. + * needs and when the platform-specific init function calls devmap_bootstrap() + * it will pick up all the entries in the akva table automatically. */ void devmap_add_entry(vm_paddr_t pa, vm_size_t sz) @@ -132,13 +132,13 @@ devmap_add_entry(vm_paddr_t pa, vm_size_t sz) if (akva_devmap_idx == 0) devmap_register_table(akva_devmap_entries); + /* Allocate virtual address space from the top of kva downwards. */ +#ifdef __arm__ /* - * Allocate virtual address space from the top of kva downwards. If the - * range being mapped is aligned and sized to 1MB boundaries then also - * align the virtual address to the next-lower 1MB boundary so that we - * end up with a nice efficient section mapping. + * If the range being mapped is aligned and sized to 1MB boundaries then + * also align the virtual address to the next-lower 1MB boundary so that + * we end with a nice efficient section mapping. */ -#ifdef __arm__ if ((pa & 0x000fffff) == 0 && (sz & 0x000fffff) == 0) { akva_devmap_vaddr = trunc_1mpage(akva_devmap_vaddr - sz); } else @@ -170,7 +170,8 @@ devmap_register_table(const struct devmap_entry *table * the previously-registered table is used. This smooths transition from legacy * code that fills in a local table then calls this function passing that table, * and newer code that uses devmap_register_table() in platform-specific - * code, then lets the common initarm() call this function with a NULL pointer. + * code, then lets the common platform-specific init function call this function + * with a NULL pointer. */ void devmap_bootstrap(vm_offset_t l1pt, const struct devmap_entry *table) Modified: head/sys/sys/devmap.h ============================================================================== --- head/sys/sys/devmap.h Tue Oct 15 21:56:19 2019 (r353599) +++ head/sys/sys/devmap.h Tue Oct 15 23:21:52 2019 (r353600) @@ -63,16 +63,18 @@ void devmap_add_entry(vm_paddr_t pa, vm_size_t sz); /* * Register a platform-local table to be bootstrapped by the generic - * initarm() in arm/machdep.c. This is used by newer code that allocates and - * fills in its own local table but does not have its own initarm() routine. + * platform-specific init function in /machdep.c. This is used by newer + * code that allocates and fills in its own local table but does not have its + * own platform-specific init routine. */ void devmap_register_table(const struct devmap_entry * _table); /* * Establish mappings for all the entries in the table. This is called - * automatically from the common initarm() in arm/machdep.c, and also from the - * custom initarm() routines in older code. If the table pointer is NULL, this - * will use the table installed previously by devmap_register_table(). + * automatically from the common platform-specific init function in + * /machdep.c, and also from the custom platform-specific init routines + * in older code. If the table pointer is NULL, this will use the table + * installed previously by devmap_register_table(). */ void devmap_bootstrap(vm_offset_t _l1pt, const struct devmap_entry *_table);