arch/csky/kernel/module.c

Source file repositories/reference/linux-study-clean/arch/csky/kernel/module.c

File Facts

System
Linux kernel
Corpus path
arch/csky/kernel/module.c
Extension
.c
Size
2595 bytes
Lines
98
Domain
Architecture Layer
Bucket
arch/csky
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 (ELF32_R_TYPE(rel[i].r_info)) {
		case R_CSKY_32:
			/* We add the value into the location given */
			*location = rel[i].r_addend + sym->st_value;
			break;
		case R_CSKY_PC32:
			/* Add the value, subtract its position */
			*location = rel[i].r_addend + sym->st_value
							- (uint32_t)location;
			break;
		case R_CSKY_PCRELJSR_IMM11BY2:
			break;
		case R_CSKY_PCRELJSR_IMM26BY2:
			jsri_2_lrw_jsr(location);
			break;
		case R_CSKY_ADDR_HI16:
			temp = ((short  *)location) + 1;
			*temp = (short)
				((rel[i].r_addend + sym->st_value) >> 16);
			break;
		case R_CSKY_ADDR_LO16:
			temp = ((short  *)location) + 1;
			*temp = (short)
				((rel[i].r_addend + sym->st_value) & 0xffff);
			break;
		default:
			pr_err("module %s: Unknown relocation: %u\n",
				me->name, ELF32_R_TYPE(rel[i].r_info));
			return -ENOEXEC;
		}
	}
	return 0;
}

Annotation

Implementation Notes