github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/mobile/app/android_arm.c (about)

     1  // Copyright 2014 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // +build android,arm
     6  
     7  #include <android/log.h>
     8  #include <stdint.h>
     9  #include <string.h>
    10  #include "_cgo_export.h"
    11  
    12  #define AT_PLATFORM  15
    13  #define AT_HWCAP     16
    14  #define HWCAP_VFP    (1 << 6)
    15  #define HWCAP_VFPv3  (1 << 13)
    16  
    17  void build_auxv(uint32_t *auxv, size_t len) {
    18  	// Minimum auxv required by runtime/os_linux_arm.go.
    19  	int i;
    20  	if (len < 5) {
    21  		__android_log_print(ANDROID_LOG_FATAL, "Go", "auxv len %d too small", len);
    22  	}
    23  	auxv[0] = AT_PLATFORM;
    24  	*(char**)&auxv[1] = strdup("v7l");
    25  
    26  	auxv[2] = AT_HWCAP;
    27  	auxv[3] = HWCAP_VFP | HWCAP_VFPv3;
    28  	for (i = 4; i < len; i++) {
    29  		auxv[i] = 0;
    30  	}
    31  }