mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 00:47:34 +00:00
Kernel: Don't create a JsonArray when generating /proc/cpuinfo
This commit is contained in:
parent
2665cdf2a1
commit
8d0cc3adc5
1 changed files with 6 additions and 7 deletions
|
@ -4,10 +4,7 @@
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <AK/JsonArraySerializer.h>
|
|
||||||
#include <AK/JsonObject.h>
|
|
||||||
#include <AK/JsonObjectSerializer.h>
|
#include <AK/JsonObjectSerializer.h>
|
||||||
#include <AK/JsonValue.h>
|
|
||||||
#include <AK/UBSanitizer.h>
|
#include <AK/UBSanitizer.h>
|
||||||
#include <Kernel/Arch/x86/CPU.h>
|
#include <Kernel/Arch/x86/CPU.h>
|
||||||
#include <Kernel/Arch/x86/InterruptDisabler.h>
|
#include <Kernel/Arch/x86/InterruptDisabler.h>
|
||||||
|
@ -521,13 +518,15 @@ private:
|
||||||
[&](Processor& proc) {
|
[&](Processor& proc) {
|
||||||
auto& info = proc.info();
|
auto& info = proc.info();
|
||||||
auto obj = array.add_object();
|
auto obj = array.add_object();
|
||||||
JsonArray features;
|
|
||||||
for (auto& feature : info.features().split(' '))
|
|
||||||
features.append(feature);
|
|
||||||
obj.add("processor", proc.get_id());
|
obj.add("processor", proc.get_id());
|
||||||
obj.add("cpuid", info.cpuid());
|
obj.add("cpuid", info.cpuid());
|
||||||
obj.add("family", info.display_family());
|
obj.add("family", info.display_family());
|
||||||
obj.add("features", features);
|
|
||||||
|
auto features_array = obj.add_array("features");
|
||||||
|
for (auto& feature : info.features().split(' '))
|
||||||
|
features_array.add(feature);
|
||||||
|
features_array.finish();
|
||||||
|
|
||||||
obj.add("model", info.display_model());
|
obj.add("model", info.display_model());
|
||||||
obj.add("stepping", info.stepping());
|
obj.add("stepping", info.stepping());
|
||||||
obj.add("type", info.type());
|
obj.add("type", info.type());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue