1 Star 0 Fork 0

OpenFDE/platform_external_minijail

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
dump_constants.cc 1.48 KB
一键复制 编辑 原始数据 按行查看 历史
Matt Delco 提交于 2020-02-12 23:05 . Avoid bextr in dump_constants
/* Copyright 2018 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
// Generate a .json file with all the architecture-specific constants.
#include <cstdint>
#include <iomanip>
#include <iostream>
#include <string>
#include "arch.h"
#include "libconstants.h"
#include "libsyscalls.h"
int main() {
// Numeric values are passed to std::cout via std::to_string() to avoid
// the use of 'bextr' asm instruction (when compiled with -march=bdver4).
std::cout << "{\n";
std::cout << " \"arch_nr\": " << std::to_string(MINIJAIL_ARCH_NR) << ",\n";
std::cout << " \"arch_name\": \"" << MINIJAIL_ARCH_NAME << "\",\n";
std::cout << " \"bits\": " << std::to_string(MINIJAIL_ARCH_BITS) << ",\n";
std::cout << " \"syscalls\": {\n";
bool first = true;
for (const struct syscall_entry* entry = syscall_table; entry->name;
++entry) {
if (first)
first = false;
else
std::cout << ",\n";
std::cout << " \"" << entry->name << "\": " << std::to_string(entry->nr);
}
std::cout << "\n },\n";
std::cout << " \"constants\": {\n";
first = true;
for (const struct constant_entry* entry = constant_table; entry->name;
++entry) {
if (first)
first = false;
else
std::cout << ",\n";
std::cout << " \"" << entry->name << "\": "
<< std::to_string(entry->value);
}
std::cout << "\n }\n";
std::cout << "}\n";
return 0;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openfde/platform_external_minijail.git
git@gitee.com:openfde/platform_external_minijail.git
openfde
platform_external_minijail
platform_external_minijail
master

搜索帮助