Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/md/md.c
Show First 20 Lines • Show All 124 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
#if defined(MD_ROOT) | #if defined(MD_ROOT) | ||||
/* | /* | ||||
* Preloaded image gets put here. | * Preloaded image gets put here. | ||||
*/ | */ | ||||
#if defined(MD_ROOT_SIZE) | #if defined(MD_ROOT_SIZE) | ||||
/* | /* | ||||
* We put the mfs_root symbol into the oldmfs section of the kernel object file. | |||||
* Applications that patch the object with the image can determine | * Applications that patch the object with the image can determine | ||||
* the size looking at the start and end markers (strings), | * the size looking at the oldmfs section size within the kernel. | ||||
* so we want them contiguous. | |||||
*/ | */ | ||||
static struct { | u_char mfs_root[MD_ROOT_SIZE*1024] __attribute__ ((section ("oldmfs"))); | ||||
u_char start[MD_ROOT_SIZE*1024]; | const int mfs_root_size = sizeof(mfs_root); | ||||
u_char end[128]; | |||||
} mfs_root = { | |||||
.start = "MFS Filesystem goes here", | |||||
.end = "MFS Filesystem had better STOP here", | |||||
}; | |||||
const int mfs_root_size = sizeof(mfs_root.start); | |||||
#else | #else | ||||
extern volatile u_char __weak_symbol mfs_root; | extern volatile u_char __weak_symbol mfs_root; | ||||
extern volatile u_char __weak_symbol mfs_root_end; | extern volatile u_char __weak_symbol mfs_root_end; | ||||
__GLOBL(mfs_root); | __GLOBL(mfs_root); | ||||
__GLOBL(mfs_root_end); | __GLOBL(mfs_root_end); | ||||
#define mfs_root_size ((uintptr_t)(&mfs_root_end - &mfs_root)) | #define mfs_root_size ((uintptr_t)(&mfs_root_end - &mfs_root)) | ||||
#endif | #endif | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 1,728 Lines • Show Last 20 Lines |