8 #include <linux/kernel.h>
9 #include <linux/types.h>
10 #include <linux/string.h>
11 #include <linux/errno.h>
13 #include <linux/module.h>
99 len =
sizeof(
struct itcw);
100 len +=
sizeof(
struct tcw) + TCCB_MAX_SIZE +
102 max_tidaws *
sizeof(
struct tidaw);
105 len +=
sizeof(
struct tcw) + TCCB_MAX_SIZE +
107 intrg_max_tidaws *
sizeof(
struct tidaw);
121 cross_count = 1 + ((max_tidaws *
sizeof(
struct tidaw) - 1)
123 len += cross_count *
sizeof(
struct tidaw);
125 if (intrg_max_tidaws) {
126 cross_count = 1 + ((intrg_max_tidaws *
sizeof(
struct tidaw) - 1)
128 len += cross_count *
sizeof(
struct tidaw);
134 #define CROSS4K(x, l) (((x) & ~4095) != ((x + l) & ~4095))
137 int align,
int check_4k)
141 addr =
ALIGN(*start, align);
142 if (check_4k &&
CROSS4K(addr, len)) {
143 addr =
ALIGN(addr, 4096);
144 addr =
ALIGN(addr, align);
146 if (addr + len > end)
149 return (
void *)
addr;
193 chunk = fit_chunk(&start, end,
sizeof(
struct itcw), 1, 0);
200 cross_count = 1 + ((max_tidaws *
sizeof(
struct tidaw) - 1)
204 if (intrg_max_tidaws)
205 cross_count = 1 + ((intrg_max_tidaws *
sizeof(
struct tidaw) - 1)
209 chunk = fit_chunk(&start, end,
sizeof(
struct tcw), 64, 0);
217 chunk = fit_chunk(&start, end,
sizeof(
struct tcw), 64, 0);
225 if (max_tidaws > 0) {
226 chunk = fit_chunk(&start, end,
sizeof(
struct tidaw) *
233 if (intrg && (intrg_max_tidaws > 0)) {
234 chunk = fit_chunk(&start, end,
sizeof(
struct tidaw) *
241 chunk = fit_chunk(&start, end,
sizeof(
struct tsb), 8, 0);
248 chunk = fit_chunk(&start, end,
sizeof(
struct tsb), 8, 0);
296 flags, cd, cd_count, count);
318 struct tidaw *following;