Skip to content

Commit

Permalink
13939 it's time the 32bit intel kernel was (x)86'd
Browse files Browse the repository at this point in the history
Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Reviewed by: Patrick Mooney <pmooney@pfmooney.com>
Approved by: Garret D'Amore <garrett@damore.org>
  • Loading branch information
richlowe committed Aug 16, 2021
1 parent 755ccbc commit 86ef0a6
Show file tree
Hide file tree
Showing 136 changed files with 984 additions and 4,551 deletions.
28 changes: 0 additions & 28 deletions usr/src/cmd/mdb/intel/amd64/Makefile.libstand

This file was deleted.

35 changes: 0 additions & 35 deletions usr/src/cmd/mdb/intel/ia32/Makefile.kmdb

This file was deleted.

35 changes: 0 additions & 35 deletions usr/src/cmd/mdb/intel/ia32/krtld/Makefile

This file was deleted.

35 changes: 0 additions & 35 deletions usr/src/cmd/mdb/intel/ia32/nca/Makefile

This file was deleted.

6 changes: 0 additions & 6 deletions usr/src/uts/common/conf/param.c
Expand Up @@ -537,12 +537,6 @@ char architecture[] = "sparcv9";
char architecture_32[] = "sparc";
char hw_provider[] = "Oracle Corporation";

#elif defined(__i386)

char architecture[] = "i386";
char architecture_32[] = "i386";
char hw_provider[SYS_NMLN] = "";

#elif defined(__amd64)

char architecture[] = "amd64";
Expand Down
41 changes: 1 addition & 40 deletions usr/src/uts/common/crypto/io/dca.c
Expand Up @@ -463,13 +463,11 @@ static struct ddi_device_acc_attr dca_devattr = {
DDI_STRICTORDER_ACC
};

#if !defined(i386) && !defined(__i386)
static struct ddi_device_acc_attr dca_bufattr = {
DDI_DEVICE_ATTR_V0,
DDI_NEVERSWAP_ACC,
DDI_STRICTORDER_ACC
};
#endif

static struct ddi_dma_attr dca_dmaattr = {
DMA_ATTR_V0, /* dma_attr_version */
Expand All @@ -481,7 +479,7 @@ static struct ddi_dma_attr dca_dmaattr = {
0x1, /* dma_attr_minxfer */
0x00ffffffUL, /* dma_attr_maxxfer */
0xffffffffUL, /* dma_attr_seg */
#if defined(i386) || defined(__i386) || defined(__amd64)
#if defined(__x86)
512, /* dma_attr_sgllen */
#else
1, /* dma_attr_sgllen */
Expand Down Expand Up @@ -1667,24 +1665,6 @@ dca_newreq(dca_t *dca)
* for driver hardening, allocate in whole pages.
*/
size = ROUNDUP(MAXPACKET, dca->dca_pagesize);
#if defined(i386) || defined(__i386)
/*
* Use kmem_alloc instead of ddi_dma_mem_alloc here since the latter
* may fail on x86 platform if a physically contiguous memory chunk
* cannot be found. From initial testing, we did not see performance
* degradation as seen on Sparc.
*/
if ((reqp->dr_ibuf_kaddr = kmem_alloc(size, KM_SLEEP)) == NULL) {
dca_error(dca, "unable to alloc request ibuf memory");
dca_destroyreq(reqp);
return (NULL);
}
if ((reqp->dr_obuf_kaddr = kmem_alloc(size, KM_SLEEP)) == NULL) {
dca_error(dca, "unable to alloc request obuf memory");
dca_destroyreq(reqp);
return (NULL);
}
#else
/*
* We could kmem_alloc for Sparc too. However, it gives worse
* performance when transferring more than one page data. For example,
Expand All @@ -1711,7 +1691,6 @@ dca_newreq(dca_t *dca)
dca_destroyreq(reqp);
return (NULL);
}
#endif

/* Skip the used portion in the context page */
reqp->dr_offset = CTX_MAXLENGTH;
Expand Down Expand Up @@ -1745,10 +1724,6 @@ dca_newreq(dca_t *dca)
void
dca_destroyreq(dca_request_t *reqp)
{
#if defined(i386) || defined(__i386)
dca_t *dca = reqp->dr_dca;
size_t size = ROUNDUP(MAXPACKET, dca->dca_pagesize);
#endif

/*
* Clean up DMA for the context structure.
Expand All @@ -1768,19 +1743,6 @@ dca_destroyreq(dca_request_t *reqp)
/*
* Clean up DMA for the scratch buffer.
*/
#if defined(i386) || defined(__i386)
if (reqp->dr_ibuf_dmah) {
(void) ddi_dma_unbind_handle(reqp->dr_ibuf_dmah);
ddi_dma_free_handle(&reqp->dr_ibuf_dmah);
}
if (reqp->dr_obuf_dmah) {
(void) ddi_dma_unbind_handle(reqp->dr_obuf_dmah);
ddi_dma_free_handle(&reqp->dr_obuf_dmah);
}

kmem_free(reqp->dr_ibuf_kaddr, size);
kmem_free(reqp->dr_obuf_kaddr, size);
#else
if (reqp->dr_ibuf_paddr) {
(void) ddi_dma_unbind_handle(reqp->dr_ibuf_dmah);
}
Expand All @@ -1801,7 +1763,6 @@ dca_destroyreq(dca_request_t *reqp)
if (reqp->dr_obuf_dmah) {
ddi_dma_free_handle(&reqp->dr_obuf_dmah);
}
#endif
/*
* These two DMA handles should have been unbinded in
* dca_unbindchains() function
Expand Down
2 changes: 1 addition & 1 deletion usr/src/uts/common/crypto/io/dca_3des.c
Expand Up @@ -38,7 +38,7 @@
#include <sys/crypto/spi.h>
#include <sys/crypto/dca.h>

#if defined(__i386) || defined(__amd64)
#if defined(__x86)
#include <sys/byteorder.h>
#define UNALIGNED_POINTERS_PERMITTED
#endif
Expand Down
6 changes: 3 additions & 3 deletions usr/src/uts/common/disp/thread.c
Expand Up @@ -182,7 +182,7 @@ thread_init(void)
mutex_init(lp, NULL, MUTEX_DEFAULT, NULL);
}

#if defined(__i386) || defined(__amd64)
#if defined(__x86)
thread_cache = kmem_cache_create("thread_cache", sizeof (kthread_t),
PTR24_ALIGN, NULL, NULL, NULL, NULL, NULL, 0);

Expand Down Expand Up @@ -1528,7 +1528,7 @@ thread_create_intr(struct cpu *cp)
tp->t_bind_cpu = PBIND_NONE; /* no USER-requested binding */
tp->t_bind_pset = PS_NONE;

#if defined(__i386) || defined(__amd64)
#if defined(__x86)
tp->t_stk -= STACK_ALIGN;
*(tp->t_stk) = 0; /* terminate intr thread stack */
#endif
Expand Down Expand Up @@ -2128,7 +2128,7 @@ stkinfo_end(kthread_t *t)
/* search until no pattern in the stack */
if (t->t_stk > t->t_stkbase) {
/* stack grows down */
#if defined(__i386) || defined(__amd64)
#if defined(__x86)
/*
* 6 longs are pushed on stack, see thread_load(). Skip
* them, so if kthread has never run, percent is zero.
Expand Down
18 changes: 3 additions & 15 deletions usr/src/uts/common/disp/thread_intr.c
Expand Up @@ -24,18 +24,6 @@
* Use is subject to license terms.
*/

/*
* FILE NOTICE BEGIN
*
* This file should not be modified. If you wish to modify it or have it
* modified, please contact Sun Microsystems at <LFI149367@-sun-.-com->
* (without anti-spam dashes)
*
* FILE NOTICE END
*/

#pragma ident "%Z%%M% %I% %E% SMI"

#include <sys/cpuvar.h>
#include <sys/stack.h>
#include <vm/seg_kp.h>
Expand Down Expand Up @@ -84,7 +72,7 @@ thread_create_intr(cpu_t *cp)
tp->t_bind_cpu = PBIND_NONE; /* no USER-requested binding */
tp->t_bind_pset = PS_NONE;

#if defined(__i386) || defined(__amd64)
#if defined(__x86)
tp->t_stk -= STACK_ALIGN;
*(tp->t_stk) = 0; /* terminate intr thread stack */
#endif
Expand All @@ -110,6 +98,6 @@ cpu_intr_alloc(cpu_t *cp, int n)
thread_create_intr(cp);

cp->cpu_intr_stack = (caddr_t)segkp_get(segkp, INTR_STACK_SIZE,
KPD_HASREDZONE | KPD_NO_ANON | KPD_LOCKED) +
INTR_STACK_SIZE - SA(MINFRAME);
KPD_HASREDZONE | KPD_NO_ANON | KPD_LOCKED) +
INTR_STACK_SIZE - SA(MINFRAME);
}
4 changes: 2 additions & 2 deletions usr/src/uts/common/exec/elf/elf.c
Expand Up @@ -375,7 +375,7 @@ elfexec(vnode_t *vp, execa_t *uap, uarg_t *args, intpdata_t *idatap,
} else {
args->to_model = DATAMODEL_LP64;
args->stk_prot &= ~PROT_EXEC;
#if defined(__i386) || defined(__amd64)
#if defined(__x86)
args->dat_prot &= ~PROT_EXEC;
#endif
*execsz = btopr(SINCR) + btopr(SSIZE) + btopr(NCARGS64-1);
Expand Down Expand Up @@ -1998,7 +1998,7 @@ elfcore(vnode_t *vp, proc_t *p, cred_t *credp, rlim64_t rlimit, int sig,
#if defined(__sparc)
ehdr->e_ident[EI_DATA] = ELFDATA2MSB;
ehdr->e_machine = EM_SPARC;
#elif defined(__i386) || defined(__i386_COMPAT)
#elif defined(__i386_COMPAT)
ehdr->e_ident[EI_DATA] = ELFDATA2LSB;
ehdr->e_machine = EM_386;
#else
Expand Down
14 changes: 7 additions & 7 deletions usr/src/uts/common/exec/elf/elf_notes.c
Expand Up @@ -66,7 +66,7 @@
#include <sys/machelf.h>
#include <sys/sunddi.h>
#include "elf_impl.h"
#if defined(__i386) || defined(__i386_COMPAT)
#if defined(__i386_COMPAT)
#include <sys/sysi86.h>
#endif

Expand Down Expand Up @@ -129,13 +129,13 @@ setup_note_header(Phdr *v, proc_t *p)
kmem_free(pcrp, size);


#if defined(__i386) || defined(__i386_COMPAT)
#if defined(__i386_COMPAT)
mutex_enter(&p->p_ldtlock);
size = prnldt(p) * sizeof (struct ssd);
mutex_exit(&p->p_ldtlock);
if (size != 0)
v[0].p_filesz += sizeof (Note) + roundup(size, sizeof (Word));
#endif /* __i386 || __i386_COMPAT */
#endif /* __i386_COMPAT */

if ((size = prhasx(p)? prgetprxregsize(p) : 0) != 0)
v[0].p_filesz += nlwp * sizeof (Note)
Expand Down Expand Up @@ -218,10 +218,10 @@ write_elfnotes(proc_t *p, int sig, vnode_t *vp, offset_t offset,
int fd;
vnode_t *vroot;

#if defined(__i386) || defined(__i386_COMPAT)
#if defined(__i386_COMPAT)
struct ssd *ssd;
size_t ssdsize;
#endif /* __i386 || __i386_COMPAT */
#endif /* __i386_COMPAT */

bigsize = MAX(bigsize, priv_get_implinfo_size());

Expand Down Expand Up @@ -447,7 +447,7 @@ write_elfnotes(proc_t *p, int sig, vnode_t *vp, offset_t offset,

VN_RELE(vroot);

#if defined(__i386) || defined(__i386_COMPAT)
#if defined(__i386_COMPAT)
mutex_enter(&p->p_ldtlock);
ssdsize = prnldt(p) * sizeof (struct ssd);
if (ssdsize != 0) {
Expand All @@ -460,7 +460,7 @@ write_elfnotes(proc_t *p, int sig, vnode_t *vp, offset_t offset,
mutex_exit(&p->p_ldtlock);
if (error)
goto done;
#endif /* __i386 || defined(__i386_COMPAT) */
#endif /* defined(__i386_COMPAT) */

nlwp = p->p_lwpcnt;
nzomb = p->p_zombcnt;
Expand Down

0 comments on commit 86ef0a6

Please sign in to comment.