| /* 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 "libconstants.h" |
| // 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 << " \"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"; |
| for (const struct syscall_entry* entry = syscall_table; entry->name; |
| std::cout << " \"" << entry->name << "\": " << std::to_string(entry->nr); |
| std::cout << " \"constants\": {\n"; |
| for (const struct constant_entry* entry = constant_table; entry->name; |
| std::cout << " \"" << entry->name << "\": " |
| << std::to_string(entry->value); |