Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision d11e6a4410d5aae70ad545d085d344644c33d9cc authored by Steve Marquess on 25 April 2017, 12:15:14 UTC, committed by Dr. Stephen Henson on 30 August 2017, 20:45:26 UTC
Add linux-mips32be target for new platform
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3300)

(cherry picked from commit d674242a884368083bf1044cc4e6e30d8f452a50)
1 parent e576b67
  • Files
  • Changes
  • 1e7c69c
  • /
  • ms
  • /
  • uplink.c
Raw File
Cook and download a directory from the Software Heritage Vault

You have requested the cooking of the directory with identifier None into a standard tar.gz archive.

Are you sure you want to continue ?

Download a directory from the Software Heritage Vault

You have requested the download of the directory with identifier None as a standard tar.gz archive.

Are you sure you want to continue ?

Cook and download a revision from the Software Heritage Vault

You have requested the cooking of the history heading to revision with identifier swh:1:rev:d11e6a4410d5aae70ad545d085d344644c33d9cc into a bare git archive.

Are you sure you want to continue ?

Download a revision from the Software Heritage Vault

You have requested the download of the history heading to revision with identifier swh:1:rev:d11e6a4410d5aae70ad545d085d344644c33d9cc as a bare git archive.

Are you sure you want to continue ?

Invalid Email !

The provided email is not well-formed.

Download link has expired

The requested archive is no longer available for download from the Software Heritage Vault.

Do you want to cook it again ?

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • content
revision badge
swh:1:rev:d11e6a4410d5aae70ad545d085d344644c33d9cc
content badge Iframe embedding
swh:1:cnt:6d59cb1f87c6f442af695bc3b42c664d69da4a66
uplink.c
#if (defined(_WIN64) || defined(_WIN32_WCE)) && !defined(UNICODE)
#define UNICODE
#endif
#if defined(UNICODE) && !defined(_UNICODE)
#define _UNICODE
#endif
#if defined(_UNICODE) && !defined(UNICODE)
#define UNICODE
#endif

#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include "uplink.h"
void OPENSSL_showfatal(const char *,...);

static TCHAR msg[128];

static void unimplemented (void)
{   OPENSSL_showfatal (sizeof(TCHAR)==sizeof(char)?"%s\n":"%S\n",msg);
    ExitProcess (1);
}

void OPENSSL_Uplink (volatile void **table, int index)
{ static HMODULE volatile apphandle=NULL;
  static void ** volatile applinktable=NULL;
  int len;
  void (*func)(void)=unimplemented;
  HANDLE h;
  void **p;

    /* Note that the below code is not MT-safe in respect to msg
     * buffer, but what's the worst thing that can happen? Error
     * message might be misleading or corrupted. As error condition
     * is fatal and should never be risen, I accept the risk... */
    /* One can argue that I should have used InterlockedExchangePointer
     * or something to update static variables and table[]. Well,
     * store instructions are as atomic as they can get and assigned
     * values are effectively constant... So that volatile qualifier
     * should be sufficient [it prohibits compiler to reorder memory
     * access instructions]. */
    do {
	len = _sntprintf (msg,sizeof(msg)/sizeof(TCHAR),
			  _T("OPENSSL_Uplink(%p,%02X): "),table,index);
	_tcscpy (msg+len,_T("unimplemented function"));

	if ((h=apphandle)==NULL)
	{   if  ((h=GetModuleHandle(NULL))==NULL)
	    {	apphandle=(HMODULE)-1;
		_tcscpy (msg+len,_T("no host application"));
		break;
	    }
	    apphandle = h;
	}
	if ((h=apphandle)==(HMODULE)-1) /* revalidate */
	    break;

	if (applinktable==NULL)
	{ void**(*applink)();

	    applink=(void**(*)())GetProcAddress(h,"OPENSSL_Applink");
	    if (applink==NULL)
	    {	apphandle=(HMODULE)-1;
		_tcscpy (msg+len,_T("no OPENSSL_Applink"));
		break;
	    }
	    p = (*applink)();
	    if (p==NULL)
	    {	apphandle=(HMODULE)-1;
		_tcscpy (msg+len,_T("no ApplinkTable"));
		break;
	    }
	    applinktable = p;
	}
	else
	    p = applinktable;

	if (index > (int)p[0])
	    break;

	if (p[index]) func = p[index];
    } while (0);

    table[index] = func;
}    

#if defined(_MSC_VER) && defined(_M_IX86) && !defined(OPENSSL_NO_INLINE_ASM)
#define LAZY(i)		\
__declspec(naked) static void lazy##i (void) { 	\
	_asm	push i				\
	_asm	push OFFSET OPENSSL_UplinkTable	\
	_asm	call OPENSSL_Uplink		\
	_asm	add  esp,8			\
	_asm	jmp  OPENSSL_UplinkTable+4*i	}

#if APPLINK_MAX>25
#error "Add more stubs..."
#endif
/* make some in advance... */
LAZY(1)  LAZY(2)  LAZY(3)  LAZY(4)  LAZY(5)
LAZY(6)  LAZY(7)  LAZY(8)  LAZY(9)  LAZY(10)
LAZY(11) LAZY(12) LAZY(13) LAZY(14) LAZY(15)
LAZY(16) LAZY(17) LAZY(18) LAZY(19) LAZY(20)
LAZY(21) LAZY(22) LAZY(23) LAZY(24) LAZY(25)
void *OPENSSL_UplinkTable[] = {
	(void *)APPLINK_MAX,
	lazy1, lazy2, lazy3, lazy4, lazy5,
	lazy6, lazy7, lazy8, lazy9, lazy10,
	lazy11,lazy12,lazy13,lazy14,lazy15,
	lazy16,lazy17,lazy18,lazy19,lazy20,
	lazy21,lazy22,lazy23,lazy24,lazy25,
};
#endif

#ifdef SELFTEST
main() {  UP_fprintf(UP_stdout,"hello, world!\n"); }
#endif
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top