cpu.h (37b087a645354d60200c774d51b305b268e41c83) cpu.h (0384fff8c5b098545c3db311b0e0aa1ec4c9ae7e)
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * William Jolitz.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 32 unchanged lines hidden (view full) ---

41#define _MACHINE_CPU_H_
42
43/*
44 * Definitions unique to i386 cpu support.
45 */
46#include <machine/psl.h>
47#include <machine/frame.h>
48#include <machine/segments.h>
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * William Jolitz.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 32 unchanged lines hidden (view full) ---

41#define _MACHINE_CPU_H_
42
43/*
44 * Definitions unique to i386 cpu support.
45 */
46#include <machine/psl.h>
47#include <machine/frame.h>
48#include <machine/segments.h>
49#include <machine/globals.h>
49
50/*
51 * definitions of cpu-dependent requirements
52 * referenced in generic code
53 */
54#undef COPY_SIGCODE /* don't copy sigcode above user stack in exec */
55
56#define cpu_exec(p) /* nothing */

--- 24 unchanged lines hidden (view full) ---

81/*
82 * Preempt the current process if in interrupt from user mode,
83 * or after the current trap/syscall if in system mode.
84 *
85 * XXX: if astpending is later changed to an |= here due to more flags being
86 * added, we will have an atomicy problem. The type of atomicy we need is
87 * a non-locked orl.
88 */
50
51/*
52 * definitions of cpu-dependent requirements
53 * referenced in generic code
54 */
55#undef COPY_SIGCODE /* don't copy sigcode above user stack in exec */
56
57#define cpu_exec(p) /* nothing */

--- 24 unchanged lines hidden (view full) ---

82/*
83 * Preempt the current process if in interrupt from user mode,
84 * or after the current trap/syscall if in system mode.
85 *
86 * XXX: if astpending is later changed to an |= here due to more flags being
87 * added, we will have an atomicy problem. The type of atomicy we need is
88 * a non-locked orl.
89 */
89#define need_resched() do { astpending = AST_RESCHED|AST_PENDING; } while (0)
90#define need_resched() do { \
91 PCPU_SET(astpending, AST_RESCHED|AST_PENDING); \
92} while (0)
90#define resched_wanted() (astpending & AST_RESCHED)
91
92/*
93 * Arrange to handle pending profiling ticks before returning to user mode.
94 *
95 * XXX this is now poorly named and implemented. It used to handle only a
96 * single tick and the P_OWEUPC flag served as a counter. Now there is a
97 * counter in the proc table and flag isn't really necessary.

--- 6 unchanged lines hidden (view full) ---

104 * process as soon as possible.
105 *
106 * XXX: aston() really needs to be an atomic (not locked, but an orl),
107 * in case need_resched() is set by an interrupt. But with astpending a
108 * per-cpu variable this is not trivial to do efficiently. For now we blow
109 * it off (asynchronous need_resched() conflicts are not critical).
110 */
111#define signotify(p) aston()
93#define resched_wanted() (astpending & AST_RESCHED)
94
95/*
96 * Arrange to handle pending profiling ticks before returning to user mode.
97 *
98 * XXX this is now poorly named and implemented. It used to handle only a
99 * single tick and the P_OWEUPC flag served as a counter. Now there is a
100 * counter in the proc table and flag isn't really necessary.

--- 6 unchanged lines hidden (view full) ---

107 * process as soon as possible.
108 *
109 * XXX: aston() really needs to be an atomic (not locked, but an orl),
110 * in case need_resched() is set by an interrupt. But with astpending a
111 * per-cpu variable this is not trivial to do efficiently. For now we blow
112 * it off (asynchronous need_resched() conflicts are not critical).
113 */
114#define signotify(p) aston()
112
113#define aston() do { astpending |= AST_PENDING; } while (0)
115#define aston() do { \
116 PCPU_SET(astpending, astpending | AST_PENDING); \
117} while (0)
114#define astoff()
115
116/*
117 * CTL_MACHDEP definitions.
118 */
119#define CPU_CONSDEV 1 /* dev_t: console terminal device */
120#define CPU_ADJKERNTZ 2 /* int: timezone offset (seconds) */
121#define CPU_DISRTCSET 3 /* int: disable resettodr() call */

--- 8 unchanged lines hidden (view full) ---

130 { "disable_rtc_set", CTLTYPE_INT }, \
131 { "bootinfo", CTLTYPE_STRUCT }, \
132 { "wall_cmos_clock", CTLTYPE_INT }, \
133}
134
135#ifdef _KERNEL
136extern char btext[];
137extern char etext[];
118#define astoff()
119
120/*
121 * CTL_MACHDEP definitions.
122 */
123#define CPU_CONSDEV 1 /* dev_t: console terminal device */
124#define CPU_ADJKERNTZ 2 /* int: timezone offset (seconds) */
125#define CPU_DISRTCSET 3 /* int: disable resettodr() call */

--- 8 unchanged lines hidden (view full) ---

134 { "disable_rtc_set", CTLTYPE_INT }, \
135 { "bootinfo", CTLTYPE_STRUCT }, \
136 { "wall_cmos_clock", CTLTYPE_INT }, \
137}
138
139#ifdef _KERNEL
140extern char btext[];
141extern char etext[];
142#ifndef intr_nesting_level
138extern u_char intr_nesting_level;
143extern u_char intr_nesting_level;
144#endif
139
140void fork_trampoline __P((void));
141void fork_return __P((struct proc *, struct trapframe));
142#endif
143
144#endif /* !_MACHINE_CPU_H_ */
145
146void fork_trampoline __P((void));
147void fork_return __P((struct proc *, struct trapframe));
148#endif
149
150#endif /* !_MACHINE_CPU_H_ */