Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 168263
b: refs/heads/master
c: 4c3da22
h: refs/heads/master
i:
  168261: 326d61a
  168259: bd14d52
  168255: c7a8ffa
v: v3
  • Loading branch information
Eric W. Biederman authored and James Morris committed Nov 4, 2009
1 parent 5e9fa6b commit cfae1b1
Show file tree
Hide file tree
Showing 25 changed files with 201 additions and 194 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 608221fdf9a2170962295dcfbea53dc5c50d1a74
refs/heads/master: 4c3da2209b1261af9a948b7509a38904c8eee554
3 changes: 0 additions & 3 deletions trunk/arch/m32r/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ config M32R
select HAVE_IDE
select HAVE_OPROFILE
select INIT_ALL_POSSIBLE
select HAVE_KERNEL_GZIP
select HAVE_KERNEL_BZIP2
select HAVE_KERNEL_LZMA

config SBUS
bool
Expand Down
16 changes: 3 additions & 13 deletions trunk/arch/m32r/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# create a compressed vmlinux image from the original vmlinux
#

targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \
vmlinux.bin.lzma head.o misc.o piggy.o vmlinux.lds
targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o \
piggy.o vmlinux.lds

OBJECTS = $(obj)/head.o $(obj)/misc.o

Expand All @@ -27,12 +27,6 @@ $(obj)/vmlinux.bin: vmlinux FORCE
$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
$(call if_changed,gzip)

$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
$(call if_changed,bzip2)

$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
$(call if_changed,lzma)

CFLAGS_misc.o += -fpic

ifdef CONFIG_MMU
Expand All @@ -43,9 +37,5 @@ endif

OBJCOPYFLAGS += -R .empty_zero_page

suffix_$(CONFIG_KERNEL_GZIP) = gz
suffix_$(CONFIG_KERNEL_BZIP2) = bz2
suffix_$(CONFIG_KERNEL_LZMA) = lzma

$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix_y) FORCE
$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
$(call if_changed,ld)
143 changes: 117 additions & 26 deletions trunk/arch/m32r/boot/compressed/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,140 @@
* Adapted for SH by Stuart Menefy, Aug 1999
*
* 2003-02-12: Support M32R by Takeo Takahashi
* This is based on arch/sh/boot/compressed/misc.c.
*/

#include <linux/string.h>

/*
* gzip declarations
*/

#define OF(args) args
#define STATIC static

#undef memset
#undef memcpy
#define memzero(s, n) memset ((s), 0, (n))

typedef unsigned char uch;
typedef unsigned short ush;
typedef unsigned long ulg;

#define WSIZE 0x8000 /* Window size must be at least 32k, */
/* and a power of two */

static uch *inbuf; /* input buffer */
static uch window[WSIZE]; /* Sliding window buffer */

static unsigned insize = 0; /* valid bytes in inbuf */
static unsigned inptr = 0; /* index of next byte to be processed in inbuf */
static unsigned outcnt = 0; /* bytes in output buffer */

/* gzip flag byte */
#define ASCII_FLAG 0x01 /* bit 0 set: file probably ASCII text */
#define CONTINUATION 0x02 /* bit 1 set: continuation of multi-part gzip file */
#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
#define ORIG_NAME 0x08 /* bit 3 set: original file name present */
#define COMMENT 0x10 /* bit 4 set: file comment present */
#define ENCRYPTED 0x20 /* bit 5 set: file is encrypted */
#define RESERVED 0xC0 /* bit 6,7: reserved */

#define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf())

/* Diagnostic functions */
#ifdef DEBUG
# define Assert(cond,msg) {if(!(cond)) error(msg);}
# define Trace(x) fprintf x
# define Tracev(x) {if (verbose) fprintf x ;}
# define Tracevv(x) {if (verbose>1) fprintf x ;}
# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
#else
# define Assert(cond,msg)
# define Trace(x)
# define Tracev(x)
# define Tracevv(x)
# define Tracec(c,x)
# define Tracecv(c,x)
#endif

static int fill_inbuf(void);
static void flush_window(void);
static void error(char *m);

static unsigned char *input_data;
static int input_len;

static long bytes_out = 0;
static uch *output_data;
static unsigned long output_ptr = 0;

#include "m32r_sio.c"

static unsigned long free_mem_ptr;
static unsigned long free_mem_end_ptr;

#ifdef CONFIG_KERNEL_BZIP2
static void *memset(void *s, int c, size_t n)
#define HEAP_SIZE 0x10000

#include "../../../../lib/inflate.c"

void* memset(void* s, int c, size_t n)
{
char *ss = s;
int i;
char *ss = (char*)s;

while (n--)
*ss++ = c;
for (i=0;i<n;i++) ss[i] = c;
return s;
}
#endif

#ifdef CONFIG_KERNEL_GZIP
#define BOOT_HEAP_SIZE 0x10000
#include "../../../../lib/decompress_inflate.c"
#endif
void* memcpy(void* __dest, __const void* __src,
size_t __n)
{
int i;
char *d = (char *)__dest, *s = (char *)__src;

#ifdef CONFIG_KERNEL_BZIP2
#define BOOT_HEAP_SIZE 0x400000
#include "../../../../lib/decompress_bunzip2.c"
#endif
for (i=0;i<__n;i++) d[i] = s[i];
return __dest;
}

#ifdef CONFIG_KERNEL_LZMA
#define BOOT_HEAP_SIZE 0x10000
#include "../../../../lib/decompress_unlzma.c"
#endif
/* ===========================================================================
* Fill the input buffer. This is called only when the buffer is empty
* and at least one byte is really needed.
*/
static int fill_inbuf(void)
{
if (insize != 0) {
error("ran out of input data");
}

inbuf = input_data;
insize = input_len;
inptr = 1;
return inbuf[0];
}

/* ===========================================================================
* Write the output window window[0..outcnt-1] and update crc and bytes_out.
* (Used for the decompressed data only.)
*/
static void flush_window(void)
{
ulg c = crc; /* temporary variable */
unsigned n;
uch *in, *out, ch;

in = window;
out = &output_data[output_ptr];
for (n = 0; n < outcnt; n++) {
ch = *out++ = *in++;
c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
}
crc = c;
bytes_out += (ulg)outcnt;
output_ptr += (ulg)outcnt;
outcnt = 0;
}

static void error(char *x)
{
Expand All @@ -62,20 +153,20 @@ static void error(char *x)
while(1); /* Halt */
}

/* return decompressed size */
void
decompress_kernel(int mmu_on, unsigned char *zimage_data,
unsigned int zimage_len, unsigned long heap)
{
unsigned char *input_data = zimage_data;
int input_len = zimage_len;
unsigned char *output_data;

output_data = (unsigned char *)CONFIG_MEMORY_START + 0x2000
+ (mmu_on ? 0x80000000 : 0);
free_mem_ptr = heap;
free_mem_end_ptr = free_mem_ptr + BOOT_HEAP_SIZE;
free_mem_end_ptr = free_mem_ptr + HEAP_SIZE;
input_data = zimage_data;
input_len = zimage_len;

puts("\nDecompressing Linux... ");
decompress(input_data, input_len, NULL, NULL, output_data, NULL, error);
puts("done.\nBooting the kernel.\n");
makecrc();
puts("Uncompressing Linux... ");
gunzip();
puts("Ok, booting the kernel.\n");
}
2 changes: 1 addition & 1 deletion trunk/arch/m32r/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ unsigned long send_IPI_mask_phys(cpumask_t physid_mask, int ipi_num,

if (mask & ~physids_coerce(phys_cpu_present_map))
BUG();
if (ipi_num >= NR_IPIS || ipi_num < 0)
if (ipi_num >= NR_IPIS)
BUG();

mask <<= IPI_SHIFT;
Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/m32r/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ u32 arch_gettimeoffset(void)
count = 0;

count = (latch - count) * TICK_SIZE;
elapsed_time = DIV_ROUND_CLOSEST(count, latch);
elapsed_time = (count + latch / 2) / latch;
/* NOTE: LATCH is equal to the "interval" value (= reload count). */

#else /* CONFIG_SMP */
Expand All @@ -93,7 +93,7 @@ u32 arch_gettimeoffset(void)
p_count = count;

count = (latch - count) * TICK_SIZE;
elapsed_time = DIV_ROUND_CLOSEST(count, latch);
elapsed_time = (count + latch / 2) / latch;
/* NOTE: LATCH is equal to the "interval" value (= reload count). */
#endif /* CONFIG_SMP */
#elif defined(CONFIG_CHIP_M32310)
Expand Down Expand Up @@ -211,7 +211,7 @@ void __init time_init(void)

bus_clock = boot_cpu_data.bus_clock;
divide = boot_cpu_data.timer_divide;
latch = DIV_ROUND_CLOSEST(bus_clock/divide, HZ);
latch = (bus_clock/divide + HZ / 2) / HZ;

printk("Timer start : latch = %ld\n", latch);

Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/m32r/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ SECTIONS
_etext = .; /* End of text section */

EXCEPTION_TABLE(16)
NOTES

RODATA
RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE)
_edata = .; /* End of data section */
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/x86/include/asm/amd_iommu.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ extern irqreturn_t amd_iommu_int_handler(int irq, void *data);
extern void amd_iommu_flush_all_domains(void);
extern void amd_iommu_flush_all_devices(void);
extern void amd_iommu_shutdown(void);
extern void amd_iommu_apply_erratum_63(u16 devid);
#else
static inline int amd_iommu_init(void) { return -ENODEV; }
static inline void amd_iommu_detect(void) { }
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
#define thread_saved_pc(t) (*(unsigned long *)((t)->thread.sp - 8))

#define task_pt_regs(tsk) ((struct pt_regs *)(tsk)->thread.sp0 - 1)
extern unsigned long KSTK_ESP(struct task_struct *task);
#define KSTK_ESP(tsk) -1 /* sorry. doesn't work for syscall. */
#endif /* CONFIG_X86_64 */

extern void start_thread(struct pt_regs *regs, unsigned long new_ip,
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/include/asm/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ extern unsigned long node_remap_size[];
| 1*SD_BALANCE_FORK \
| 0*SD_BALANCE_WAKE \
| 1*SD_WAKE_AFFINE \
| 0*SD_PREFER_LOCAL \
| 1*SD_PREFER_LOCAL \
| 0*SD_SHARE_CPUPOWER \
| 0*SD_POWERSAVINGS_BALANCE \
| 0*SD_SHARE_PKG_RESOURCES \
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/x86/kernel/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1220,8 +1220,6 @@ static void __detach_device(struct protection_domain *domain, u16 devid)
amd_iommu_dev_table[devid].data[1] = 0;
amd_iommu_dev_table[devid].data[2] = 0;

amd_iommu_apply_erratum_63(devid);

/* decrease reference counter */
domain->dev_cnt -= 1;

Expand Down
24 changes: 1 addition & 23 deletions trunk/arch/x86/kernel/amd_iommu_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ static void iommu_feature_enable(struct amd_iommu *iommu, u8 bit)
writel(ctrl, iommu->mmio_base + MMIO_CONTROL_OFFSET);
}

static void iommu_feature_disable(struct amd_iommu *iommu, u8 bit)
static void __init iommu_feature_disable(struct amd_iommu *iommu, u8 bit)
{
u32 ctrl;

Expand Down Expand Up @@ -519,26 +519,6 @@ static void set_dev_entry_bit(u16 devid, u8 bit)
amd_iommu_dev_table[devid].data[i] |= (1 << _bit);
}

static int get_dev_entry_bit(u16 devid, u8 bit)
{
int i = (bit >> 5) & 0x07;
int _bit = bit & 0x1f;

return (amd_iommu_dev_table[devid].data[i] & (1 << _bit)) >> _bit;
}


void amd_iommu_apply_erratum_63(u16 devid)
{
int sysmgt;

sysmgt = get_dev_entry_bit(devid, DEV_ENTRY_SYSMGT1) |
(get_dev_entry_bit(devid, DEV_ENTRY_SYSMGT2) << 1);

if (sysmgt == 0x01)
set_dev_entry_bit(devid, DEV_ENTRY_IW);
}

/* Writes the specific IOMMU for a device into the rlookup table */
static void __init set_iommu_for_device(struct amd_iommu *iommu, u16 devid)
{
Expand Down Expand Up @@ -567,8 +547,6 @@ static void __init set_dev_entry_from_acpi(struct amd_iommu *iommu,
if (flags & ACPI_DEVFLAG_LINT1)
set_dev_entry_bit(devid, DEV_ENTRY_LINT1_PASS);

amd_iommu_apply_erratum_63(devid);

set_iommu_for_device(iommu, devid);
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/cpu/mtrr/cleanup.c
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ int __init mtrr_cleanup(unsigned address_bits)
sort(range, nr_range, sizeof(struct res_range), cmp_range, NULL);

range_sums = sum_ranges(range, nr_range);
printk(KERN_INFO "total RAM covered: %ldM\n",
printk(KERN_INFO "total RAM coverred: %ldM\n",
range_sums >> (20 - PAGE_SHIFT));

if (mtrr_chunk_size && mtrr_gran_size) {
Expand Down
5 changes: 0 additions & 5 deletions trunk/arch/x86/kernel/process_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,3 @@ long sys_arch_prctl(int code, unsigned long addr)
return do_arch_prctl(current, code, addr);
}

unsigned long KSTK_ESP(struct task_struct *task)
{
return (test_tsk_thread_flag(task, TIF_IA32)) ?
(task_pt_regs(task)->sp) : ((task)->thread.usersp);
}
8 changes: 0 additions & 8 deletions trunk/arch/x86/kernel/reboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,14 +436,6 @@ static struct dmi_system_id __initdata pci_reboot_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5"),
},
},
{ /* Handle problems with rebooting on Apple Macmini3,1 */
.callback = set_pci_reboot,
.ident = "Apple Macmini3,1",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "Macmini3,1"),
},
},
{ }
};

Expand Down
Loading

0 comments on commit cfae1b1

Please sign in to comment.