arch/mips/mm/sc-mips.c

Source file repositories/reference/linux-study-clean/arch/mips/mm/sc-mips.c

File Facts

System
Linux kernel
Corpus path
arch/mips/mm/sc-mips.c
Extension
.c
Size
6308 bytes
Lines
265
Domain
Architecture Layer
Bucket
arch/mips
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

switch (mips_machtype) {
		/*
		 * According to config2 it would be 5-ways, but that is
		 * contradicted by all documentation.
		 */
		case MACH_INGENIC_JZ4770:
		case MACH_INGENIC_JZ4775:
			c->scache.ways = 4;
			break;

		/*
		 * According to config2 it would be 5-ways and 512-sets,
		 * but that is contradicted by all documentation.
		 */
		case MACH_INGENIC_X1000:
		case MACH_INGENIC_X1000E:
			c->scache.sets = 256;
			c->scache.ways = 4;
			break;
		}
	}

	c->scache.waysize = c->scache.sets * c->scache.linesz;
	c->scache.waybit = __ffs(c->scache.waysize);

	c->scache.flags &= ~MIPS_CACHE_NOT_PRESENT;

	return 1;
}

int mips_sc_init(void)
{
	int found = mips_sc_probe();
	if (found) {
		mips_sc_enable();
		mips_sc_prefetch_enable();
		bcops = &mips_sc_ops;
	}
	return found;
}

Annotation

Implementation Notes