+static const struct kalloc_zone_config {
+ bool kzc_caching;
+ int kzc_size;
+ const char *kzc_name;
+} k_zone_config[] = {
+#define KZC_ENTRY(SIZE, caching) { .kzc_caching = (caching), .kzc_size = (SIZE), .kzc_name = "kalloc." #SIZE }
+
+#if CONFIG_EMBEDDED
+
+#if KALLOC_MINSIZE == 16 && KALLOC_LOG2_MINALIGN == 4
+ /* Zone config for embedded 64-bit platforms */
+ KZC_ENTRY(16, true),
+ KZC_ENTRY(32, true),
+ KZC_ENTRY(48, true),
+ KZC_ENTRY(64, true),
+ KZC_ENTRY(80, true),
+ KZC_ENTRY(96, true),
+ KZC_ENTRY(128, true),
+ KZC_ENTRY(160, true),
+ KZC_ENTRY(192, true),
+ KZC_ENTRY(224, true),
+ KZC_ENTRY(256, true),
+ KZC_ENTRY(288, true),
+ KZC_ENTRY(368, true),
+ KZC_ENTRY(400, true),
+ KZC_ENTRY(512, true),
+ KZC_ENTRY(576, false),
+ KZC_ENTRY(768, false),
+ KZC_ENTRY(1024, true),
+ KZC_ENTRY(1152, false),
+ KZC_ENTRY(1280, false),
+ KZC_ENTRY(1664, false),
+ KZC_ENTRY(2048, false),
+ KZC_ENTRY(4096, false),
+ KZC_ENTRY(6144, false),
+ KZC_ENTRY(8192, false),
+ KZC_ENTRY(16384, false),
+ KZC_ENTRY(32768, false),
+
+#elif KALLOC_MINSIZE == 8 && KALLOC_LOG2_MINALIGN == 3
+ /* Zone config for embedded 32-bit platforms */
+ KZC_ENTRY(8, true),
+ KZC_ENTRY(16, true),
+ KZC_ENTRY(24, true),
+ KZC_ENTRY(32, true),
+ KZC_ENTRY(40, true),
+ KZC_ENTRY(48, true),
+ KZC_ENTRY(64, true),
+ KZC_ENTRY(72, true),
+ KZC_ENTRY(88, true),
+ KZC_ENTRY(112, true),
+ KZC_ENTRY(128, true),
+ KZC_ENTRY(192, true),
+ KZC_ENTRY(256, true),
+ KZC_ENTRY(288, true),
+ KZC_ENTRY(384, true),
+ KZC_ENTRY(440, true),
+ KZC_ENTRY(512, true),
+ KZC_ENTRY(576, false),
+ KZC_ENTRY(768, false),
+ KZC_ENTRY(1024, true),
+ KZC_ENTRY(1152, false),
+ KZC_ENTRY(1280, false),
+ KZC_ENTRY(1536, false),
+ KZC_ENTRY(2048, false),
+ KZC_ENTRY(2128, false),
+ KZC_ENTRY(3072, false),
+ KZC_ENTRY(4096, false),
+ KZC_ENTRY(6144, false),
+ KZC_ENTRY(8192, false),
+ /* To limit internal fragmentation, only add the following zones if the
+ * page size is greater than 4K.
+ * Note that we use ARM_PGBYTES here (instead of one of the VM macros)
+ * since it's guaranteed to be a compile time constant.
+ */
+#if ARM_PGBYTES > 4096
+ KZC_ENTRY(16384, false),
+ KZC_ENTRY(32768, false),
+#endif /* ARM_PGBYTES > 4096 */
+
+#else
+#error missing or invalid zone size parameters for kalloc
+#endif
+
+#else /* CONFIG_EMBEDDED */
+
+ /* Zone config for macOS 64-bit platforms */
+ KZC_ENTRY(16, true),
+ KZC_ENTRY(32, true),
+ KZC_ENTRY(48, true),
+ KZC_ENTRY(64, true),
+ KZC_ENTRY(80, true),
+ KZC_ENTRY(96, true),
+ KZC_ENTRY(128, true),
+ KZC_ENTRY(160, true),
+ KZC_ENTRY(192, true),
+ KZC_ENTRY(224, true),
+ KZC_ENTRY(256, true),
+ KZC_ENTRY(288, true),
+ KZC_ENTRY(368, true),
+ KZC_ENTRY(400, true),
+ KZC_ENTRY(512, true),
+ KZC_ENTRY(576, true),
+ KZC_ENTRY(768, true),
+ KZC_ENTRY(1024, true),
+ KZC_ENTRY(1152, false),
+ KZC_ENTRY(1280, false),
+ KZC_ENTRY(1664, false),
+ KZC_ENTRY(2048, true),
+ KZC_ENTRY(4096, true),
+ KZC_ENTRY(6144, false),
+ KZC_ENTRY(8192, true),
+ KZC_ENTRY(12288, false),
+ KZC_ENTRY(16384, false)
+
+#endif /* CONFIG_EMBEDDED */
+
+#undef KZC_ENTRY