Skip to content

Commit

Permalink
Cleanup in mips/pic32 files: removed all pmax stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
Serge Vakulenko committed Apr 29, 2014
1 parent 60e1d3b commit d6b308d
Show file tree
Hide file tree
Showing 18 changed files with 236 additions and 2,453 deletions.
81 changes: 81 additions & 0 deletions sys/mips/dev/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,87 @@ uartstop(tp, flag)
// TODO
}

/*
* Get a char off the appropriate line via. a busy wait loop.
*/
int
uartGetc(dev)
dev_t dev;
{
// TODO
#if 1
return 0;
#else
register uart_regmap_t *regs;
register int c, line;
register unsigned value;
int s;

line = UARTLINE(dev);
regs = (uart_regmap_t *)uart_softc[UARTUNIT(dev)].uart_pdma[line].p_addr;
if (!regs)
return (0);
s = spltty();
for (;;) {
value = UART_READ_REG(regs, line, UART_RR0);
if (value & UART_RR0_RX_AVAIL) {
value = UART_READ_REG(regs, line, UART_RR1);
UART_READ_DATA(regs, line, c);
if (value & (UART_RR1_PARITY_ERR | UART_RR1_RX_OVERRUN |
UART_RR1_FRAME_ERR)) {
UART_WRITE_REG(regs, line, UART_WR0, UART_RESET_ERROR);
UART_WRITE_REG(regs, UART_CHANNEL_A, UART_WR0,
UART_RESET_HIGHEST_IUS);
} else {
UART_WRITE_REG(regs, UART_CHANNEL_A, UART_WR0,
UART_RESET_HIGHEST_IUS);
splx(s);
return (unsigned char) c;
}
} else
DELAY(10);
}
#endif
}

/*
* Send a char on a port, via a busy wait loop.
*/
void
uartPutc(dev, c)
dev_t dev;
int c;
{
// TODO
#if 0
register uart_regmap_t *regs;
register int line;
register u_char value;
int s;

s = spltty();
line = UARTLINE(dev);
regs = (uart_regmap_t *)uart_softc[UARTUNIT(dev)].uart_pdma[line].p_addr;

/*
* Wait for transmitter to be not busy.
*/
do {
UART_READ_REG(regs, line, UART_RR0, value);
if (value & UART_RR0_TX_EMPTY)
break;
DELAY(100);
} while (1);

/*
* Send the char.
*/
UART_WRITE_DATA(regs, line, c);
MachEmptyWriteBuffer();
splx(s);
#endif
}

/*
* Test to see if device is present.
* Return true if found and initialized ok.
Expand Down
4 changes: 2 additions & 2 deletions sys/mips/include/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include <machine/machConst.h>

/*
* Exported definitions unique to pmax/mips cpu support.
* Exported definitions unique to MIPS cpu support.
*/

/*
Expand Down Expand Up @@ -80,7 +80,7 @@ struct clockframe {

/*
* Give a profiling tick to the current process when the user profiling
* buffer pages are invalid. On the PMAX, request an ast to send us
* buffer pages are invalid. On MIPS, request an ast to send us
* through trap, marking the proc as needing a profiling tick.
*/
#define need_proftick(p) { (p)->p_flag |= P_OWEUPC; aston(); }
Expand Down
9 changes: 4 additions & 5 deletions sys/mips/include/param.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@

/*
* Size of kernel malloc arena in CLBYTES-sized logical pages
*/
*/
#ifndef NKMEMCLUSTERS
#define NKMEMCLUSTERS (512*1024/CLBYTES)
#endif
Expand Down Expand Up @@ -136,10 +136,9 @@
/*
* Mach derived conversion macros
*/
#define pmax_round_page(x) ((((unsigned)(x)) + NBPG - 1) & ~(NBPG-1))
#define pmax_trunc_page(x) ((unsigned)(x) & ~(NBPG-1))
#define pmax_btop(x) ((unsigned)(x) >> PGSHIFT)
#define pmax_ptob(x) ((unsigned)(x) << PGSHIFT)
#define mips_round_page(x) ((((unsigned)(x)) + NBPG - 1) & ~(NBPG-1))
#define mips_btop(x) ((unsigned)(x) >> PGSHIFT)
#define mips_ptob(x) ((unsigned)(x) << PGSHIFT)

#ifndef LOCORE
#ifdef KERNEL
Expand Down
4 changes: 2 additions & 2 deletions sys/mips/include/pcb.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*/

/*
* PMAX process control block
* MIPS process control block
*/
struct pcb
{
Expand All @@ -53,7 +53,7 @@ struct pcb

/*
* The pcb is augmented with machine-dependent additional data for
* core dumps. For the PMAX, there is nothing to add.
* core dumps. For MIPS, there is nothing to add.
*/
struct md_coredump {
long md_pad[8];
Expand Down
7 changes: 3 additions & 4 deletions sys/mips/include/pmap.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Copyright (c) 1987 Carnegie-Mellon University
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
Expand Down Expand Up @@ -51,7 +51,7 @@
* The user address space is mapped using a two level structure where
* virtual address bits 30..22 are used to index into a segment table which
* points to a page worth of PTEs (4096 page can hold 1024 PTEs).
* Bits 21..12 are then used to index a PTE which describes a page within
* Bits 21..12 are then used to index a PTE which describes a page within
* a segment.
*
* The wired entries in the TLB will contain the following:
Expand All @@ -62,8 +62,7 @@
* dynamically allocated at boot time.
*/

#define pmax_trunc_seg(x) ((vm_offset_t)(x) & ~SEGOFSET)
#define pmax_round_seg(x) (((vm_offset_t)(x) + SEGOFSET) & ~SEGOFSET)
#define mips_trunc_seg(x) ((vm_offset_t)(x) & ~SEGOFSET)
#define pmap_segmap(m, v) ((m)->pm_segtab->seg_tab[((v) >> SEGSHIFT)])

#define PMAP_SEGTABSIZE 512
Expand Down
2 changes: 1 addition & 1 deletion sys/mips/include/profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
/*
* The following two macros do splhigh and splx respectively.
* They have to be defined this way because these are real
* functions on the PMAX, and we do not want to invoke mcount
* functions on MIPS, and we do not want to invoke mcount
* recursively.
*/
#define MCOUNT_ENTER s = _splhigh()
Expand Down
2 changes: 1 addition & 1 deletion sys/mips/include/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@
/*
* Machine dependent trace commands.
*
* None for the pmax at this time.
* None for the MIPS at this time.
*/
13 changes: 0 additions & 13 deletions sys/mips/pic32/TODO

This file was deleted.

Loading

0 comments on commit d6b308d

Please sign in to comment.