Skip to content

Commit 35a4c67

Browse files
AdithyaBaglodyandrewboie
authored andcommitted
samples: MPU: updated the memory domain test for x86.
GH-3852 Signed-off-by: Adithya Baglody <[email protected]>
1 parent 8d910b3 commit 35a4c67

File tree

1 file changed

+15
-0
lines changed
  • samples/mpu/mem_domain_apis_test/src

1 file changed

+15
-0
lines changed

samples/mpu/mem_domain_apis_test/src/main.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,23 @@ struct k_thread app_thread_id[3];
2626
struct k_mem_domain app_domain[2];
2727

2828
/* the start address of the MPU region needs to align with its size */
29+
#ifdef CONFIG_ARM
2930
u8_t __aligned(32) app0_buf[32];
3031
u8_t __aligned(32) app1_buf[32];
32+
#else
33+
u8_t __aligned(4096) app0_buf[4096];
34+
u8_t __aligned(4096) app1_buf[4096];
35+
#endif
3136

3237
K_MEM_PARTITION_DEFINE(app0_parts0, app0_buf, sizeof(app0_buf),
3338
K_MEM_PARTITION_P_RW_U_RW);
39+
#ifdef CONFIG_X86
40+
K_MEM_PARTITION_DEFINE(app0_parts1, app1_buf, sizeof(app1_buf),
41+
K_MEM_PARTITION_P_RO_U_RO);
42+
#else
3443
K_MEM_PARTITION_DEFINE(app0_parts1, app1_buf, sizeof(app1_buf),
3544
K_MEM_PARTITION_P_RW_U_RO);
45+
#endif
3646

3747
struct k_mem_partition *app0_parts[] = {
3848
&app0_parts0,
@@ -41,8 +51,13 @@ struct k_mem_partition *app0_parts[] = {
4151

4252
K_MEM_PARTITION_DEFINE(app1_parts0, app1_buf, sizeof(app1_buf),
4353
K_MEM_PARTITION_P_RW_U_RW);
54+
#ifdef CONFIG_X86
55+
K_MEM_PARTITION_DEFINE(app1_parts1, app0_buf, sizeof(app0_buf),
56+
K_MEM_PARTITION_P_RO_U_RO);
57+
#else
4458
K_MEM_PARTITION_DEFINE(app1_parts1, app0_buf, sizeof(app0_buf),
4559
K_MEM_PARTITION_P_RW_U_RO);
60+
#endif
4661

4762
struct k_mem_partition *app1_parts[] = {
4863
&app1_parts0,

0 commit comments

Comments
 (0)