From owner-svn-src-head@freebsd.org Fri Oct 11 14:15:51 2019 Return-Path: Delivered-To: svn-src-head@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 951DF150B49; Fri, 11 Oct 2019 14:15:51 +0000 (UTC) (envelope-from jhibbits@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 46qVNl3Q1Hz4cJr; Fri, 11 Oct 2019 14:15:51 +0000 (UTC) (envelope-from jhibbits@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 554E91B5A0; Fri, 11 Oct 2019 14:15:51 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9BEFpLM097203; Fri, 11 Oct 2019 14:15:51 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9BEFoMV097201; Fri, 11 Oct 2019 14:15:50 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201910111415.x9BEFoMV097201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 11 Oct 2019 14:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353436 - in head: sys/arm64/include usr.bin/gcore X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head: sys/arm64/include usr.bin/gcore X-SVN-Commit-Revision: 353436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Oct 2019 14:15:51 -0000 Author: jhibbits Date: Fri Oct 11 14:15:50 2019 New Revision: 353436 URL: https://svnweb.freebsd.org/changeset/base/353436 Log: gcore: Add aarch64 32-bit core support Summary: Add trivial 32-bit arm cores on aarch64 support for gcore. This doesn't handle fpregs. Reviewed by: #arm, andrew Sponsored by: Juniper Networks, Inc Differential Revision: https://reviews.freebsd.org/D21947 Modified: head/sys/arm64/include/elf.h head/usr.bin/gcore/Makefile head/usr.bin/gcore/elf32core.c Modified: head/sys/arm64/include/elf.h ============================================================================== --- head/sys/arm64/include/elf.h Fri Oct 11 13:34:09 2019 (r353435) +++ head/sys/arm64/include/elf.h Fri Oct 11 14:15:50 2019 (r353436) @@ -64,7 +64,11 @@ typedef struct { /* Auxiliary vector entry on initial __ElfType(Auxinfo); +#ifdef _MACHINE_ELF_WANT_32BIT +#define ELF_ARCH EM_ARM +#else #define ELF_ARCH EM_AARCH64 +#endif #define ELF_MACHINE_OK(x) ((x) == (ELF_ARCH)) Modified: head/usr.bin/gcore/Makefile ============================================================================== --- head/usr.bin/gcore/Makefile Fri Oct 11 13:34:09 2019 (r353435) +++ head/usr.bin/gcore/Makefile Fri Oct 11 14:15:50 2019 (r353436) @@ -5,7 +5,7 @@ PROG= gcore SRCS= elfcore.c gcore.c LIBADD= sbuf util -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" SRCS+= elf32core.c .endif Modified: head/usr.bin/gcore/elf32core.c ============================================================================== --- head/usr.bin/gcore/elf32core.c Fri Oct 11 13:34:09 2019 (r353435) +++ head/usr.bin/gcore/elf32core.c Fri Oct 11 14:15:50 2019 (r353436) @@ -32,7 +32,15 @@ elf_convert_gregset(elfcore_gregset_t *rd, struct reg rd->r_eflags = rs->r_rflags; rd->r_esp = rs->r_rsp; rd->r_ss = rs->r_ss; -#else +#elif defined(__aarch64__) + int i; + + for (i = 0; i < 13; i++) + rd->r[i] = rs->x[i]; + rd->r_sp = rs->x[13]; + rd->r_lr = rs->x[14]; + rd->r_pc = rs->elr; + rd->r_cpsr = rs->spsr; #error Unsupported architecture #endif } @@ -43,6 +51,8 @@ elf_convert_fpregset(elfcore_fpregset_t *rd, struct fp #ifdef __amd64__ /* XXX this is wrong... */ memcpy(rd, rs, sizeof(*rd)); +#elif defined(__aarch64__) + /* ARM64TODO */ #else #error Unsupported architecture #endif