Skip to content

Improve the process for Cortex-A9 in mbed_application #7331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions platform/mbed_application.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,33 @@

#if defined(__CORTEX_A9)

static void powerdown_gic(void);

void mbed_start_application(uintptr_t address)
{
__disable_irq();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use critical section instead please

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@c1728p9 Should be fine to be used here?

Copy link
Contributor Author

@TomoYamanaka TomoYamanaka Jul 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xc0170 @c1728p9
With respect to __disable_irq, it is used in this form at Cortex-M too. Ref
Should I change to critical section both?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I was not aware. That will need to be addressed then separately if @c1728p9 agrees

powerdown_gic();
__enable_irq();
((void(*)())address)();
}

static void powerdown_gic()
{
int i;
int j;

for (i = 0; i < 32; i++) {
GICDistributor->ICENABLER[i] = 0xFFFFFFFF;
GICDistributor->ICPENDR[i] = 0xFFFFFFFF;
if (i < 4) {
GICDistributor->CPENDSGIR[i] = 0xFFFFFFFF;
}
for (j = 0; j < 8; j++) {
GICDistributor->IPRIORITYR[i*8+j] = 0x00000000;
}
}
}

#else

static void powerdown_nvic(void);
Expand Down