MCPcopy Create free account
hub / github.com/F-Stack/f-stack / platform_start_ap

Function platform_start_ap

freebsd/mips/cavium/octeon_mp.c:130–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130int
131platform_start_ap(int cpuid)
132{
133 uint64_t cores_in_reset;
134
135 /*
136 * Release the core if it is in reset, and let it rev up a bit.
137 * The real synchronization happens below via octeon_ap_boot.
138 */
139 cores_in_reset = cvmx_read_csr(CVMX_CIU_PP_RST);
140 if (cores_in_reset & (1ULL << cpuid)) {
141 if (bootverbose)
142 printf ("AP #%d still in reset\n", cpuid);
143 cores_in_reset &= ~(1ULL << cpuid);
144 cvmx_write_csr(CVMX_CIU_PP_RST, (uint64_t)(cores_in_reset));
145 DELAY(2000); /* Give it a moment to start */
146 }
147
148 if (atomic_cmpset_32(&octeon_ap_boot, ~0, cpuid) == 0)
149 return (-1);
150 for (;;) {
151 DELAY(1000);
152 if (atomic_cmpset_32(&octeon_ap_boot, 0, ~0) != 0)
153 return (0);
154 printf("Waiting for cpu%d to start\n", cpuid);
155 }
156}

Callers

nothing calls this directly

Calls 5

cvmx_read_csrFunction · 0.85
cvmx_write_csrFunction · 0.85
printfFunction · 0.50
DELAYFunction · 0.50
atomic_cmpset_32Function · 0.50

Tested by

no test coverage detected