[OpenBIOS] [PATCH 2/4] ppc: add new context handler
Programmingkid
programmingkidx at gmail.com
Sun May 1 20:29:29 CEST 2016
On May 1, 2016, at 6:23 AM, Mark Cave-Ayland wrote:
>
> +/* Switch to another context. */
> +struct context *switch_to(struct context *ctx)
> +{
> + volatile struct context *save;
> + struct context *ret;
> + unsigned int lr;
> +
> + debug("switching to new context:\n");
> + save = __context;
> + __context = ctx;
> +
> + asm __volatile__ ("mflr %0\n\t" : "=r" (lr) : : );
This line breaks compatibility with gcc 4.2.3. A simple fix is this:
asm __volatile__ ("mflr %0\n\t" : "=r" (lr));
and this
> + asm __volatile__ ("mtlr %0\n\t" : : "r" (lr) : );
asm __volatile__ ("mtlr %0\n\t" : : "r" (lr));
More information about the OpenBIOS
mailing list