Skip to content
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

Incorrect definitions in .S sources #73

Closed
michaelopdenacker opened this issue Oct 16, 2019 · 3 comments
Closed

Incorrect definitions in .S sources #73

michaelopdenacker opened this issue Oct 16, 2019 · 3 comments

Comments

@michaelopdenacker
Copy link

Looking at the definitions of "jiffies" in https://elixir.bootlin.com/linux/v5.3.5/source/arch/arc/kernel/vmlinux.lds.S#L17 , we can see some assignments improperly considered as definitions.

There is probably a need for special processing of the .S files to avoid this.

@abrodkin
Copy link

Did you mean something like that (https://elixir.bootlin.com/u-boot/latest/source/arch/arc/lib/start.S)?

__KEEPIDENTS__B(__KEEPIDENTS__C)
	/* Setup interrupt vector base that matches "__text_start" */
	sr	__KEEPIDENTS__D, [__KEEPIDENTS__E]

	; Disable/enable I-__KEEPIDENTS__F according to configuration
	__KEEPIDENTS__G	__KEEPIDENTS__H, [__KEEPIDENTS__I]
	breq	__KEEPIDENTS__J, 0, 1f		; I$ doesn't exist
	lr	r5, [ARC_AUX_IC_CTRL]
#if !CONFIG_IS_ENABLED(SYS_ICACHE_OFF)
	bclr	r5, r5, 0		; 0 - Enable, 1 is Disable
#else
	bset	r5, r5, 0		; I$ exists, but is not used
#endif
	sr	r5, [ARC_AUX_IC_CTRL]

Note all that nonsense of __KEEPIDENTS__ :)
In reality it should be like that ():

ENTRY(_start)
	/* Setup interrupt vector base that matches "__text_start" */
	sr	__ivt_start, [ARC_AUX_INTR_VEC_BASE]

	; Disable/enable I-cache according to configuration
	lr	r5, [ARC_BCR_IC_BUILD]
	breq	r5, 0, 1f		; I$ doesn't exist
	lr	r5, [ARC_AUX_IC_CTRL]
#if !CONFIG_IS_ENABLED(SYS_ICACHE_OFF)
	bclr	r5, r5, 0		; 0 - Enable, 1 is Disable
#else
	bset	r5, r5, 0		; I$ exists, but is not used
#endif
	sr	r5, [ARC_AUX_IC_CTRL]

@michaelopdenacker
Copy link
Author

Apparently closed in version 2.0

@abrodkin
Copy link

abrodkin commented Jun 2, 2020

Indeed I do see it all correct now https://elixir.bootlin.com/u-boot/latest/source/arch/arc/lib/start.S

ENTRY(_start)
	/* Setup interrupt vector base that matches "__text_start" */
	sr	__ivt_start, [ARC_AUX_INTR_VEC_BASE]

	; Disable/enable I-cache according to configuration
	lr	r5, [ARC_BCR_IC_BUILD]
	breq	r5, 0, 1f		; I$ doesn't exist
	lr	r5, [ARC_AUX_IC_CTRL]
#if !CONFIG_IS_ENABLED(SYS_ICACHE_OFF)
	bclr	r5, r5, 0		; 0 - Enable, 1 is Disable
#else
	bset	r5, r5, 0		; I$ exists, but is not used
#endif
	sr	r5, [ARC_AUX_IC_CTRL]

And thanks for all the fish! (C)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants