Resent-Date: Tue, 27 Jul 1999 13:37:11 +0200 (MET DST)
To: Roman Zippel <zippel@fh-brandenburg.de>
Cc: Linux/m68k <linux-m68k@lists.linux-m68k.org>
Subject: Re: 2.3.11
References: <Pine.GSO.3.96.990727095302.24534A-100000@zeus>
X-Yow: My life is a patio of fun!
From: Andreas Schwab <schwab@suse.de>
Date: 27 Jul 1999 13:36:34 +0200
In-Reply-To: Roman Zippel's message of "Tue, 27 Jul 1999 10:20:00 +0200 (MET DST)"
User-Agent: Gnus/5.070095 (Pterodactyl Gnus v0.95) Emacs/20.4
Resent-From: linux-m68k@phil.uni-sb.de

Roman Zippel <zippel@fh-brandenburg.de> writes:

|> - I didn't check much of the other drivers, I only know that sound doesn't
|> compile, but I didn't looked closer to it (and currently I can't test it
|> anyway).

This patch makes the bloddy thing compile.  The PPC people should have
been more careful.

Andreas.

--- linux/drivers/sound/dmasound.c.~1~	Tue Jul 27 10:28:39 1999
+++ linux/drivers/sound/dmasound.c	Tue Jul 27 13:30:09 1999
@@ -131,7 +131,9 @@
 static int irq_installed = 0;
 #endif /* MODULE */
 static char **sound_buffers = NULL;
+#ifdef CONFIG_PPC
 static char **sound_read_buffers = NULL;
+#endif
 
 #ifdef CONFIG_ATARI
 extern void atari_microwire_cmd(int cmd);
@@ -282,7 +284,9 @@
 
 static int catchRadius = 0;
 static int numBufs = 4, bufSize = 32;
+#ifdef CONFIG_PPC
 static int numReadBufs = 4, readbufSize = 32;
+#endif
 
 MODULE_PARM(catchRadius, "i");
 MODULE_PARM(numBufs, "i");
@@ -796,10 +800,12 @@
 				    size_t userCount,
 				    u_char frame[], ssize_t *frameUsed,
 				    ssize_t frameLeft);
+#ifdef CONFIG_PPC
 static ssize_t sound_copy_translate_read(const u_char *userPtr,
 				    size_t userCount,
 				    u_char frame[], ssize_t *frameUsed,
 				    ssize_t frameLeft);
+#endif
 
 
 /*
@@ -846,7 +852,9 @@
 };
 
 static struct sound_queue sq;
+#ifdef CONFIG_PPC
 static struct sound_queue read_sq;
+#endif
 
 #define sq_block_address(i)	(sq.buffers[i])
 #define SIGNAL_RECEIVED	(signal_pending(current))
@@ -4031,6 +4039,7 @@
 		return 0;
 }
 
+#ifdef CONFIG_PPC
 static ssize_t sound_copy_translate_read(const u_char *userPtr,
 				    size_t userCount,
 				    u_char frame[], ssize_t *frameUsed,
@@ -4069,6 +4078,7 @@
 	else
 		return 0;
 }
+#endif
 
 
 /*
@@ -4644,6 +4654,7 @@
 }
 
 
+#ifdef CONFIG_PPC
 static int sq_allocate_read_buffers(void)
 {
 	int i;
@@ -4680,15 +4691,12 @@
 	
 
 	if (sound_read_buffers) {
-
-#if CONFIG_PPC
 		cp = awacs_rx_cmds;
 		for (i = 0; i < numReadBufs; i++,cp++) {
 			st_le16(&cp->command, DBDMA_STOP);
 		}
 		/* We should probably wait for the thing to stop before we
 		   release the memory */
-#endif
 		for (i = 0; i < numBufs; i++)
 			sound.mach.dma_free (sound_read_buffers[i],
 					     bufSize << 10);
@@ -4696,6 +4704,7 @@
 		sound_read_buffers = 0;
 	}
 }
+#endif
 
 
 static void sq_setup(int numBufs, int bufSize, char **write_buffers)
@@ -4735,12 +4744,11 @@
 #endif /* CONFIG_PPC */
 }
 
+#ifdef CONFIG_PPC
 static void read_sq_setup(int numBufs, int bufSize, char **read_buffers)
 {
-#ifdef CONFIG_PPC
 	int i;
 	volatile struct dbdma_cmd *cp;
-#endif /* CONFIG_PPC */
 
 	read_sq.max_count = numBufs;
 	read_sq.max_active = numBufs;
@@ -4753,14 +4761,6 @@
 	read_sq.syncing = 0;
 	read_sq.active = 0;
 
-#ifdef CONFIG_ATARI
-	read_sq.ignore_int = 0;
-#endif /* CONFIG_ATARI */
-#ifdef CONFIG_AMIGA
-	read_sq.block_size_half = read_sq.block_size>>1;
-	read_sq.block_size_quarter = read_sq.block_size_half>>1;
-#endif /* CONFIG_AMIGA */
-#ifdef CONFIG_PPC
 	cp = awacs_rx_cmds;
 	memset((void *) cp, 0, (numBufs + 1) * sizeof(struct dbdma_cmd));
 
@@ -4784,8 +4784,8 @@
 	out_le32(&awacs_rxdma->control, (RUN|PAUSE|FLUSH|WAKE) << 16);
 	out_le32(&awacs_rxdma->cmdptr, virt_to_bus(awacs_rx_cmds));
 
-#endif /* CONFIG_PPC */
 }
+#endif /* CONFIG_PPC */
 
 
 static void sq_play(void)
@@ -4868,6 +4868,8 @@
 
 /***********/
 
+#ifdef CONFIG_PPC
+
 /* Here is how the values are used for reading.
  * The value 'active' simply indicates the DMA is running.  This is
  * done so the driver semantics are DMA starts when the first read is
@@ -4930,6 +4932,7 @@
 	}
 	return uRead;
 }
+#endif
 
 static int sq_open(struct inode *inode, struct file *file)
 {
@@ -4957,6 +4960,7 @@
 	}
 
 
+#ifdef CONFIG_PCC
 	if (file->f_mode & FMODE_READ) {
 		if (read_sq.busy) {
 			rc = -EBUSY;
@@ -4976,6 +4980,7 @@
 		read_sq_setup(numReadBufs,readbufSize<<10, sound_read_buffers);
 		read_sq.open_mode = file->f_mode;
 	}                                                                      
+#endif
 
 #ifdef CONFIG_ATARI
 	sq.ignore_int = 1;
@@ -5004,10 +5009,12 @@
 		sq.busy = 0;
 		WAKE_UP(sq.open_queue);
 	}
+#ifdef CONFIG_PCC
 	if (file->f_mode & FMODE_READ) {
 		read_sq.busy = 0;
 		WAKE_UP(read_sq.open_queue);
 	}
+#endif
 err_out:
 	MOD_DEC_USE_COUNT;
 	return rc;
@@ -5056,16 +5063,20 @@
 	sound.hard = sound.dsp;
 	sound_silence();
 
+#ifdef CONFIG_PPC
 	sq_release_read_buffers();
+#endif
 	sq_release_buffers();
 	MOD_DEC_USE_COUNT;
 
 	/* There is probably a DOS atack here. They change the mode flag. */
 	/* XXX add check here */
+#ifdef CONFIG_PPC
 	if (file->f_mode & FMODE_READ) {
 		read_sq.busy = 0;
 		WAKE_UP(read_sq.open_queue);
 	}
+#endif
 
 	if (file->f_mode & FMODE_WRITE) {
 		sq.busy = 0;
@@ -5173,7 +5184,11 @@
 static struct file_operations sq_fops =
 {
 	sound_lseek,
+#ifdef CONFIG_PPC
 	sq_read,			/* sq_read */
+#else
+	NULL,			/* sq_read */
+#endif
 	sq_write,
 	NULL,			/* sq_readdir */
 	NULL,			/* sq_poll */
@@ -5198,12 +5213,16 @@
 	init_waitqueue_head(&sq.open_queue);
 	init_waitqueue_head(&sq.sync_queue);
 
+#ifdef CONFIG_PPC
 	init_waitqueue_head(&read_sq.action_queue);
 	init_waitqueue_head(&read_sq.open_queue);
 	init_waitqueue_head(&read_sq.sync_queue);
+#endif
 
 	sq.busy = 0;
+#ifdef CONFIG_PPC
 	read_sq.busy = 0;
+#endif
 
 	/* whatever you like as startup mode for /dev/dsp,
 	 * (/dev/audio hasn't got a startup mode). note that
@@ -5251,7 +5270,10 @@
 
 static int state_open(struct inode *inode, struct file *file)
 {
-	char *buffer = state.buf, *mach = "", awacs_buf[50];
+	char *buffer = state.buf, *mach = "";
+#ifdef CONFIG_PPC
+	char awacs_buf[50];
+#endif
 	int len = 0;
 
 	if (state.busy)
--- linux/drivers/video/atafb.c.~1~	Thu Feb 25 19:02:11 1999
+++ linux/drivers/video/atafb.c	Tue Jul 27 12:06:08 1999
@@ -2828,9 +2828,12 @@
 		/* Map the video memory (physical address given) to somewhere
 		 * in the kernel address space.
 		 */
-		external_addr = ioremap_writethrough(external_addr, external_len);
+		external_addr =
+		  ioremap_writethrough((unsigned long)external_addr,
+				       external_len);
 		if (external_vgaiobase)
-			external_vgaiobase = ioremap(external_vgaiobase, 0x10000 );
+			external_vgaiobase =
+			  (unsigned long)ioremap(external_vgaiobase, 0x10000);
 		screen_base      =
 		real_screen_base = external_addr;
 		screen_len       = external_len & PAGE_MASK;
@@ -3069,7 +3072,7 @@
 	external_yres  = yres;
 	external_depth = depth;
 	external_pmode = planes;
-	external_addr  = addr;
+	external_addr  = (void *)addr;
 	external_len   = len;
 		
 	if (external_card_type == IS_MV300)
--- linux/drivers/misc/parport_atari.c.~1~	Tue Jul 27 10:28:38 1999
+++ linux/drivers/misc/parport_atari.c	Tue Jul 27 13:29:21 1999
@@ -92,12 +92,7 @@
 }
 
 static void
-parport_atari_write_status(struct parport *p, unsigned char status)
-{
-}
-
-static void
-parport_atari_init_state(struct parport_state *s)
+parport_atari_init_state(struct pardevice *d, struct parport_state *s)
 {
 }
 
@@ -148,41 +143,36 @@
 	parport_atari_read_control,
 	parport_atari_frob_control,
 
-	NULL, /* write_econtrol */
-	NULL, /* read_econtrol */
-	NULL, /* frob_econtrol */
-
-	parport_atari_write_status,
 	parport_atari_read_status,
 
-	NULL, /* write fifo */
-	NULL, /* read fifo */
-
-	NULL, /* change_mode */
-
-	NULL, /* epp_write_data */
-	NULL, /* epp_read_data */
-	NULL, /* epp_write_addr */
-	NULL, /* epp_read_addr */
-	NULL, /* epp_check_timeout */
+	NULL, /* enable_irq */
+	NULL, /* disable_irq */
 
-	NULL, /* epp_write_block */
-	NULL, /* epp_read_block */
+	NULL, /* data_forward */
+	NULL, /* data_reverse */
 
-	NULL, /* ecp_write_block */
-	NULL, /* ecp_read_block */
+	parport_atari_interrupt,
 
 	parport_atari_init_state,
 	parport_atari_save_state,
 	parport_atari_restore_state,
 
-	NULL, /* enable_irq */
-	NULL, /* disable_irq */
-	parport_atari_interrupt,
-
 	parport_atari_inc_use_count,
 	parport_atari_dec_use_count,
-	parport_atari_fill_inode
+	parport_atari_fill_inode,
+
+	NULL, /* epp_write_data */
+	NULL, /* epp_read_data */
+	NULL, /* epp_write_addr */
+	NULL, /* epp_read_addr */
+
+	NULL, /* ecp_write_data */
+	NULL, /* ecp_read_data */
+	NULL, /* ecp_write_addr */
+
+	NULL, /* compat_write_data */
+	NULL, /* nibble_read_data */
+	NULL, /* byte_read_data */
 };
 
 
--- linux/arch/m68k/atari/stram.c.~1~	Tue Jul 27 10:28:37 1999
+++ linux/arch/m68k/atari/stram.c	Tue Jul 27 13:24:18 1999
@@ -346,12 +346,11 @@
 				 "swap=%08lx-%08lx\n", swap_start, swap_end );
 		
 		/* reserve some amount of memory for maintainance of
-		 * swapping itself: 1 page for the lockmap, and one page
-		 * for each 2048 (PAGE_SIZE/2) swap pages. (2 bytes for
-		 * each page) */
+		 * swapping itself: one page for each 2048 (PAGE_SIZE/2)
+		 * swap pages. (2 bytes for each page) */
 		swap_data = start_mem;
-		start_mem += (((SWAP_NR(swap_end) + PAGE_SIZE/2 - 1)
-			       >> (PAGE_SHIFT-1)) + 1) << PAGE_SHIFT;
+		start_mem += ((SWAP_NR(swap_end) + PAGE_SIZE/2 - 1)
+			      >> (PAGE_SHIFT-1)) << PAGE_SHIFT;
 		/* correct swap_start if necessary */
 		if (swap_start == swap_data)
 			swap_start = start_mem;
@@ -610,8 +609,7 @@
 	p->flags        = SWP_USED;
 	p->swap_file    = &fake_dentry[0];
 	p->swap_device  = 0;
-	p->swap_lockmap = (unsigned char *)(swap_data);
-	p->swap_map	= (unsigned short *)(swap_data + PAGE_SIZE);
+	p->swap_map	= (unsigned short *)swap_data;
 	p->cluster_nr   = 0;
 	p->next         = -1;
 	p->prio         = 0x7ff0;	/* a rather high priority, but not the higest
@@ -623,9 +621,6 @@
 	swap_inode.i_rdev = p->swap_device;
 	stram_open( &swap_inode, MAGIC_FILE_P );
 	p->max = SWAP_NR(swap_end);
-
-	/* initialize lockmap */
-	memset( p->swap_lockmap, 0, PAGE_SIZE );
 
 	/* initialize swap_map: set regions that are already allocated or belong
 	 * to kernel data space to SWAP_MAP_BAD, otherwise to free */

-- 
Andreas Schwab                                  "And now for something
schwab@suse.de                                   completely different."
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg

