Formatting fixes for the book

This commit is contained in:
Ben Gras
2005-08-29 16:47:18 +00:00
parent ed84c34c6b
commit 911ff6a873
25 changed files with 165 additions and 125 deletions

View File

@@ -62,9 +62,14 @@ _PROTOTYPE( void check_runqueues, (char *when) );
*/
#if (DEBUG_TIME_LOCKS || DEBUG_LOCK_CHECK)
# undef lock
# define lock(c, v) do { lockcheck; intr_disable(); locktimestart(c, v); } while(0)
# define lock(c, v) do { lockcheck; \
intr_disable(); \
locktimestart(c, v); \
} while(0)
# undef unlock
# define unlock(c) do { locktimeend(c); intr_enable(); } while(0)
# define unlock(c) do { locktimeend(c); \
intr_enable();\
} while(0)
#endif
#endif /* DEBUG_H */

View File

@@ -2,7 +2,7 @@
* Together with "mpx.s" it forms the lowest layer of the MINIX kernel.
* There is one entry point from the outside:
*
* sys_call: a system call, i.e., the kernel is trapped with an INT
* sys_call: a system call, i.e., the kernel is trapped with an INT
*
* As well as several entry points used from the interrupt and task level:
*
@@ -73,7 +73,8 @@ FORWARD _PROTOTYPE( void pick_proc, (void) );
#if (CHIP == INTEL)
#define CopyMess(s,sp,sm,dp,dm) \
cp_mess(s, (sp)->p_memmap[D].mem_phys, (vir_bytes)sm, (dp)->p_memmap[D].mem_phys, (vir_bytes)dm)
cp_mess(s, (sp)->p_memmap[D].mem_phys, \
(vir_bytes)sm, (dp)->p_memmap[D].mem_phys, (vir_bytes)dm)
#endif /* (CHIP == INTEL) */
#if (CHIP == M68000)
@@ -106,7 +107,8 @@ message *m_ptr; /* pointer to message in the caller's space */
* if the caller doesn't do receive().
*/
if (! (priv(caller_ptr)->s_trap_mask & (1 << function)) ||
(iskerneln(src_dst) && function != SENDREC && function != RECEIVE)) {
(iskerneln(src_dst) && function != SENDREC
&& function != RECEIVE)) {
kprintf("sys_call: trap %d not allowed, caller %d, src_dst %d\n",
function, proc_nr(caller_ptr), src_dst);
return(ECALLDENIED); /* trap denied by mask or kernel */

View File

@@ -145,8 +145,10 @@ PUBLIC void prot_init()
* (u32_t *) dtp->base = vir2phys(idt);
/* Build segment descriptors for tasks and interrupt handlers. */
init_codeseg(&gdt[CS_INDEX], kinfo.code_base, kinfo.code_size, INTR_PRIVILEGE);
init_dataseg(&gdt[DS_INDEX], kinfo.data_base, kinfo.data_size, INTR_PRIVILEGE);
init_codeseg(&gdt[CS_INDEX],
kinfo.code_base, kinfo.code_size, INTR_PRIVILEGE);
init_dataseg(&gdt[DS_INDEX],
kinfo.data_base, kinfo.data_size, INTR_PRIVILEGE);
init_dataseg(&gdt[ES_INDEX], 0L, 0, TASK_PRIVILEGE);
/* Build scratch descriptors for functions in klib88. */

View File

@@ -32,8 +32,8 @@
#define CS_SELECTOR 0x30 /* (CS_INDEX * DESC_SIZE) */
#define MON_CS_SELECTOR 0x38 /* (MON_CS_INDEX * DESC_SIZE) */
#define TSS_SELECTOR 0x40 /* (TSS_INDEX * DESC_SIZE) */
#define DS_286_SELECTOR 0x49 /* (DS_286_INDEX*DESC_SIZE + TASK_PRIVILEGE) */
#define ES_286_SELECTOR 0x51 /* (ES_286_INDEX*DESC_SIZE + TASK_PRIVILEGE) */
#define DS_286_SELECTOR 0x49 /* (DS_286_INDEX*DESC_SIZE+TASK_PRIVILEGE) */
#define ES_286_SELECTOR 0x51 /* (ES_286_INDEX*DESC_SIZE+TASK_PRIVILEGE) */
/* Fixed local descriptors. */
#define CS_LDT_INDEX 0 /* process CS */
@@ -113,12 +113,12 @@
#define PAGE_GRAN_SHIFT 12 /* extra shift for page granular limits */
/* Type-byte bits. */
#define DESC_386_BIT 0x08 /* 386 types are obtained by ORing with this */
#define DESC_386_BIT 0x08 /* 386 types are obtained by ORing with this */
/* LDT's and TASK_GATE's don't need it */
/* Granularity byte. */
#define GRANULAR 0x80 /* set for 4K granularilty */
#define DEFAULT 0x40 /* set for 32-bit defaults (executable seg) */
#define BIG 0x40 /* set for "BIG" (expand-down seg) */
#define AVL 0x10 /* 0 for available */
#define LIMIT_HIGH 0x0F /* mask for high bits of limit */
#define GRANULAR 0x80 /* set for 4K granularilty */
#define DEFAULT 0x40 /* set for 32-bit defaults (executable seg) */
#define BIG 0x40 /* set for "BIG" (expand-down seg) */
#define AVL 0x10 /* 0 for available */
#define LIMIT_HIGH 0x0F /* mask for high bits of limit */

View File

@@ -402,7 +402,7 @@ vir_bytes bytes; /* # of bytes to copy */
/* Copy bytes from virtual address src_addr to virtual address dst_addr.
* Virtual addresses can be in ABS, LOCAL_SEG, REMOTE_SEG, or BIOS_SEG.
*/
struct vir_addr *vir_addr[2]; /* virtual source and destination address */
struct vir_addr *vir_addr[2]; /* virtual source and destination address */
phys_bytes phys_addr[2]; /* absolute source and destination */
int seg_index;
int i;

View File

@@ -66,10 +66,10 @@ PUBLIC char *t_stack[TOT_STACK_SPACE / sizeof(char *)];
* structure 0 is shared by user processes.
*/
#define s(n) (1 << s_nr_to_id(n))
#define SRV_M (~0)
#define SYS_M (~0)
#define USR_M (s(PM_PROC_NR) | s(FS_PROC_NR) | s(RS_PROC_NR))
#define DRV_M (USR_M | s(SYSTEM) | s(CLOCK) | s(LOG_PROC_NR) | s(TTY_PROC_NR))
#define SRV_M (~0)
#define SYS_M (~0)
#define USR_M (s(PM_PROC_NR) | s(FS_PROC_NR) | s(RS_PROC_NR))
#define DRV_M (USR_M | s(SYSTEM) | s(CLOCK) | s(LOG_PROC_NR) | s(TTY_PROC_NR))
/* Define kernel calls that processes are allowed to make. This is not looking
* very nice, but we need to define the access rights on a per call basis.
@@ -89,7 +89,7 @@ PUBLIC char *t_stack[TOT_STACK_SPACE / sizeof(char *)];
/* The system image table lists all programs that are part of the boot image.
* The order of the entries here MUST agree with the order of the programs
* in the boot image and all kernel tasks must come first.
* Each entry provides the process number, flags, quantum size (qs), scheduling
* Each entry provides the process number, flags, quantum size (qs), scheduling
* queue, allowed traps, ipc mask, and a name for the process table. The
* initial program counter and stack size is also provided for kernel tasks.
*/
@@ -116,6 +116,7 @@ PUBLIC struct boot_image image[] = {
* causing a compile time error. Note that no space is actually allocated
* because 'dummy' is declared extern.
*/
extern int dummy[(NR_BOOT_PROCS==sizeof(image)/sizeof(struct boot_image))?1:-1];
extern int dummy[(NR_BOOT_PROCS==sizeof(image)/
sizeof(struct boot_image))?1:-1];
extern int dummy[(BITCHUNK_BITS > NR_BOOT_PROCS - 1) ? 1 : -1];