Skip to contentSkip to conversation

I have a problem about changing a bundle, help!

DISCUSSION Lai Jiangshan 1 participant 1 message Dec 21, 2007

lore
Share & tools
lore
#0 lore raw

Hello!

Are the following statements safe? Is there any coherence problem?
And why?

	/* change the instruction */
	memcpy(ins_addr, ins_buf, sizeof(struct ia64_bundle));

flush_icache_range(ins_addr, ins_addr + sizeof(struct ia64_bundle));

I have make sure that just one thread changes the instruction(bundle),
but maybe a lot of threads execute the instruction in the same time.

Is any thread executes an error instruction(maybe an error bundle
combined with old bundle and new bundle, or other) in some condition?

If the statements are unsafe, how can i change a bundle safely?

Best Regards!
Lai Jiangshan