File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 1010#include <ztest.h>
1111#include <sys/printk.h>
1212#include <pm/device_runtime.h>
13+ #include <linker/sections.h>
1314#include "abstract_driver.h"
1415
1516
@@ -130,14 +131,17 @@ static void test_null_dynamic_name(void)
130131#endif
131132}
132133
134+ __pinned_bss
133135static struct init_record {
134136 bool pre_kernel ;
135137 bool is_in_isr ;
136138 bool is_pre_kernel ;
137139} init_records [4 ];
138140
141+ __pinned_data
139142static struct init_record * rp = init_records ;
140143
144+ __pinned_func
141145static int add_init_record (bool pre_kernel )
142146{
143147 rp -> pre_kernel = pre_kernel ;
@@ -147,11 +151,13 @@ static int add_init_record(bool pre_kernel)
147151 return 0 ;
148152}
149153
154+ __pinned_func
150155static int pre1_fn (const struct device * dev )
151156{
152157 return add_init_record (true);
153158}
154159
160+ __pinned_func
155161static int pre2_fn (const struct device * dev )
156162{
157163 return add_init_record (true);
Original file line number Diff line number Diff line change 88#include <device.h>
99#include <init.h>
1010#include <ztest.h>
11+ #include <linker/sections.h>
1112
1213
1314/**
3637
3738
3839/* this is for storing sequence during initializtion */
39- int init_level_sequence [4 ] = {0 };
40- int init_priority_sequence [4 ] = {0 };
41- unsigned int seq_level_cnt ;
42- unsigned int seq_priority_cnt ;
40+ __pinned_bss int init_level_sequence [4 ] = {0 };
41+ __pinned_bss int init_priority_sequence [4 ] = {0 };
42+ __pinned_bss unsigned int seq_level_cnt ;
43+ __pinned_bss unsigned int seq_priority_cnt ;
4344
4445/* define driver type 1: for testing initialize levels and priorites */
4546typedef int (* my_api_configure_t )(const struct device * dev , int dev_config );
@@ -58,6 +59,7 @@ static const struct my_driver_api funcs_my_drivers = {
5859};
5960
6061/* driver init function of testing level */
62+ __pinned_func
6163static int my_driver_lv_1_init (const struct device * dev )
6264{
6365 init_level_sequence [seq_level_cnt ] = LEVEL_PRE_KERNEL_1 ;
@@ -66,6 +68,7 @@ static int my_driver_lv_1_init(const struct device *dev)
6668 return 0 ;
6769}
6870
71+ __pinned_func
6972static int my_driver_lv_2_init (const struct device * dev )
7073{
7174 init_level_sequence [seq_level_cnt ] = LEVEL_PRE_KERNEL_2 ;
You can’t perform that action at this time.
0 commit comments